Pages: [1]   Go Down
Author Topic: Using 74hct164 with arduino  (Read 1159 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11730
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: