mg82fel308 Megawin Technology, mg82fel308 Datasheet - Page 55

no-image

mg82fel308

Manufacturer Part Number
mg82fel308
Description
A Single-chip Microcontroller Based On A High Performance 1-t Architecture 80c51
Manufacturer
Megawin Technology
Datasheet
MG82FE(L)308/316
MEGAWIN
Preliminary, v 0.04
MAKE YOU WIN
13. Serial Port (UART)
The serial port of MG82FE(L)308/316 support full-duplex transmission, meaning it can transmit and receive
simultaneously. It is also receive-buffered, meaning it can commence reception of a second byte before a
previously received byte has been read from the register. However, if the first byte still hasn’t been read by the
time reception of the second byte is complete, one of the bytes will be lost. The serial port receive and transmit
registers are both accessed at special function register SBUF. Writing to SBUF loads the transmit register, and
reading from SBUF accesses a physically separate receive register.
The serial port can operate in 4 modes: Mode 0 provides synchronous communication while Modes 1, 2, and 3
provide asynchronous communication. The asynchronous communication operates as a full-duplex Universal
Asynchronous Receiver and Transmitter (UART), which can transmit and receive simultaneously and at different
baud rates.
Mode 0: 8 data bits (LSB first) are transmitted or received through RXD(P3.0). TXD(P3.1) always outputs the
shift clock. The baud rate can be selected to 1/12 or 1/2 the system clock frequency by URM0X6 setting in
AUXR2 register.
Mode 1: 10 bits are transmitted through TXD or received through RXD. The frame data includes a start bit (0), 8
data bits (LSB first), and a stop bit (1), as shown in Figure 13-1. On receive, the stop bit would be loaded into
RB8 in SCON register. The baud rate is variable.
Figure 13-1 Mode 1 Data Frame
Mode 1
8-bit data
Start
D0
D1
D2
D3
D4
D5
D6
D7
Stop
Mode 2: 11 bits are transmitted through TXD or received through RXD. The frame data includes a start bit (0), 8
data bits (LSB first), a programmable 9th data bit, and a stop bit (1), as shown in Figure 13-2. On Transmit, the
9th data bit comes from TB8 in SCON register can be assigned the value of 0 or 1. On receive, the 9th data bit
would be loaded into RB8 in SCON register, while the stop bit is ignored. The baud rate can be configured to 1/32
or 1/64 the system clock frequency.
Figure 13-2 Mode 2, 3 Data Frame
Mode 2, 3
9-bit data
Start
D0
D1
D2
D3
D4
D5
D6
D7
D8
Stop
Mode 3: Mode 3 is the same as Mode 2 except the baud rate is variable.
In all four modes, transmission is initiated by any instruction that uses SBUF as a destination register. In Mode 0,
reception is initiated by the condition RI=0 and REN=1. In the other modes, reception is initiated by the incoming
start bit with 1-to-0 transition if REN=1.
In addition to the standard operation, the UART can perform framing error detection by looking for missing stop
bits, and automatic address recognition.
This document information is the intellectual property of Megawin Technology.
© Megawin Technology Co., Ltd. 2009 All rights reserved.
QP-7300-03D
55/84

Related parts for mg82fel308