Having easy UART Functionality can be of great use in AVR Projects, even if they don’t need the UART fucntionality, the UART can be used as a great debugging tool (sending program status to the UART as a console). Peter Fleury has a AVR UART Library as well along with his AVR LCD Library which I explained here some time ago.
The Library handles all the UART related tasks and works on Interrupts so, it can receive data coming in even when the AVR is not explicitly polling the UART Lines. I had made this serial-test project so that I have a working UART snippet for use whenever I need. I have tried to clean up the uart-test file which is provided along with the library and made the IF condition a little more compact.
I am attaching all the project files with this post so you may easily download them and use.
Software Used:
- AVR Studio with WINAVR (AVR GCC)
- Proteus for Simulation
- AVR UART Library from Peter Fleury (http://www.jump.to/fleury)