Setting the Serial Port Mode

The divide-by-32 is a result of the fOSC being divided by 2 (by setting T2CON.TCLK and T2CON.RCLK) and the Timer 2 overflow being divided by

16.

To determine the RCAP2H:RCAP2L value from a given baud rate use the equation below:

RCAP2H : RCAP2L + (65536

 

fOSC

*

 

)

32 @ BaudRate

Table 9−3. Common Baud Rates Using Timer 2

 

 

 

 

 

Baud Rate

C/T2

RCAP2H:RCAP2L (@ 11.0592MHz fOSC)

57.6k

0

 

0FFFAH

19.2k

0

 

0FFEEH

9.6k

0

 

0FFDCH

4.8k

0

 

0FFB8H

2.4k

0

 

0FF70H

1.2k

0

 

0FEE0H

9.2.3Serial Mode 2: Asynchronous Full-Duplex

In mode 2, serial data transfers are 11 bits long, full-duplex, and asynchronous. The transfer begins with a start bit, followed by eight bits of data (LSB first), an additional bit of data (ninth bit), then a stop bit. On transmit, the ninth data bit is set by TB8. On receive, the ninth bit is shifted into the RB8 bit in the SCON register and the stop bit is ignored. The baud rate is either fOSC/64 or fOSC/12.

RXD is used for receiving data, TXD is used for transmitting data, LSB first. On transmission, SCON.TB8 is used for the ninth bit. On reception the ninth bit goes into RB8 in the SCON register. The baud rate is selectable at fOSC/32 or fOSC/64.

Figure 9−5. Serial Port 0 Mode 2 Transmit Timing.

Serial Communication

9-9

 

Page 99
Image 99
Texas Instruments MSC1210 3. Common Baud Rates Using Timer, Serial Mode 2 Asynchronous Full-Duplex, Rcap 2H Rcap 2L +