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);
Serial.println(col);
//Output data to row register
digitalWrite(latchPinRowReg, LOW);
shiftOut(dataPinRowReg, clckPinRowReg, MSBFIRST, row);
digitalWrite(latchPinRowReg, HIGH);
delay(500);
}
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?
