Pages: [1] 2   Go Down
Author Topic: 74LS164P shift register, in sinking configuration?  (Read 1845 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

Hello,

Wondering if anyone can give me insight on this one. I'm playing around with a shift reg, HD74LS164P. Datasheet is at http://www.alldatasheet.com/datasheet-pdf/pdf/246762/RENESAS/HD74LS164P.html

I followed this example to get an idea for how it works: http://www.instructables.com/id/The-74HC164-Shift-Register-and-your-Arduino/step5/Project-1pt-2-2-Wire-bargraph-LED-display-con/. Wired up the arduino according to instructions: A is always at +5, B to a digital output pin, clear always at +5, clock to another digital pin. 3 LEDs through 100 ohm resistors on the first output pins, rest are not connected (don't know if it's relevant to have NC output pins or not?).

I hook up the breadboard to 2 button cells, with data and clock unplugged. All the LEDs light up.

I move it to the Arduino. Connect clock and data, connect 5V from the arduino board. I run the first example sketch. Nothing happens. From what I read it's supposed to alternate on and off and leave the LEDs fixed at that state. When uploading the sketch all the LEDs turn on (I suppose it's while the sketch starts executing), then they turn off and stay off.

I tried the second example.. same thing. Momentarily all LEDs on, then off and nothing happens. The shift is supposed to be visible with the 100ms delay the sketch has, I tried increasing to 500ms in case I was missing something, nothing.

Any ideas?
« Last Edit: January 09, 2013, 02:10:16 pm by mmelendeze » 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

Have you connected the ground to the arduino ground ?
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

Yep, when I use the board I'm taking the +5V from the arduino board, so ground is going to the GND pin on the board as well.
Logged

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

Got it... put in 8 LEDs and now it works. Although I don't think a missing 2 LEDs would make the IC go haywire, probably I had something wired wrong and when I put the new LEDs in the wires hooked up right.  smiley-cool
Logged

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

Ok, here's the next one. I have my 74LS164P which I use to control a series of indicator LEDs. Nothing fancy, just on and off LEDs. LEDs currently in common anode configuration with a single resistor (330 ohm), so I have the problem that as I light more LEDs, they get dim. That part seems easy enough: use a resistor for each LED, say 100 ohm.

But the 74LS164 datasheet says max recommended output current is 8 mA. So two questions:

1. How can I be powering a LED at full bright with no problems, which consumes about 20 mA from what I hear, off a 8 mA pin? Is the 74LS164 going to burn out eventually?

2. Say I wanted to light all 8 LEDs at once, which in theory would exceed the allowed power dissipation of the IC (20mA x 8 x 5V = 800 mW vs 400 mW max on datasheet). Aside from switching the LEDs on and off real fast, what do I do? I heard one solution is to use the IC in "sinking" configuration, can that work on the 74LS164? From what I've read in sinking config your LEDs come first in the circuit and are switched to ground through the IC. But this IC provides voltage and not ground on output pins, so how would a sinking configuration be? Anyone got a napkin diagram?

Or did I just happen to pick a wuss of a shift register that can't do 8 LEDs, and need to switch to a heavier one?
Logged

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

Quote
did I just happen to pick a wuss of a shift register that can't do 8 LEDs,

Yes.

Quote
and need to switch to a heavier one?

Depends. You can put a npn on each output line to buffer; or you can switch to a beefier one.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 537
Posts: 27068
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

TPIC6x595 is good for sinking higher currents; i.e., connect to cathode end of LED, anode to +5, with current limit resistor as well sized for your LED Vf.
Check them out at avnet.com and TI.com
6595
6A595
6B595  << I use this one a lot.
6C595
6D595 << this one with 100mA/pin drive would be fine for 20mA LEDs as well.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34122
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
which consumes about 20 mA from what I hear
An LED only consumes what you let it consume, this is determined by the resistor. At 8mA it will be perfectly bright enough.
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

Quote
At 8mA it will be perfectly bright enough.

Might be OK outdoors in UK , but might not cut it in real sunshine :-)     

But the brightness of available (  economical )  LEDs seems to double every few months so it is getting less of an issue .

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

 smiley-mr-green Found myself an LED display (A-503GA) from an old PC chasis, only it's common anode: http://www.datasheetdir.com/A-503GA+LEDs

So in order to drive it with a shift register, the shift needs to work in sinking mode.

Can this be done with a 74LS164P? How would the hardware part go? Just invert the current direction and LEDs, so that the current flows into the IC output pins?

DS for the 74LS: http://www.alldatasheet.com/datasheet-pdf/pdf/246762/RENESAS/HD74LS164P.html
« Last Edit: January 09, 2013, 05:29:39 pm by mmelendeze » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34122
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Found myself an LCD display (A-503GA) from an old PC chasis, only it's common anode:
An LCD does not have a common anode or common anything else for that matter.

Quote
How would the hardware part go? Just invert the current direction and LEDs, so that the current flows into the IC output pins?
No just wire it between +5V and the shift register pin to sink current through it.
« Last Edit: January 09, 2013, 05:31:49 pm by Grumpy_Mike » Logged

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

An LCD does not have a common anode or common anything else for that matter.

My bad... LED, not LCD.

No just wire it between +5V and the shift register pin to sink current through it.

So I would understand one of those shift registers alternates its shift pins between GND and +5V so current can flow either way?
« Last Edit: January 09, 2013, 05:31:14 pm by mmelendeze » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34122
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes that is right.  smiley
Logged

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

Yes that is right.  smiley

Getting that one right after a week of misbehaving circuits just made my day  smiley-lol
Logged

geo. area called Italia
Offline Offline
Full Member
***
Karma: 0
Posts: 196
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
How would the hardware part go? Just invert the current direction and LEDs, so that the current flows into the IC output pins?
No just wire it between +5V and the shift register pin to sink current through it.

So when the pin is low it's always shorted to ground?



* 74HC164 sinking current.jpg (47.5 KB, 428x386 - viewed 34 times.)
« Last Edit: May 29, 2013, 06:06:11 pm by naut » Logged

Pages: [1] 2   Go Up
Jump to: