On-Chip Peripheral Components
C513AO
User’s Manual
6-32
05.99
Special Function Register SCON (Address 98H)
Reset Value: 00H
Special Function Register SBUF (Address 99H)
Reset Value: XXH
Bit
Function
SM0
SM1
Serial port operating Mode selection bits
SM2
Enable Serial port Multiprocessor communication in Modes 2 and 3
In Mode 2 or 3, if SM2 is set to “1”, then RI will not be activated if the received 9th
data bit (RB8) is “0”. In Mode 1, if SM2 = 1 then RI will not be activated if a valid
stop bit was not received. In Mode 0, SM2 should be “0”.
REN
Enable Receiver of serial port
Enables serial reception. Set by software to enable serial reception. Cleared by
software to disable serial reception.
TB8
Serial port Transmitter Bit 9
TB8 is the 9th data bit that will be transmitted in Modes 2 and 3. Set or cleared by
software as desired.
RB8
Serial port Receiver Bit 9
In Modes 2 and 3, RB8 is the 9th data bit that was received. In Mode 1, if SM2 = 0,
RB8 is the stop bit that was received. In Mode 0, RB8 is not used.
TI
Serial port tRansmitter Interrupt flag
TI is set by hardware at the end of the 8th bit time in Mode 0, or at the beginning
of the stop bit in the other modes, in any serial transmission. TI must be cleared
by software.
RI
Serial port Receiver Interrupt flag
RI is set by hardware at the end of the 8th bit time in Mode 0, or halfway through
the stop bit time in the other modes, in any serial reception (exception see SM2).
RI must be cleared by software.
9FH
9EH
9DH
9CH
9BH
9AH
99H
98H
SM0
SM1
SM2
REN
98H
SCON
Bit No.
MSB
LSB
TB8
RB8
TI
RI
99H
SBUF
7
6
5
4
3
2
1
0
Serial Interface Buffer Register
SM0
SM1
Selected Operating Mode
0
0
Serial Mode 0: Shift register, fixed baudrate (
f
OSC
/12)
0
1
Serial Mode 1: 8-bit UART, variable baudrate
1
0
Serial Mode 2: 9-bit UART, fixed baudrate (
f
OSC
/32 or
f
OSC
/64)
1
1
Serial Mode 3: 9-bit UART, variable baudrate