English
Language : 

UPSD3422_06 Datasheet, PDF (100/293 Pages) STMicroelectronics – Turbo Plus Series Fast Turbo 8032 MCU with USB and Programmable Logic
Serial UART interfaces
uPSD34xx
21.1.3
21.1.4
21.1.5
Mode 2
Mode 2 provides asynchronous, full-duplex communication using a total of 11 bits per data
byte. Data is transmitted through TxD and received through RxD with: a Start Bit (logic '0');
eight data bits (LSB first); a programmable 9th data bit; and a Stop Bit (logic '1'). Upon
Transmit, the 9th data bit (from 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. Upon receive, the 9th
data bit goes into RB8 in SCON, while the Stop Bit is ignored. The baud rate is
programmable to either 1/32 or 1/64 of fOSC.
Mode 3
Mode 3 is the same as Mode 2 in all respects except the baud rate is variable like it is in
Mode 1.
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.
Table 46. UART operating modes
Bits of SFR,
Mode Synchronization
SCON
SM0 SM1
Baud Clock
Data
Bits
Start/Stop
Bits
See Figure
0
Synchronous
0
0
fOSC/12
Figure 31
8
None
on
page 105
1
Asynchronous
0
1
Timer 1 or Timer 2
Overflow
8
1 Start, 1
Stop
Figure 33
on
page 107
2
Asynchronous
1
0 fOSC/32 or fOSC/64 9
1 Start, 1
Stop
Figure 35
on
page 109
3
Asynchronous
1
1
Timer 1 or Timer 2
Overflow
9
1 Start, 1
Stop
Figure 37
on
page 110
Multiprocessor communications
Modes 2 and 3 have a special provision for multiprocessor communications. In these
modes, 9 data bits are received. The 9th one goes into bit RB8, then comes a stop bit. The
port can be programmed such that when the stop bit is received, the UART interrupt will be
activated only if bit RB8 = 1. This feature is enabled by setting bit SM2 in SCON. A way to
use this feature in multi-processor systems is as follows: When the master processor wants
to transmit a block of data to one of several slaves, it first sends out an address byte which
identifies the target slave. An address byte differs from a data byte in that the 9th bit is 1 in
an address byte and 0 in a data byte. With SM2 = 1, no slave will be interrupted by a data
byte. An address byte, however, will interrupt all slaves, so that each slave can examine the
received byte and see if it is being addressed. The addressed slave will clear its SM2 bit and
prepare to receive the data bytes that will be coming. The slaves that were not being
addressed leave their SM2 bits set and go on about their business, ignoring the coming data
bytes.
100/293