Go Down

### Topic: 74HC164N Binary Help (Read 1 time)previous topic - next topic

#### RazorFly

##### Jul 09, 2012, 01:43 am
I am trying to use 3 74HC164N's to control 22 leds.

I am new to the Arduino Sandbox, so please bare with me.

How do I daisy chain the 3 shift registers? (I figured I should connect the data in to Q7 on the previous register)
but where does clock go?

also since I have expanded this to 3 shift Registers what does the bit string look like? If its 8-bit for one...is it 16 bit for 2? 24 bit for 3?

ie one register = B00110101
two register = B00110100011010111?

(probably not...)

Im really LOST...

#1
##### Jul 09, 2012, 03:55 am

Connect all CLKs in parallel to Arduino.
Connect all CLRs to +5.
Connect Qh of 1 to A & B of the next, Qh to A & B of the next.

Perform 3 shiftout()s to send out 3 bytes of data.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### tmd3

#2
##### Jul 09, 2012, 03:58 am

(I figured I should connect the data in to Q7 on the previous register)
That's right.
Quote
but where does clock go?
The same clock signal goes to the clock input on each IC.
Quote
what does the bit string look like?

You don't say what method you're using to interface the shift registers.  I'll presume that you're using the shiftOut() function. The output value for that function has the type byte, so it's eight bits long.  If you want to shift three bytes, you'll have to call the function three times.

#### RazorFly

#3
##### Jul 10, 2012, 04:32 amLast Edit: Jul 10, 2012, 09:44 pm by RazorFly Reason: 1
Ok...there are 10 people in this world. Ones that understand Binary and those that dont....

I get the joke but not shifting binary to a shift register.

I am sending a string:
B00000000;
B10000000;
B11000000;

thinking this would translate to turning each led on sequentially...I was wrong...

I could use just a bit more direction.

Thanks!!

++EDIT++

Realized i was using LSB not MSB....changed the way it worked thanks!

Go Up