
ML51/ML54/ML56
Sep. 01, 2020
Page
483
of 719
Rev 2.00
ML
51
/ML
54
/ML
5
6 S
E
RI
E
S
TECHNI
CA
L
RE
F
E
R
E
NC
E
M
A
NU
A
L
ML51/M
L54
/M
L56
Series
Tec
hnical Reference
Manual
Framing Error Detection
6.9.3.3
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.
Multiprocessor Communication
6.9.3.4
The ML51/ML54/ML56 Series 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.
SM2 has no effect in Mode 0, and in Mode 1 can be used to check the validity of the stop bit. For
Mode 1 reception, if SM2 is 1, the receiving interrupt will not be issue unless a valid stop bit is
received.
Automatic Address Recognition
6.9.3.5
The automatic address recognition is a feature, which enhances the multiprocessor communication
feature by allowing the UART to recognize certain addresses in the serial bit stream by using
hardware to make the comparisons. This feature saves a great deal of software overhead by
eliminating the need for the software to examine every serial address, which passes by the serial port.
Only when the serial port recognizes its own address, the receiver sets RI bit to request an interrupt.
The automatic address recognition feature is enabled when the multiprocessor communication feature
is enabled, SM2 is set.