MS51
Nov. 28, 2019
Page
369
of 491
Rev 1.00
MS51
32K
SE
RIES
TE
CHNICAL RE
F
EREN
CE MA
N
UAL
Fsys Value
Baud Rate
TH1 Value (Hex)
RH3,RL3 Value (Hex)
Baudrate Deviation
200000
FB
FFFB
0.000000%
250000
FC
FFFC
0.000000%
333333
FD
FFFD
0.000100%
500000
FE
FFFE
0.000000%
1000000
FF
FFFF
0.000000%
6.9.4
Framing Error Detection
Framing error detection is provided for asynchronous modes. (Mode 1, 2, or 3.) The framing error
occurs when a valid stop bit is not detected due to the bus noise or contention. The UART can detect
a framing error and notify the software.
The framing error bit, FE, is located in SCON.7. This bit normally serves as SM0. While the framing
error accessing enable bit SMOD0 (PCON.6) is set 1, it serves as FE flag. Actually, SM0 and FE
locate in different registers.
The FE bit will be set 1 via hardware while a framing error occurs. FE can be checked in UART
interrupt service routine if necessary. Note that SMOD0 should be 1 while reading or writing to FE. If
FE is set, any following frames received without frame error will not clear the FE flag. The clearing has
to be done via software.
6.9.5
Multiprocessor Communication
The MS51 multiprocessor communication feature lets a master device send a multiple frame serial
message to a slave device in a multi-slave configuration. It does this without interrupting other slave
devices that may be on the same serial line. This feature can be used only in UART Mode 2 or 3. User
can enable this function by setting SM2 (SCON.5) as logic 1 so that when a byte of frame is received,
the serial interrupt will be generated only if the 9
th
bit is 1. (For Mode 2, the 9
th
bit is the stop bit.) When
the SM2 bit is 1, serial data frames that are received with the 9
th
bit as 0 do not generate an interrupt.
In this case, the 9
th
bit simply separates the slave address from the serial data.
When the master device wants to transmit a block of data to one of several slaves on a serial line, it
first sends out an address byte to identify the target slave. Note that in this case, an address byte
differs from a data byte. In an address byte, the 9
th
bit is 1 and in a data byte, it is 0. The address byte
interrupts all slaves so that each slave can examine the received byte and see if it is addressed by its
own slave address. The addressed slave then clears its SM2 bit and prepares to receive incoming
data bytes. The SM2 bits of slaves that were not addressed remain set, and they continue operating
normally while ignoring the incoming data bytes.
Follow the steps below to configure multiprocessor communications:
1. Set all devices (masters and slaves) to UART Mode 2 or 3.
2. Write the SM2 bit of all the slave devices to 1.
3.
The master device’s transmission protocol is:
First byte: the address, identifying the target slave device, (9
th
bit = 1).
Next bytes: data, (9
th
bit = 0).
4. When the target slave receives the first byte, all of the slaves are interrupted because the 9
th
data bit is 1. The targeted slave compares the address byte to its own address and then clears
its SM2 bit to receiving incoming data. The other slaves continue operating normally.
5. After all data bytes have been received, set SM2 back to 1 to wait for next address.