English
Language : 

TDA8029 Datasheet, PDF (16/58 Pages) NXP Semiconductors – Low power single card reader
Philips Semiconductors
Low power single card reader
Product specification
TDA8029
8.2.4 BAUD RATE GENERATOR MODE
Bits TCLK and/or RCLK in register T2CON allow the serial
port transmit and receive baud rates to be derived from
either timer 1 or 2. When TCLK = 0, timer 1 is used as the
serial port transmit baud rate generator. When TCLK = 1,
timer 2 is used. RCLK has the same effect for the serial
port receive baud rate. With these two bits, the serial port
can have different receive and transmit baud rates, one
generated by timer 1, the other by timer 2.
The baud rate generation mode is like the auto-reload
mode, in that a rollover in TH2 causes the timer 2 registers
to be reloaded with the 16-bit value in registers RCAP2H
and RCAP2L, which are preset by software.
The baud rates in modes 1 and 3 are determined by the
overflow rate of timer 2, given by equation (1):
Baud rate = T----i--m-----e---r----2-----o--1-v---6e---r--f--l-o----w------r--a---t--e-
(1)
The timer can be configured for either timer or counter
operation. In many applications, it is configured for timer
operation (C/T2 = 0). Timer operation is different for
timer 2 when it is being used as a baud rate generator.
Usually, as a timer it would increment every machine cycle
(i.e. 1/12 fosc). As a baud rate generator, it increments every
state time (i.e. 1/2fosc). Thus the modes 1 and 3 baud rate
formula is as Equation (2):
Baud rate = -3---2-----×-----[--6---5---O-5---3-s--6-c---i-–l--l-a--(-t-R-o---r-C---f-A-r--e-P--q--2-u--H--e---,n---Rc---y-C-----A----P----2---L----)---] (2)
Where (RCAP2H, RCAP2L) is the contents of RCAP2H
and RCAP2L registers taken as a 16-bit unsigned integer.
The timer 2 as a baud rate generator is valid only if
RCLK = 1 and/or TCLK = 1 in the T2CON register. Note
that a rollover in TH2 does not set TF2, and will not
generate an interrupt. Thus, the timer 2 interrupt does not
have to be disabled when timer 2 is in the baud rate
generator mode. Also if the EXEN2 (T2 external enable)
flag is set, a HIGH to LOW transition on T2EX
(Timer/counter 2 trigger input) will set the EXF2 (T2
external) flag but will not cause a reload from (RCAP2H
and RCAP2L) to (TH2 and TL2). Therefore, when timer 2
is used as a baud rate generator, T2EX can be used as an
additional external interrupt, if needed.
When timer 2 is in the baud rate generator mode, never try
to read or write TH2 and TL2. As a baud rate generator,
timer 2 is incremented every state time (1/2fosc) or
asynchronously from controller I/O T2; under these
conditions, a read or write of TH2 or TL2 may not be
accurate. The RCAP2 registers may be read, but should
not be written to, because a write might overlap a reload
and cause write and/or reload errors. The timer should be
turned off (clear TR2) before accessing the timer 2 or
RCAP2 registers. See Fig.5 for an overview.
Table 9 Timer 2 generated commonly used baud rates
BAUD RATE
375k
9.6k
2.8k
2.4k
1.2k
300
110
300
110
CRYSTAL OSCILLATOR
FREQUENCY
TIMER
RCAP2H (HEX)
RCAP2L (HEX)
12 MHz
FF
FF
12 MHz
FF
D9
12 MHz
FF
B2
12 MHz
FF
64
12 MHz
FE
C8
12 MHz
FB
1E
12 MHz
F2
AF
6 MHz
FD
8F
6 MHz
F9
57
2003 Oct 30
16