CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

RS-485...Sometimes commands not getting through

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jseidmann



Joined: 04 Nov 2004
Posts: 67

View user's profile Send private message Send e-mail

RS-485...Sometimes commands not getting through
PostPosted: Mon Jul 11, 2005 1:03 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 11, 2005 2:15 pm     Reply with quote

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







PostPosted: Mon Jul 11, 2005 3:08 pm     Reply with quote

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?.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group