Categories: Hookup Guide-8051

UART Hookup Guide-AT89S8253

UART

UART which stands for universal asynchronous receiver/transmitter is an integrated circuit for serial transmission based on communication protocols such as RS-232.
There are two modes of serial communication. They are synchronous and asynchronous. UART is an asynchronous transmission protocol and is carried out through two lines-a transmission line(Tx) and a reception line(Rx). In the asynchronous transmission mode, receiver and transmitter are separately clocked. So, a clock signal present in synchronous transmission is absent in asynchronous communication. The speed of data transfer is managed with a separate module called baud rate generator. The data format and transmission speeds are configurable. UART can be considered as the microchip with programming that controls a computer’s interface to its attached serial devices.

RS-232 Level Converter

For transmission of data between two devices, RS-232 serial communication protocol is used. The protocol defines a logic 0 with voltage in the range between +3V and +15V and a logic 1 with voltage in between -3V and -15V. This voltage level is incompatible with a CMOS or TTL logic family devices since the voltage levels are 0V for a logic 0 and 5V for logic 1. This mismatch in the voltage levels demands the requirement of a voltage level shifter to convert RS-232 logic levels into TTL logic levels and vice versa. Most commonly used voltage level shifter IC for this purpose is MAX232.

MAX 232

The most commonly used level shifting IC is MAX232.

Image above shows the interfacing circuitry example for level shifting IC (MAX232). Since OpenLab has its hardware already connected to the controller with the MAX232, the user does not have to worry about it. The other end of the MAX232 will have a DB9 connector connected to it.
The DB9 connector is an analog 9 pin plug. The DB9 connector is used for serial communication allowing for the asynchronous transmission of data as provided in the RS-232 standards. The DB9 end of the interfacing circuit is connected to the serial port of the PC using a DB9 cable.
The user needs to program the device for transmission/reception or both for testing the UART communication for the desired baud rate.

Jumpers

Two jumpers are there on the OpenLab to connect the microcontroller transmission and reception lines with the MAX232 circuits and without these jumpers, the MAX232 circuit is in a disconnected state.

Connect jumpers J21 and J22 using jumper caps to interface TX and RX lines with AVR microcontroller.

Software/tools

There are several free softwares available for displaying and debugging the serial communication. One such software widely used is RealTerm. Baud rate, a port in which DB9 connected need to be set in the real term settings. This software can be used for visualization of the serially transmitted data. In the image below, a RealTerm window is given.

The baud rate generated in the code should be fixed in the settings of the software. The appropriate port through which PC is connected to the OpenLab via DB9 should be selected.

Share