3 595 ic's and an 8x8 led matrix

Hello,

I have 3 74HC595 chips cascading to power a dual-color, 24-pin, LED matrix from sparkfun (see datasheet here: LED Matrix - Dual Color - Medium - COM-00682 - SparkFun Electronics) I mostly set everything up like the shiftOut tutorial here (http://www.arduino.cc/en/Tutorial/ShiftOut) except instead of single LEDs the 595 pins are going into the 24 pins of the LED matrix.

I want to be able to control this matrix dot by dot, write words, make a smiley face, whatever. I can hook up a pot and with shiftOut(dataPin, clockPin, MSBFIRST, pot); lights will move around...but I don't understand why they do what they do.

In the first 595, the one that goes to the Arduino, i have the 8 pins used for the red columns of the matrix. In the second 595, I have it cascaded into 595 #1 (just like in the shiftOut tutorial) and all those go to the 8 pins for the rows of the matrix. The last 595 goes to the green columns in the matrix. I also set that up just like I set up #2.

The way i thought it would be was that I would give for my value a decimal number that would correspond to a binary number that would control the pins in the 595's. For example if i said value = 2, that would be a 00000010 in binary. Therefore, the 2nd pin in the 595 would go to high. That works; but, if i want to make, say, the third pin in the second 595 go to high AND the 7th pin in the 1st 595 how do i do that? i thought it would simply be 00000100 01000000 or 1088 in decimal...but that doesn't work. i instead get the 7th pin going high in 595 #1 and 595 #3 (??) and i the last pin appears to go high in 595 #2...I have no idea why this is. (I am also doing shiftOut(dataPin, clockPin, MSBFIRST, (value>>8)); if the number is greater than 255)

I hope i'm being clear...I think i'm pretty over my head here...I've been trying to figure this out all day. Any help on how to cascade and control these 595s would be much appreciated. Maybe I'm using the wrong ICs for this job...

Thanks so much!

Its much easier to use the matrix like it outlines here.

Hi,

Thanks for the help.
But that is for a 16 pin matrix...mine has 24 pins. And also I just want to figure out how to use these 595s better...so I could run a few of these matrices at once.

sorry I don't know the 595s or shiftout but maybe it would be worth your while to just ignore the green pins and get the example working.

Alternatively, put the matrix aside and just try to shift some bits through your registers tracking them with a single led or multimeter.

I might not be able to help directly but if you post your schematic and the actual code I'll have a look and somebody will be able to help.

I do have a 2 color matrix but I'm driving it with a decoder to select the rows and 16 pins from the arduino to run the red and green columns.

i have a dual color matrix from sparkfun. start off just using one color until you get the hang of it. then you can add the other color pretty easily. cant help much tho since i didnt use shift registers, sorry

Could you please post your code so that we can see exactly what is going on?

Thanks!

Try to check this Instructables article:

Hi,

Thanks for all the help everyone! I got a lot further last night and I kind of figured it out but I know that I am way off base. With much effort I was able to make a green square and a smaller red square. However, there is a faint green line going down the center-right or the matrix and I don't know why. As you can see in the picture it's making the right of the red square turn a little orange: http://tiny.cc/TktdA
My hook up is exactly like in the shiftOut tutorial (http://www.arduino.cc/en/Tutorial/ShiftOut) just with a 3rd 595 cascaded...and I did not use a capacitor as I do not have one. But they said that was for the flicker and I don't have any flicker. Maybe this would be easier with some line decoders? Is that what people more typically use for these matrices? I have a couple M74HC23881's which default on LOW...just seems like it would be tedious to draw pixel by pixel...
So..here is my embarrassing code. I know there must be an easier way but...

``````int latchPin = 8;
int clockPin = 12;
int dataPin = 11;

void setup() {
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}

void loop() {
//green square
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, 255);  //controls the green 595 (#3)
shiftOut(dataPin, clockPin, MSBFIRST, 126);  //controls the rows 595 (#2)
shiftOut(dataPin, clockPin, MSBFIRST, 0);    //controls the red 595 (#1)
digitalWrite(latchPin, HIGH);

digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, 255);
shiftOut(dataPin, clockPin, MSBFIRST, 254);
shiftOut(dataPin, clockPin, MSBFIRST, 0);
digitalWrite(latchPin, HIGH);

digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, 128);
shiftOut(dataPin, clockPin, MSBFIRST, 0);
shiftOut(dataPin, clockPin, MSBFIRST, 0);
digitalWrite(latchPin, HIGH);

digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, 1);
shiftOut(dataPin, clockPin, MSBFIRST, 0);
shiftOut(dataPin, clockPin, MSBFIRST, 0);
digitalWrite(latchPin, HIGH);
//end green square

//make a smaller red square//
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, 0);
shiftOut(dataPin, clockPin, MSBFIRST, 195);
shiftOut(dataPin, clockPin, MSBFIRST, 36);
digitalWrite(latchPin, HIGH);

digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, 0);
shiftOut(dataPin, clockPin, MSBFIRST, 219);
shiftOut(dataPin, clockPin, MSBFIRST, 60);
digitalWrite(latchPin, HIGH);

digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, 0);  //i don't know why I need
shiftOut(dataPin, clockPin, MSBFIRST, 255);// these last two sections
shiftOut(dataPin, clockPin, MSBFIRST, 0);  // with 255 but when I take
digitalWrite(latchPin, HIGH);                      //them out my red square loses
// a row
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, 0);
shiftOut(dataPin, clockPin, MSBFIRST, 255);
shiftOut(dataPin, clockPin, MSBFIRST, 0);

//end red square

}
``````

I did not use a capacitor as I do not have one.

That is a very bad tutorial as adding a capacitor in that position will damage the arduino.

However as you say:-

I do not have one.

I assume you have no supply decoupling, with 3 shift registers you really need some. Your odd green glitch is the sort of thing you can get with no decoupling.
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

I used this schematic in my bi-color LED matrix shield:

with only 2 595s, matrix rows controlled by Arduino's output pins.
(I sell the LED matrix shield here: Wise time with Arduino: Buy LED matrix shield kit - DISCONTINUED)

GO TO .oomloot.Arduino & DIY Electronics.

click on LEDS, then click on Bi-colour matrix, then click on one page start guide.

That is a very bad tutorial as adding a capacitor in that position will damage the arduino.

Could you explain why ? I have that circuit running on a breadboard for a couple of weeks and had to add that capacitors to eliminate noise that caused unwanted bits to be set etc..

Could you explain why

A discharged capacitor looks like a short circuit, therefore it will exceed the maximum current output from the arduino pin. This will damage it, no question. The fact that it still works is beside the point you are exceeding the current of the pin.
See:-
http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

The reason you had problems with flickering was that the supply was not decoupled on the shift register chip. Move the capacitor to across the power supply close to the chip:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

If you insist in putting a capacitor to slow down or delay an edge you need a 100R resistor in series with it to protect the output pin.

Thanks - I'll make that change tonight on my board and see what happened.

How do we get the Shiftout page changed - showing something that could blow a chip on the tutorials is a bit naughty.

Hi,
I am trying to do the same stuff as you did. But I am trying to make a scrolling text go on the matrix.

Could anyone help me with that?