I wanted to learn about shift registers and followed through Tom Igoes excellent "ShiftOut" tutorial.
What I was able to find was the 74HC595N, I ordered a handful.
Now I've followed the instructions, and found that these chips appear to work as a sink, not as a source. Though it does not work as desired I was able to get it working. So I think I understand the basics.
After reading the datasheet I can not find anything stating it is a sink or otherwise. Is there a way to get this chip to work as a source, or am I simply going to have to find other chips? If so how can I tell from the datasheet, sink or source?
Here is the sheet for the chip I ordered, I cant seem to find out where it says it only works as a sink.
I've also noticed that I don't seem to need a ground... isn't that odd? I can disconnect ground from the arduino... and it keeps working.
I hate not understanding what I am working on... but I know I am missing something(or a lot of things) here.
These 595s have 3-state outputs. If you shift in 0s, the pins are set to GND and can sink a few 10 mA. If you shift in 1s, the pins are set to 5V and can source a few 10mA. The 3rd state (high resistance) is set to all outputs if the display enable pin is set to GND.
I seem to be seeing the exact thing he is describing below, it only works as a sink. Are you saying I should shift out on the opposite value for the clock pin, or latch pin?
Does it have something to do with pin 13 OE?
Is this in the datasheet somewhere? This chip can do both?
From the tutorial
Add 8 LEDs.
In this case you should connect the cathode (short pin) of each LED to a common ground, and the anode (long pin) of each LED to its respective shift register output pin. Using the shift register to supply power like this is called sourcing current. Some shift registers can't source current, they can only do what is called sinking current. If you have one of those it means you will have to flip the direction of the LEDs, putting the anodes directly to power and the cathodes (ground pins) to the shift register outputs.
Ok I just rewired the whole thing from scratch, and it is now working as a source.
This is really cool because it make the chip that much more versatile, but I don't know how I got it to work as a sink. I probably wired something wrong.
Can any of you explain what I did wrong, or how to get this chip to act as a sink?(which is likely what I did wrong)
All chip outputs can source or sink current (excluding open collector outputs that is).
It's just a matter of how you wire things to them. If you put one end of the load to +ve and the other to the input it is sinking current.
If you connect one end of the load to ground and the other to the output you are sourcing current.
It's just that the way some chips are made inside, that some of them can sink a lot more current than they can source but they can all do both.
Just to tidy things up, open collector outputs are designed to be wired together (the only time you wire outputs together) so that if any one pulls low the resulting output is low. This is known as a "wired OR" and requires an external pull up resistor. This arrangement obviously can only sink current.