Direct LED drive capability in the HC908JL3

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Direct LED drive capability in the HC908JL3

2,476 次查看
bespenschied
Contributor III
I am trying to find out exactly what it means in the documentation when it states that the port pins have Direct LED drive capability. I tried a few searches on this site but found no explaination of what this means. I have been using port pins to drive LED's with for years and didn't realize there were special pins for this. Does this mean I don't need any current limiting resistor in series with the LED? or does it mean the pin can handle the current needed to drive the LED? If so then Have I been overdriving port pins by using them to drive LED's with? Just curious.....
 
Brian
 
 
标签 (1)
0 项奖励
回复
2 回复数

687 次查看
bigmac
Specialist III

Hello Brian,

Further to Rocco's comments, a pin that has "direct LED drive" capability is capable of directly sourcing and/or sinking the required LED current (usually 10-15 mA) without an intervening buffer transistor.  A series current limiting resistor would usually be fitted. 

However, for the 908JL3 device, it appears that some of the PTA and PTD outputs have been specified without external current limiting (current sink only), but this will result in up to 3:1 unit-to-unit variation in LED current, which may be unacceptable.  The inclusion of an external resistor would reduce this variation, but with a reduction in LED current.  I notice that the data sheet specifies 2.0 volts across the LED for 5 volt supply rail, but only 1.2 volts for 3 volt supply, resulting in lower LED current in practice for typical LEDs.

PTD6 and PTD7 are capable of more sinking more current, and an external resistor must be fitted.  Using these outputs with a 3.3 volt supply, white and blue LEDs would be problematic, but other colours should be OK, provided the supply is regulated (and not sourced directly from a single lithium cell).

Port pins without this capability used for LEDs will not be over-driven, but will simply restrict the LED current to a lower value, perhaps requiring a more efficient LED.  Note that the source current capability is often much less than the sink current capability (908JL3 included), dictating the type of LED connection used.  However, because of wide unit-to-unit variation in the output charactistics, a series resistor is still recommended.

A CMOS output can be viewed as a resistance in series with the relevant supply rail, where the resistance value will be dependent on supply voltage, but there is no saturation voltage threshold (as there would be with a bi-polar transistor).  For a LED drive output pin, the resistance value will be lower than for other types of output.  Doing a rough calculation for the 908JL3 pins gives an 'on' resistance 120-300 ohms at 5 volts, and 150-450 ohms at 3 volts, for the LED capable pins.  For PTD6 and PTD7 the resistance would be less than 20 ohms at 5 volts.

Many of the data sheets (but unfortunately not the 908JL3 data sheet) show typical current source and current sink output characteristics as a voltage-current graph, where the behaviour would be more apparent.  When the graph is available, it is possible to plot a "load line" to get a better idea of LED current.  For a current sink connection subtract the nominal LED voltage from the supply voltage, and mark this value on the voltage axis.  Then from this point, project a straight line back towards the current axis until it intersects the output graph - the slope of the line should equal the value of the external current limiting resistor. The intersection point will give the typical current through the LED.

Regards,
Mac

0 项奖励
回复

687 次查看
rocco
Senior Contributor II

bespenschied wrote:
I am trying to find out exactly what it means in the documentation when it states that the port pins have Direct LED drive capability. . . I have been using port pins to drive LED's with for years . . .
Hi, Brian:

You and I both.
I would bet that most of your designs that use LEDs in this fashion run on 5 volts. Here is my understanding, though I may not understand it fully:

All of the port pins can sink/source an absolute maximum of +/-25 milliamp. I usually use a 2-pin red/green LED hooked across 2 I/O pins, with a 180 ohm series resistor, and have never had a problem at 5 volts.

But if you look at the spec of the GP32, the "Output low voltage" and "Output high voltage" are 1.5 volts from their respective rails when you draw 10 milliamp (the JL3 doesn't even spec a 10 milliamp draw). That doesn't leave much margin if the LED forward-bias voltage is 2 volts or more. With a 3 volt supply, it simply doesn't work. Actually, it works dimly or flickers, as the port pin supplies just enough current to match the LED's forward-bias voltage.

The new "LED drive" special outputs have open-collector transistors to be able to sink 25 milliamp, without the "Output low voltage" going above .5 volts (still leaving 2.5 volts for the LED forward bias in a 3 volt system).
0 项奖励
回复