Challenge #1
Take SPI addressable RGB LEDs like those in the video below and update a wall comprised of 2500 of the little sods quickly enough that it looks okay. The design goal I've set is to get to 25 frames per second, much like TV. This is not such a big deal for Tetris, but for other animations a fast frame rate such as this is important.
2500 x 125 / 1000 = 312.5 metres of daisy chained lights. Two obvious problems surface with this.
- SPI in this application is good to 2Mhz
- There is voltage drop over 300 metres and 5v (easily fixable)
- Besides 2Mhz being the ceiling of device, the WS2801 spec has this to say on long runs...
The Connection and Driving of Cascading Operation The transmit of data over long distance by cascading, the WS2801 integrates push-pull output stage with strong driving capability. This enables the data and clock to be transmitted up to 6 meters at 2MHz clock frequency. To prevent the reflection, it is necessary to connect a 50Ω resistor at the data input or output port for impedance match. So 6 metres is it, regardless of how many LEDs... I think the phrase rhymes with 'clucking bell'.So I'm planning 32 SPI buses to keep close to or under that 6 meter ceiling.
There are a few options to achieve this:
- Use the Arduino's stack of digital IO pins and some serious bit banginging to emulate in software lots of SPI buses across those pins.
The chip in the Arduino is not quick enough to do this well.
Or - Ask good old Sean to come up with a much better plan. By using the fast hardware SPI port on the chip (an Atmega 2560) to run at 2Mhz and multiplex that signal with a CPLD.
The dev board has been ordered, the VDHL has been written and over a couple beers explained to me slowly. No emulation and bit twiddling required. Ace
Assuming option two works, how many pixels can we push through SPI at 2Mhz?
- Each pixel drinks 24 bits, 8 each for Red, Green and Blue.
- 2 Mhz is 2 million cycles per second. (2,000,000 / 24 bits) / 25 frames = 3333 pixels!
- A nice margin over 2500 right? In fact 1.5 Mhz will probably do us just fine.
Whatho,
Mackintosh