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 CCS Technical Support

RS232 Question - 1 Master, 1 PDA and 6 Slaves

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



Joined: 17 May 2007
Posts: 15

View user's profile Send private message

RS232 Question - 1 Master, 1 PDA and 6 Slaves
PostPosted: Mon Jun 11, 2007 2:28 pm     Reply with quote

I am planning on connecting one Master PIC to 6 slave pic's and a palm. I was looking for advice on what sort of communication should I use. Should I use rs232 or I2C? I need the Master PIC to receive commands from the PDA and to relay those commands to each of the slave PIC's individually. Currently I feel comfortable with rs232, but not exactly sure how I could connect them all on the same bus. But from what I've understood so far, it seems I2C is better suited for this sort of communication. Any advice would be appreciated. Thank you.

Simeon


Last edited by ElectricalNoob on Wed Jun 13, 2007 1:23 pm; edited 1 time in total
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Mon Jun 11, 2007 2:47 pm     Reply with quote

Simeon,

If your setup will be operating in the field, I would recommend RS485 or CAN.
If your setup is mechanically small (say, 3m or less), I would recommend I2C. There are ways to make a rugged (from the EMI standpoint) I2C bus, but it's better to pick a right bus for field applications from the very beginning.

Nick
_________________
Read the label, before opening a can of worms.
ElectricalNoob



Joined: 17 May 2007
Posts: 15

View user's profile Send private message

RS232 Question - 1 Master, 1 PDA and 6 Slaves
PostPosted: Wed Jun 13, 2007 1:22 pm     Reply with quote

I'm trying to interconnect a master, six slaves and a PDA using the rs232 communication line. I've heard that this is possible with the proper protocol. However I noticed that when I connect a pic with the PDA, I have to crossover the transmit and receive pins. This works fine when there are two objects trying to communicate. However when you have more than 2, you can't crossover the receive and transmit pins for all.

My question is this:

How would I be able to setup the connection such that I have a PDA which communicates by rs232 with a master. Then on the same connection I would have a 6 slaves that communicate with the master, but the slaves do not communicate with each other or with the PDA.

My thought was to keep the same connection with all the slaves and the PDA. Then I would crossover the receive and transmit wires that are connected to the master. I would probably need some protocol to avoid collisions. But I was not sure if this would even work. Would each slave be able to report back to the Master, or will they only be able to listen?

Would this work for the communication I am trying to do? Or do I need to use something else like I2C.



Simeon
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

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

RE:
PostPosted: Wed Jun 13, 2007 3:28 pm     Reply with quote

Since you are using RS 232, you might consider using RS 485 as both protocols are some what similar (software wise only), but to implement RS 485 standard you need to modify the hardware. You need to use a RS 485 to ttl converter like 75LBC184. There are other types available, check it out in google.

You can also get the hardware easily from the net.

Also for the PDA you need a RS 232 to RS 485 converter, this is easily made using a MAX 232 and the 75LBC184 IC.

thanks
arunb
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

Re: RS232 Question - 1 Master, 1 PDA and 6 Slaves
PostPosted: Wed Jun 13, 2007 8:18 pm     Reply with quote

ElectricalNoob wrote:
...Or do I need to use something else like I2C.

I've never seen I2C adaptors for PDAs. That speaks against I2C.
Unlike I2C spec, the RS-232 and RS-485 specs themselves don't say that the system is or is not master-slave.
Knowing what I know about your application, RS-485 (probably with MODBUS protocol) would be the most natural choice.
_________________
Read the label, before opening a can of worms.
ElectricalNoob



Joined: 17 May 2007
Posts: 15

View user's profile Send private message

PostPosted: Thu Jun 14, 2007 7:37 am     Reply with quote

Thanks for your help guys. I'm thinking that if I could get the master pick using its i2c line to communicate with the six slaves. Then the master could also communicate with the PDA using rs232 communication. This should be able to do the trick.

Simeon
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Thu Jun 14, 2007 7:26 pm     Reply with quote

ElectricalNoob wrote:
...using its i2c line to communicate with the six slaves. Then the master could also communicate with the PDA using rs232 communication. This should be able to do the trick.

Yes, it should, if the distances are small and EMI is not too harsh.
_________________
Read the label, before opening a can of worms.
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