Pages: [1] 2   Go Down
Author Topic: A 595 question.. (Shift Registers)  (Read 1394 times)
0 Members and 1 Guest are viewing this topic.
B0100111001000011, USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1503
I'm confused.  Wait, maybe not..
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm looking into 74HC595's on eBay.  I have a question though:  What power is actually sent out through the output pins?  Is it the same as the power you put into the VCC pin?  I only ask because these Shift Registers can run on fairly low voltage, so I was thinking I could possibly get away with inputting only about 3.5 volts, and then using LEDs that require that amount.  Having no 595's at the moment, I can't test it myself.

If anyone has the answer (I can't seem to find it in the datasheet), that'd be great.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 611
Posts: 49092
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.datasheetcatalog.org/datasheets/320/387709_DS.pdf

This is one datasheet for that chip. Page 4 shows the voltage requirements.

Keep in mind that even though the chip will operate correctly at lower voltages, the Arduino may not.
Logged

B0100111001000011, USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1503
I'm confused.  Wait, maybe not..
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

One more question:  When it comes to these Shift Registers, I know they're supposed to source current rather than sink it, but when you set a particular output to low (0), does it connect to ground?  Or simply not connect to anything?

I only ask because I was thinking that it would be easy (if you can sink the current to ground through these) to make a 4*4 LED matrix.

[edit]Or is that why people always use Transistors with these things? smiley-razz[/edit]
« Last Edit: December 18, 2009, 05:59:09 pm by Tchnclfl » Logged

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can sink OR source with them. I believe most of them generally only allow like 20ma per pin... so you'll need a transistor if you're using a LED matrix.

They can source/sink the same amount normally, but you can look into using the ULN28xx (darlington array transistors, basically 8 transistors in a chip) they can handle 500ma per channel, and they're often used to sink current rather than source.

But yeah, you're correct, when a pin is driven low, it's connected to GROUND internally. So if you want to sink with the 595, connect the negative of the LED to the pins, then on the positive of the LED, put the resistor to 5v. (or whatever your supply is) This way, the LED will light up when you drive the pins LOW, and it will turn off when the pin is HIGH.
Logged

B0100111001000011, USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1503
I'm confused.  Wait, maybe not..
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Final question:

Do shift registers work by pulsing power between all the outputs that are enabled very quickly (causing a persistence of vision effect when using LEDs)?  I think I read that they did somewhere..but I can't remember where to be honest.

If it did do that, I'm still confused, because how could it have an overall maximum current rating that includes all pins if only one is active at a time?
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

lets say you have 8 led's and you send the shift register B10000000 only 1 led is lit

if you don't write to the register again that 1 led will remain lit, so you have to refresh the "screen" fast enough to display a dot matrix image to the eye that doesn't flicker

keeping that in mind what happens when you send B11111111 to the register?

you just turned on all 8 led's at once

« Last Edit: December 18, 2009, 11:23:59 pm by Osgeld » Logged


Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://earthshinedesign.co.uk/ASKManual/ASKManual.pdf
You should save that, and read through it later.. but for now, scroll down to the Project where he uses 595's, he has some code that makes them a bit easier to use. And explains alot about how they work.
Logged

B0100111001000011, USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1503
I'm confused.  Wait, maybe not..
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
http://earthshinedesign.co.uk/ASKManual/ASKManual.pdf
You should save that, and read through it later.. but for now, scroll down to the Project where he uses 595's, he has some code that makes them a bit easier to use. And explains alot about how they work.

I have read (most of) the ASK manual, including the part about the shift registers.  I'll reread it, but what you guys are saying is that sending B11111111 will turn on ALL of the LEDs simultaneously, correct?  And if I wanted to do a POV kind of thing, with only one on at a time, I would need to do that manually with consecutive things like this:

Code:
shiftOut(dataPin, clockPin, MSBFIRST, B10000000)
shiftOut(dataPin, clockPin, MSBFIRST, B01000000)
shiftOut(dataPin, clockPin, MSBFIRST, B00100000)
etc.?
« Last Edit: December 19, 2009, 10:41:12 am by Tchnclfl » Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yep, but a array and a loop would make it easier
« Last Edit: December 19, 2009, 01:05:58 pm by Osgeld » Logged


B0100111001000011, USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1503
I'm confused.  Wait, maybe not..
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
yep, but a array and a loop would make it easier

Agreed.  But I thought I'd do it that way to make my point more graphic.

Thanks everyone! smiley-grin
Logged

B0100111001000011, USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1503
I'm confused.  Wait, maybe not..
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have another question about Shift Registers and LED Matrices.

We were discussing using 595s to power LED matrices, and someone mentioned that to turn off the LED, you just change the cathode to HIGH (1).  My question is:  Is it safe to have both the cathode and anode of an LED high at the same time?  I assume nothing bad will happen...but you never know.. smiley-razz

Also, to power these, people typically do a pov-style of powering, right?  applying 5 volts through a resistor to the anode, and then grounding the cathode, and continuing in quick succession to create the illusion of static lights, right?

That way, I wouldn't really need transistors?  :-?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17293
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is it safe to have both the cathode and anode of an LED high at the same time?  I assume nothing bad will happen...but you never know.

Grounding both ends of a LED (LOW) would result in no current flow. Having +5vdc applied to both ends (HIGH) would also result in no current. No harm in either case.

Having ground on the anode and +5vdc on the cathode would result in no current flow because it is a reversed bias condition, Again no harm as long as the applied reverse voltage does not exceed the maximum reverse voltage specification of the diode (see specific LED datasheet).

Having a ground on the cathode and +5vdc on the anode would result in forward current flow and if not limited externally from the LED (either with a resistor, constant current source, etc) could of course damage the LED or the device driving the LED due to excessive current flow above the LED's maximum foward current specification.

Lefty
Logged

B0100111001000011, USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1503
I'm confused.  Wait, maybe not..
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Grounding both ends of a LED (LOW) would result in no current flow. Having +5vdc applied to both ends (HIGH) would also result in no current. No harm in either case.

Having ground on the anode and +5vdc on the cathode would result in no current flow because it is a reversed bias condition, Again no harm as long as the applied reverse voltage does not exceed the maximum reverse voltage specification of the diode (see specific LED datasheet).

Having a ground on the cathode and +5vdc on the anode would result in forward current flow and if not limited externally from the LED (either with a resistor, constant current source, etc) could of course damage the LED or the device driving the LED due to excessive current flow above the LED's maximum foward current specification.

Lefty

Thought as much.  Thanks for clarifying though smiley.
Logged

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

A point not picked up:-

Quote
I could possibly get away with inputting only about 3.5 volts, and then using LEDs that require that amount.

No you always need a current limiting resistor.
http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

Quote
if you don't write to the register again that 1 led will remain lit, so you have to refresh the "screen" fast enough to display a dot matrix image to the eye that doesn't flicker

Sorry but that is wrong. These shift registers have output latches, that means you can shift new data out as slow as you like and you will get no flickering. You only get a change in the output when you update the latch with the shift / load line.
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

latch or not, refreshing at a high enough rate so as your displaying individual dots in a pattern and it doesn't flicker while it presents the entire image to the eye
« Last Edit: December 21, 2009, 09:19:40 am by Osgeld » Logged


Pages: [1] 2   Go Up
Jump to: