Go Down

Topic: Using 74hct164 with arduino (Read 1 time) previous topic - next topic

cyberteen

Hi,
I want to use two 74hct164 8 bit shift registers to control two 7 segment displays. I found that these registers don't have the ability to latch output like the hc595. I want to count up 0 to 99 and then count down based on a condition. Now the problem is I don't know to code for this task using shiftout function.
I am thinking of cascading the two ic's by connecting the 13th pin of the first to 1st pin of the second ic
Also, the data sheet says that "Data shifts one place to the right on each LOW-to-HIGH transition of the clock (CP) input" . So if I am sending the data 01111111 should I switch the clock low and high 8 times so that all the bits gets shifted and I can display 0?

Datasheet:http://datasheet.octopart.com/74HCT164N-Philips-datasheet-28100.pdf

Boffin1

Why the 164 shift registers?    or do you have a bag of them.

Have you considered the TPIC6B595 ?, which has latch, blanking for PWM, and can drive massive 7seg displays of 150mA per segment.

You can use simple Shiftout.

Just a thought
With my mobile phone I can call people and talk to them -  how smart can you get ?

dhenry

Quote
I don't know to code for this task using shiftout function.


They are identical to hc595, without the latch function - doesn't make a difference to your eyes as they shift so fast.


cyberteen

Ok, but can someone answer about switching the clock pin low and high 8 times to completely shift a 8 bit data into it?

dhenry

The answer is yes but that doesn't matter to you as you are using the shiftOut().

Boffin1

With Shiftout, you take the latch pin low and the library takes care of the clocking the byte through the shift register ( while leaving the existing display showing )
You just tell it if you want msb or lsb first ( the right way works, the wrong one gives gibberish )

When you take the latch pin high again, the new display immediately replaces the previous display.
With my mobile phone I can call people and talk to them -  how smart can you get ?

cyberteen

But boffin, pls note that the 74hct164 does not have a latch pin.
So i guess, it's only shiftout(datapin,clkpin,order,data);

Boffin1

Right, I have looked at the data sheet and wonder why you want to use these chips?  They can only sink/source 25mA at 5v, so limit the size of the 7 seg display.

It looks like you would have to clock the data through while the segments are on.
With my mobile phone I can call people and talk to them -  how smart can you get ?

MarkT

I'd ensure you have good decoupling on the 74HCT164's, vital when switching lots of LEDs.  1uF ceramic on each chip's supply (as close as poss).  And don't forget current-limiting resistors for each segment.

BTW why HCT?  HC family is the normal choice for cmos logic, HCT is strictly limited to 5V supply whereas HC will run from 2 to 6V.
[ I won't respond to messages, use the forum please ]

Go Up