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.
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 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 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
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.
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 Maybe I have to add a diode somewhere?
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.
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
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 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.
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