USART communication (Hardware)
Overview
This is a short program I wrote to test the USART communication of a project. It is written in MPLab’s C18 and customized for a PIC18F1220. The program has two modes, it starts by writing every char between 0 and 255 out on the screen as fast as it can. When the user presses the escape key it pauses, until the key is pressed again.

An example output of the Hyper terminal screen
Connection Specifications
The PIC18F1220 has a 8MHz on board clock activated in this code and this directly affects the connection speed (bits per second) setting. The settings on your connection program should be as follows for this code to work:
- Bits Per Second: 19200
- Data Bits: 8
- Parity: None
- Stop bits: 1
- Flow Control: None
C Code
Here is the link to the code: usart_test.c
Further reading
For a nice tutorial on connecting your micro controller with USART using the max232 visit this link. If you are interesed in writing a program on the computer to connect to your device take a look at the ComPort Library for Delphi and C++.
Related:
0 Comments »
No comments yet.
RSS feed for comments on this post. TrackBack URI


