basics of 8051 UART module

Thread Starter

vead

Joined Nov 24, 2011
629
Hi
I was reading about Uart. Many micro-controllers have internal UART's, to communicate with external devices. 8051 have internal UART (universal asynchronous receiver/transmitter). It can both transmit and receive serial data at the same time on two different I/O pins. like we can receive or send data (number or characters to port of computers.. Generally receiver means a circuit that receive data and transmitter means a circuit that send data and register is device that store binary information. I know what is transmitter , receiver and register but when it come under 8051 uart module I am confused. I don't see use of transmitter and receiver. if we want to transmit or receive data. we only need to configure Uart registers

UART Registers

The below table shows the registers associated with 8051 UART.

Register Description

SCON Serial Control Register
TCON Timer Control Register for Baud Rate Generator
TMOD Timer Mode Control for Baud Rate Generator
SBUFF Serial Buffer holds the data to be transmitted and the data received

I don't understand how uart Registers related with transmitter and receiver circuit of microcontroller ?
 
Once the UART is setup, writing data into SBUF initiates a transmit. It is completed when TI interrupt flag is set.

In order to receive, you look for RI interrupt flag. Once it is active, reading the value in SBUF is the receive..
 
Top