Pages: [1]   Go Down
Author Topic: Max7219 won't shut off LEDs  (Read 1280 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been working on building an arduinome for some time (http://flipmu.com/work/arduinome/) and I'm almost done except for getting the LEDs to light up how I want them to. I've been having major problems with the MAX7219 and after hours and hours of wiring and rewiring (it isn't even that many wires...) I am at wit's end. The strangest thing is that a while ago the LEDs were working perfectly, and then one day they just stopped.

The LEDs are organized in an 8x8 grid, so I have the columns as the digits and the rows as the segments. I am fairly positive everything else is wired correctly, the V+ goes to the 5v on the arduino and the GNDs are both plugged in, the ISET is connected to a 15k resistor to V+. DIN, LOAD and CLK are connected to 4,5,6 of the arduino.

When I plug in the arduino, all the lights light up immediately-- even without any code, and even when in code I explicitly set all outputs to LOW. I don't understand why it would do this, because from the MAX72xx datasheet it says of the initial power-up :

Quote
On initial power-up, all control registers are reset, the
display is blanked, and the MAX7219/MAX7221 enter
shutdown mode. Program the display driver prior to
display use. Otherwise, it will initially be set to scan one
digit, it will not decode data in the data registers, and
the intensity register will be set to its minimum value.

There seems to be clearly something wrong with the MAX, but the thing is I have 5 of these things that have essentially never been used before (I ordered the first one, and when that didn't work I ordered two more, and when those didn't work I ordered another two, and now I am just at a loss). Does anybody know what I could be doing wrong?
« Last Edit: February 02, 2013, 06:08:19 am by cerpin » Logged

Valencia, Spain
Online Online
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When I plug in the arduino, all the lights light up immediately-- even without any code, and even when in code I explicitly set all outputs to LOW. I don't understand why it would do this, because from the MAX72xx datasheet it says of the initial power-up :

Quote
On initial power-up, all control registers are reset, the
display is blanked, and the MAX7219/MAX7221 enter
shutdown mode. Program the display driver prior to
display use. Otherwise, it will initially be set to scan one
digit, it will not decode data in the data registers, and
the intensity register will be set to its minimum value.

Where did you get them? The cheap MAX2719s on eBay are clones and some of them don't reset properly (they work fine apart from that).
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I got them all from digikey.
Logged

Valencia, Spain
Online Online
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do they all do the exact same thing? If so it must be a wiring problem.

Can you build a quick test circuit on a breadboard, see what happens there?

nb. If there was a problem like a stray blob of solder it could have killed the chips. They die quite easily in my experience.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just tested it with a single LED hooked up to the MAX, it immediately lights up when I plug in the arduino.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just tested it with a single LED hooked up to the MAX, it immediately lights up when I plug in the arduino.

Anybody? I still have this problem and I have no idea how to fix it.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 135
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just finishing my buffer based ledmatrix library, I ran into this problem while developing the library -- it turns out that sending in right commands in right sequence is important. If commands are not right, or they are not clocked right (raise and lower the CS/LOAD pin), the Max7219 gets into weird states and will behave strangly -- sometimes all leds are turned on, sometimes only a few, sometimes ... well you probably have seen it already.

My solution is to power everything down when it happens, detach the led matrix from Arduino, fix the code to get it right, then reconnect and power up. After I got the commands/data clocked into 7219 correctly, I do not have this issue anymore -- still, sometimes all leds are on, but will shutdown correctly.

Another way to test your Max7219 is to use a well known library (mine is too new :-)), like LedControl to test it.

Logged

Search for "mjkzz" on eBay :-)

BHZ, MG, Brazil
Offline Offline
Sr. Member
****
Karma: 10
Posts: 346
Android developer; Arduino enthusiast
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had this problem last week.

It happened that I had switched DIG and SEG pins.

Do this: whatever you is connected as SEG.1, swap with DIG.1,   SEG2 <-> DIG2, .... and so on. Mine worked perfectly after that.

Logged

Learn to live: Live to learn.
Showing off my work: http://arduino.cc/forum/index.php/topic,126197.0.html

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using the arduinome code at sourceforge: http://sourceforge.net/projects/arduinome/

I also used the LEDControl library from the arduino playground and I'm not getting any better results. I don't think I should be having the issue you described because I didn't write this code from scratch...
Logged

BHZ, MG, Brazil
Offline Offline
Sr. Member
****
Karma: 10
Posts: 346
Android developer; Arduino enthusiast
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I wasn't talking about the code. I was talking about the wires from the MAX7219 to the LED matrix. You got them swapped (DIG <--> SEG).

Logged

Learn to live: Live to learn.
Showing off my work: http://arduino.cc/forum/index.php/topic,126197.0.html

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had this problem last week.

It happened that I had switched DIG and SEG pins.

Do this: whatever you is connected as SEG.1, swap with DIG.1,   SEG2 <-> DIG2, .... and so on. Mine worked perfectly after that.



WOW, this worked! I feel so stupid right now, this problem has been screwing me up for the past forever! Thank you so much!!!
Logged

Pages: [1]   Go Up
Jump to: