EasyManuals Logo

Intel MCS 51 User Manual

Intel MCS 51
334 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #193 background imageLoading...
Page #193 background image
in~.
8XC51FXHARDWAREDESCRIPTION
The baud rates in Modas 1 and 3 are deterrnin
ed by
Timer 2’s overflow rate as follows:
Modesland3BaudRates= ‘i’”’r20’’’tO’Rate’Rate
The Timer can be contlgured for either “timer” or
“counter” operation. In most a~lications, it is config-
ured for “timer” operation (C/T2 = O).The “Timer”
operationis different for Timer 2 when it’s being used
as a baudrategenerator.Normally, as a timer, it incre-
ments everymachine cycle (1/12 the oscillatorfrequen-
Cy).AS a baud rste generator, however, it increments
everystate time (1/2the oscillatorfrequency).The baud
rate formulais given below:
Modes 1 and 3 =
Oscillator Frequency
Baud Rate
32 X [65536 - (RCAP2H, RCAP2L)]
where (RCAP2H, RCAP2L) is the content of
RCAP2H and RCAP2L taken as a l~bit unsigned
integer.
Timer 2 as a baud rategeneratoris shown in Figure 23.
This tigureis valid only if RCLKand/or TCLK = 1in
T2CON. Note that a rolloverin TH2 does not set TF2,
and will not generatean interrupt.Therefore the Timer
2 interruptdoes not have to be disabledwhen Timer 2
is in the baud rate generator mode. Note too, that if
EXEN2 is seL a l-to-O transition in T2EX will set
EXF2 but will not cause a reload from (RCAP2H,
RCAP2L) to (TH2, TL2). Thus when Timer2 is in use
as
a baud rategenerator,T2EX canbe used as an extra
externalinterrupt, if desired.
It should be noted that when Timer 2 is
*J3 w
= 1) in “timer” firncticmin the baud rate generator
mode, one should not try to reador writeTH2 or TL2.
Under these conditions the Timer is being incremented
everystate time, and the results of a reador write may
not be accurate.The RCAP2 registersmaybe read, but
shouldn’tbe written to, because a writemight overlap a
reloadand cause write and/or reloademors.The timer
should be turned off (clear TR2) beforeaccessing the
Timer 2 or RCAP2 registers.
Table 16lists commonly used baud ratesand how they
can be obtained from Timer 2.
Baud
Rate
375K
9.6K
4.6K
2.4K
1.2K
300
110
300
110
Table 16.Timer2 Generated
Commonly Used Baud Rates
Osc
Fraq
12 MHz
12 MHz
12 MHz
12 MHz
12 MHz
12 MHz
12 MHz
6 MHz
6 MHz
Timer 2
RCAP2H
FF
FF
FF
FF
FE
FB
F2
FD
F9
RCAP2L
FF
D9
B2
84
C8
IE
AF
8F
57
74
ml
Ovsnn.ow
+-l
r
NomOec.Psao.taolnDao
BY 2, MOT 12.
D
+’2
I
-L
1
TH2
TLS
.Rx
Cmex
1
1
1
1
? ‘—
I
RCAP2H
I
RCAP2L
r=
1
TX CLOCK
L
non! ~ OFAmrnonu axramsL Wrremw’r
270S53-20
Figura 23. Timer 2 in Baud Rate Generator Mode
5-31

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Intel MCS 51 and is the answer not in the manual?

Intel MCS 51 Specifications

General IconGeneral
BrandIntel
ModelMCS 51
CategoryMicrocontrollers
LanguageEnglish

Related product manuals