1999 Mar 12
32
Philips Semiconductors
Product specification
8-bit microcontroller
P8xC557E8
13 SERIAL I/O PORTS
The P8xC557E8 is equipped with 2 independent serial
ports:
SIO0, which is the full duplex UART port, identical to the
PCB80C51 serial port
SIO1,which is an I
2
C-bus serial I/O interface with byte
oriented master and slave functions.
13.1
Serial I/O Port: SIO0 (UART)
SIO0 is a full duplex serial I/O port - it can transmit and
receive simultaneously. This serial port is also
receive-buffered. It can commence reception of a second
byte before the previously received byte has been read
from the receive register. If, however, the first byte has still
not been read by the time reception of the second byte is
complete, one of the bytes will be lost. The SIO0 receive
and transmit registers are both accessed via the S0BUF
special function register. Writing to S0BUF loads the
transmit register, and reading S0BUF accesses a
physically separate receive register. SIO0 can operate in
four modes:
Mode 0 Serial data is transmitted and received through
RXD. TXD outputs the shift clock. 8 data bits are
transmitted/received (LSB first). The baud rate is
fixed at
1
12
×
the oscillator frequency. A write into
S0CON should be avoided during a transmission
to avoid spikes on RXD/TXD.
Mode 1 10 bits are transmitted via TXD or received
through RXD: a start bit (0), 8 data bits (LSB first),
and a stop bit (1). On receive, the stop bit is put
into RB8 of the S0CON SFR. 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 9
th
data bit, and a stop bit (1).
On transmit, the 9
th
data bit (TB8 in S0CON) can
be assigned the value of 0 or 1. With nominal
software, TB8 can be the parity bit (P in PSW).
During a receive, the 9
th
data bit is stored in RB8
(S0CON), and the stop bit is ignored. The baud
rate is programmable to either
1
32
or
1
64
of the
oscillator frequency.
Mode 3 11 bits are transmitted through TXD or received
through RXD: a start bit (0), 8 data bits (LSB first),
a programmable 9
th
data bit, and a stop bit (1).
Mode 3 is the same as Mode 2 except for the
baud rate which is variable in Mode 3.
In all four modes, transmission is initiated by any
instruction that writes to the SFR S0BUF. Reception is
initiated in Mode 0 when RI = 0 and REN = 1. In the other
three modes, reception is initiated by the incoming start bit
provided that REN = 1.
Modes 2 and 3 are provided for multiprocessor
communications. In these modes, 9 data bits are received
with the 9
th
bit written to RB8 (S0CON). The 9
th
bit is
followed by the stop bit. The port can be programmed so
that with receiving the stop bit, the serial port interrupt will
be activated if, and only if RB8 = 1.
This feature is enabled by setting bit SM2 in S0CON.
It may be used in multiprocessor systems.
For more information about how to use the UART in
combination with the registers S0CON, PCON, IE, SBUF
and the Timer register, refer to “Data Handbook IC20”