Author Topic: Lots of serial links to a micro  (Read 3511 times)

0 Members and 1 Guest are viewing this topic.

Offline huslageTopic starter

  • Newbie
  • Posts: 1
Lots of serial links to a micro
« on: April 04, 2014, 02:01:22 pm »
I'm building an art project that modulates audio onto LED pendants which are received by headsets as people walk underneath them. We are currently planning a maximum of 512 individual LED pendants.

I am considering using an AVR on the pendants to do the PWM modulation. This will have some sort of SPI flash storage to store the audio files. The requirements are that we can remotely upload audio files via a computer attached to this beast. There is currently no requirement that the audio playback be coordinated in any way...they simply play in a loop.

I can't, for the life of me, think of an easy way to connect all of these together such that we can send data to them remotely. I considered using Ethernet, but that makes things really expensive. RS485 seems a bit of a pain.

What ideas are out there for connecting a large number of independent microcontrollers together like this?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Lots of serial links to a micro
« Reply #1 on: April 04, 2014, 02:21:32 pm »
Quote
I can't, for the life of me, think of an easy way to connect all of these together such that we can send data to them remotely. I considered using Ethernet, but that makes things really expensive. RS485 seems a bit of a pain.

Rather than trying to implement something that you have no clue about - and end up frustrating yourself, I would try to figure out what you do know and implement something based on that. That way, you will always make progress and when your knowledge / skills are sufficiently advanced, you can come back to your original, more complex goal.

Having said that, I would wire them up via RS485 / CAN: it is simple and sufficiently resistant to interference. I would also implement a protocol whereby the nodes known which message is intended for them. So each message would contain a header / identifier for the node it is intended for, a body, and a checksum.
================================
https://dannyelectronics.wordpress.com/
 

Offline dfmischler

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: us
Re: Lots of serial links to a micro
« Reply #2 on: April 04, 2014, 02:42:32 pm »
I agree that it would be hard to beat RS485 for cost, but keep in mind the addressability limits (32 nodes per segment, unless you use repeaters).  What is your total throughput requirement (i.e. how long can it take to update all 512 nodes)?  What level of reliability is required (e.g. do you need to prevent the loss of one "segment" of an audio sequence going to a particular node)?  Do the nodes need to be able to keep playing the old audio tracks while they are being updated?

Ethernet will probably cost more for hardware, but you might also need a lot more software (e.g. ARP, IP, TCP) unless you plan to develop your own LAN protocol.

Wifi would be great, but will probably cost even more for hardware and have even more software requirements than ethernet.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Lots of serial links to a micro
« Reply #3 on: April 04, 2014, 02:49:43 pm »
Wireless may be a good option if we are not talking about too long of a distance. those 2.4G receivers are quite cheap and you don't have wiring to worry about.

It is slower, however.
================================
https://dannyelectronics.wordpress.com/
 

Offline DenzilPenberthy

  • Frequent Contributor
  • **
  • Posts: 423
  • Country: gb
Re: Lots of serial links to a micro
« Reply #4 on: April 04, 2014, 02:50:44 pm »
A project I did a while ago was a board with 8 analogue outputs which drive tiny tiny heaters. The current from each o/p is controlled by a PIC on the board and an 8 channel D-A converter. The whole thing is then controlled via RS232 from a PC. i.e. you tell it to turn on channel 4 with 5mA.

There was a lot of interest in expanding the number of channels massively so we used the second UART on the PIC to echo the commands back out again (and on to another identical board) but with 8 subtracted from the channel number (and ignore commands for an address greater than 8 ).

That means you can daisy chain the boards and the instructions get passed along the line.

 I don't know if this would be fast enough for your application but it was very easy to implement in both hard and software.
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: Lots of serial links to a micro
« Reply #5 on: April 04, 2014, 02:57:32 pm »
Watch a few of Mike's videos where he shows details of his light / artist installations. I remember one (or two?) where he also talked about the bus system and addressing he is using. Or maybe you can contract him to do the development :-)
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 3180
  • Country: gb
Re: Lots of serial links to a micro
« Reply #6 on: April 04, 2014, 02:57:37 pm »
How are you powering the pendants?
Are they battery powered or wired to a common PSU? If there is a common wired PSU connection you might be able to make up your own PLT protocol for sending data along the power line to each pendant.
 

Offline Len

  • Frequent Contributor
  • **
  • Posts: 552
  • Country: ca
Re: Lots of serial links to a micro
« Reply #7 on: April 04, 2014, 03:51:59 pm »
Watch a few of Mike's videos where he shows details of his light / artist installations. I remember one (or two?) where he also talked about the bus system and addressing he is using. Or maybe you can contract him to do the development :-)
FYI, since there's more than one Mike on the internet, B@W was referring to this Mike:
https://www.youtube.com/user/mikeselectricstuff
DIY Eurorack Synth: https://lenp.net/synth/
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2733
  • Country: us
Re: Lots of serial links to a micro
« Reply #8 on: April 04, 2014, 04:11:51 pm »
RS485 shouldn't be much of a pain, really, and will likely be the cheapest and easiest in terms of wiring and programming.  There are some wireless systems with mesh protocols that may be somewhat easier to program, but will definitely be more expensive.  The standard limit for the number of devices on an RS485 bus is 32 as dfmischler mentioned, but there are 1/4 and 1/8 unit load transceivers available that would allow you to put up to 128 or 256 devices on one bus.  The only tricky bit with programming for an RS485 interface is going to be avoiding collisions.  The easiest way to avoid this is to ensure your system only ever requires one device to transmit.  If you need two-way communication, you can use one pair of wires for master->slave communication and the other for slave->master communication, and as long as you have only one master device you just have to ensure that only one slave ever transmits at a time.

Since you mentioned AVRs, look into the multi-processor communication mode, which I believe is available on all the devices that have a hardware USART (possibly not on the ATTiny devices that have a USI).  It's a hardware mode that uses the first stop bit to indicate if a character contains an address or data and prevents data from appearing in the receive buffer until the device has been addressed.  It should substantially reduce the amount of data that each slave device has to process and simplify your firmware a bit.
 

Offline tonyarkles

  • Regular Contributor
  • *
  • Posts: 118
Re: Lots of serial links to a micro
« Reply #9 on: April 04, 2014, 04:13:32 pm »
DMX-512 http://en.wikipedia.org/wiki/DMX512 is an industry-standard way to do lighting control and it uses RS-485 under the hood. It also suffers from the 32 node limit, but handles it by separating it into separate "universes" of 32 nodes each.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf