
HT80C51 User Manual
Peripheral Modules – Standard Serial Interface (SIO0)
Handshake Solutions
© Philips Electronics N.V. 2005
Page 33 of 132
5.3.
Standard Serial Interface (SIO0)
This module implements a buffered, full duplex asynchronous serial interface with multimaster sup-
port.
5.3.1.
Options
This module can be enabled (ordered) by using option HT80C51_SIO.
5.3.2.
Special function registers (SCON SBUF SMOD)
SCON
Serial Port Control Register
addr = 98H
reset value = 00H
bits
7
6
5
4
3
2
1
0
SM0
SM1
SM2
REN
TB8
RB8
TI
RI
bit
symbol
Function
SCON.7
SCON.6
SM0
SM1
00:
01:
10:
11:
serial mode selection: (SM0,SM1):
mode 0:
shift register
fsio_clk_i
mode 1:
8bit UART
depending on ft01_overflow
mode 2:
9bit UART
fsio_clk_i /64 or fsio_clk_i /32
mode 3:
9bit UART
depending on ft01_overflow
SCON.5
SM2
multiprocessor communication in modes 2 and 3.
If SM2=1 in modes 2 and 3, then RI will not be activated if the received
9
th data bit (RB8) is 0.
If SM2=1 in mode 1, then RI will not be activated if a valid stop bit was
not received.
In mode 0 SM2 should be 0.
SCON.4
REN
Enables serial reception. Set by software to enable reception. Clear by
software to disable reception.
SCON.3
TB8
The 9th data bit that will be transmitted in Modes 2 and 3. Set or clear
by software as desired.
SCON.2
RB8
In Modes 2 and 3, is the 9th data bit that was received. In Mode 1, it
SM2=0, RB8 is the stop bit that was received. In Mode 0, RB8 is not used.
SCON.1
TI
Transmit interrupt flag. 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. Must be cleared by software.
SCON.0
RI
Receive interrupt flag. 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 (except see SM2). Must be cleared by software.
The serial port control and status register is the Special Function Register SCON. This register contains
not only the mode selection bits, but also the 9th data bit for transmit and receive (TB8 and RB8), and
the serial port interrupt bits (TI and RI).
SBUF
Serial Port Buffer
addr = 99H
reset value = XX
bits
7
6
5
4
3
2
1
0
SBUF
The serial port receive and transmit registers are both accessed thru special function register SBUF.
Writing to SBUF loads the transmit register, and reading SBUF accesses a physically separate receive
register.