View previous topic :: View next topic |
Author |
Message |
PatM
Joined: 25 Oct 2004 Posts: 104
|
Posted: Sat Feb 16, 2008 3:07 pm Post subject: multi-drop networking protocol? |
|
|
I want to start playing with networked chips (RS-485 most likely) and while the hardware part is simple I'm having a hard time figuring out (or finding) a protocol to use.
For the most part this would be a master to many slaves network (easy enough) but I was thinking it would be good to have the network auto-configure when another slave is added. The obvious way would be to have a newly added slave send out a "I'm here" message so the master can add it to its routines. Of course, the immediate thought that came to mind is managing the bus. What another unit starts talking at the same time and the packets collide? Perhaps theres a way to have the master detect and interrogate the new unit?
I know many people must have had to handle this kind of thing and found solutions and I'm wondering if any has a link to something along those lines? |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
|
Back to top |
|
|
PatM
Joined: 25 Oct 2004 Posts: 104
|
Posted: Sun Feb 17, 2008 4:48 pm Post subject: |
|
|
Yeah, I've done similar between a master and slave. What I'm looking for is something that deals with auto-configuration.
The easy way is to assign addresses on each board (physical or software) then tell the master to talk to the new unit. I'm thinking more along the lines of putting an un-addressed unit into a network, have it annouce its presense, then have the master assign the address. If a unit is removed, the master should notice and stop trying to talk to it.
Sounds easy but without something like an attention line (pull low to tell everyone not to talk because you're doing so) you could just inject bytes into another unit's message and screw up both of them. |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Mon Feb 18, 2008 10:01 am Post subject: Sweep |
|
|
Perhaps you can do a sweep every n minutes initiated by the Master.
Have fun
Ben Zijlstra |
|
Back to top |
|
|
PatM
Joined: 25 Oct 2004 Posts: 104
|
Posted: Mon Feb 18, 2008 12:49 pm Post subject: |
|
|
I was thinking that very thing
Since this is RS-485 about the most units you could possibly have would be 128 (all 1/4 UL chips). In this particular application I can't see having more than 6 but it'd be nice to have a generic protocol.
I could broadcast a "Anyone new?" packet once a minute (probably overkill but not onerous. On powerup (after power failure) the master could step through all possible addresses with a "Are you there?" packet (optinal setting on master for "highest address"?).
Hmm, have to do a lot of thinking about this. |
|
Back to top |
|
|
|