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. You should check the your specific datasheet if you aren't using a 595 series chip. Don't forget to add a 220-ohm resistor in series to protect the LEDs from being overloaded.
My TPIC6C595 can only be used as drain... and the max source to drain current is 250mA.
The schema above wouldn't work, unless LED are reversed.
[http://www.arduino.cc/en/Tutorial/ShiftOut]
�3 states� refers to the fact that you can set the output pins as either high, low or �high impedance.� Unlike the HIGH and LOW states, you can�t set pins to their high impedance state individually. You can only set the whole chip together. This is a pretty specialized thing to do -- Think of an LED array that might need to be controlled by completely different microcontrollers depending on a specific mode setting built into your project. Neither example takes advantage of this feature and you won�t usually need to worry about getting a chip that has it.
[http://arduino.cc/en/Tutorial/ShiftOut]
0 comments:
Post a Comment