0
\$\begingroup\$

I'm developing a highly customizeable lights system for emergency vehicles that consist on a series of devices, all of them in sync, with the posibility to program diferent sequences (of a moderate complexity) and with some type of plug n' play funcionality. So i need a way for syncing and configuring the individual patterns of the lights.

I was thinking in I2C, but i would have to implement some kind of dynamic adresses assignation. Also, i don't know how to sync a series of slave devices with out a master.

In summary, i need to keep all the devices in sync, but working with their own sequence and with the posibility to reprogram each device's pattern independenly using an external device connected temporaly.

So, any idea?

\$\endgroup\$
  • \$\begingroup\$ Use one extra pin in the cable arrangement to allow automatic configuration of one device as master. Are you going for a line, ring, or star topology? \$\endgroup\$ – Ben Voigt May 11 '17 at 4:04
  • \$\begingroup\$ It all depends on your requirements. There's dozens, if not hundreds of protocols out there, each with their own capabilities. Some might even work despite them being intended for other uses. JTAG might actually meet your needs. \$\endgroup\$ – Cort Ammon May 11 '17 at 4:04
  • \$\begingroup\$ I want to implement each node using an attiny85, so I need something simple. Less cables is better, just 2 for power and 2 or 3 for communication and sync. \$\endgroup\$ – Gaspar S. May 11 '17 at 4:25
1
\$\begingroup\$

How long is the cabling going to be? Is there only one central controller?

I would go for CAN, but if you prefer simpler MCUs then RS-485 is a reliable option (just two wires + ground) as long as you can have a single control panel (otherwise you will have to design a protocol that will avoid collisions from two masters).

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ But how can I use either of those protocols to dynamically assign an address to a new device?. Also I don't want to have a master connected all the time, only for configuration purposes. \$\endgroup\$ – Gaspar S. May 11 '17 at 13:19
  • \$\begingroup\$ CAN and RS-485 is not exactly a protocol, bus physical layer standard. You have to design your own protocol (though CAN is truly a "non-master" system - every device is equal). If you connect the master only for configuration, then how the lights are controlled later? Only by connecting power? \$\endgroup\$ – filo May 11 '17 at 13:33
  • \$\begingroup\$ The ligths would work independently, with their own configuration, but in sync with the others (not necessarily with the same blinking patterns) \$\endgroup\$ – Gaspar S. May 11 '17 at 14:04
  • \$\begingroup\$ If they don't communicate, just sync when powered on, then RS-485 is still a good option. Make a dip switch on each device "sync on". When you are programming the devices - turn that switch off and use any RS-485 protocol (eg. Modbus) to configure all your devices, then disconnect the programming adapter and turn the sync switch on (only one device) - only this one device will send, let's say, a single byte on the bus, other will listen and treat it as a sync signal. \$\endgroup\$ – filo May 12 '17 at 4:58
  • \$\begingroup\$ Thanks filo, that will work. But how can I assign addresses to the new devices?. \$\endgroup\$ – Gaspar S. May 12 '17 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.