UART
UART is the abbreviation of Universal Asynchronous Receiver/Transmitter.In a simple sense, it is an integrated circuit for serial transmission based on communication protocols such as RS-232.
Serial communication can be either in synchronous mode or in asynchronous mode. UART carries out asynchronous communication and the communication is carried out through two lines, a transmission line(Tx) and a reception line(Rx). The receiver and transmitter are separately clocked. That means a clock signal found in the synchronous mode of communication is absent in asynchronous communication in which 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
RS-232 is a serial communication protocol for the transmission of data between two devices.The protocol defines a logic 0 with voltage in the range+3V to +15V and a logic 1 with voltage in between -3V to -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.
Interfacing circuitry example for level shifting IC (MAX232) with PIC is shown in the above image. OpenLab has its hardware already connected to the controller with the MAX232. The user doesn’t need 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
In order to connect the microcontroller transmission & reception lines with the MAX232 circuit, two jumpers are provided in the OpenLab. Without these jumpers, the MAX232 circuit is in a disconnected state.
Connect jumpers J20 and J18 using jumper caps to interface TX and RX lines with PIC microcontroller.
Software/tools
Several free softwares are available for displaying and debugging the serial communication. One of the softwares widely used is RealTerm. Baud rate, 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. A RealTerm window is shown below.
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.