Common Features Description
2-91 Atmel 8051 Microcontrollers Hardware Manual
4316B–8051–02/04
Table 2-12. RCAP2H Register -RCAP2H (S:CBh)
Timer 2 Reload/Capture High Byte Register
Reset Value = 0000 0000b
Not bit addressable
Table 2-13. RCAP2L Register - RCAP2L (S:CAh)
Timer 2 Reload/Capture Low Byte Register
Reset Value = 0000 0000b
Not bit addressable
2.13 Serial Interface It provides both synchronous and asynchronous communication modes. It operates as a
Universal Asynchronous Receiver and Transmitter (UART) in three full-duplex modes
(Modes 1, 2 and 3). Asynchronous transmission and reception can occur simultaneously
and at different baud rates.
It is also receive-buffered, meaning it can commence reception of a second byte before
a previously received byte has been read from the receive register. (However, if the first
byte still hasn’t been read by the time reception of the second byte is complete, one of
the bytes will be lost). The serial port receive and transmit registers are both accessed
at Special Function Register SBUF. Writing to SBUF loads the transmit register, and
reading SBUF accesses a physically second receive register.
The serial port can operate in 4 modes:
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 oscil-
lator frequency.
Mode 1: 10 bits are transmitted (through TXD) or received (through RXD): a start bit (0),
8 data bits (LSB first), and a stop bit (1). On receive, the stop bit goes into RB8 in Spe-
cial Function Register SCON. The baud rate is variable.
Mode 2: 11 bits are transmitted (through TXD) or received (through RXD): a start bit (0),
8 data bits (LSB first), a programmable 9th data bit, and a stop bit (1). On transmit, the
9th data bit (TB8 in SCON) can be assigned the value of 0 or 1. Or, for example, the par-
ity bit (P, in the PSW) could be moved into TB8. On receive, the 9th data bit goes into
76543210
--------
Bit
Number
Bit
Mnemonic Description
7:0 High Byte of Timer 2 Reload/Capture.
76543210
--------
Bit
Number
Bit
Mnemonic Description
7:0 Low Byte of Timer 2 Reload/Capture.