English
Language : 

SM59D03G2 Datasheet, PDF (36/67 Pages) SyncMOS Technologies,Inc – 8-Bits Micro-controller
SM59D03G2
8-Bits Micro-controller
8KB+ ISP Flash & 1KB RAM embedded
10 Serial interface (UART)
The UART serial port is full duplex, meaning it can transmit and receive 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 hasn’t been
read by the time reception of the second byte is complete, one of the bytes will be lost). The serial
port’s receive and transmit registers are both accessed through SFR SBUF. Actually, SBUF is
composed of two separate registers, a transmit buffer and a receive buffer. Writing to SBUF loads
the transmit register, and reading SBUF accesses a physically separate receive register.
The serial port control and status register are in the SFR SCON. This register contains the mode
selection bits (SM0 and SM1), the SM2 bit for the multiprocessor modes (please see Subsection
10.1), the Receive Enable (REN); the 9th data bit for transmit and receive (TB8 and RB8); and the
serial port interrupt bits (TI and RI).
The serial port can operate in the following 4 modes:
Mode 0: Serial data enters and exits through RXD. TXD outputs the shift clock. 8 bits are
transmitted or received with LSB first. The baud rate is fixed at 1/6 the system frequency as
defined in Section 1.
Mode 1: 10 bits are transmitted (through TXD) or received (through RXD) with a start bit (=0),
then the 8 data bits with LSB first, finally a stop bit (=1). On the receiving side, 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) with a start bit (=0),
then the 8 data bits with LSB first, then a programmable 9th data bit, finally a stop bit (=1). On
the transmitting side, the 9th data bit (TB8 in SCON) can be assigned the value of 0 or 1, or, for
example, the parity bit (P in the PSW) could be moved into TB8. On the receiving side , the 9th
data bit goes into RB8 in SCON. The baud rate is programmable to either 1/32 or 1/16 of the
system frequency.
Mode 3: 11 bits are transmitted (through TXD) or received (through RXD) with a start bit (=0),
then the 8 data bits with LSB first, then a programmable 9th data bit, finally a stop bit (=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 SBUF as a destination
register. Reception is initiated in Mode 0 by the condition RI = 0 and REN = 1. Reception is initiated
in the other modes by the incoming start bit if REN = 1.
10.1 Multiprocessor Communications
Mode 2 and 3 have a special provision for multiprocessor communications. In these modes, 9 data
bits are received. The 9th one goes into RB8. Then comes a stop bit. The port can be programmed
such that when the stop bit is received, the serial port interrupt will be activated only if RB8 = 1. This
feature is enabled by setting bit SM2 in SCON. This feature is used in multiprocessor systems as
follows.
Specifications subject to change without notice contact your sales representatives for the most recent information.
ISSFD-M030
36
Ver.C SM59D03G2 07/2009