Hi everyone. I'm using the PIC18F452 and part of the task of the little micro is to process commands through RS-485. The thing works great for 99% of the commands it gets. The problem occurs on 1% of the commands which it does not understand (even though they are right). Essentially I have a VB program sending the same command over and over and over again and occasionally the VB program does not get something back even though it should. The micro is running at 19200 baud and the receive buffer size is 128! (transmit buffer is 64). Most of the commands sent from the VB program are about 6-8 characters in length (very short). I was wondering if any of you had anything I should look for. I use the #INT_RDA interrupt and then it puts what it got into the interrupt routine. Its the second highest priority interrupt, but the higher priority one doesnt do much (just sets some flags). Does anyone have some ideas on what I can do to troubleshoot this?
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
Posted: Mon Jul 11, 2005 2:15 pm
What your expecting is 100% good replies. This should be achievable for your specified use. The MODBUS routines I posted in the Code Library achieve this when the connection is good. It can actuall run on two serial ports at the same time sending and or recieving packets so interupt priority is probably not the problem. Maybe you have a process that disables interupts globaly and the PIC is not recieving the entire packet from the PC. For example writing to the EEPROM takes ~5mS and you could miss an entire packet while writing a single byte.
Ttelmah Guest
Posted: Mon Jul 11, 2005 3:08 pm
Other comments. Does the line ever 'idle' (ie., the lines are not driven at eaither end). If so, how are the lines biased?. Also how is your termination arranged?.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum