5*7 Matrix code check

I have a 5*7 matrix that I’ve hooked up to two 74HC595 shift registers, my problem is that nothing is lighting up.
Prior to checking the connections I wanted to see if I got the code right, and more importantly if I actually do understand the idea behind the shift register.

Two small hardware notes.

I’m supplying power to the registers via an external battery source who’s output is 5.5V tested via a somewhat accurate multimeter. According to this data sheet http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf
that should be okay given that the maximum input is 7v with max operational voltage being 6.

I have failed to find the datasheet for the led Matrix but via trial and error I’ve managed to produce a diagram that I’ve tested multiple times concerning the row and column connections.
The diagram is also attached.

Uppdiagonal is pulled HIGH
Lowerdiagonal is pulled LOW


byte row = 0b00000000;
byte col = 0b11111110;

const int dataPinColReg = 2;
const int clckPinColReg = 3;
const int latchPinColReg = 4;

const int dataPinRowReg = 8;
const int clckPinRowReg = 9;
const int latchPinRowReg = 10;

void setup() {
  pinMode(latchPinColReg, OUTPUT);
  pinMode(clckPinColReg, OUTPUT);
  pinMode(dataPinColReg, OUTPUT);
  pinMode(latchPinRowReg, OUTPUT);
  pinMode(clckPinRowReg, OUTPUT);
  pinMode(dataPinRowReg, OUTPUT);

void loop() {
  //Output data to col register
    digitalWrite(latchPinColReg, LOW);
    shiftOut(dataPinColReg, clckPinColReg, MSBFIRST, col);  
    digitalWrite(latchPinColReg, HIGH);
  //Output data to row register
    digitalWrite(latchPinRowReg, LOW);
    shiftOut(dataPinRowReg, clckPinRowReg, MSBFIRST, row);  
    digitalWrite(latchPinRowReg, HIGH);

Alright, just a brief concept check. shiftOut pushed the data in accordance to the output of the clock pin. After the clock pin goes high the most significant bit of the data is pushed into the register’s memory. Once the data is shifted completely into the register the latch pin is turned on and the data is outputted.
From my understanding that is what my code does. The data in question is the two global bytes row and col, each obeying the diagram I have put together in order to turn on the entire matrix.

So, software wise should everything be okay?

Anodes & cathodes might be swapped. Do you have current limit resistors?
You are not multiplexing; i.e. driving one anode cathode high and driving the cathodes high (off)/low (on) as needed, or driving one cathode low and driving all anodes high (on)/low (off) as needed.


You have omitted to explain how you tested the matrix and also to show a diagram (and perfectly focussed picture in full daylight) of your actual circuit.

Of course this is only an exercise. For a real application you would use a MAX7219.

I constructed the diagram by trying to turn the entire matrix and then sequentially unplugging pins and seeing what goes out ie (row or column).

As for the current limiting resistors, I used 330 Ohm resistors for the column connections that are connected to ground.

I'll redo the connections for the circuit because the wiring is extremely messy and unclear, if it still doesn't work I'll post a pic of the hardware.

With regards to the anodes and cathodes being connected correctly, when the registers are connected to the supplies all the leds light up and keep flickering haphazardly, so I'm assuming my connections are correct.

Posting a picture of the wiring is not too helpful we need a schematic of how you have wired it up. You must have one otherwise you could not have hoped to possible wire it up could you?