Professional Documents
Culture Documents
M&M 3
M&M 3
M&M 3
delays
/ WIN (Tw)
wait state and
to 8086 system timing diagram During " 1,0122 Timings
1 ' '
I Ty / ( Ta )
'
I the buses the
rehired delay
'
Ti Ti same
signals remain
'
T Tz Ts Tw Tz
-
on
, , " , Ty
(a)
required count =
output change .
n -
1-
← period
1 I
! ! ! ! ! ! ! I / -
in
/ IT E. RJ doesn't
change during wait
no
.f dock states
1 i ! ! l '
state required ( ) to eneuite
-
. I , . n
↑ -
the
delay loop
once .
cycle ☒ or ex ,
count
-
4 -
2 NOP
33
of
-
no - states .
•
JNZ label -
16
instruction
time required to fetch and execute an RET -
s
f dock cycle
=
21-3+16 = 21
contain more
cycle
or
An instruction one
may time required for execution of loop once
machine
cycle .
= nT
INS
100ms =
2
Td
-
=
say ,
Tw
* wait state 100×10-33
-
i. N =
device 47619,0
required by
the =
↳ time
¥-6
count
=
BAO ] H =
ROM)
to send or receive data
function for delay 9
i. e
;
to
respond .
Unruly we write a
while
- 16 cycles
fuel
* say Queue is at some
point terminated
JNZ is not satisfied { loop is
is and at the same instant
CPU
processing
read
-
4 cycles .
there's no
ongoing
or write
operation
state Td = 4 ✗ ° 'm ' +
(2+33)×47619 ✗ 0 . In
-
Idle .
enact
-1M
+ 16×47618 ✗ 0.1Mt 4×1×0
{
write by processor
.
B. Ty →
count exceeds
for loos →
Say delay
=
FFFFH
if processor
is not
ready Tw
for this both inner and outer loops
write wide are created to meet the
delay time .
I l
, '
!
→ MOV BX ,
count I
÷: i
'
BIBB
" "
: MOV
NOP
CX .
count 2
i i
É_
*
: !
! ! ! ☐ Eccx
I I
"
'
'
"
ALE .
, JNZ Ccc
!
' '
' ' '
.
ap ,
'
I ' l i
! '
I RET
;
:
¥
- - -
EL for
the
should calculate count 1
!
R--y(!
' we
'
l
' Now ,
1
!
'
I 1
'
i to
easy approach
Con is
: f- ,
,
required delay .
READY
! I F- ! I
I I
! make count 2= FFFFH .
y
; "
,
! :
:p
* ni
! : i :
'
:-| : . : :
'
-
i
'
En
: : : : : : i ! ! !
-1 : :-# :
:
:|
- .
:
. i
: i :
;
'
' '
:
Interrupts E. interrupt responses 131101 " INT 3 → software interrupt
software
→ hardware [ INTR .NmI
)
mainline what's the
advantage of writing
means
of getting interrupts
→ software
program -2
Interrupt hardware?
flags sp=sP interrupt over
Push
↓
> >
↓ IF
service
[
instruction
-
interrupt clear
procedure TNT 2- software int - -
er ror condition
produced oneention clear TF
→ hardware
sp=sP -2 when NMI is set
by execution of (
Int type , push cs
just In t
E- NTO )
PUSH IP sP=sP - 2 IRET
instructor .
Fetch ISR
>
instead
of giving
how -
high signal
r
address
En : by
dividing
zero -
~
checks for interrupts .
/ tmaskable
locations
→ each interrupt memory
↳ checks If
flag
→
current 4
/
instruction
interrupt
# starting
address
of ISP
I
internal
/ 3
t
interrupt vector
→ use
(32-255)
§
yes
interrupt acknowledge
=
interrupt Inta →
( or , interrupt pointer
& controller is
NO
9 8259
-
interrupt priority
table referred as
used multiple
•
Push when
vector table
interrupt
NMI flags
" in order to avoid self interrupt ,
TF 9
µ a•r
◦ • -
imempttnpes
YES GTF If are cleared .
INTR /
FF=l
-
PUSH
dedicated interrupts
1 CS QIP
0-4
µ , 7 STE in INT
?
q,
1- Acknowledge read I single step
_
> IF _
type
(5) ( divide by zero , ,
interrupt call interrupt 2
°ᵈe
interrupts
# ◦ mashable ,
service routine non -
8086 8259
overflow
TF _ execute user
break
point ,
-
type code ←
}
b ←
Abo
y b
{ IRO
interrupt
f-
3 4 ←
°
interrupt <
procedure <
←
←
inputs
reserved
ene cute
ÉP
5- 31
by INTEL
next
P°P • <$
80286
AD
> 2 IR > ¥
instruction
( za ) for complex
80386
miwopw who
☐
INTA INTA
pop flags
80486
I
return
32 -255 available for Wren to me
> INTR
interrupt INT
procedure for hardware software
/
or
( 2214
interrupts
machine
cycles
"
are
" " ° 2
acknowledge
{
""
00001 IP ( H)
sent to 8259 after (INTR → If = 1)
00002 CS CL)
00003 CS CH )
1st int acte mlc cycle
00004
{
type
- l
00005 ↓
8086 floats data bus line
00006
ADO -
AD
, }
00007
and then send int ack pulse
00008
{ £
◦ ◦◦◦ 9
On INTA olp pin
-2 2×4
type
0000A
0000B tells 8259 to
get ready
second int ack Mlc cycle
-
pulse through INTA Otp
003 FFH
then 8259 puts interrupt type [ ADO -
AD >
)
and it is need by 8086 .
Any low -
does type - 2
processor
are received by 8259 .
But 8259 prioritizes
after
allowing
to
after proc recognizes NME
,
it goes
among all requests ,
one
:|:#
00008 the .
O_0
☐
when of
* INTO -
type of only I
?⃝
.
151101¥ Priority of 8086 interrupts for decoder to
distinguish b/w RAM { Rom
chips
line is used
Divide by zero error
,
-
A 13
highest A ,] is 1 for EPROM
INTO coz
Int n , .
I
0 for ROM .
'
NMI
Ao line -
to select even bank chips -
INTI
000-0 CIs { CI,
%
]←
0,0-1 Tsc,
Ao -
B
bank how bark
°o° -
2
Is
high
A - C 74138 } °
,}
CST Ai
Aff
-
↳ 3
Ao 86552 ^
?
←
3 :S " Rom
Er: pom
program ☒
→☒ÉÉA .tt#4kx8
main
"" ° CJ , { Tsz
"
41<+8 tho Addren { date
/
040-4 |-O µ,
!
-4 MET JE
]
f° }
'
¥#Ñ
◦
50 lines a re
0,
cjz
g
⇐e/
_
Do
-
D>
Do D, , red
multiple
-
STI
060-6 ,
)
error
is ,
diu by zero ☐
On - 7 drawn
they're
7=17-1 =D for
'
individually
]
◦
0
sub - runtime
Ten.p ID →
f) °
A
¥8b better understand
-[
enanw € ing
?#?
.
^
-
/
" °" "" "
" " "
\"
"
MIÉ
¥ " "
.
RAM
""
-DÉw÷
"
i A"
_mÉÉñ aus
; AM ng
41<+8 mE€owÑ
IRET
g-↑D£Do -
D
>
what if NMI
gets activated
simultaneously Do Dis
-
in the above En .
→ ist
type O C B A
-
and
but then it
goes
to sub -
routine decoder
ifp A ,} Ao BHFT
to
checks for interrupts again q gets word transfer o o o even
§ odd address RAM
enecutes
type 2 interrupt service routine
-
Interface
on
Dg Dig
-
2 4K ✗ 8 EPROM
ROM
{ odd address
/
even
chips
/
RAM word ' ° °
2 412×8
the address
range byte i ◦ I only even ROM
① - what is
memory
f each
chip .
byte 1 I 0
only odd ROM
reset
when Soso is
booting process
stored in Rom )
after
resetting ,
8086
goes to the
way
that the Rom
chip can accommodate
ffff OH address -
chip pair
-
a
* * * Always memory
/
"
1 I 1 I 1 I 1 I 1 1 I 1 I 1 I 1 I 1 I 1 1 Fff Ff H
i
EPROM 8K ✗ 8
I 1 I 1 I 1 i O O O O O O O O O O O O O F F- 000 H
1
- - - - -
.÷÷
' FDFFFH
am
" " % .
-16412×8
-216164k )
2- 32K ✗ 8 Ram
/
1
EPROM 3212×8
starting
!
"
I O O O O O O O O O O O O Fg oooh
I 1 1 I l O O O
address
÷ ÷
- - -
- - - - - - -
- - - - - - -
-
- -
-
-
-
- - -
1 I 1 I 1 I 1 I 1 I 1 I 1 1 I \
O
! ffffty
/
O O O i ①
'
: " ^^
I RAM 8K ✗ 8
!
° °
0 ° i 0 O O O O O O O O O O O O O O O 0000014
'
i i
ais
Ag
=←| b high Bank
a
,
how Bank
Ts , Ai -
A14°F IS
,
☒ 7-
↑!
°
→ lbkxs
1612×8
EPROM
/ IT
⇐ prom
M *
At -5
Do-177 Do -
D>
Dg Dis of
/
/ -
8086
Do
-
D> of 8080
⇐ =
.
↓↓ high Bank
-1 how Bank
Do -
Dy Al Al -
-50£ Do -
D>
Ao Ao
3212×8 324×8
Ñ[-
◦ Rj ! :
ram ram
Aig -114
?ÉI→ñ °
.
%
:*
A÷÷-Aig -
¥
É
Interface IZKB EPROM to 8086
address A 000014
starting
-
As we need a
pair of memory chips ,
we
split
12143 -
8 KB 1- 4 KB ( powers L 2)
identical
But pair of memory chips
should be
ZKB + ZKB -
2 ZKB
2k +2k
}
done
for
interfacing Spain
is
memory mapping
continuous as
-
2K +2K
2kt 2k
/
"
}
" ° "
" "
4kB EPROM
"
↑
I [ 2- 2k B)
1 1 I 1 i i 1 , i 1 Aofffgy
I ° ° O O O I p
I 0 , ROM
I
1000 H
}
O O O O O O O O O O O O A
I 0
I 0 O O O I I
2ⁿᵈ P "
akB EPROM
.
2K B)
I I 1 1 At fffty ( 2-
O O 1 i 1 1 1
I 0 I O O I , I 1 I
ROM
I
I
}
! A 200011 3rd
1 0 I O O O 1 °
O O O O O O O O O O O O
pair
( 2- ZKB)
4kB EPROM
'
0
'
1 I 1 I 1 I 1 I 1 1 11 AZFFFH
I 0 I O O O I
,
I Rom
!
7-
unused address
livest used
decoder
in
?⃝
" 8086 2011°F Ifp port 7415245
#
Sw ,
to swg
HB Say address of port =
074014
LB
Ai -
A' I
Do Dy &
haedweeehy
-
to be
Dg -015 78084
of 8086
I t has
connected
D; ,
-1¥ ?
.
☐°
of •• pom ROM
;
-
:
p zyp.gg 01000000 H
, a , A ,o2K✗8 D
,
O 000 0111
EE o- RT OI
o £-0 o
to 1- Tsi
"
Ai All
-
Di 78086 Do Dy -
;
☐ g-
.mn ÷
. . •
• : ;
← of 8086 01
.
21<+8
% 2k ✗ 8 Ayo Dy
OÉ
0
OTE OTE DIR →
[ og
≈1
◦ ◦
is , Esi #~ ?
0s
A -
All 06
,
-
4- 8086 07
☐ is sw : i closed
☐g- °>
"
" ' ☐° 0
-
÷
'
open
d- 8086
◦
¥
' I
: ; zicxs : of son
,
was ,
D
Alo >
OI
¥ EE
O
§
Tsz Tsi
- Ai -0
-0
i. -
a ,
]
¥
,,
°
'
"
1 E-
c g.
Aig
-
B *
B 3 :S O '
!
Air -
A 020-3 ) AFB
Oz Aig
-
[ adewderoz Ag
J
_
I 5 am
-
as :S
°]
MITS -
I ,
3 :S 1 - decoder
MIEO
decoder MIE G AH -91 memsei
040
-
-
-
BITE -62A
14138 A
'
Fsu -
GIB must -052ps A → GIB 06
!
'
-
_ 07 I -
o
- f
Ai
.
-
dedicated
memory space for
CPU Ilo devices Ao -0
→ I /◦ interfacing : -
Mov cx
DSi CX
.
000° "
-
000004 Mov
B2 00M
mapped isolated Ilo MOV ,
1) I 10 cool
07404
[
MOV DX ,
2) mapped 1=10
memory
\ IN AL
,
DX
MOV BL AL
devices viewed f- of FF te
,
viewed ( 0500h]
}
as MOV Al
Ilo devices Ito devices
,
as memory : dedicated to
felt
distinct Ilo denim { locations q ≤•◦ on
transfer
addressed accordingly addressed Parallel data
'
accordingly .
:
FFFFFH
bit address
16
ʰiᵗ°ᵈᵈʳˢ
interfacing
-
man
2° 10
bit address simple I
@
min g
←
-
ax
- IMB
µ_
is more
words Con as there
IIP
or 32 k
address decoding .
words
32k
0 /P
Any instruction
can
be mode
addressing
can
instructions
used
used for can be
only AL, AX
wrto
? As there is flenibititl when date almost remains the same
reading
↳ mom time
( significant data
change)
.
i e no
;
-
fast in
operation ,
less complex
hardware
addressing -
simple Ilo
interfacing
is
adopted
operation gets
9
hardware En :
temp measurement
sluggish
.
more
becomes if
complete
. Now consider a
keypad ,
we use
simple
1=10 here ,
some i
/p data
given through
keypad might get lost
so instead once i
/p data is
put on the
bus
,
a low strobe signal is
given
=
ÉTB = ↑
through software ,
one can check whether
9. which port is
pulse .
-
interrupt technique E.
→ SNH
010-0 / °
-
I 000
when data is
changing very rapidly E i
/P → A. Ao
A acts
-
data is sent from port A
{ port as
still
device is
sending a strobe signal olp port here
loss ace
there
might be chance
of data
.
a
IN ALI 8411
all port cats
Cot
processor might not
acknowledge -
data
goes to port C
{
here
i / p port
.
as
that
pulses being sent to
the strobe are
dat
fast and
continuously
.
to other devices
transfer
.
data schemes
of
.
Therefore ,
we have to ensure that the
8255
-
Handshake data transfer scheme
→
be .
25110122
8255 programmable peripheral
interface
/p
É
peripheral ← easy implementation of
deni " parallel I10 in
-
=
port pa [ , ""
{ }
,
" ""
device
☐ A
" 393 Pas
8086
-
processor port
PA [3 38 ] PAG
,
i. A§ PAO [ 4 37 ] PAY
RI [ 5
36 ] JR
is [ 6
359 Reset
and [ 7 8255
34 ] Do
A , [ 8 PPI 33 ] D,
A ◦ [ 9 323 Dz
Here data
FB -
#y-
,
PC> [ 10
31 ] D
]
being sent
PCGC "
3° ] ☐
4
ACK
#
without
confirming Pls
PC4[ 13
[ '2
29 ] D;
! whether
processor pco [
,q
V8 ]
27
D8
not 3D >
is
ready PG
'
or [ is
"c
#- P
•
data Pack 25 ]
}
PB >
- PC ] [ 17
I
243 PBG
PBo[ 18
{
233 PBS
'9
PB , [
→ Double handshake I / 0 scheme : -
Port 223 Pity
[ 20
PB 21 ] PB }
, -
from to
① first STB
-
two
Acknsignal . or
ST device to
control
^
bit
single
-
data
{ Device
puts lines .
on
bit 8- bit
: 8255 can do single , 4- bit {
from processor device
saying
④ low Ack to
ports
that data is read .
☐◦ -
p → g- bit bi -
directional data lines
,
=
be Port be
un * c
pins can
.
-
.
but
complex
simple some activated 'll
but tedious just → Once Reset in 8255 is ,
it
should hardware
(processor initialize all
ports as i
/ p ports .
it structure
check for
) needed critical date
everytime is •
Ip ports ?
.
not
why as -
some
best when
junk data ?
7 diff processorsused
°
are being → A Ao of 8255
,
-
SOH O O
-
port A
B
82M 0 I -
port
8411 I 0 -
port C
↓ G port Alolp) .
data
Porte =
bus T ) ←→ upper
# I /° mod
butter (4)
mode
initialized
" -2
Pc _
A be in
4 port
↑ only
> can
↑
Port < ≤
used as
bidirectional handshake
# cower data transfer .
RTs →
(4)
.
read /
FR →
write
>
Group Data can be i
/p or Otp on the same 8 lines
of Port A
control ≤
-
is
A →
control Port B
)
#-) DT
,
£ ( for bi dir HS
of
↳
→ mode -2 -
A. (g) Applications
PB -
PBO
☒"
"→
to
,
wants to entered the data bus for slave miwp~wTh
B
→
when processor
°
Group
Est control → for data to be transferred to discs .
lines
/
Mode - 2 Handshake
Port A PC ] to PC >
[ PC ]
Pc
,
3
4,5
, 6,7
-
-
i /P
0
/P
)
mode
0£ Here .
when
port is in mode -1
Pc PC
Pcp
-
} , Pc , -
PB > PBO -
pa , -
pp ,
→
pco -
pcz used as I 0 / Port
~ A
code
"
pass control word to control word register for particular
mode a
If / ,¥ / ¥BE☐É%±n
↑
/ ¥14T
µ,
control words
✓
→
Constructing
a
sending 8255
/
or
≤☐
ga y,
format
, ,,
,, ,
definition control word
g. µ, ,
"
↳ mode
◦
pa
_
pa ,
being operated
or
PB > PB , ,
-
ports
are
To what modes
-
the
ACKB FBA ◦r
ALKA
# handshake
-
~ A
-
mode -2
a
pin of port C
B mode set )
put Part B Pco PG Pcz Pc ] the PCs PCGPC> Porta control word
1
maybe
mode mode
-
°
- '
II ↑ ↓ ¥% / a¥a / ( bi-directional
✓ bus ) " "° % " " %
IF "
•
✓ 3
INTRA
~ control Iisfa OFF
PA
-
Pao
f/
PB > PBO - >
Group B
Group A
21401 " 8255 PPI
portccwwer )
""
→ "
I = IIP
0 = ◦ If
Moy
:
.
.
port B
B in mode ° Port A
A
port
-
Both port {
.
Iip
→ IIP → , =
I =
◦ =
OIP
used
g
port
-
8- bit OIP
Port c. can be as . ◦ =
mode
mode selection
selection
mode set →
( or ) mode 0
4- bit ports mode
2 ◦ ◦ ° ◦ =
→
.
flag
=
active
◦ I model 1 = model
/P I
= =
↳
+ bit i '
I ✗ = mode 2
mode set
4bilP
I
(b) MSB
-
MSB ° -
bit set / rest
(b)
Bit set / reset control word for the above configuration
of go µ
-
=
of pins port C
, ☐ ☐ ◦ ☐ ◦
◦ ◦
Say ,
mode -1
M Ilp in
:
10 , , oooo = Both -
port A
Both port A q in
lines say
Handshake
,
mode -
1
in mode -0
10001110 = SEH
-
port A Otp
port
-
B Pco , PG , PCL INTR port B IIP in mode -
l
pc, -
strobe
A Ptt port
-
C upper Ilp
port Pc , peg qpc ,
as
-
]
,
Cilp ) Pc , IRF
( PG)
-
C
Port bit 3 as 0
/P
A Pez Fcb 9 PC > PCG Ack
port
-
-
§
,
(◦ ip) pe , ◦ ☐f
address
.
→ Say 70 -
port A
A2 ' A ' Y 8086 always connected
is
72 -
port to A , ,Ao Of 8255
nay , ,
,
,
, ,,
,
,
,
p, ,, ,
peg ,
Pci be
used •
76 -
control word register
can
him Ciws
as I 10 IN
code : MOV AL ,
SOH
OUT 7611 ,
AL
A address
and INTRA is sent
port 010011 when both IBFA { INTEA becomes 1
Pc] becomes 1 .
→
say 711 0111 so
-
I 0
75 _
port C
I 1
But How to make
pcq as 1 ?
77 -
CWD
A
Civil : 10110000 ( cot port ☐ can be
anything ]
Say 074011
-
port
B MOV AL BOH
0742
-
,
OUT 76th AL
0744 -
c ,
OUT 76 Al AL
,
-
HLT
latched is
MOV AL ,
SEH If NMI is there instead of INTRA ;
when data is G INTEA
OUT DX AL
,
activated , type -2
interrupt is done .
MOV DX 0740 H
[§
,
;É¥
COZ 55M 01010101
og
-
◦ ◦
MOV AL , 55th 11 or AAH
AAH -
10101010
÷
a- ☐× .
"
◦ ◦
◦ A
.
HLT
for alternate
blinking of LEDs
:
1200
IN AL, > OH
28110122 Bit set / reset )
control word ( Port C
Mov [ 050014] ,
AL
IRET
D> Pi Do
☐6 ☐
5 Dg Dz Dz
poling technique
:-
→ wring
/ I 1 >
Bit set / reset
✗ × I -_ set it is I
✗
check IBFA whether ◦ or -
◦ = reset
-
don't care If
'
1
'
read the data
Bit select for
-
port C
- O 0 I O O O O -
WH
"^
" "
°
° PG , PIG Pcs Peg ,
,
,
PC] . Pez , Pco
B¥
00001017
> 0 1 0 I 0 I 0 1 contents
IN AL > AH I / reading port c
again
:
= OBH ,
> O O I I 0 0 I '
Bi not
is 1
WH
Il check whether peg or
AND AL ,
,
>
O O O O I I 1 I Bz if I
IBF a
= 0 2-f =
JZ again
Bit set I/ code until becomes
/ repeats the IBF I
reset
flag
D= active IN AL , 70M
A
I → 7° -
Port MOV
@ 50011] AL
to set PCs to ,
72 -
port ☐
74 -
purtc mode
post AA / P port ; I
-
→ 0
76 -
cur
( connected
MOV AL , 80 to
PA > Pao
external device
]
-
°ÑA
}
MOV AL OBH "" ←
pq→;ÉÉÉÉi 1-
,
handshake
/ p signals
°
-
76 AL
↓ 1-
OUT ,
PEG →
AIKA
to
→
Say port A IIP ; set pc , to 1
MOV AL 91M
from
,
sent to 8086
Al
OPTFA = 0 when data is 82-55 .
OUT 76th
( Porta )
,
W : 00001101 MOV AL ,
ODH
then it sends
OUT 7614 , AL
an
AIKA = 0
Now
INTEA is made 1 I → service routine
→ port A Ilp port ;
mode - 1
INTRA -_ .
I 07
Carr
:
0 0000 PCG -
0000 1101
switches
etc ;)
( ADC
PA > -
Pao ⇐ MOV AL , AOH
OUT 76th
when WMI is
given
,
AL
pcq ← StBa
pµ→:ÉÉÉ-
MOV AL, ODH 01200 i MOV Ali AA
OUT 70M AL
pc , → IBFA becomes 1 after data is latched out 76th AL ,
:{ _!
IBF ,
v
±"" "
MOV AL FOH
Inter
- internal signal -
interrupt ,
↳
OUT > OH AL
snftwaeehy
, ◦ ◦
enable is ◦ A
↳→
'
'
INTRA enable again
: JMP again
pig _
INT EA __
I
r
→ seven
segment display interface :
,¥%
-
poling technique :
common
anode
¥
"
7411
ITTTTTTTI
_mnn_#
IN AL ,
AND AL H Az→A / PA ,
,
AM to PAs _ run
.
a
JNZ again
town win PAT
¢↳zqq_mm#{ b
_nn##-
→
> <
MOV AL AA PA ]
, ITRD →
RI
buffers d
nmmⁿʰ§
reset → reset Paz
OUT 70 AL
MGR
,
PA ,
-
Pao g
311101W → port A mode -2
operation -
☐◦ ≥
. % -
pa, .
¥
IIP OIP t
cathode
B)
common
1¥ EI EI EI EI
"↳ ≤ "
" " "° '
" TRB
-
NPN
→ a i%-m---
wnf→É
PG -
IBFB PG -
Otfp , a
PB ,
MY !
} {
-
t
Ebro & { {
" "↳
ATKB
-
' 2
_-
-
→
Intra ""
,_→→§§
e
•
h
PB The d
Internal signal IPCI DBFI }
-1
>
¥21
_
'
Interrupt enable
← at,<
a
pique
[ INTE )
¥ÑIÉI
IN
TEA -
Peg pAjPA◦#
INTEB FR PA PA PA PA , PA PAO
-
Por
WI - Displays , ,
PA
, PA¢ , ,
M PI←ÉBa
'
-
Ñp±→±ppa f
b d
IT → H a c e g
IIP
I
TIE? I 1 I O O I I 1 CFH
INTE
,a
-
PG 92M
2 I ° 0 I 0 0 I 0
INTE
,z
-
Pcz
3 I ° O 0
O O I I
86th
¥ 4 1 ' O o I I 0 0
CCH
5 I 0 °
I 0 I ° ° AAH
I
6
{ All Ao _M-Ér
/
-
gosh
A- A
pay
7
'
/ I 1 i µ f f ,
pas -mn
'
◦ I PAs -mn_.
Pay _mmiy display
SHL to select particular seven
segment
PA ] _m_ix
-
Dido Rao
_nn-DÉ÷
÷:
PBS
# t
_
PI ÑD PB #
°_ -
- ◦
,
5r→wÑ PB , → =L
PBL
reset → Reset PB
, -É=
PBO I s
Sw , -
{ 10k
→
↓tVcc
co-ordination and
flenibitity in mode
operations
-
advantage of 8255 .
esau )
mode Porta
}
0
port A OIP →
304
ˢ% B
Ilp mode
-
, 32h port
port ☐ then
34M poitc
36th UR
cut :
10000010 = 8211
code : AL 8211
} / configuration J
MOV
pom
,
,
OUT 3614,7L
OUT 30h ,
AL
(say Sws Sw
>
.
. . _
swo = FOH ) '
2-
-
D-
At
✓
:
MOV BX 0500M 4-BE
,
×
5 -171
-
MOV [ BX) AL
, !
✗
8-1>-1 -
HLT
I
011111 " ADC 0808/0809 Interfacing soc - start Jlonversion poling technique → IN AL , 5411
is not
of lonvertion 11 to check MSB 1
soc
CLK Eoc end AND AL got
or .
1 ↓
-
~
→ Eoc Jt
Control q
/ Pio →
→-
I
+
→ be wired
±"? → 8 channel) or RCL ,
ROL can
↓ ""
[
" £ ᵗʰ
"""" &
7- " ° " "
""
" "% "
Mr &
"
""
" - " °
"
%
Successive "" "" * °
" "
bit it
"
* ↳ = " " ☐ = "
switches """ "" • buffer
±, "p→ register ( Otp latch)
Otp
# ;
fifty → er ror is ten
}
D- Jv
analog
-
o
LSB
-
A
}
address if
latch ✓ ↑ 2. sv -
TF n en : FOH is
given some error
B IP ( OE )
address
◦
3 FM
-
" enable
lines
_
caewd tree
◦ on
◦ ✓
,
↑
25612
register
Address ilp select → matrix display
channel
§
ladder
8×8 LEDs
column
ports for
wire { wise activation
diff now
-
-
°" 'É
"
( port A) ( port B)
0 Ilp ,
Vre Vre
PBO PB >
PB , - - -
€
. . - - -
O O I I /P ,
5N 20 -
port f)
9
: : : matrix
B
i ;
i § display
22 -
f 2] c
9¥
:
-
i.
.
PAT
-
cwr
zq
1 IIP
I I
p > .
AL SOM
MOV ,
ME
AL
OUT 26h ,
.
set PAO
for every is AL ,ffH
ifI
successive ref
edge approx mov
-
tire
out zone
AL
¥
,
"
soc -
:/
resolution Ab
data is the 9 lost 2211
.J bits Out
in more ,
the
.
more
,
no
§
to
Alison
-
parameters mov
now LEDs
/-q↑¥↑¥
MOV Aliff "
pao our
will glow
OUT 2211 AL
,
[ 28
IIP I
JIIPZ
3
[ 2 27 ] IIP ,
I/
Py
f-
[ 3 26 ] IIPO for 1st column should 810W
shape
-
IIP
provide a
delay
shouldg.co#
,
Vcc [ 11 18 ] 0¢
1+1
[ 12 17 3 00 LSB
Vret
'b ] D
Vrefl
-
GND C 13
C '
4 15 ]
O 0
, ,
e) c- 7
port A -
IIP
{
✓ Vret
CJ Vcc ref B- ◦ IP
port
/ / 1-1
, ,
I m.de lower
- ◦ IP
◦ -0 port c
"
upper
-
IIP
" port c.
" { EOC
•" ' ◦ ◦ " °o°
→ a. cw
> soc ADC I
/ P, ← Analog i / p :
→ Ao
0809
→ Reset pro
=
9811
-1
RTs -0 RI
and
Jp → WÑ PBL
A B 1-
}
C
,
selected B
1st channel is port
,
/
AL 00
AH 03M M ◦✓
/
MOV AL 98th m°V ,
MOV AL , 01M
OUT
544 , AL
CALL
delay
MOV AL , ◦§µ-
OUT 54th AL
,
?⃝
?⃝
't "
0211 8254 Software Programmable Times / counter sc , sco Rw , Rwo
0 counter
0 -0
0 0 counter latch command
-
0 I counter -
I
counter
← CLKO
I
0 I read / write LSB only
← GATE 0 0 counter -2
Data
0
bus # ← OUT °
1 i read back command I 0 read / write MSB only
a
☐ 7- Do buffer LSB first then MSB
I 1 read / write ,
← CLKI
counter
RI
← GATE '
bit data 1 mode
RW , ; Rwo
◦ =
load use 1
.
To 16 __
-
/ I
-
read
a
← OUT
ER- 0 I
write logic
⇐%
Az→ A
t
,
← Uk BCD Mz M MO
A → 2 Max ,
, Ao
← c. ATEZ
2 0 Binary counter FFFFM interrupt on
terminal
← OUT ◦ ◦ ◦ mode 0 -
count
2 .
^
is -10 1 BCD counter 9999
◦ ◦ 1 mode , _
hardware • ne -
shot
control
word _ ✗ I 0 mode 2-
pulse generator
register
✗ mode 3-
square
wave
generator
-
I ° ° mode 4- software triggered strobe
strobe
I 0 1 mode 5- hardware triggered
}
counter -0
frequency
✗
-
high mode 3
cw : 00 I 10 1 11 = 3711
→
It'd be difficult for applications like interrupts which has low freq ( KHJ)
-
( 1000710
load 16-bit
count
data
for
we
go 8254 programmable timers
-
has
counter -0 20h
say MOV AL 37M
to → ,
division
frequency 27M
.
get
-2
to MOV AL OOH
} for
,
" LSB
CWR 26th out ↳µ a,
8253 times ,
}
MOV AL IOH
,
It for MSB
82533
I 8254 out 2. µ , a,
3- 16 bit counters _
} I
Counter - I
2. 6MH3
upto → cw : 0 I 1 1 00 00 =
7011
mode -0
- maxi
/ PIK 8MHz
y, , , µ gun ,
MOV AL > OH
read current count ,
(feasibility to
OUT 2611 ,
AL
MOV AL 70th
,
OUT 22 H AL
,
MOV AL ,
OFFH I / start always with
integer only
OUT 22ft ,
AL
selected
* Based on
address lines
, particular counters are .
be obtained
clock also
As we have independent { gate /
i ps
,
the 01ps can
independently .
Ai Ao Select
mode low or
Rising High
low
0 0 counter O
going
-
1 counter -
I
◦
◦
disables _
enables
counting
I 0
counter -2
counting
control word 1) initiates
1
I , writing
register _
_
2) Resets OIP
after next
clock
level triggered or
pulse immediately
high
↳
depends on the operation .
3 11 11
' '
can't be loaded
of 16 bit time 16 bits
-
at
though counters are ,
a
disables enables
from data bus ¢ _
counting
.
counting
5 -
initiates
Sc -
select counter
031'" " software ( infinite loop) to come out
of it
hanging
when occurs ; so as
terminal count :
interrupt
-
mode on
used
watchdog
→ -0
timers can be .
' ( LSB 2) __
? %?
in
-Et generator generator
-
rate :
interrupt
-
or
- - - - - - - -
- - - -
:
-
-
→ mode -2 Timed
I 1 I
- - - i - - - - - - -
1- - - i - - - - - - - - - . . _ .
- -
' 4
;LSB=4
-
1-
.
CW
.
. -
=
.
i i i ' '
Jr - - - -
-
- -
:
- - -
- - - - - - - - -
l i
-
-
I
' '
"
;
'
÷
' i. - - -
- - - - - - - -
÷
- - -
. -
=
* :-.
'
l ,
y ;
-
-
y
- - - - - -
-
i
i -1-1-1-1
-
I 1
, i e I I
i
1
,
ji
a:X
i
. . - - -
- - -
- - - - - - - - - -
- - - -
- -
,
-
. .
I
y
-
i
-
-
y
- - - - - -
◦*,
_
'
i l " '
l
f5V
, ,
I
f ; ! f- i
,
I
- -
¥
-
i If a-gate
-
'
- - - -
-
; crate l
-
÷ i
- - - - - - - -
- - - -
-
wish
- - -
- - - - -
. . . _ -
- . . . _ . _
,
.
" '
i
1
I '
i|ʳ
1
IT
I
1 " "" " ^ °"
,
"
°
i
. I i ,
i
'
I i connives .
.
- -
t - -
so after I 3 I
1 1 2 2
,
i
,
1 I
I 3 ,
, ,
/ "
°
° i l '
I fit
I '
l i I 1
ii!÷.,,iz:##
" wads
!
,
'
" '
l '
I : : I i ! i 1
;) ,
,
e
reek
I i i : : i i : : i '
.
i i
i
i i !
'
i i : :
i ! iii. :
I
1
after clock
pulse clock pulse at the ◦
Ip for N clock pulses → divide
by N counter
loaded starts ist * one
every
once the count is ,
counting *
to
@+ 1) clock pulses
are
5) before ( LSB ) is
given (say
the 1st count :]
If another count is ↳ D=
[ n' count )
being
the .
completed ,
the times completes the 1st count {
only then it starts
counting
counting won't stop immediately
.
↳ It stops
after a clock
pulse .
loaded count
En
Say 1kHz clock pulse { 100
: a .
Out I → only ↳ B. =
4
10,0¥ =
long → frequency of ◦
Ip signal .
OUT 2
→ only LSB =3
→ mode -1 Hardware
is
Previously
-
level triggering
- -
- - -
- - -
- - -
- - - - -
- -
- - - - -
"
"
"
"Y
"
"→
t.EE#:.M.-w-ir.--.-Yi?. i----i.?B---?:------.y-y------
.
en
UK
-
-
t -
÷ . . . _
¥ -
,
-
-
'
!
" ' :
-
:
- - -
- - - - - - - - -
a.*
+
; I ,
!
y
l
.IE/-!..---i--.-.--------;----
1-
l
I
Yi
' ' ' - - - -
- - - -
i
- -
- - -
+
-
or
- - -
- -
- -
.
i
'
! I
- - - - - - - - -
I
_
I
. . .
i
!
, ,
µ
, '
± .-
" i - -
.
. -
a-
- -
- - - -
= → - -
I 2
- -
4
-
1 I 2
"
I 4 2 4 2 4 I I
UH 1 , ! ,
,
¥ !E
,
I 1- - -
t - - -
-
=3
1-
-
-
- .
÷
-
t
- - - -
- _ . - - -
-
☐
↳
t.i-i-i.ir
i i
a- .
;<"i2;'→
' '
" ' °
aate
'
- - - - -
i c
,¥¥H
I
.
' I 1
f7!3!2
OVTI B=8
i I
' '
'
fslc.ie#f:i:::iii::i:i;::i
l
/
i
↳ '
'
I l
! ar 6 4 2
81
1
i
-
' ' 1 , 1 ,
'
, '
1
; '
i. i ,
l i i i.
/ I / i
;
,
.
I i
'
i i
'
i :
; ; !
frequency J ↳Pᵈ° "
}
clock
freq
=
wave
wave
* 2.66mHz
→ 1kHz square
square count
process again 9
again provide retiring
continue the
counting → count
,
to =
2660
at count =L
everytime
in the above case .
high N¥
it
Every 20ms ,
you
have to
retigger -
◦
IP -
olp
,
low -
and parameters
↳ Now
interrupt occurs all the
I
toned .
goes
to
necessary
operations
parameters
.
to store the
→ mode -4 Software triggered strobe : -
,iN22 8251
programmable communication interface
on -18
_ ( USA RT )
-
- -
-
F-
- - -
-
wñ
.
- - - - - - -
i
.
g-
- -
y
-
y
- - - -
-
-
- -
- -
- - -
,
-
transmit
/ ^
.it#..7.-i.F.H-.Ft-.F--f..H---,--i-...y---
1 ' '
1 butter → 1-
a" ,
1 ✗ ☐
,
'
I Data
! ! / 1 -
joie
1
I ,
l g-
Do bus
◦
v.
i
-
l
- -
l - - . - -
l - - -
butter ↑↓
i
IT t t TMM
→
I l
É!;!
-
transmit
◦
- -
- - - ' - -
y,
-
reset control
1
. I UK
→
→ need /
→
Tummy
'
I
-1 l l cus → write ←
TI
-3-1--2-1 i rñ
-
control
-
t
- - - - - -
i -2-1
-
-0
; ; ;
- .
- -
-
- - -
- -
:ii¥F-
Jr logic
-0
I /
Is - 1 ° Receive
buffer ← R✗☐
'
l I #
DTR ◦
(S P)
f- -3-1--2--4
-
-
I
l 1- modem
f- ntnr
' - - - -0
- - - - - -
- - -
-
; control
-1
- -
y
- - -
-
y
-
-
°
-
-
y
-
'
3 12
I
1 /
/ / ,
its _
RTs -0
receive
→
RXRNY
control ←
Rye
-
for low
going
strobe puke .
f w SYNDET
internal
data bus
CIÑ
signal
→
is A
high gate given ,
.
continuous
low strobe control signal A2
-
101000190
loaded delay
the
going clip pin I →
-
be {
through software ,
count can
signal .
◦ → data signal -
10100019°
Q) after
Interrupt processor 10ms
;
Ik = 1.5mm Hr
control format
OUT A2 , AL
llsending the
10-6 AO AL 11 data
TE
75
= 6-67×10-17 Out >
transmitting
AO 11 serial data
IN AL
, receiving
1° ✗ 10-3 IN AL , A2 11 status information is received .
= 15000 → Nt /
-6.6%-7
count ,
N = 14999 Band mate → bits / see
=3 -197 H
Asynchronous serial
communication : -
transmitter
Cw
:
00110000 =
3014 us ART
- universal sync asyn
received
/
EP
=
249 Ef H Sz S
,
PEN Lz Li B2 B ,
→ O O I I
a-
count #/ Sync -1 166%641
can't load this .
.
model
. .
mode
-
which
-
° I 1
°
→
BE
-
IPJ to i
/p of IK
J counter I
-
◦ counter -0
enable
→ parity 0 disable
1 = enable ,
=
"" ""
]
th
UKO -
→ even parity
mode -3 I =
Even ☐ = odd
0 +5W ,
gate
-
{
8254 out 0
I 1-51<1^7
•µ ,
↳ o o I I
→ no -1 stop bits
gatel tsv
}
-0
mode -0 invalid ¥ {¥
'
out
' - looms zit
transfer zokisand
for high speed data
.
_
0 sync comm -
counter
20M →
counter
I ↳ needs a clock
signal
MOV AL 37 22h →
expensive compared
,
↳ to
~
async
.
OUT 26 AL → counter
, 24
- WR
A- 400 zu
MOV
Band rate 16%
}
En :
count-OUT
20cal counter -1 format ?
for mode instruction
14g char size gbits what Is the
MOV AL 10
odd
parity
,
OUT 2° AL 0149 -
BCD
I
stop bit
, :
movn 7114 = cw
Ali @9)
{
Mov
/
☐ CD
AIS : -
01-01 1-110
= 5 EH
OUT 22h AL
9. ?
,
moral .
as
OUT 2111 AL
,
→ command instruction format : -
AL , 28th
} 11
* Mov
AL
sending data
format Out Ao
mode
setting
or ,
whether it is
*
How 8251
recognizes
Command format
setting ? IN AL , A2
§
will be
again :
considered
considered as mode format and the next one
as Jt again
,µ
Command format .
}
MOV AL , fs
for
OUT AO AL
loop sending
DI Dr 173
,
Di hundreds date
of
DG Dot Dz Do .
INC SI
F- H IR RTS ER SBRK RXEN DTR TXEN
data terminal
/
I
a ready '
forces to'0 IN AL AO
1 =
DTR Otp ,
0 = disable it
}
( PE E again :
data
=
11 receive
.
→ Otp to o
I = force RTT
Tt
again
internal reset
→ returns 8251
I
format
=
to mode instruction
8251
→
enter hunt mode
IoT -0 WRT
got
An -
CIÑ Tx☐s•→ 1- xD
2g 11
A44°H software reset
-
MOV
OUT A2 ,
AL
tear
for hardware revet → do
system reset manually Axis
1- R× ,
-
bizv
→ I
¥m
reset ,
?
]
Reset
to transmit
serially →
to receive
serially →
0011 0111 →
wring control signals
data transfer
faster rate →
parallel
interface
↳
ape →
general purpose
* → status register
CFE )
D> Do Dr Dq ☐3 DL ☐I Do
framing
error
} /Hardware
MOV AL , JEM
reset
out n-u.ae
} 11
Mov All 40h
software reset
OUT Ah ,
AL
Pony
,
Get
set
computers
computers
machine control applications -
-
contains hardware -
hardware for only
for everything few operations
embedded in
single chip
-
acts as a min
computer . .
Everything
At)DÑ☐
Gimpy ) say
has
only
specific
on :
-
."""
1)I V
1=10 s
-
takes up more
memory
CPU IRANI
/Rom1EpRom
EEPR0M_
parallel fog gofteuaee program
£"
timing Coz
repeated
"
place
"
¥
a ← En : add or sub takes .
{ R/ egister serial →
unit t
additional device DAC
operation evident
.
→
faster in data
png*am9are
oscillator
,£- indep
or
blocks
Otp
CPU CPU
F
a
hangs
,
width
( pulse
modulation )
gosimicwcontnll
* functional blocks on a
single IC
→ 8- bit microcontroller
control board
↳ reduced
size of
of preferred
.
a
bits in microprocessors .
Usually no are
m o re
-
↳ low consumption
power
preferred
.
Er :
Say 64-bit is most today .
↳ faster in
operation
↳ ease
of integration .
But in microcontroller ,
how no
-2 bits are
preferred .
ts high reliability
-
for cost effective usage .
↳ cost
of automation ↓
→ 5- type
temp
module -
thermocouple → K -
type
→
12MHz freq
ROM / EPROM / EEPROM
_→ ñ"Ist
Lrcb
temp
Jv -
2. 5V
-
7ft
* MUL DIV instructions available
§
.
◦ v -
OOH
{ microcontrollers
:
b/w microprocessors
-
differences teeth
→ Basic → Hmos technology ,
CHMOS uertiom also available .
or
external ( Po -
P}
)
data from memory
to Cpu
two
types of bit Manto multiplexed
one or
→ 16 bit address bus to
port 0 { port 2 .
handling
instructions .
q date
with
rapid movement of bits
movement
of code
within the
addressed to chip chip .
from emit
read date
read data
perform limited
use :
prime ,
calculations
perform en tensive
calculations .
To control
data
on that .
environment on that
store data in mass calculation .
device
Storage
.
17(1)22 Architecture
of 8051 microcontroller
microprocessors
are
dynamically expandable
but microcontrolless have fixed programs
YourEner
ATMAL series
of microcontrollers.
PC DPTR
I lo E D)
ALLAS semiconductors.
address
I
bit
get
to
efo -..........Ad
austries, amorean
I
E
.
CoN
↑
Regbank 2
RESET-menrest ! Regbank l
I o
Elow
meg S
TLI
amn
bank o
= >
interupts -
sports:--
T HI
F counter-
Internal Betis sais
3
memory
control senaldealt
some
ports
have multifunctionality
↳all have
spine. A spins xpports=32pins->10
lines Cout of 40 pins of soil
external addresses can be accerned.
so that
connected to
port 092
Internal RAW
SROM 10 pins
parts with
programmable
timers, counters
↳
independent control
16 -
bit
program counter (PC) a data pointer (DPTR)
8-bit status word (PSW)
program
8 -
bit stack pointer (SP)
ROM -> type of rom differs with versions
of skil
↑ Ks
interparvimn oustoneis
I tend dam
-ite
same
les
32 110
pins -
SBUF
full duplex serial data receiver/transmitter -
TCOM-timer control
Control register
PLON
-
time mode
TMoD-
E
*
IP
SCON-
MOD CON
T
2
F
bit addvenable
*
of Rom *
8. 8 to
ED
cree
&
If is to E
113
IS math register
17
1) 2
10f
9I
I
scon shut poor sw
08
07
Redbank o serial data
register
OO
8 883 8 82
16-bit
-
SP DPH DPL PC
counter
stack pointer data
pointer program
* * *
so & o* Ao Bo
Port latches
21112
Program
enter (PC):
↑FFFH
FEFFH Patanenorebates)
r instructions are
fetched by
auto
incrementing
PC.
↓program
acto
external doesn't have address (usually any
other
register
program external
our hip external any
can be referred worth
memory
program
its
register).
memory
some
of there locations
R:- data
pointer register.
used for
controlling
#
1000t
of 4)
805 operations of peripherals
(SFRs) DIP
OFFFH
internal 64k Ctimers/counters) ↳ addresses for internal a external code date access.
Conor
registen:
-
0000t
0000t
alerta crystaelected
·
↑CON, TMOD, IF, IP, SCON, PCON.
EA 0
=
pin -FA=1
extendly status word (PSW): similar to
flag register.
two
-
· scillator at is on-chip
ports for
32 to line
32 11.059 Mnny
FirstE E E E E
Cy AC to
for
-
S serial commo
cy-carly
reason
for using specifically 11.059ty
-cuxillary
3
Ac
p5 rather than 11 or 12
E
isoI nero
·
3
Fo
I
cow
unit:-
Timing
or Fogramming:
-
A
synchronize
with clock pulse 90. P., P2,is ->8-bit ports 132 to lives.
ALE, an
Once the system is RESET, they're
to acces
control unit
timing a
'O"is written-olp
device. when
the off chip
to reconfigure on it, write"? Pass
fit?
Restors.
general purpose
or
working
I
register
Poto pin connected externally
to lok pull up register
stack pointer
=
4 gen purpose
Ygg
banks
32 -> 4 register
each bank I
counter
(Ro-R.)
program
FE
2 - AEB
ofregisters
special
is
-> accumulator
Aneg
CADD,JUB, MUL, DIN, boolen bit manipulation]
d bitwise
operations
a re
predominent
PT
can be in minocontrolles
used for all
ineg ->
along with A. MULE DIV * Say you
wa n n a
toggle all bits of port of Back: Mor A, #55H
a
A
C ALL DELAY
ACALL
type f -
stack from oth location.
two
(within 2K) Mor A. #OAAH
*
pointer starts
memory
sub-routin
instructions
MOU
Po, A
in cAc
AGALL DELAY
&
tCA22
(long call) S TMp Back
for off-ship T
external 12 OM
(within 64K)
50%-duty cycle
opport
I generate
with
be
Duevote
wave
Pooral: ,
say you
wa n n a
square
HOFE
to addren a date multiplexed line here: SETB P1.2
again: CPL P1.2
MoU Po, A
ACALL DELAY ACALL DELAY
S JMp Back
STMP here
not
or do port
ACALL
CALL
&
DELAY
DELAY
STMP here
r
·
oi port
madef
Porredress line can
DELAY sub-routine
+ cx
syn
f
*
↑OU 124, #OFFH
Icuto decrement
used.
pull up registers
be
again: JNER4, again
internally
RET
to read opk address,
say
porto sport
I can
work together.
bit instructions
->
single
used address
part is
being
when as
the
JB bit, target
JBC
bit,
bit,
target
target
I
Pz. O RxD Consider Oven
application,
&serial communication
on
when is increased
be switched on temp
Pz ( Tx1
say a buzzer has to
RostEEOGoutocideforexteer runter
to some value.
interrupts
I
soil a Butter
sootton
I
out
an
used
only
to lines if 425 goes high
F405
on
are
In 8751,8951 -
ACALL DECAY
CLR P1. 3
Mor PI, FOAAH s TMP here
ACALL DELAY
SJMP Back say you wanna display status of the switch on LED
switch-p..4-ilp port
reset
Ports status upon
Pop port
LED is
have value -
Eff
all
ports
S ETB P1. 4
programming
10
* Bit manipulation bit
flag it is
only
Astoring
in as
mor 6,41.4 Caney
accell-
-
(set bit)
post no
0, 1, 2, 3)
say you
venna toggle all bits of is continuously
for (i,i)
P..4 CPLP.4
30
SETB
again: again:
=0x55; in Lex
CALL
A DELAY
CALL DELAT
&
Ildeta
P
CLP P.. 4 1 =
0XAA;
s jmp
again
ACALL DELAY 3
sTMp
again 3
say you wanna activate a
particular bit, To enable or disable the counter we use GATE signal
means.
signed
have
This LATE be both software or
can
given by
#include <regs1.h>
shit - > poutibit4, "O GATE 02
=
TR1 timer I
1)
-
for (t=0; t c =
100; t+
counting process
90,00
the
SETD TRO I timer starts
=
0; port(bit=0; CLR TRO II to
stop counting
port(bit= 19
-4,0
1,
=
CLR TRO
3
derived from enternal sources.
file
(hardware)
->
a
program tcount external events, set GATE=1
file.
file lengthy compared assembly
is
to
but a
control
icon-> timer
register
- > 8051 timew Bit Symbol
- 16 bit
TUN.7 TFI -
times I overflow flag
2 time I counter
events CON. G control bit
happening TR1 run
↑
I
to count times
delay; counter-
-
time
timer - to generate overflow flog
↑CoN.5
timeno
TFo-timero
outside microcentroller
-
timews To not
of 0000+
it to
Ans: use one the
times, set
using
THO T10
3 timer -
O
20 00010000 I only timer i s used in orbit times mode.
TH1
+113 times -
1
->
through TROSTR1 times can be started or
stopped by instructions
2 pizz
timer
counts to max value -> sets
flag TFORTF
Timer - a
register
+
->
CON
mov THO
mode
Tmop
register-timer power
4-bit -
interrupt function
-> 8-bit
which sets the mode
of times registers
register operation
upper 4-bit-timer
( timer
-
O
timer -
5351-down counter
tmoD
Both time- stimento
model can
be set
simultaneously using once an initial value is beded in to or TH
↑HO TH 1
M. MO
II for timer-1
eased
SETD TRI
O · mode-o 13-bit times mode
modela
mode
O I mode-l 16-bit times
Say you gave
an
initial count Effort - now it starts counting
I 0 mode-28-bit autoreload & once it reaches frrFH,
00001
it was over from firFH to
flag
delay generator /event
counter
CLR+nO 11 to stop timer after TF = 1
reset to 0.
delay generator.
is
time reload thatL 9+F
cli used as timer
repeat
the prown,
-
= 0 -> ↓
sFiro-Fic-ITovertion
source
connected in
Can crystal is
↓ XTALI, XTAL2)
↓
flogo
frequency of times
P1.4 to square
wave with 50% duty
cycle; timer
-
o
f
mode-1
an: rs-Ffff
11 time O
MortMoD, #olt
-
count ->12
19-924B KMy
=
HOF3H
here: mor
TLO,
Delay:
az outera 21.6KMy
SETB TRO &
MOUTHO, #OFEH
again: JNB TFO, again b
CPL
P1.4 22R + RO 1.085 MS
ACALL
Delay CLR TFO
Ms
5 JMP here RET 13x1.085
time
delay
=
:
: