Chapter 6 Serial Communications. Objectives Introduce the RS232 standard and position it within the crowded field of serial communications standards. Configure the 8051 serial port. Read and write to the serial port. Introduce software and hardware handshaking. 6.1 Introduction.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Introduce the RS232 standard and position it within the crowded field of serial communications standards.
Configure the 8051 serial port.
Read and write to the serial port.
Introduce software and hardware handshaking.
SCON (Serial Port Control)
RI (Receive Interrupt). SCON.0
TI (Transmit Interrupt). SCON.1
REN (UART Receive Enable). SCON.4
SM0 and SM1 (UART Operation Mode). SCON.6, SCON.7
SBUF (Serial Data Buffer)This is a one-byte buffer for both receive
IE (Interrupt Enable)
ES (Enable Serial). IE.4Set the bit to 1 to enable receive and
IP (Interrupt Priority)PS (Priority Serial). IP.4
Set the bit to 0 for a low priority
or 1 for a high priority.
UARTEN (UART Enable) XBR0.2 (Port I/O Crossbar Register 0,
SMOD (Serial Port Baud Rate Doubler Enable)
PCON (Power Control Register). PCON.7
Set the bit to 1 to double the baud rate defined
by serial port mode in SCON.
Mode Synch Baud Clock Data Bits Start/Stop Bits
1 Synch SYSCLK/12 8 None
2 Asynch T1 or T2 Overflow 8 1 Start / 1 Stop
3 Asynch SYSCLK/32,SYSCLK/64 9 1 Start / 1 Stop
4 Asynch T1 or T2 Overflow 9 1 Start / 1 Stop
The baud rate is a combination of factors:
RS232 DB9 pin D-SUB male connector