You Are Here: Home » AVR ATmega Projects » Interfacing(USB - RS232 - I2c -ISP) Projects » How to interface AVR microcontroller with PC using USART (RS232 protocol)

How to interface AVR microcontroller with PC using USART (RS232 protocol)




This article covers data transmission using 8 bit USART. The readers should have a basic understanding of serial communication and how to receive the serial data output. More  details on these topics  are available on Serial communication using AVR Microcontroller USART.

How to interface AVR microcontroller with PC using USART (RS232 protocol)

The registers of USART system are already explained in previous article. Before transmitting the data, it must be stored in UDR register. The HyperTerminal software is used to show received data. The following steps can be followed to transmit the data to COM port of computer.
        i.            Monitor the status of UDRE (USART Data register Empty) flag.
       ii.            A high on the UDRE indicates that the UDR register is empty and ready to accept new data to be sent.
 How to interface AVR microcontroller with PC using USART (RS232 protocol) schematic
void usart_putch(unsigned char send)
{
while ((UCSRA & (1 << UDRE)) == 0); // Do nothing until UDR is ready..
// for more data to be written to it
UDR = send; // Send the byte
}

Leave a Comment

You must be logged in to post a comment.

Scroll to top