1998 Apr 07
26
Philips Semiconductors
Product specification
8-bit Flash microcontrollers
P89C738; P89C739
12 FULL DUPLEX SERIAL PORT (UART)
The serial port is functionally similar to the implementation
in the 8052AH, with the possibility of two different baud
rates for receive and transmit with Timer 1 and Timer 2 as
baud rate generators. It is full duplex, meaning it can
receive and transmit simultaneously. 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
has not been read by the time the reception of the second
byte is complete, one of the bytes will be lost. The Serial
Port receive and transmit registers are both accessed as
SFR SBUF. Writing to SBUF loads the transmit register,
and reading SBUF accesses the physically separate
receive register.
12.1
The Serial Port operating modes
The serial port can operate in one of 4 modes:
Mode 0 Serial data enters and exits through RXD.
TXD outputs the shift clock. Eight bits are
transmitted/received (LSB first). The baud rate is
fixed at
1
12
f
clk
.
Mode 1 10 bits are transmitted (through TXD) or received
(through RXD): a start bit (logic 0), 8 data bits
(LSB first), and a stop bit (logic 1). On receive,
the stop bit goes into RB8 in SFR SCON.
The baud rate is variable.
Mode 2 11 bits are transmitted (through TXD) or received
(through RXD): start bit (logic 0), 8 data bits (LSB
first), a programmable 9th data bit, and a stop bit
(logic 1). On transmit, the 9th data bit (TB8 in
SFR SCON) can be assigned the value of a
logic 0 or logic 1. For example, the parity bit (P in
the PSW) could be moved into TB8. On receive,
the 9th data bit goes into RB8 in SFR SCON,
while the stop bit is ignored. The baud rate is
programmable to either
1
32
or
1
64
f
clk
.
Mode 3 11 bits are transmitted (through TXD) or received
(through RXD): a start bit (logic 0), 8 data bits
(LSB first), a programmable 9th data bit and a
stop bit (logic 1). In fact, Mode 3 is the same as
Mode 2 in all respects except the baud rate.
The baud rate in Mode 3 is variable.
In all four modes, transmission is initiated by any
instruction that uses SFR SBUF as a destination register.
In Mode 0, reception is initiated by the condition RI = 0 and
REN = 1. Reception is initiated by incoming start bit if
REN = 1 in the other modes.