Jump to content
Sign in to follow this  
MoonWa

RS485 serial comms

Recommended Posts

I'm using the pic the send/receive serial data via twisted pair RS485 @ 115k.  I sometimes receive frame errors while communicating with another computer.  We are using odd parity, so I must enable the 9th bit.  Do I need a delay before reading the data byte after receiving an indication of an icomming byte?

 

Jon

Share this post


Link to post
Share on other sites

While I've never seen your specific problem, you shouldn't need any delay.  As long as you're in 9-bit mode, RCIF shouldn't get triggered until the stop bit is received.  Of course, if you're getting framing errors, the stop bit isn't there when it expects it.

 

I'd suspect a couple of things:

 

- Is the transmitter's clock out of tolerance (on the slow side), such that it's a borderline case whether it samples in a possibly low bit 0 rather than in the stop bit?

 

- Is some other node transmitting before it's presumably supposed to?  I don't know anything about your specifics, but I've had several instances where firmware problems were causing spurious transmissions that would cause at the least corrupt data and at the worst framing errors.

 

- Rather unlikely, but do you have some sort of termination issue with the network, causing a reflection that's occasionally being picked up as a low bit?  Your baud rate is definitely high enough that this could be an issue if the right combination of things came together against you.

 

Just some thoughts, but I've never had such problems with a 9-bit network.

 

Nathan

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...