TE
CH
tm
T2CON.1: Timer or counter select. (Timer 2) , 0 as internal timer
T81L0003A
TM Technology, Inc. reserves the right
P. 11
to change products or specifications without notice. Revision: C
Publication Date: SEP. 2004
T2CON.0: Capture/Reload flag. When set, captures will occur on negative transitions at T2EX if EXEN2=1. When cleared,
auto reloads will occur either with timer2 overflow or negative transitions at T2EX when EXEN2=1. When either
RCLK=1 or TCLK=1, this bit is ignored and the timer is forced to auto-reload on timer2 overflow.
Note then the baudrates for transmit and receive can be simultaneously different. Setting RCLK and/or TCLK puts Timer2
into its baudrate generator mode.
The baudrate generator mode is similar to the auto reload mode, in that a rollover is TH2 causes the Timer2 registers to be
reload with the 16 bit value in registers RCAP2H and RCAP2L, which are preset by software given by the formula.
Baudrate= (Timer2 overflow rate)/16 =(Oscillator Frequency) / (32*(65536-(RCAP2H,RCAP2L)))
Serial Interface Timing Diagram
S1.........S6
S1.........S6
S1.........S6
S1.........S6
S1.........S6
S1.........S6
S1.........S6
S1.........S6
S1.........S6
S1.........S6
ALE
D0
D1
D2
D3
D4
D5
D6
D7
RXD
TXD
D0
D1
D2
D3
D4
D5
D6
D7
RXD
TXD
Receive
Shift
W rite to SCON, Clear RI
RI
W rite to SBUF
Send
Shift
Serial Port M ode 0