cascading / powering 16 MAX7221s - need some help

Video: http://www.youtube.com/watch?v=u1wpTZNGz3M

Hardware:

Okay, so I have 1/2 of my device working with 8 cascaded MAX7221s running 512 leds. Amazingly, I am able to do this w/ only USB power by using a 47k ISET resistor on each MAX7221 circuit to reduce the brightness. (I think the low power consumption is also due to the way the MAX7221 uses PWM to strobe the leds.) I'm also providing 5V to 8 touchstrip/potentiometers. I'm not sure what will happen when I add 8 more MAX7221 circuits. The program in the video only lights a few leds of course but the test pattern lights the whole grid so I've been using that to sort of feel my way power-wise. I have 2 external power wall-wart options: 1) 5VDC 3.7A 2) 5VDC 2A. I'm thinking I should plug the supply right into the led driver board rather than through the Arduino (Wiring) board, right? I will also need to power the Arduino/Wiring board from the external supply since this is going to run standalone as well as thru the computer. Oh, and a MIDI port takes power, too, I suppose.

Before I upped the ISET resistors to 47k, (they were 10k), my test pattern would choke on the bottom few leds of the 8th column (did most of it). After I upped them it could light all the leds on the left side no problem. I'm not sure whether to add the additional MAX7221's to the right side of the board 1 by 1 and test each time, or if it is only once I actually light the leds that the power requirements kick in. The one I have in there now is defaulting to "all leds on" - probably because there is no data coming in. I guess I will just try adding chips and run the test pattern on the left side.

Firmware:

The firmware is a combination of the zambetti/ness cascaded MAX7219 Matrix.h example and the SimpleMessageSystem, and I have an OSC chunk I'm adding later.

The example code with the 8 cascaded 7219's works great for the left half but I'm wondering the best way to do the other side. I have it wired up right now so the DATA, LOAD, CLK pins of the right side are hooked to 3 additional pins. I saw on the 7221 datasheet that you can cascade 16, but I'm not sure whether to try to talk to them all from 3 pins or kind of double everything up and run them as 2 separate sides. I don't know if the existing libraries will handle 16 matrices, either.

Also, I saw in the Wayoda code that he did stuff slightly differently for the MAX7221 than for the 7219 - something about the startup state. But I don't have any problems with that even though for a while I was actually using a combination off 7219s and 7221s. Now I have a full complement of 16 7221s. And I see the MAX7221 supports something called SPI, but I don't quite understand how that's different than the 3-wire interface I have right now.

The MAX7221 only lights one LED at a time which is why it doesnt draw much current. That means 16 LEDs on at any one time with your setup. USB can handle that easily. :)

Also I think your supposed to go with a power pack 7V or higher. The onboard voltage regulator takes it down to 5v. I personally use a 9V 1A adaptor.

Hello phineus,

I'm thinking I should plug the supply right into the led driver board rather than through the Arduino (Wiring) board, right?

Yes.

Before I upped the ISET resistors to 47k, (they were 10k), my test pattern would choke on the bottom few leds of the 8th column (did most of it). After I upped them it could light all the leds on the left side no problem.

Be careful. If your ISET resistor is to low you might kill your MAX7221! Refer to the Table in the Datasheet for the correct value.

Also, I saw in the Wayoda code that he did stuff slightly differently for the MAX7221 than for the 7219 .... And I see the MAX7221 supports something called SPI, but I don't quite understand how that's different than the 3-wire interface I have right now.

The only difference is how the LOAD-Signal to the MAX72xx is handled. If your code is based on any one of the existing Arduino-libs there will be no problem.

Thanks for the help so far! I need to read that datasheet again anyways.

How should I address the additional 8 7221s? Same 3 wire interface, but (somehow) have the code address 16 matrices, or instead try to “double-up” the code to address 2 separate 8x7221 matrices?

I guess I will try the first approach using the existing code but with maxInUse set to 16 and go from there…

Hi

How should I address the additional 8 7221s? Same 3 wire interface, but (somehow) have the code address 16 matrices, or instead try to "double-up" the code to address 2 separate 8x7221 matrices?

In my LedControl-Library I have set an upper limit of 8 devices because I noticed a slight visual delay in the 7 segment displays. The delay is caused by the fact that 16 bytes of data have to be shifted into the cascaded matrix for each digit that changes its value. Say for instance your 4 digit 7-Seg Display is currently showing 0000. Now the next measurement will update it to 1234. 4 times 16 bytes have to be shifted into the cascaded MAX7221 to update all 4 digits. All the digits come up at the same time. But if you want to address more MAX7221, more bytes need to be shifted. I tested an upper limit of 12 devices (24 bytes have to be shifted for that). I could notice a slight delay when the digits change with the above values. It went from 0000 -> 0004 ->0034->0234->1234. Just a flicker, but visible. So I deciced to set the 8 device max limit.

But this might not be a problem if you display some icons other eye-candy.

Eberhard

For anyone who is reading this for info on driving 16 7221's the answer was easy - I wired the 2nd set of 8 chips' DATA CLK and LOAD pins in series with the other 8, used the tomek/zambetti code example, set maxInUse = 16, and it just works. e.g. maxOne(16,4,255) party on. ;)