English
Language : 

W79E225A_08 Datasheet, PDF (144/203 Pages) Winbond – 8-bit Microcontroller
Preliminary W79E225A/226A/227A Data Sheet
Fosc
1/12 1/4
Write to
SBUF
TX START
Internal
Data Bus
TX SHIFT
Transmit Shift Register
PARIN
LOAD SOUT
CLOCK
RXD
P3.0 Alternate
Output Function
SM2 0
1
TX CLOCK
TI
Serial Interrupt
RI
REN
RXD
P3.0 Alternate
Input Function
RX CLOCK
RI
SHIFT CLOCK
TX START
LOAD SBUF
RX SHIFT
Serial Controllor
CLOCK
PAROUT
SIN
TXD
P3.1 Alternate
Output Function
Read SBUF
SBUF
Internal
Data Bus
Receive Shift Register
Figure 16-1 Serial Port Mode 0
The serial port receives data when REN is 1 and RI is zero. The shift clock (TxD) is activated, and the
serial port latches data on the rising edge of the shift clock. The external device should, therefore,
present data on the falling edge of the shift clock. This process continues until all eight bits have been
received. The RI flag is set in C1 following the last rising edge of the shift clock, which stops reception
until RI is cleared by the software.
16.2 Mode 1
In Mode 1, full-duplex asynchronous communication is used. Frames consist of ten bits transmitted on
TXD and received on RXD. The ten bits consist of a start bit (0), eight data bits (LSB first), and a stop
bit (1). When receiving, the stop bit goes into RB8 in SCON. The baud rate in this mode is 1/16 or 1/32
of the Timer 1 overflow, and since Timer 1 can be set to a wide range of values, a wide variation of
baud rates is possible.
Transmission begins with a write to SBUF but is synchronized with the divide-by-16 counter, not the
write to SBUF. The start bit is put on TxD at C1 following the first roll-over of the divide-by-16 counter,
and the next bit is placed at C1 following the next rollover. After all eight bits are transmitted, the stop
bit is transmitted. The TI flag is set in the next C1 state, or the tenth rollover of the divide-by-16
counter after the write to SBUF.
Reception is enabled when REN is high, and the serial port starts receiving data when it detects a
falling edge on RxD. The falling-edge detector monitors the RxD line at 16 times the selected baud
rate. When a falling edge is detected, the divide-by-16 counter is reset to align the bit boundaries with
the rollovers of the counter. The 16 states of the counter divide the bit time into 16 slices. Bit detection
is done on a best-of-three basis using samples at the 8th, 9th and 10th counter states. If the first bit
after the falling edge is not 0, the start bit is invalid, reception is aborted immediately, and the serial
port resumes looking for a falling edge on RxD. If a valid start bit is detected, the rest of the bits are
shifted into SBUF. After shifting in eight data bits, the stop bit is received. Then, if;
1. RI is 0, and
2. SM2 is 0 or the received stop bit is 1,
- 144 -
Publication Release Date: April 15, 2008
Revision A4.0