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

2 PIC Communication Problem
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Sat Jan 25, 2020 7:46 am     Reply with quote

There is a generic issue, that doesn't apply at present, but needs to be thought
about. Problem is how are your 'slave' devices going to know which byte in
the data is the 'address'?. If your data may contain the values you use as
addresses, then things will go wrong.

Two solution suggestions:

1) Only send data as ASCII (so A to Z and numbers), and use the values
below 0x20 as the addresses.
2) Use 9bit serial, and set the 9th bit on the address.

The latter is a very simple and good way of doing this. Slaves simply
read values till they see one with bit 9 set, then test for the address.

RS485.c uses this approach.

Your #use rs232, is being overridden by the one internal to the rs485
driver. So the same port is being setup twice. Your setup doesn't have the
right stream name for the driver, so I've no idea how this will interfere....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
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