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?
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.
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.
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.