Go Down

Topic: A 595 question.. (Shift Registers) (Read 1 time) previous topic - next topic

TchnclFl

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.

PaulS

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.

TchnclFl

#2
Dec 18, 2009, 11:34 pm Last Edit: Dec 18, 2009, 11:59 pm by Tchnclfl Reason: 1
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? :P[/edit]

CaptainObvious

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.

TchnclFl

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?

Osgeld

#5
Dec 19, 2009, 05:16 am Last Edit: Dec 19, 2009, 05:23 am by Osgeld Reason: 1
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

http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

CaptainObvious

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.

TchnclFl

#7
Dec 19, 2009, 04:40 pm Last Edit: Dec 19, 2009, 04:41 pm by Tchnclfl Reason: 1
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: [Select]
shiftOut(dataPin, clockPin, MSBFIRST, B10000000)
shiftOut(dataPin, clockPin, MSBFIRST, B01000000)
shiftOut(dataPin, clockPin, MSBFIRST, B00100000)

etc.?

Osgeld

#8
Dec 19, 2009, 07:05 pm Last Edit: Dec 19, 2009, 07:05 pm by Osgeld Reason: 1
yep, but a array and a loop would make it easier
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

TchnclFl

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! :D

TchnclFl

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.. :P

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

retrolefty

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

TchnclFl

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 :).

Grumpy_Mike

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.

Osgeld

#14
Dec 21, 2009, 03:18 pm Last Edit: Dec 21, 2009, 03:19 pm by Osgeld Reason: 1
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
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Go Up