Intel MCS 51 User Manual page 246

Table of Contents

Advertisement

in~.
87C51GB HARDWARE DESCRIPTION
The baud rate generator modeis similarto the auto-re-
load mcde,in that a rolloverin TH2 causesthe Timer 2
registersto be reloadedwith the Id-bitvsduein registers
RCAP2Hand RCAP2L, whichare presetby software.
The baud rates in Modes 1 and 3 are determined by
Timer 2'soverflowrate as follows:
Modes
I
and 3 = ~mer 2 ov~~
Rate
BaudRates
16
Timer2 can becont@red for either "timer" or "coun-
ter" operation.In most applicati~
it is con@ured for
"timer" operation (C—T2 = O).The "Timer" opere-
tion is differentfor Timer 2 when it's being used as a
baudrats generator.Normally,es a timer, it increments
everymachinecycle(1/12 the osciUatorfrequency).As
a baud rate generator, howwer, it increments every
state time (1/2the oscillator frequency).The baud rate
formulais givenbelow:
Mcdaa 1
and
3.
OscillatorFrsqueney
BaudRate
32 x [65536 - (RCAP2H,RCAP2L)]
where (RCAP2H, RCAP2L) is the content of
RCAP2Hand RCAP2L taken as a M-bitunsignedin-
teger.
Timer2 as a baud rate generatoris validonly if RCLK
and/or TCLK = 1 in T2CGN. Note that a rollover in
TH2 doesnot set TF2, end will not generatean inter-
rupt. Therefore,the Timer 2 interrupt doesnot have to
be disabledwhen Timer 2 is in the baud rate generator
mode. Note too, that if EXEN2 is set, a l-to-O tran-
sitionon the T2EXpin willset EXF2but willnot esuse
a reload from (RCAP2H, RCAP2L) to (TH2, TL2).
Thus whenTimer 2 is in use as a baud rate gesmretor,
T2EX can be used as an extra external interrupt, if
desired.
Table 18Iistscommonlyusedbaud rates end how they
can be obtainedfrom Timer 2.
It shouldbe noted that whenTimer 2 is running (TR2
= 1) in "timer" function in the baud rate generator
mode,oneshouldnot try to read or write TH2 or TL2.
Under these conditionsthe Timer is beingincremented
everystate time, and the results of a read or write may
not be accurate. The RCAP2registersmaybe read, but
shouldn'tbe written to, becausea writemight overlapa
reloadand cause write and/or reload errors. The timer
shouldbe turned off (clear TR2) before accessingthe
Timer 2 or RCAP2 registers.
Table18,
BaudRate
375K
9.6K
4.8K
2.4K
1.2K
300
110
300
110
imer2 Ge
F=
12MHz
12MHz
12MHz
12MHz
12MHz
12 MHz
12MHz
6 MHz
6 MHz
erstedBaudRates
Tilt
RCAP2H
FFH
FFH
FFH
FFH
FEH
FBH
F2H
FDH
F9H
r2
RCAP2L
FFH
D9H
B2H
64H
C8H
IEH
AFH
6FH
57H
9.0 SERIALEXPANSIONPORT
The SerialExpansionPort (SEP) allowsa wide variety
of serially hosted peripherals to be connected to the
8XC51GB.The SEP has four programma ble modes
and four clock options.There is a singlebi-directional
data pin (P4.1) and a clock output pin (P4.0). Data
transfersconsistof 8 clockswith 8 bits of dati received
or transmitted.When not transmittingor receivingthe
data and clockuins are inactive.Thereare 3 SFRSM
ciated with the'SEP as shownin Figure 30.
(MSB)
'
(LSB) sEmN
SEPE , SEPREN, CLKPOL , CLKPH , SEPS1
BEPSO
OD7H
(MSB)
(LSB)
6EPSTAT
t
,
, SEPFWR , SEPFRD
I
SEPIF
OF7H
I
Figure30.SEPSFRS
6-%

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents