8XC251SA, SB, SP, SQ USER’S MANUAL
10-12
10.6.3.3 Timer 2 Generated Baud Rates (Modes 1 and 3)
Timer 2 may be selected as the baud rate generator for the transmitter and/or receiver (Figure
10-5). The timer 2 baud rate generator mode is similar to the auto-reload mode. A rollover in the
TH2 register reloads registers TH2 and TL2 with the 16-bit value in registers RCAP2H and
RCAP2L, which are preset by software.
The timer 2 baud rate is expressed by the following formula:
10.6.3.4 Selecting Timer 2 as the Baud Rate Generator
To select timer 2 as the baud rate generator for the transmitter and/or receiver, program the
RCLCK and TCLCK bits in the T2CON register as shown in Table 10-5. (You may select differ-
ent baud rates for the transmitter and receiver.) Setting RCLK and/or TCLK puts timer 2 into its
baud rate generator mode (Figure 10-5). In this mode, a rollover in the TH2 register does not set
the TF2 bit in the T2CON register. Also, a high-to-low transition at the T2EX pin sets the EXF2
bit in the T2CON register but does not cause a reload from (RCAP2H, RCAP2L) to (TH2, TL2).
You can use the T2EX pin as an additional external interrupt by setting the EXEN2 bit in T2CON.
NOTE
Turn the timer off (clear the TR2 bit in the T2CON register) before accessing
registers TH2, TL2, RCAP2H, and RCAP2L.
Table 10-4. Timer 1 Generated Baud Rates for Serial I/O Modes 1 and 3
Baud
Rate
Oscillator
Frequency
(F
OSC
)
SMOD1
Timer 1
C/T# Mode
Reload
Value
62.5 Kbaud (Max) 12.0 MHz 1 0 2 FFH
19.2 Kbaud 11.059 MHz 1 0 2 FDH
9.6 Kbaud 11.059 MHz 0 0 2 FDH
4.8 Kbaud 11.059 MHz 0 0 2 FAH
2.4 Kbaud 11.059 MHz 0 0 2 F4H
1.2 Kbaud 11.059 MHz 0 0 2 E8H
137.5 Baud 11.986 MHz 0 0 2 1DH
110.0 Baud 6.0 MHz 0 0 2 72H
110.0 Baud 12.0 MHz 0 0 1 FEEBH
Serial I/O Modes 1 and 3 Baud Rate
Timer 2 Overflow Rate
16
------------------------------------------------------------=