View previous topic :: View next topic |
Author |
Message |
ElectricalNoob
Joined: 17 May 2007 Posts: 15
|
RS232 Question - 1 Master, 1 PDA and 6 Slaves |
Posted: Mon Jun 11, 2007 2:28 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Mon Jun 11, 2007 2:47 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
ElectricalNoob
Joined: 17 May 2007 Posts: 15
|
RS232 Question - 1 Master, 1 PDA and 6 Slaves |
Posted: Wed Jun 13, 2007 1:22 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Wed Jun 13, 2007 3:28 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
Re: RS232 Question - 1 Master, 1 PDA and 6 Slaves |
Posted: Wed Jun 13, 2007 8:18 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
ElectricalNoob
Joined: 17 May 2007 Posts: 15
|
|
Posted: Thu Jun 14, 2007 7:37 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Thu Jun 14, 2007 7:26 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
|