I'm Back
Ok, I am making progress, maybe. I know what the problem is but I haven't narrowed down the cause yet. I broke up the receiver error routine into to parts to check RCSTA.1 and RCSTA.2 individually. If either one errors I turn on a corresponding LED. Now every time my ModBus Master sends a request I get an error on RCSTA.2. I get an error but my slave(pic) still sends out the proper message to the master. Now the goofy thing is, is that I do not have this problem when using rs232. Only have the problem using my 485 to 232 converter.
When using the rs232 chip I can have the cpu scan at 5ms with no errors. Using the 485 to 232 if I scan ever 5 senconds my message gets through but my pic still has RCSTA.2 errors. It errors every time.
At this point I am no longer sure if its a software problem or a hardware problem. I'm not real sure what a framing error is but I am going to investigate.
Heres my code if anyone would like to through in their 2 cents.
The readRegResponse: label is the subroutine where the RTS line is pulled and data sent out.
Thanks
Shawn
Bookmarks