Electronics > Beginners

Communication Protocol Needed

(1/3) > >>

Hi All,

I am hoping that someone can help with a problem i have with a project i am working on.

The devices i am designing are essentially fancy relay controllers, the devices can operate independently, however i also need the ability to connect up to 6 of the devices together (although it could be any number of devices connected between 2 and 6, possibly more if needed). They are based on the Atmega328 micro.

Each device needs to be connected over a distance of no more than say 10 meters and if at all possible the protocol should be resilient to interference as these devices will be used in a high RF environment (1-500Mhz). I don't need a huge amount of bandwidth between the devices so speed is not a massive issue.

I've been struggling to come up with something suitable so i'm hoping that some of the very knowledgeable people that hang around on these forum's can help.




--- Quote from: allanw on December 08, 2010, 03:03:57 pm ---RS-485?

--- End quote ---

Thanks, that looks like it should do the trick, i will look into it further.

RS-485 might be a suitable electrical interface, but he still needs a protocol.  ModBus RTU is common on rs-485 but probably far too complex if all you want to send is some relay open/close commands, maybe some status.  Since it appears like you don't have to worry about being compatible with other bus protocols in the wild, and if your needs are really quite simple, I'd suggest a simple time-division multiplexing (TDM) scheme on a multi-drop RS-485 bus. There is only 1 master, all communications are initiated by the master, and the slave only reads and writes data during it's time slot. The time slot is easy to calculate based on the slave ID, all slaves first listen for the master to send a sync/heartbeat/command packet, which starts the slaves timing for when then can transmit data. Each slave that has data to send will only send it during it's time window.  [ slaveID  x length of slot ]. Commands to the slaves are always sent at the start of a cycle, initiated by the master. after all the slaves have sent data and the time has elapsed for a complete cycle, it starts again.

This kind of protocol can be low overhead, fast cycle times at high bit rates, and easy to implement on small memory micros.

Wouldn't it even be simpler to do the 485 but use a polling protocol? Slaves only speak when spoken to.

Or you could consider DMX. Loads of existing hardware. http://en.wikipedia.org/wiki/DMX512


[0] Message Index

[#] Next page

There was an error while thanking
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod