Figure 79, wr – Rainbow Electronics AT89C5132 User Manual
Page 109
109
AT8xC5132
4173A–8051–08/02
Figure 79. Transmission Waveforms (Mode 0)
Reception (Mode 0)
To start a reception in mode 0, write to SCON register clearing SM0, SM1 and RI Bits
and setting the REN bit.
As shown in Figure 80, Clock is pulsed and the LSB (D0) is sampled on the RXD pin.
The D0 bit is then shifted into the shift register. After eight sampling, the MSB (D7) is
shifted into the shift register, and hardware asserts RI bit to indicate a completed recep-
tion. Software can then read the received byte from SBUF register.
Figure 80. Reception Waveforms (Mode 0)
Baud Rate Selection (Mode 0)
In mode 0, the baud rate can be either fixed or variable.
As shown in Figure 81, the selection is done using M0SRC bit in BDRCON register.
Figure 82 gives the baud rate calculation formulas for each baud rate source.
Figure 81. Baud Rate Source Selection (mode 0)
Figure 82. Baud Rate Formulas (Mode 0)
Write to SBUF
TXD
RXD
TI
D0
D1
D2
D3
D4
D5
D6
D7
Write to SCON
TXD
RXD
RI
D0
D1
D2
D3
D4
D5
D6
D7
Set REN, Clear RI
0
1
M0SRC
BDRCON.0
PER
CLOCK
÷
6
To
IBRG
CLOCK
Serial Port
Baud_Rate =
6
(1-SPD)
⋅
32
⋅
(256 -BRL)
2
SMOD1
⋅
F
PER
BRL = 256
-
6
(1-SPD)
⋅
32
⋅
Baud_Rate
2
SMOD1
⋅
F
PER
a. Fixed Formula
b. Variable Formula
Baud_Rate
=
6
F
PER