Having another nice Saturday. I've been trying to get the built-in AUSART circuit working. Had an odd bug with the RS232 level converter chip. The one I'm using is from Sipex ( courtesy of sparkfun.com ). The docs for all these converters want 4-5 0.1uF caps. When I hook up the caps on V- and V+, it was causing my pic to reset over and over. What I would see was something like:
( trying to send "Hello, world!" to PC ) HHHHHHHHHHHHHHHHHHHHHHHHHeHHHHHHellHHHHHello, world!HHHHHHHHHHHHH
I got this to work in a couple of ways. The first way was to disconnect the caps to V- and V+. I'm really not enough of an electrical engineer type to know if this is harmful. I decided to go Luddite. I found a great diagram of a fast RTL inverter on Free Circuit Diagrams. They work great. Sparkfun has some variations on this. They sell a serial cable with this kind of inverter built in. They add a couple of capacitors to ground, though. This setup produces voltages between 0 and ~5V. This is enough on my PC to trigger the rs232 correctly. It may not work on all PCs, though. I think the threshold is supposed to be between around +/- 3.8 V.
I can now send RS232 chars to my PC and output the same on the LCD. Now I need to create a buffer and receive chars, print to LCD, and confirm each line from a hex file. Not sure if I'll actually do an MD5 checksum calculation on each line or not. Need some way to check if I got what I should without sacrificing too much time. We'll see.
No comments:
Post a Comment