written 7.8 years ago by | • modified 6.1 years ago |
The 8051 contains UART – universal asynchronies receiver transmitter
• The serial port is full duplex
• It can transmit and receive simultaneously
• 2 port and 3 pins are used to provide the serial interface
P 3.0 is the receiver pin (RXD) P 3.1 is the transmitter pin (TXD)
Both synchronous and asynchronous transmission supported
A synchronous transmission sends a clock signal with the data adjustable baud rate and data frame size supported in asynchronous mode
Serial port mode:
Mode 0:
• Only synchronous mode
• Data transferred on RXD clock on TXD
• Clock is fixed at 1/12 of the oscillator frequency
Mode 1:
• Asynchronous mode
• 10 bit data frame (start bit, 8 data bit and stop bit)
• Variable baud rate
• Stop bit is placed in RB 8 bit of SCON register on reception of a frame
Mode 2:
• Asynchronous mode
• 11 bit data frame (start bit, 8 data bit, programmable 9 bit and stop bit)
• On transmission 9th bit is TB 8 bit of SCON
• On reception 9th bit is placed in RB 8 bit of SCON
• 9th bit may be used for data or as a parity bit
• Baud rate may be 1/32 or 1/64 of oscillator frequency
Mode 3:
• Same as module 2 but with programmable baud rate