New to RPi. I plan on building a lighting setup consisting of ~ 64 Panels, which I want to control via the RPi. Is there a way to do that with the limited amount of pins the RPi supplies?
New to RPi. I plan on building a lighting setup consisting of ~ 64 Panels, which I want to control via the RPi. Is there a way to do that with the limited amount of pins the RPi supplies?
As I mentioned, by multiplexing you could fit it into 16 outputs, much like a seven segment display is driven.
As you suggest, I'll leave value judgements to the implementer.
Peter, we're talking about something like this http://www.adafruit.com/products/887 yes ?
There are various different versions of these as seen under 'Know Your LED Strips' here http://learn.adafruit.com/digital-led-strip some of which have individually addressable LEDs which would mean you could daisy chain them all and control everything with just a couple of pins.
As Derek suggests there are also various multi-channel PWM controllers like the TLC5947 24 channel device that could help, many of which will considerably reduce both pin count and complexity since you can tell the controller what you want and it'll take care of the hard stuff for you.
How you proceed maybe depends on whether you have your lighting strips already, or not. Either way there are lots of choices, for how to proceed.
Derek Campbell wrote:
If you don't need maximum output, you could consider multiplexing them, but I think Selsinork's suggestion will give you the maximum flexibility with respect to adding brightness control later.
Those expanders are pretty low cost and four will cover your needs.
The concern would be that doing software PWM with them becomes limited by SPI clock speed, so perhaps a purpose designed multi channel PWM controller would be a better starting point.
You're still right that more information is needed to help Peter get the best out of what he's trying to do 
selsinork wrote:
The concern would be that doing software PWM with them becomes limited by SPI clock speed, so perhaps a purpose designed multi channel PWM controller would be a better starting point.
Yes, definitely something to think about. SPI can be driven at 16MHz and even beyond with some care. A 100Hz rate would keep the PWM pulses invisible to the human eye, so I think there's a comfortable margin there to allow a usable brightness range.
I think I2C might be a better bet than SPI, given the need to connect 4 devices. That has a typical 100KHz bus speed which might be a bit closer to being limiting, though still useable I think.
Derek Campbell wrote:
Yes, definitely something to think about. SPI can be driven at 16MHz and even beyond with some care.
Assuming still talking about those MCP23S17's they have a max SPI rate of 10Mhz according to the datasheet, the BCM2835 arm peripherals data sheet suggests a theoretical 125MHz max for SPI but then goes on to say that's not actually possible, but without giving enough info to tell what is.
I think I2C might be a better bet than SPI, given the need to connect 4 devices. That has a typical 100KHz bus speed which might be a bit closer to being limiting, though still useable I think.
MCP23017 can do 1.7MHz i2c, Pi can do 400KHz.
The need to connect 4 of those to SPI shouldn't be a problem, you can configure 3 bits of addressing for each chip allowing 8 on a single spi chip select, they are quire nice that way 
Anyway, I think we've come to the same conclusion - it's certainly very possible to do it. Exactly how is up to Peter, but help is available here if he needs/wants it !
Just a short follow-up question. How do I control those chips (using code) then?
Here is a link that looks useful for I2C.
Thank you! Do you know where I can find a diagramm of how to hook up multiple MCP23017 chips up to one pie?
http://en.wikipedia.org/wiki/I²C#Design
Google is your friend ;-)
Thanks! Do I need those pullup resistors or does the RPi have internal ones?