MAX7219 goes blank after 50th LED

hi,
i recently built a 8x8 matrix controlled with an arduino and a MAX7219

http://aminalhostipel.blogspot.com/2010/02/dense-8x8-3mm-led-matrix.html

it works all fine, but when i try to light more than 50 leds (20mA, 2.2V) all go blank and the MAX7219 is unresponsive. it does not matter which LEDs are lit up. when this happens, the arduino is still running, i.e. generates output on the serial port.

when i measure the current flowing through V+ I can only light up ~20 LEDs with a current reading of 50mA. I'm not sure why the multimeter should change the behavior.

however, interpolating the 50mA for 20 LEDs to 64 LEDs, gives about 160mA, which is close to the PD I calculated using the formula in the spec sheet (166mA).

does anyone have an idea what could be wrong?
thanks in advance.

I'm not sure why the multimeter should change the behavior.

The multimeter is not giving you an accurate reading because you are trying to measure pulsed current. It also acts as a load and will drop a voltage across it.

Can your PSU handle the amount of peak current?
Have you applied sufficient PSU decoupling around the max chip?
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

in the meantime i tested the following:

  • added a 10uF cap between V+ and GND as suggested by the MAX7219 spec, but this made it worse (could only light 40 LEDs).
  • use an external power supply with a regulated 5V up to 2A -> no change
  • added a 10uF cap between V+ and GND as suggested by the MAX7219 spec, but this made it worse (could only light 40 LEDs).

In which case you have real troubles as that WILL make things better.
Also use a ceramic 0.1uF cap in parallel with the 10uF.

If it is making it worse then you probably have a very unstable system. How is it constructed, can you post a photograph?

not very "well" I guess. see the link in the first post :expressionless:

If that's your layout then I am not surprised.

Have you tried dropping the current down to say 10mA and seeing if they can all come on?

Have you connected both grounds on the chip?

You software is not touching the shut down register is it?

When they go off how do you bring them back on, can you do this by software or do you have to perform a power cycle?
If you have to resort to a power cycle have you checked the temperature of the chip with your finger?

If that's your layout then I am not surprised.
well, let's say it's a prototype :slight_smile: what exactly do you think is problematic? the wires, the home-made dual-layer pcb?

Have you tried dropping the current down to say 10mA and seeing if they can all come on?
that will be my next test to choose a higher Rset.

You software is not touching the shut down register is it?
no.

When they go off how do you bring them back on, can you do this by software or do you have to perform a power cycle?
My test starts with a blank matrix and turns on 1 led after the other, but after 50, all go blank. after a full cycle of 64 leds, I re-init the MAX7219 registers. but this only works every other time. when I press the reset button on the arduino, the scan starts again, too.

If you have to resort to a power cycle have you checked the temperature of the chip with your finger?
the chip stays cool.

the home-made dual-layer pcb?

The link you pointed at was solder-less bread board, do you have a PCB?

Do you have a scope? Can you look at the waveforms with and without the LEDs connected?

I am beginning to think it is either wiring or software, can you post the code?

The link you pointed at was solder-less bread board, do you have a PCB?
Sorry, I wasn't correct. I didn't know the english term - There are 2 raster-bread-boards 90 degrees rotated, so they form "rows" and "columns". I soldered first the anodes of the leds in the upper board, clipped the pins, then placed the 2nd board upside down underneath, and soldered the cathodes.

I think the software is fine and the circuit is digitally correct, since I can light all LEDs in arbitrary order or quantity - just not more than 50 :slight_smile:

Hi,
you try to could replace the RSet resistor with a bigger value to limit the current through the Leds to 10 or 5 mA. So you can see if it's an overcurrent problem.

Are you running the arduino on batteries all the time, or does this also happen when you power the board from USB.

Eberhard

I did some more tests. I had to set Rset to 100kOhm in order to get all LEDs concurrently running. Which seems very high. according to the spec, the LED current is 100 times higher as Iset, so that would only be 5mA.

Then I tried to measure the current the circuit is using:
PSU
5V+ ---- [ 75ohm ] ---- V+
5V- ------------------- GND

Arduino
GND ------------------GND
CS ------------------- CS
DIN ------------------- DIN
CLK ------------------- CLK
5+ --

And measured the voltage drop between 5+ and GND over the 75Ohm resistor. When all LEDs are on, I got 1.6 V / 75 ~ 20mA, when no Leds were on, I got: 2.7mV / 75 ~ 36uA. Interestingly, when i turned arduino off, I got 2.0 V / 75 ~ 26mA

I also measured a frequency of 3.78kHz.

When I disconnect the external power source I still measure some negative voltage over 5+ and GND, coming from CS.

then I got the idea taking CS LOW again after latching the data:

//latch the data onto the display
digitalWrite(SPI_CS,HIGH);
delayMicroseconds(1);
digitalWrite(SPI_CS,LOW);

and then it works with my 27kOhm resistor!! but not very stable :frowning: Maybe I have to add a diode somewhere?

but not very stable

That's where we get back to decoupling.

Hi,
is there a chance you are using low-current leds by accident?
Do you have a datasheet for them?
Eberhard

Why would low current LEDs make any difference here?
They just light up brighter for lower current. If you give them more current they get even brighter or burn out permanently.

Why would low current LEDs make any difference here?

Just a wild guess. The MaxChip drives the Leds with a higher current and a duty-cycle of 1/8. A normal Led is rated for a Max-current of 100mA, low-power leds are rated with ~20mA.

I'm not sure what exactly happends when you drive an led beyond its max-current rating, but the way the curcuit behaves sounds very strange anyway.

Are you running the arduino on batteries all the time, or does this also happen when you power the board from USB.

... also hasn't been answered yet.

Eberhard

A normal Led is rated for a Max-current of 100mA,

No normal is 20mA continuous.

I'm not sure what exactly happends when you drive an led beyond its max-current rating

It either burns out immediately, or has a severely reduced life. Note life of an LED is quoted to the stage where the light output drops to half or less.

also hasn't been answered yet.

Yes it has:-

  • use an external power supply with a regulated 5V up to 2A -> no change

thanks for the replies.

Are you running the arduino on batteries all the time, or does this also happen when you power the board from USB.

it doesn't matter - either USB or the 9V battery have the same results.

The LEDs should be ok with 20mA / 2.2V:

http://chdist35.distrelec.com/distrelec/datasheets.nsf/datasheets?Open&country=ch&language=de&artno=632086

I start to think that my circuit is just too sloppy. there can be any errors or stray currents due to the poor design with all the wires and stuff.

I probably will create a new version using a proper PCB.

I just submitted a PCB to the fab - and then looked at my prototype again
and I couldn't believe it: there is a wire connecting the CS with GND :frowning: This must have happened during my last modifications to bring the caps closer to the circuit.

however, after fixing this problem - it works! so it was decoupling after all.

thanks for all your help.

Regarding the LED current:
seeing the LED datasheet it should never be a problem with those dot matrix drivers.
you need to consider 2 currents in the datasheet:
Iavg: or DC forward current, in this case 25mA &
Ipeak, which is in this case 140mA

So the LED can sustain 140mA current but only the thermal heating of average 25mA.

So you have to stay below those two values, but the MAX7219 as well as compatible parts like AS1106 show these values:
~45mA segment current, which means divided by 8 (multiplxing) only around 5.5mA average current.
So the peak current for the LED is 45mA & average 5.5mA.... so everything is fine.

For the other problem you might try the AS1106

it is a drop in replacment so you can use either the MAX part or the AMS part