User`s guide

LZ87010 Advance User’s Guide UARTs
1/15/03 10-13
10.3.2 SBUF and SBUF1 (Serial Data Buffer) Registers
Each UART has a serial buffer register (SBUF for UART 0, and SBUF1 for UART 1), which
has different functions on reads and writes. Writing to SBUF or SBUF1 copies the written
data to the output section of the UART, where it is shifted out the TXD0 or TXD1 pin as
serial data. Reading SBUF or SBUF1 reads the least-significant eight bits of the character
most recently received.
The UARTs each have one character of data buffering for reads and one for writes. On
writes, a character can be written while the previous character is being shifted out through
the UART’s transmit shift register. On reads, the previously received character can be read
while the next character is being shifted in through the UART’s receive shift register. Addi-
tional writes to the SBUF or SBUF1 register will overrun the transmit side and will corrupt
the transmitted data. To prevent this, handshaking is provided through the RI and TI bits
(receive and transmit interrupt bits) of the SCON and SCON1 registers.
Table 10-7. SBUF and SBUF1 Registers
BIT 7 6 5 4 3 2 1 0
FIELD D[7] D[6] D[5] D[4] D[3] D[2] D[1] D[0]
RESET ——— ———
RW RW RW RW RW RW RW RW RW
ADDR
SBUF: 0x99
SBUF1: 0xC9
Table 10-8. SBUF, SBUF1 Register Bits
BIT NAME DESCRIPTION
7:0 D[7:0]
Serial Data When data is written to this register, it is copied to a shift register and
sent as serial data over a Transmit Data pin. When a full character of serial data is
received over a Receive Data pin, it is copied from the receive data shift register to
this field. Nine-bit formats use the TB8 and RB8 bits of the UART’s control register
(SCON or SCON1) as well. These registers are undefined on Reset.