Doing some LED stuff…Seems to me that sinking is needed for common cathode LEDs and sourcing is needed for common anode LEDs? Apparently one has to buy the right driver. Thanks
The way that I think of it is that a Source is the “provider” of the electrical current and the Sink is the end or termination point of the current flow. This Wiki article explains it better: http://en.wikipedia.org/wiki/Current_source. If an I/O pin sources current, it provides the voltage to the LED (for example). The other end of the LED would then be connected to VSS/GND via a resistor (to limit current flow). If an I/O pin acts as a sink, it provides the path to VSS/GND. The LED is connected to a current source (VDD/VCC) via a resistor and the other end of the LED is connected to the I/O pin.
As you reference common cathode/anode LEDs, I presume that you mean LED displays or bar graph:
A common anode display has all the anodes of the segments connected together and each segment’s cathode connects to an I/O pin. The I/O pins in this case act as a current sink. The LED segment is turned on by setting the pin to 0.
A common cathode display has all the cathodes of the segments connected together and each segment’s anode connects to an I/O pin. The I/O pins in this case act as a current source. The LED segment is turned on by setting the pin to 1.
You need the right driver because there is a limit to the current that a single I/O port can provide. Because an LED display has multiple segments, it is easy to exceed the maximum current rating. Also, don’t forget the current limiting resistors on each segment.
Thanks! That clears up a bit. I have common cathode 7-segments. Off to the tutorial