Hey,
I have been working on this too long and thought I had it working. The program below works fine when hooked up to rs 232 but when I hook it up to a rs 485 chip it does not work. It is not a hardware issue I know for a fact that the 485 hardware and hookup are wired properly. I am pretty sure I have a problem with a configuration or something in my program.
I am using a pic 18F4585 at 20 MHz. I am using hardware rx tx and I have a RTS line for the 485 chip. I know its not called rts on the 485 chip but anyway. My rts line is PORTC.4 and I have a led attached to it to see if it flashes every time a response is made. When I have the tx and rx of the pic tied to 232 chip and the computer everything works fine, the rts led flashes whenever the chip is making a response.
When I hook the tx and rx up to a 485 chip I get 1 response and 1 flash of the RTS LED and then its done. I had this problem before when I was using Portd.2 pin and thought that maybe it was interrupting off of the compatator and not exiting the interrupt routine. So I switched it to c.4 and it worked, then I lost my code and had to backtrack a little. Now I am stuck and frustrated I missing something simple and stupid but beating my head isn't helping anymore.
When using the rs232 on the computer I don't actually use any handshaking
Anyone want to take a look at my messy code and see what they think. Maybe it will pop right out to someone else.
Thanks
Shawn
Bookmarks