I got it, I'm still not sure what difference it made between using the rs 485 and the rs 232 bus, but I fixed the RCSTA.2 error problem. Turns out reading the RCREG clears the frame error. So I put the routine that checks for the error after the routine that reads out the RCREG when a character is detected. That seems to make sense in my mind.
So this is how it tested out. I set the scan rate on my Modbus Master to 1mS. Obviously that is rediculous but I wanted to dump all I could at it. I sent a function 3 command from the Master to read 8 one word registers every 1ms. What I got was 1308 TX RX round trips in a minute with no errors on the master or the slave. That comes out to roughly 46mS per TX RX round trip which I thought was pretty good since every byte sent and received takes about 1mS. There was 31 bytes in every TX RX round trip, so theres about 30mS. Then there is a 4mS wait for end of frame delay. That puts me up to 34mS, so it looks like I am waisting 12mS a second which I would like to get down but I am not to worried about at this time.
I am going to keep posting problems with this project on this post, and eventually I will post the final modbus code on here.
Thank You
Shawn
Bookmarks