MAX7219 (CNG - model from Sparkfun)

I am trying to get this chip up and running with the super bright leds from sparkfun:

I have the chip wired to my arduino on pins 9-11 and my code is pretty basic (using led control library):

//we have to include the libary 
#include "LedControl.h"

/*
 Now we need a LedControl to work with.
 ***** These pin numbers will probably not work with your hardware *****
 pin 11 is connected to the DataIn 
 pin 10 is connected to the CLK 
 pin 9 is connected to LOAD 
 We have only a single MAX72XX.
 */



//and create the LedControl 
LedControl lc=LedControl(11,10,9,1); // data clc load

/* we always wait a bit between updates of the display */
unsigned long delaytime=100;

void setup() {
  //wake up the MAX72XX from power-saving mode 
  lc.shutdown(0,false);
  //set a medium brightness for the Leds
  lc.setIntensity(0,4);
  /* and clear the display */
  lc.clearDisplay(1);
  }

  void loop() {
    lc.clearDisplay(1);
  }

/*
  This function lights up a some Leds in a column.
 The pattern will be repeated on every column.
 The pattern will blink along with the column-number.
 column number 4 (index==3) will blink 4 times etc.
 */
void columns() {
  for(int col=0;col<8;col++) {
    delay(delaytime);
    lc.setColumn(0,col,B10100000);
    delay(delaytime);
    lc.setColumn(0,col,(byte)0);
    for(int i=0;i<col;i++) {
      delay(delaytime);
      lc.setColumn(0,col,B10100000);
      delay(delaytime);
      lc.setColumn(0,col,(byte)0);
    }  
  }
}

The only part im using is the one to try to clear the display. For some reason when I have the anodes wired to Seg DP and the cathodes (-) wired to dig 0 - 8 the leds are on all the time. No matter what I do to the program the chip is always sending voltage to all the pins.

Let me know what other information you would need to help me.

I have created a flickr album with some images.


Thank you very much for your help,

-Greg

bump... :/

It is wired exactly like the schematic on this site...

http://www.arduino.cc/playground/uploads/Main/MAX72XX_Schematic.jpg

I am using one of the rows as the only leds.

EDIT: Also it is being powered by the Arduino's 5v bus at the moment I am only using 8 leds to test it, so I figured the power would be sufficient. Later I am going to convert it to being powered from a USB hub.

EDIT 2: My RSET resistor is 24.6 k ohms - tested with a multimeter

and the capacitors are from radio shack 1 is a 10 uF tantalum capacitor, and 0.1 uF Ceramic disc Capacitor

Ive also tried it bypassing the capacitors going into the ground

I have also tried two max chips.

The tantalum capacitor has a positive and a negative lead, what is the proper orientation of that when taking the 5v from the bus into the ground? It has a short and a long end.

Thanks

The common side of the leds are wired to pin 22, which I believe is seg DP, I had them switched around when I was troubleshooting, it is odd if I flip them one way at times they are really dim, and the other way they arefull blast, it seems as though it is leaving the seg and dig pins on all the time. The cathodes are connected to the dig 0 - 7 pins.

Ill play around with it some more.

I was only trying to work with one row to get an idea how it works before I wire up the actual 8 x 8 matrix I made.

By flipping I meant that I flipped the anodes and the cathodes of the leds to make sure they were not backwards.

When I plug the 8 leds into seg dp - g on the cathodes of the leds, and the anodes on any dig port 0 - 7, one at a time, the entire row lights up each time.

If I rather wire the 8 leds cathodes into dig 0 - 7 and all of the anodes on dp - g one at a time, each time the entire row lights up as well.

It seems to me that no matter what combination I do the leds will all always light up.

Thanks for your help by the way, I understand that this kind of troubleshooting is hard over this form of communication.

-G

EDIT:

Is it normal for the load clk and data to keep the leds lit up without any 5 volts or ground being run into the chip? It is dimmer than with the 5v and ground plugged in. But nevertheless I find this odd... more specifically the load is keeping them on... if i remove the clock it dims 1/2 and the data has no affect.

Im working with one led, on 0, 0 of the matrix with seg dp and dig 0, with this code:

//We always have to include the library
#include "LedControl.h"

/*
 Now we need a LedControl to work with.
 ***** These pin numbers will probably not work with your hardware *****
 pin 12 is connected to the DataIn 
 pin 11 is connected to the CLK 
 pin 10 is connected to LOAD 
 We have only a single MAX72XX.
 */
LedControl lc=LedControl(12,11,10,1);

/* we always wait a bit between updates of the display */
unsigned long delaytime=100;

void setup() {
  /*
   The MAX72XX is in power-saving mode on startup,
   we have to do a wakeup call
   */
  lc.shutdown(0,false);
  /* Set the brightness to a medium values */
  lc.setIntensity(0,8);
  /* and clear the display */
  lc.clearDisplay(0);
}

void loop() { 
  lc.setLed(0, 0, 0, true);

  delay(1000);

  lc.setLed(0, 0, 0, false);
}

the one led is on high all the time, no matter which way I connect seg dp and dig 0 (ie to the anode or cathode or vice versa) im using pins 2 and 22 as dig 0 and sed dp respectively.

Im at a loss.

-G

Well I ordered 3 more chips, Im guessing that I wired them incorrectly, the only thing that would question about my hookup is the capacitors.

I have one 0.1 uF Ceramic disc capacitor and 1 10 uF Tantalum capacitor, the tantalum has one shorter and one longer lead, how is that supposed to be plugged in to this schematic? I had the 5v coming from the breadboards positive rail, which was plugged into the arduinos 5v plug, and that leading into a new rail, which had 1 side of each of the capacitors then the other side of the capacitors leading to a new rail with two jumper cables leading to pins 4 and 9.

A couple of times when I was working with this side of the board the arduino’s power light would dim, which obviously led me to believe that the capacitors were plugged in wrong.

So im guessing this was the fault.

Thanks,

-G

I understand that, I was only using the arduino boards power to run one led, or even 8 leds max, on my breadboard.

For the final matrix I am planning to use a usb hub.

I wonder what else could cause the arduino light to dim, the capacitors were the only thing I was working with when it did that.

My Tantalum capacitor has one short and one long lead, which one gets connected to the 5v rail and which back into the ground? If i had this backwards it could have been amplifying the 5v back into the ground, which could lead to a short like I explained right?

And could this in any way have fried the Max chip? Other than that the only things I possibly could have miswired were the leds polarity, which I don't think could fry the max, and the data clock and load connections heading into the chip.

-G

I was never intending to supply the entire array from the arduino's usb port, I was going to supply it from a root hub with its own usb cable broken down for its +5v and ground. and use the port from my macbook to power the arduino itself.

I have tried using a separate usb cable, broken down for its +5 and G pins, to power the chip and the usb port on my macbook to power the arduino and it does the same thing. The hub has its own power power cord to the wall, so it is not taking the power from the usb port on the macbook.

I have the capacitors wired correctly now, the side marked + is plugged into the 5v rail and the other leading into the ground.

I have not ever in my troubleshooting process applied +5 or ground to an output pin, and I have also not wired +5 ad G backwards to the chip. I have two separate chips that I am working with, and both were not involved in the troubleshooting of the capacitors.

-G