Obsolete
Product(s)
- Obsolete
Product(s)
UPSD3254A, UPSD3254BV, UPSD3253B, UPSD3253BV
Standard serial interface (UART)
Now, the baud rates in Modes 1 and 3 are determined at Timer 2’s overflow rate as follows:
Modes 1 and 3 Baud Rate = Timer 2 Overflow Rate / 16
The timer can be configured for either “timer” or “counter” operation. In the most typical
applications, it is configured for “timer” operation (C/T2 = 0). “Timer” operation is a little
different for Timer 2 when it’s being used as a baud rate generator. Normally, as a timer it
would increment every machine cycle (thus at the 1/6 the CPU clock frequency). In the
case, the baud rate is given by the formula:
Modes 1 and 3 Baud Baud Rate = fOSC / (32 x [65536 – (RCAP2H, RCAP2L)]
where (RCAP2H, RCAP2L) is the content of RC2H and RC2L taken as a 16-bit unsigned
integer.
Timer 2 also be used as the Baud Rate Generating mode. This mode is valid only if RCLK +
TCLK = 1 in T2CON or in PCON.
Note:
A roll-over in TH2 does not set TF2, and will not generate an interrupt. Therefore, the Timer
Interrupt does not have to be disabled when Timer 2 is in the Baud Rate Generator mode.
Note:
If EXEN2 is set, a 1-to-0 transition in T2EX will set EXF2 but will not cause a reload from
(RCAP2H, RCAP2L) to (TH2, TL2). Thus when Timer 2 is in use as a baud rate generator,
T2EX can be used as an extra external interrupt, if desired.
It should be noted that when Timer 2 is running (TR2 = 1) in “timer” function in the Baud
Rate Generator mode, one should not try to READ or WRITE TH2 or TL2. Under these
conditions the timer is being incremented every state time, and the results of a READ or
WRITE may not be accurate. The RC registers may be read, but should not be written to,
because a WRITE might overlap a reload and cause WRITE and/or reload errors. Turn the
timer off (clear TR2) before accessing the Timer 2 or RC registers, in this case.
12.2.4
More about Mode 0
Serial data enters and exits through RxD. TxD outputs the shift clock. 8 bits are
transmitted/received: 8 data bits (LSB first). The baud rate is fixed at 1/12 the fOSC.
Table 45.
Timer 1-generated commonly used baud rates
Baud Rate
fOSC
SMOD
Timer 1
C/T
Mode
Reload Value
Mode 0 Max: 1MHz
12MHz
X
Mode 2 Max: 375K
12MHz
1
X
Modes 1, 3: 62.5K
12MHz
1
0
2
FFh
19.2K
11.059MHz
1
0
2
FDh
9.6K
11.059MHz
0
2
FDh
4.8K
11.059MHz
0
2
FAh
2.4K
11.059MHz
0
2
F4h
1.2K
11.059MHz
0
2
E8h
137.5
11.059MHz
0
2
1Dh
110
6MHz
0
2
72h
110
12MHz
0
1
FEEBh