Hey guys, my circuit doesn't work, can someone point me what is wrong here?
I have 5x 595 chips in cascade using above schematic, latch and clock pins are wired in parallel.
There is a led on each QA-QH pin of each chip.
I'm doing some tests with this code
const int latchPin = 8;
const int clockPin = 9;
const int dataPin = 10;
void setup()
{
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop ()
{
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, B00000100);
shiftOut(dataPin, clockPin, MSBFIRST, B00000000);
shiftOut(dataPin, clockPin, MSBFIRST, B00000000);
shiftOut(dataPin, clockPin, MSBFIRST, B00000000);
shiftOut(dataPin, clockPin, MSBFIRST, B00000000);
digitalWrite(latchPin, HIGH);
delay(1000);
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, B00000000);
shiftOut(dataPin, clockPin, MSBFIRST, B00000000);
shiftOut(dataPin, clockPin, MSBFIRST, B00000000);
shiftOut(dataPin, clockPin, MSBFIRST, B00000000);
shiftOut(dataPin, clockPin, MSBFIRST, B00000000);
digitalWrite(latchPin, HIGH);
delay(1000);
}
I was expecting to get a blinking led for each active bit, but the only one that makes difference is the last bit in the last shiftout(), then I get almost all leds blinking with some random pattern.
I was using a similar code for 7 segments display control, and it worked well, but now it doesn't.
Thanks in advance for any help.