Go Down

Topic: Max72xx with 32 leds (Read 3051 times) previous topic - next topic

capicoso

Hi. I need to build a 8x4 led matrix, I had a board with a max7219 and a 8x8 led matrix lying around, so i'm going to use that chip. I've got it working with the 8x8 led matrix. But before making the pcb for the 32 leds I wanted to test it on the breadboard. I'm not 100% sure how it works, but I put only one led with the anode to pin 22 and cathode to pin 2, just to see if I had it correctly wired. The sketch is the same one I was using for the 8x8 matrix, all 64 leds on.
 The led doesn't light up. I tried with two leds, the second one with the anode to pin 14 and cathode to pin 2. It doesn't work.
 So, is something wrong with my wiring, or in order to work it needs to have all the leds connected ?
 For the 8x4 matrix I was going to use 8 rows with 4 leds each one. What do I do with the rest of the output pins? Leave them floating?
thanks

CrossRoads

You have the VCC caps and current limit resistor for the max7219 wired up also?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

capicoso

Yes, also pin 9 and 4 to gnd. The resistor from pin 18 to 19 is 47k. Maybe its too high? The leds are standard 3mm 2v 20mA

Paul__B

Yes, of course something is wrong with your wiring.

Offhand I am not checking that you have the LEDs wired the correct way around to the correct pins, but it most certainly makes no difference whatsoever how many LEDs you actually have connected.

You need the two capacitors and the current set resistor fitted, and you should have a 10k pull-up on the chip select input pin.

capicoso

Yes, of course something is wrong with your wiring.

Offhand I am not checking that you have the LEDs wired the correct way around to the correct pins, but it most certainly makes no difference whatsoever how many LEDs you actually have connected.

You need the two capacitors and the current set resistor fitted, and you should have a 10k pull-up on the chip select input pin.

I have the 10k pulldown on the CS, and only a 0.1uF capacitor, didn't have anything close to 10uF at the time.
 Well I'm glad my wiring is wrong. I was prototyping it fast and didn't have a multimeter. I'll check it later again
thanks

Paul__B

I have the 10k pulldown on the CS,
I hope not!

It needs a 10k pull-up.

PaulRB

Hi,

I've never used a resistor on the CS pin and not had a problem. Its not shown on the "Typical Application Circuit" in the data sheet. So I'm not sure that's the problem.

Sorry if you already tried these, but: did you try putting the max chip back in the matrix board to test it; did you test these leds accross the 5V supply (with ~200R series resistor); does your breadboard need a link to join a gap in the 5V power rail; do you have another breadboard to try?

Post a well focussed close-up picture of your circuit, with neat wriring so we can see where every wire goes.

Paul

Paul__B

Not sure of the exact gyrations the library actually goes through, but without the pull-up, random fluctuations on all three of the control lines can and will write nonsense to the MAX7219 (typically making all LEDs light) during reset and until the code is initialised for that port - which also means if you have it connected whilst using a sketch which does not use the MAX7219.

Same applies, need I say it - to the WS28xx series LEDs.

Yes, the obvious thing is to start with the 8 by 8 matrix, then disconnect only the matrix and connect up the individual LEDs.  I recommend not bothering to try and mount the MAX7219 in other than the board which comes with it in one of those matrix kits, and just connect whatever other display or individual LEDs you want, to the matrix termination, either by the socket holes or without mounting the sockets, just solder wires to the point where the socket strips would mount.

capicoso

I hope not!

It needs a 10k pull-up.

I followed the schematic from Gammon's site and he uses it as a pull-down (?

By the way, It works now, something was wrong with my wiring, I used the same board to test the individual leds

thanks all

PaulRB

I followed the schematic from Gammon's site and he uses it as a pull-down (?
You're right, it does: http://www.gammon.com.au/forum/?id=11516

I suppose if the idea is to prevent random data from getting loaded while the Ardiono is booting, it doesn't matter much whether it's a pull-up or pull-down. Either prevents a rising edge that would cause the chip to load bad data, on a max7219.

However, for a max7221, a pull-up might be preferable because the pin is /CS rather than LOAD.

Paul__B

I followed the schematic from Gammon's site and he uses it as a pull-down (?
Well that is his problem, but it is an active low control (even more important for the MAX7221 version as for that chip it enables data shift in as well), so it makes more sense to hold it high when you do not want random data to be entered.  Accidental entry of "all ones" data and then latching with this pin activates the "lamp test" register turning all LEDs on at maximum brightness (though only for one digit/ row if this was at initial turn-on).

Paul__B

#11
Jul 09, 2015, 08:37 am Last Edit: Jul 09, 2015, 08:39 am by Paul__B
I suppose if the idea is to prevent random data from getting loaded while the Ardiono is booting, it doesn't matter much whether it's a pull-up or pull-down. Either prevents a rising edge that would cause the chip to load bad data, on a max7219.
Except - that - what is the first thing your library does?  It pulls it high of course, thus immediately latching in whatever random data has already been shifted in if it was previously pulled down.

PaulRB

Except - that - what is the first thing your library does?  It pulls it high of course, thus immediately latching in whatever random data has already been shifted in if it was previously pulled down.
I've never used or written a library with max7219/21, and the OP didn't mention one either, so not sure what you are referring to, perhaps the led_control library?

Whether its the 7219 or the 7221, its the rising edge of the LOAD or /CS pin that triggers the data to be loaded. I've only ever used 7219s, and when I write a sketch, I don't set LOAD to HIGH during setup(), I just set it to LOW just before shifting out 16 bits (per chip, if chaining several), then set LOAD to HIGH. This should be safe, do you agree Paul?

Paul__B

I don't set LOAD to HIGH during setup(), I just set it to LOW just before shifting out 16 bits (per chip, if chaining several), then set LOAD to HIGH. This should be safe, do you agree Paul?
It should be safe with either a pull-up or pull-down.

I was merely pointing out that other situations are not so safe, and it makes more sense to pull an active-low line up until you are ready to use it, than otherwise.

Go Up