UART interfacing with PIC microcontroller

One of the most commonly used and easy to use the protocol in serial communication is USART. It is the abbreviation for Universal Synchronous Asynchronous Receiver Transmitter. It is the commonly used asynchronous communication protocol and available in a vast variety of devices. For example, GSM modems, GPS modems, sensors etc. The advantage of asynchronous communication is it doesn’t need a clock for syncing data between two devices.

RS-232

The computer has a serial port which uses RS-232 interface standard and it is one of most reliable communication standard using UART protocol. RS-232 voltage levels are different from TTL levels and a voltage level converter is a need when interfacing with PIC Microcontroller board.

Interfacing

PIC Microcontroller has inbuilt UART module which is very easy to interface. There are two pins for UART module, TX, transmitter and RX, receiver. When interfacing to other devices, Tx will be connected to Rx of the other device and Rx will connect to Tx. Both devices should share a common ground, otherwise, they will misbehave.

This is the firmware guide of PIC Microcontroller: UART Interfacing with PIC Microcontroller

Baud rate

Baud rate is the number of bits transmitting or receiving be second, commonly denoted in bps (bits/sec). It determines the speed of the transmission.

Software Tools

The best tool for checking communication with PC is RealTerm , we have written a guide on how to use RealTerm for your firmware development. Or you can use the HyperTerminal tool from Windows (old versions only).

Examples

We have some example firmware of UART interfacing in our code library section. Download sample codes from our Code library.