# How to shift LEDs from 74HCT164 ?

1. ## 74hct164

Hi I need to drive 16 LEDs from 2 shift registers 74HCT164.

The inputs to shift registers I'm giving from a 8 pin micro controller.

The problem is I don't know what logic to give to serial inputs (A & B) in the shift register?

I know only to give clocks.

•

2. ## running leds using 74hct164

It depends on in which pattern you want to light the LEDS. Some examples

1. Give Logic one on A&B during the first clock cycle after that keep A&B Low and continue clock, on each clock the ON LED will advance to the next one. Running the on LED.
2. If you keep the A&B inputs high while clocking all LEDS will turn on one by one.

There are just examples you can create many patterns by giving correct logic level on A&B on the correct cycle.
Please remember that you need to keep count of how many clock cycles are generated so that you can achieve the required pattern.

•

3. ## 74hct164 clock

Originally Posted by dipal_z
It depends on in which pattern you want to light the LEDS. Some examples

1. Give Logic one on A&B during the first clock cycle after that keep A&B Low and continue clock, on each clock the ON LED will advance to the next one. Running the on LED.
2. If you keep the A&B inputs high while clocking all LEDS will turn on one by one.

There are just examples you can create many patterns by giving correct logic level on A&B on the correct cycle.
Please remember that you need to keep count of how many clock cycles are generated so that you can achieve the required pattern.

You are totally correct last night I make an experiment.

I cleared everything that you described.

But I wonder why it needs two inputs A & B? One input is more than enough.?

Better tie both A & B together & give inputs.

•

4. ## 74hct164 driving a led

But I wonder why it needs two inputs A & B? One input is more than enough.?
For most of the application you can do with one input, but two inputs gives you more flexibility. You can feed input data to Say input A and use input B as on/off switch. Thus when input B is high data on Input A will be shifted in, when input B is low Input A is disconnected. This can be very useful when you are planning to implement something without micro-controllers.

Better tie both A & B together & give inputs.
Yes if you don't want that additional control you can tie then together or tie one of them high and use other to to give an input.

5. ## Re: How to shift LEDs from 74HCT164 ?

Originally Posted by dipal_z

But I wonder why it needs two inputs A & B? One input is more than enough.?
For most of the application you can do with one input, but two inputs gives you more flexibility. You can feed input data to Say input A and use input B as on/off switch. Thus when input B is high data on Input A will be shifted in, when input B is low Input A is disconnected. This can be very useful when you are planning to implement something without micro-controllers.
I see now its very useful when implement something without micro-controllers.Thanks for that hint.

Yes if you don't want that additional control you can tie then together or tie one of them high and use other to to give an input.
Ok I'm going to tie both the inputs together.

But last night got a problem when B = high (A floating) the LEDs counting one by one thats ok.

when A= high (B floating) the LEDs wont count.

•