PICs with pins that have Direct LED Drive.

Status
Not open for further replies.

Hippogriff

Member
I know as well as anyone that it is considered best practice to have a resistor coupled with an LED so that it doesn't die on you. However, when doing simple debugging things on my breadboard I have never used a resistor when using an LED with my PIC projects, when that LED is connected directly to a PIC's output pin. I have also not - yet - had one blow on me.

I was reading through some PIC datasheets and I noticed that some (not all) have this thing called "direct LED drive (the 12F683 does, but not the 16F1825) and that sounded cool.

Is that what allows me to get away with this? I've driven LEDs directly from PIC pins on PICs that don't list this feature in their datasheet, i.e. 16F676 and 16F684, and have not - yet - fallen foul of dying LEDs, but maybe I've just got lucky.

Also, maybe it's down to the LEDs I've been using, usually I pick up a blue one, but I have orange and red and green.

Maybe "direct LED drive" is something that is inbuilt to all PICs these days and they just don't mention it in the datasheet?
 
Hi,

If you run the PIC at 5v and the LED has a forward drop of 3.5v (like the blue ones) then the PIC only has to drop around 1.5v and at 25ma that's about 40mw the PIC has to dissipate in the area of that pins internal MOS transistor.
 
Cool, but does a PIC with the "direct LED drive" feature imply I don't even have to worry about it all, or am I misreading that?
 
Cool, but does a PIC with the "direct LED drive" feature imply I don't even have to worry about it all, or am I misreading that?

hi,
I would recommend that you work within the specifications shown in the datasheet.

Note: the maximum PORT source current and the max current for the Vdd and Vss power pins.

The notice at the bottom of the specification warns of the possible problems.

For the minor expense of a 0.01pence resistor I would not make a direct pin connection with an LED
 

Attachments

  • AAesp04.gif
    39.9 KB · Views: 223
The question is not about any expense implications; it is really much more about me understanding the features that have been intentionally included in the microcontroller and how I can take advantage of them. If I'm reading the below (from the 12F683 datasheet) correctly, of course...

**broken link removed**

...which I may not be, of course.
 
Last edited:
"High current source/sink for direct LED drive" just means you dont need an external transister, but you still need a resister.
 
Ah, thanks, well that clarifies things for me... I guess. So - in the past - it looks like I've just been lucky. I think the description still sounds like what I thought it was, but I'm still a newbie.
 
Hi Hippo,

Your source of confusion lies in the interpretation of the phrase "direct drive". Depending on the forum or context 'direct drive' may mean several things. In the flashlight world, 'direct drive' means to drive an LED without any resistor, but in the context of the PIC pin 'direct drive' means no other active drive needs to be added and it should be understood that it is best to use a resistor when powering an LED or other device that has no intrinsic current limit of its own.

To show how strange it can get without a resistor, ask yourself how much current is flowing in or out of the pin through the LED with no resistor. It's very difficult to calculate that and it could vary from chip to chip. The max current is specified in the data sheet, but without a resistor you cant figure out if it's more than the spec or less than the spec. With a resistor it's easy.
 
Last edited:
I must admit, that terminology used by microchip is a bit dodgy - more of a marketing ploy than 'good tech'. Sure, many 8-bit micro's will control an LED or two, and its nice that it's I/O's can supply more than the 3/4mA of the older generation uC's, but they really should drop the 'direct drive' phrase, leaving only the 'high current'. I've always used a resistor of anywhere from 220, to 1k, in testing just so the LED lights up. Don't really care for brightness level until the final design. But I vaguely remember years ago when I started out with PIC's just why they suddenly brought in 'direct drive' into their datasheets, when the 'ol F84 could source/sink a similar amount of current.

To Micrchip: Frankly if someone is reading the datasheet for that chip, I'm sure they have a basic understanding of current requirements for LED without having to bring in ambiguous phrases. Add the output impedance of pins to the 'IO ports' section, and thats it.

rank over.
 
I never heard of "Direct LED Drive".

I believe that a PIC uses High Speed Cmos (74HCxxxx) transistors. A spec sheet for High Speed Cmos shows that the output current into a dead short is typically 45mA (when the IC is cool) but could be as low as 27mA or only 21mA when the IC is hot.

Into a 3.5V blue LED the current is typically 30mA which is higher than the 25mA max continuous output current rating.
Into a 2.0V red LED the current is typically 42mA which will probably blow up the PIC and the LED.
 

Hi audioguru,

"Direct LED drive" is a common phrase among flashlight circuit aficionados to describe an LED driven directly from a battery or other source without a dropping resistor. Since I too am somewhat fond of the LED lights i came to understand this quite a long time ago when white LED's where just starting to become popular. I never drive my LEDs this way but with certain combinations of battery type and LED type it becomes possible.
You'll find many of those small key chain LED lights driven using this method.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…