
HT80C51 User Manual
Peripheral Modules – Standard Serial Interface (SIO0)
Handshake Solutions
© Philips Electronics N.V. 2005
Page 35 of 132
Mode 1:
10 bits are transmitted (through sio_txd_o) or received (through sio_rxd_i): a start bit
(0), 8 data bits (LSB first), and a stop bit (1). On receive, the stop bit goes into RB8 in Spe-
cial Function Register SCON. The baud rate is derived from the overflow rate of timer 1.
Mode 2:
11 bits are transmitted (through sio_txd_o) or received (through sio_rxd_i): start bit
(0), 8 data bits (LSB first), a programmable 9th data bit, and a stop bit (1). On Transmit,
the 9th data bit (TB8 in SCON) can be assigned the value of 0 or 1. Or, for example, the
parity bit (P, in the PSW) could be moved into TB8. On receive, the 9th data bit goes into
RB8 in Special Function Register SCON, while the stop bit is ignored. The baud rate is pro-
grammable to either 1/32 or 1/64 of the clock input sio_clk_i.
Mode 3:
11 bits are transmitted (through sio_txd_o) or received (through sio_rxd_i): a start bit
(0), 8 data bits (LSB first), a programmable 9th data bit, and a stop bit (1). In fact, Mode 3
is the same as Mode 2 in all respects except baud rate. The baud rate in Mode 3 is de-
rived from the overflow rate of timer 1.
In all four modes, transmission is initiated by any instruction that uses SBUF as a destination register.
Reception is initiated in Mode 0 by the condition RI = 0 and REN = 1. Reception is initiated in the other
modes by the incoming start bit if REN = 1.
5.3.4.2.
Baud Rates
The baud rate in mode 0 has a fixed relation to the clock input sio_clk_i:
Mode 0 Baud Rate
=
sio_clk_i
f
The baud rate in Mode 2 depends on the value of bit SMOD in special function register PCON. If
SMOD = 0 (which is the value on reset), the baud rate is 1/64 of the frequency on clock input
sio_clk_i. If SMOD = 1, the baud rate is 1/32 of the frequency at sio_clk_i.
Mode 2 Baud Rate
=
sio_clk_i
64
2
f
SMOD
×
The baud rates in Modes 1 and 3 are determined by the Timer 1 overflow rate.
5.3.4.3.
Using Timer 1 to Generate Baud Rates
When Timer 1 is used as the baud rate generator, the baud rates in Modes 1 and 3 are determined by
the Timer 1 overflow rate and the value of SMOD as follows:
Mode 1, 3 Baud Rate
=
)
1
(
32
2
rate
overflow
Timer
SMOD
×
The Timer 1 interrupt should be disabled in this application. The Timer itself can be configured for
either “timer” or “counter” operation, and in any of its 3 running modes. In the most typical applications,
it is configured for “timer” operation, in the auto-reload mode (high nibble of TMOD = 0010B). In that
case the baud rate is given by the formula:
Mode 1, 3 Baud Rate
=
()1
256
32
2
_
_
01
TH
f
i
clk
t
SMOD
−
×
One can achieve very low baud rates with Timer 1 by leaving the Timer 1 interrupt enabled, and con-
figuring the Timer to run as a 16-bit timer (high nibble of TMOD = 0001B), and using the Timer 1 inter-
rupt to do a 16-bit software reload. [Table 7] lists various commonly used baud rates and how they can
be obtained from Timer 1.