Hello,
I have rigged up a 74HC164N Shift Register with my
arduino and a 7 segment display.
So I am very happy I got that working, however I would like some help rigging up 6 of these nifty things.
Here is my code:
int dataPin=11;
int clockPin=12;
int del = 700;
int zero = B10001000;
int one = B11111001;
int two = B01001100;
int three = B01101000;
int four = B00111001;
int five = B00101010;
int six = B00001010;
int seven = B11111000;
int eight = B00001000;
int nine = B00101000;
void setup(){
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop(){
shiftOut(dataPin, clockPin, LSBFIRST, zero);
delay(del);
shiftOut(dataPin, clockPin, LSBFIRST, one);
delay(del);
shiftOut(dataPin, clockPin, LSBFIRST, two);
delay(del);
shiftOut(dataPin, clockPin, LSBFIRST, three);
delay(del);
shiftOut(dataPin, clockPin, LSBFIRST, four);
delay(del);
shiftOut(dataPin, clockPin, LSBFIRST, five);
delay(del);
shiftOut(dataPin, clockPin, LSBFIRST, six);
delay(del);
shiftOut(dataPin, clockPin, LSBFIRST, seven);
delay(del);
shiftOut(dataPin, clockPin, LSBFIRST, eight);
delay(del);
shiftOut(dataPin, clockPin, LSBFIRST, nine);
delay(del);
}
however I would like some help rigging up 6 of these nifty things.
What sort of help?
To chain them just connect the serial out of one to the serial in of the other. All other pins going to the arduino should be in parallel.
In software just send out 6 sets of data, the first you send out will reach the furthest shift register.
Look in the playground for examples.
I could not find anyting concerning a serial input in the datasheet.
Does this chip support this function?
And if it does, when I connect it to Q7 not Q4, will it work?
I could not find anyting concerning a serial input in the datasheet.
DSA and DSB are your serial inputs.
Does this chip support this function?
It better, it's a serial in shift register
And if it does, when I connect it to Q7 not Q4, will it work?
Yep.
Note that this SR does not latch the data, so as you are shifting your bits in they will ripple through all the outputs, this is not normally desirable, your displays will flicker all over the place when you update. If you are updating regularly this may make the display unreadable.