|Home > AVR Microcontroller Projects > Serial Interface for an AVR|
This document describes how to add an serial interface to an AVR.
Most of the AVR devices have a serial port, often called UART or USART. But for interfacing with RS-232 devices, such as the COM port of a PC, a converter is necessary which converts the CMOS/TTL signals of the AVR to RS-232 compatible signals.
|1||+5V R232 Transceiver||maxim integrated
MAX232A or MAX3232CPE
|5||Ceramic Capacitor||100nF||only old MAX232 need 1uF Tantalum Capacitors|
|1||Modem Serial cable (straight through) with DB9 Connectors||any|
This circuit shows a simple RS-232 to TTL interface level converter, which consists of two MOSFET transistors and two resistors. The only drawback is that this only generates 0V instead negative Voltage for RS232C logic '1'. Most modern PC accept this level, even if it is not RS232C standard. The advantage of using MOSFET transistors instead bipolar ones, is that no current limiting resistor and clamping diode for negative voltage is needed to drive the gate. The optional resistor R3 improves ESD protection and prevents a floating input when the DB9 connector is not connected to a PC:
My UART library the AVR-GCC provides an easy interface to the UART.
© Copyright 2002 Peter Fleury http://tinyurl.com/peterfleury