Trouble with MAX7219

I am attempting to control a single MAX7219 with the LedControl library. I am going to use 60 discrete LEDs (neglecting the remaining 4). Right now I just have 2 hooked up to arbitrary digit and segment pins on the driver. I have tried several configurations with them with the same results.

I first started with my rather large and untested sketch. Instead of only certain (potential) LEDs lighting up, they all lit up (at least the dozen or so I tried). Suspecting my code, I switched to an established demo sketch:

http://www.arduino.cc/playground/Main/LedControlDemos

Same result. (I established that this program was running).

The LEDs turn on as soon as I apply power, even before the Arduino begins the program proper. They remain on until I disconnect power. The setLed and related functions have no effect. The shutdown and setIntensity functions don't work either.

I haven't decoupled the power, but it is the only chip off the Arduino and I am using USB power, not AC adapter. Besides, I'm not getting erratic behavior, I'm getting perfectly consistent behavior that just isn't correct! Nevertheless, I will try decoupling after dinner.

I am also considering multiplexing manually. Perhaps there is something I can do with fewer than all the pins, given that I only need to use 2 LEDs at any given time.

Please help? Thanks all!

Hi, this is usally (with the MAX 7219) a sign of the leds wired the wrong way round. Reverse the wiring of the Led's and try again.

Eberhard

I have a very hard time understanding why this would happen. Does this have something to do with one of the differences between the 7219 and the 7221, where the off pins go to V+ and hi-Z respectively? I suppose I would have seen nothing if I used a 7221.

Now that I know what the problem is, I easily found supporting evidence in the data sheet. It says which way to hook them up in the pin descriptions.

I think I tried plugging it in the other way one time, but it was dark, so obviously in backwards. In hindsight, it was dark because I was telling it to be dark!

Oddly, when I disconnected the V+ and/or GND while still powered on (my mac complains when I disconnect the cable), the LEDs only dimmed! I know it's undefined behavior, but it seems pretty crazy even for that!

Thanks so much for that bit of help. Who knows how long it would have taken me to try hooking it up backwards?

Hi wasp

I have a very hard time understanding why this would happen. Does this have something to do with one of the differences between the 7219 and the 7221, where the off pins go to V+ and hi-Z respectively? I suppose I would have seen nothing if I used a 7221.

Exactly, so you’re kind of lucky you used the 7219, they are easier to debug :slight_smile:

With the 7221 the cause of the malfunction is not so easy to find out. It could be the led-wiring, or the the software that doesn’t turn the Leds on.

Eberhard