MS51
Dec. 17, 2019
Page
63
of 316
Rev 1.01
M
S51
SE
RIES
TE
CHNICA
L REF
ERE
N
CE MA
NU
A
L
SCON
– Serial Port Control
Regiser
Address
Reset Value
SCON
98H, all pages, Bit addressable
0000_0000b
7
6
5
4
3
2
1
0
SM0/FE
SM1
SM2
REN
TB8
RB8
TI
RI
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Bit
Name
Description
7
SM0/FE
Serial port mode select
SMOD0 (PCON.6) = 0:
See Table 6.8-1 Serial Port UART0 Mode / baudrate Description for details.
SMOD0 (PCON.6) = 1:
SM0/FE bit is used as frame error (FE) status flag. It is cleared by software.
0 = Frame error (FE) did not occur.
1 = Frame error (FE) occurred and detected.
6
SM1
5
SM2
Multiprocessor communication mode enable
The function of this bit is dependent on the serial port 0 mode.
Mode 0:
This bit select the baud rate between F
SYS
/12 and F
SYS
/2.
0 = The clock runs at F
SYS
/12 baud rate. It maintains standard 8051
compatibility.
1 = The clock runs at F
SYS
/2 baud rate for faster serial communica-
tion.
Mode 1:
This bit checks valid stop bit.
0 = Reception is always valid no matter the logic level of stop bit.
1 = Reception is valid only when the received stop bit is logic 1 and the
received data matches “Given” or “Broadcast” address.
Mode 2 or 3:
For multiprocessor communication.
0 = Reception is always valid no matter the logic level of the 9
th
bit.
1 = Reception is valid only when the received 9
th
bit is logic 1 and the
received data matches “Given” or “Broadcast” address.
4
REN
Receiving enable
0 = Serial port 0 reception Disabled.
1 = Serial port 0 reception Enabled in Mode 1,2, or 3. In Mode 0, reception is initiated by the
condition REN = 1 and RI = 0.
3
TB8
9
th
transmitted bit
This bit defines the state of the 9
th
transmission bit in serial port 0 Mode 2 or 3. It is not used in
Mode 0 or 1
2
RB8
9
th
received bit
The bit identifies the logic level of the 9
th
received bit in serial port 0 Mode 2 or 3. In Mode 1, RB8 is
the logic level of the received stop bit. SM2 bit as logic 1 has restriction for exception. RB8 is not
used in Mode 0.
1
TI
Transmission interrupt flag
This flag is set by hardware when a data frame has been transmitted by the serial port 0 after the 8
th
bit in Mode 0 or the last data bit in other modes. When the serial port 0 interrupt is enabled, setting
this bit causes the CPU to execute the serial port 0 interrupt service routine. This bit should be
cleared manually via software.
0
RI
Receiving interrupt flag
This flag is set via hardware when a data frame has been received by the serial port 0 after the 8
th
bit in Mode 0 or after sampling the stop bit in Mode 1, 2, or 3. SM2 bit as logic 1 has restriction for
exception. When the serial port 0 interrupt is enabled, setting this bit causes the CPU to execute to
the serial port 0 interrupt service routine. This bit should be cleared manually via software.