AVR tutorial 4


Using the AVR UART.

Last change : 13 November 2006 recompiled using WinAVR 20060412.
WinAVR 20060412 is introduced in tutorial # 1

updated 25 Nov 2005:
New, improved uart0001 and main components added.

Updated and re compiled using WinAVR 20040404 on 21 April 2005.

This project receives whatever character you send it on a RS232 serial link, and transmit the next character in the ASCII table.

Circuit diagram



Software.

The files included :
serial.gif : the above circuit diagram.
main.c : the main c application.
uart001.c : the uart routines.
uart001.h : the header file used by main.c for the function prototypes.
uart001.inc : a file used by main.c and uart001.c for constants and defines.
makefile : the file created by AVRMakeGen.

Download (18KB) the software and diagram in one Zip.

Serial setup.

9600 baud.
1 stop bit.
0 parity bits.
Full duplex

For a terminal application, use Hyper Terminal or the terminal application found here.


How to.

To build your project simply extract all the files to the same directory.
Next, using programmers note pad, open main.c.
Now click on tools and then on make all.

Note: The provided makefile is generated for a SP12 type programmer as shown in tutorial 2. If you are using a different programmer you'll have to edit the makefile.

Program the device, insert it into the circuit and plug the db9 into your PC's serial port.


Forward to tutorial 5

Home mail add