![Nuvoton NuMicro MS51 32K Series Скачать руководство пользователя страница 364](http://html1.mh-extra.com/html/nuvoton/numicro-ms51-32k-series/numicro-ms51-32k-series_technical-reference-manual_1720303364.webp)
MS51
Nov. 28, 2019
Page
364
of 491
Rev 1.00
MS51
32K
SE
RIES
TE
CHNICAL RE
F
EREN
CE MA
N
UAL
received. Then the received flag RI will be set as 1. User can clear RI to triggering the next byte
reception.
Mode 1
6.9.2.2
Mode 1 supports asynchronous, full duplex serial communication. The asynchronous mode is
commonly used for communication with PCs, modems or other similar interfaces. In Mode 1, 10 bits
are transmitted through TXD or received through RXD including a start bit (logic 0), 8 data bits (LSB
first) and a stop bit (logic 1). The baud rate is determined by the Timer 1. SMOD (PCON.7) setting 1
makes the baud rate double. Figure 6.9-2 shows the associated timings of the serial port in Mode 1 for
transmitting and receiving.
Figure 6.9-2 Serial Port Mode 1 Timing Diagram
Transmission is initiated by any writing instructions to SBUF. Transmission takes place on TXD pin.
First the start bit comes out, the 8-bit data follows to be shifted out and then ends with a stop bit. After
the stop bit appears, TI (SCON.1) will be set to indicate one byte transmission complete. All bits are
shifted out depending on the rate determined by the baud rate generator.
Once the baud rate generator is activated and REN (SCON.4) is 1, the reception can begin at any
time. Reception is initiated by a detected 1-to-0 transition at RXD. Data will be sampled and shifted in
at the selected baud rate. In the midst of the stop bit, certain conditions should be met to load SBUF
with the received data:
1. RI (SCON.0) = 0, and
2. Either SM2 (SCON.5) = 0, or the received stop bit = 1 while SM2 = 1 and the received data
matches “Given” or “Broadcast” address. (For enhancement function, see Section 6.9.5
“Multiprocessor Communication” and Section 6.9.6 “Automatic Address Recognition”.)
If these conditions are met, then the SBUF will be loaded with the received data, the RB8 (SCON.2)
with stop bit, and RI will be set. If these conditions fail, there will be no data loaded and RI will remain
0. After above receiving progress, the serial control will look forward another 1-to-0 transition on RXD
pin to start next data reception.
Mode 2
6.9.2.3
Mode 2 supports asynchronous, full duplex serial communication. Different from Mode1, there are 11
bits to be transmitted or received. They are a start bit (logic 0), 8 data bits (LSB first), a programmable
9
th
bit TB8 or RB8 bit and a stop bit (logic 1). The most common use of 9
th
bit is to put the parity bit in it
or to label address or data frame for multiprocessor communication. The baud rate is fixed as 1/32 or
1/64 the system clock frequency depending on SMOD (PCON.7) bit. Figure 6.9-3 shows the
associated timings of the serial port in Mode 2 for transmitting and receiving.