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.
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. 8)
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:
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?
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?
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.
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?
cool, thanks, the diagram makes it easy to understand:
DOC Circuit Description
Figure 6 shows a simplified output stage of a typical logic circuit. When the input is low, the n-channel transistor (Qn) turns off and the p-channel transistor (Qp) turns on and begins to conduct, and the output voltage VO is pulled high. Conversely, when the input is high, Qp turns off, Qn begins to conduct, and VO is pulled low. This action is similar to an inverter, and several of these inverting stages typically are cascaded in series to form a buffer/driver.