I am looking to drive approx. 750 leds & monitor some buttons.
I was thinking the MCP23017 would do me right on an uno or mega. But If my Calculations are correct I can only drive 8 x 16 leds (128) per i2c channel. and the Arduino's only have One set of CLK/DAT pins.
I was told (or so I thought) I can run much more than that. Am I missing something or am I right in being limited to only 128 additional i/o pins?
What other options are out there besides charlieplexing?
Depending on the rating of the LEDs, a MAX7219 will drive 64 of them by multiplexing to an average current of 5 mA, requiring only one 10k resistor and two bypass capacitors per chip, which chips can be daisy- chained on three control lines (but may require some buffering).
If you can make do with an average current of 10 mA, you can use twice as many driver chips to drive 32 LEDs each.
Alternately, the Arduino has many sets of SDA and SCL pins - half as many as it has a total of functional digital (including most of the analog) pins.
Alternately, the Arduino has many sets of SDA and SCL pins - half as many as it has a total of functional digital (including most of the analog) pins.
That is a bit confusing for a beginner, it requires a software version of the I2C bus.
The best way to control that many LEDs is to use an LED strip of indupividually addressable LEDs. If it is just outputs you want then you can use shift registers to get your control. Alternatively put them in a matrix and multiplex them, that takes less pins.
RazorFly:
I am looking to drive approx. 750 leds & monitor some buttons.
SIngle color? How are they arranged? In a nice grid or just all over the place?
RazorFly:
I was thinking the MCP23017 would do me right on an uno or mega. But If my Calculations are correct I can only drive 8 x 16 leds (128) per i2c channel. and the Arduino's only have One set of CLK/DAT pins.
I2C can talk to many different devices on the same pair of wires. The fourth bullet-point of the MCP23017 datasheet says: "Three hardware address pins to allow up to eight devices on the bus". That means you can use 8 of them.
If you need more, I2C is easy to do in software on any pair of Arduino pins. Each pair of pins give you another eight.
RazorFly:
What other options are out there besides charlieplexing?
Charlieplexing isn't really an option for that many LEDs.
Ar-Ds (Arduinos) - thought i was being clever....apparently not...
just 1 (8x16) i2c (1 i2c channel is capable of 8x16 (128 pins))
an i2c w/ software? (someone earlier mentioned being able to run i2c on more than just pins 4&5 with "software", how is this possible?)
A single I2C bus can hold up to 128 devices or chips providing each chip has a different address. If the chips have all the same address or range of addresses you can use analogue multiplexers to switch the two signals of the bus to different chips or groups of chips. So in effect you can have an almost limitless number of chips addressed.
The MCP23017 can have 8 different addresses giving as you say 8 x 16 outputs or 128 LEDs, so for 770 outputs you will need six banks of chips. But just to light LEDs this is a bit of a waste. The control will only be on or off you would be better off with a chain of shift registers.
A better chip is the PCA9685 this has 12 bit PWM dimming, you get 16 channels in a chip and you can have 256 of them on a single I2C bus, you only need 49.
someone earlier mentioned being able to run i2c on more than just pins 4&5 with "software",
RazorFly:
Ar-Ds (Arduinos) - thought i was being clever....apparently not...
just 1 (8x16) i2c (1 i2c channel is capable of 8x16 (128 pins))
an i2c w/ software? (someone earlier mentioned being able to run i2c on more than just pins 4&5 with "software", how is this possible?)
I mentioned earlier that you can run 8 of those chips on each I2C bus. Two pins, eight chips.
A dozen MAX7219s, daisy chained, can control 768 LEDs.
The LEDs are wired up in groups of 8, just make a breakout area to wire the LEDs to.
For example, the digits here are driven by a MAX7219, each digit is wired up common cathode and wired to the breakout board in the middle of the box.
Each group of 8 LEDs is addressed by 1 register in the MAX7219, so an array of 96 would hold the status of all LEDs, your code would just to send the 96 bytes out whenever there was a change madee.