Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 6th November 2009, 09:24 PM   #1
Default Sourcing/Sinking LED current

Something I never really thought about or had to do is Sink LED current.

To light an LED I always connect the (+)anode to the output pin of the µC, and the (-)cathode to ground.
And configure the output pin i am using for the LED as an 'Ouput' and i 'set' the ouput to light the LED, and 'clear' the output to trun it off.

But if i connect the LED the other way...
postive suuply to the (+)anode, and the (-)cathode to the µC (with resistor of course)
I now want to sink current, instead of sourcing it like above.

Im gussing the PORT pin that the LED is connected to should be configured to an INPUT (seen as though i want to sin currect),
So My question is...
what state should the input pin be for the LED to be on, and off.

How do you make the input pin go into 'high impedance' (to trun the LED off) and then, how do you make the input sink current so the LED lights.

The reason for this is using a Common Anode LED 7 segment.
__________________

jakeselectronics is offline  
Old 6th November 2009, 09:46 PM   #2
Default

The pin should be configured as an output and writing a 0 turns on the LED. Writing a 1 turns it off.
colin mac is offline  
Old 6th November 2009, 10:02 PM   #3
Default

thanks colin mac
problem solved
__________________

jakeselectronics is offline  
Reply

Tags
current, led, sourcing or sinking

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
min current needed for sinking current 8051 neo_star 8051/8951 2 16th July 2009 06:10 PM
Sourcing and sinking currents for AT89S51 sam288 Micro Controllers 2 5th April 2009 10:17 PM
555 Sinking Current - How? ParkingLotLust Electronic Projects Design/Ideas/Reviews 15 9th April 2008 03:38 AM
Maximum sinking current.... asp1987 Micro Controllers 3 2nd October 2007 10:28 AM
Sourcing and Sinking DigiTan General Electronics Chat 3 10th May 2004 09:25 AM



All times are GMT. The time now is 06:43 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker