English
Language : 

C8051F02X Datasheet, PDF (207/272 Pages) Silicon Laboratories – 8K ISP FLASH MCU Family
C8051F020/1/2/3
20.1.2. Mode 1: 8-Bit UART, Variable Baud Rate
Mode 1 provides standard asynchronous, full duplex communication using a total of 10 bits per data byte: one start
bit, eight data bits (LSB first), and one stop bit. Data are transmitted from the TX0 pin and received at the RX0 pin.
On receive, the eight data bits are stored in SBUF0 and the stop bit goes into RB80 (SCON0.2).
Data transmission begins when an instruction writes a data byte to the SBUF0 register. The TI0 Transmit Interrupt
Flag (SCON0.1) is set at the end of the transmission (the beginning of the stop-bit time). Data reception can begin
any time after the REN0 Receive Enable bit (SCON0.4) is set to logic 1. After the stop bit is received, the data byte
will be loaded into the SBUF0 receive register if the following conditions are met: RI0 must be logic 0, and if SM20
is logic 1, the stop bit must be logic 1.
If these conditions are met, the eight bits of data are stored in SBUF0, the stop bit is stored in RB80 and the RI0 flag
is set. If these conditions are not met, SBUF0 and RB80 will not be loaded and the RI0 flag will not be set. An inter-
rupt will occur if enabled when either TI0 or RI0 is set.
Figure 20.4. UART0 Mode 1 Timing Diagram
MARK
SPACE
START
BIT
D0
D1
D2
D3
D4
D5
D6
D7
STOP
BIT
BIT TIMES
BIT SAMPLING
The baud rate generated in Mode 1 is a function of timer overflow, shown in Equation 20.1 and Equation 20.2.
UART0 can use Timer 1 operating in 8-Bit Auto-Reload Mode, or Timer 2 operating in Baud Rate Generator Mode to
generate the baud rate (note that the TX and RX clocks are selected separately). On each timer overflow event (a roll-
over from all ones - (0xFF for Timer 1, 0xFFFF for Timer 2) - to zero) a clock is sent to the baud rate logic.
Timer 2 is selected as TX and/or RX baud clock source by setting the TCLK0 (T2CON.4) and/or RCLK0 (T2CON.5)
bits, respectively (see Section “22. TIMERS” on page 225 for complete timer configuration details). When either
TCLK0 or RCLK0 is set to logic 1, Timer 2 is forced into Baud Rate Generator Mode, with SYSCLK / 2 as its clock
source. If TCLK0 and/or RCLK0 is logic 0, Timer 1 acts as the baud clock source for the TX and/or RX circuits,
respectively.
The Mode 1 baud rate equations are shown below, where T1M is the Timer 1 Clock Select bit (register CKCON),
TH1 is the 8-bit reload register for Timer 1, SMOD0 is the UART0 baud rate doubler (register PCON) and
[RCAP2H , RCAP2L] is the 16-bit reload register for Timer 2.
Equation 20.1. Mode 1 Baud Rate using Timer 1
BaudRate
=


-2---S--M-3---2O----D---0-
×


S----Y----S---C--(--L-2---5K---6--×--–---1--T-2--H--(-T--1-1--)-M----–----1---)-)
Equation 20.2. Mode 1 Baud Rate using Timer 2
BaudRate = 3----2----×-----(--6---5---5---3---6-----–----S[---RY----SC---C-A----L-P--K--2---H----,---R----C----A----P----2---L-----]--)
Rev. 1.4
207