# Driving LED with FPGA

Considering that FPGA can be programmed with various drive current, can we rely solely on this for limiting current through an LED diode attached to the pin of the FPGA, without using series resistors? Or to broaden the question, what is the mechanism for controlling drive current within FPGA? I am talking about signal LED diodes, commonly used for indication.

• What does the datasheet tell you about the guaranteed maximum/minimum output current at the LED Vf out? What does the LED datasheet tell you about the maximum current? Are they compatible without a resistor? Hint: if a parameter isn't guaranteed you should be reluctant to rely upon it. Output current can be roughly controlled by the dimensions of the particular MOSFET or MOSFETs carrying the current. – Spehro Pefhany Mar 11 '18 at 19:17
• @SpehroPefhany Well the problem is more related to the characteristic of the output pin of the FPGA than the LED diodes. You can specify the drive current in FPGA but my question is, can one rely on this for driving the load. When you do this, depending on how the fpga limits current internally, this can considerably increase dissipation within FPGA. – ercegovac Mar 11 '18 at 19:22
• WHat is your design spec for current, Voltage, power in FPGA and LED? – Tony Stewart Sunnyskyguy EE75 Mar 11 '18 at 19:31
• You can drive a car with your knees, not using your hands. It is just bad practice. Same here. An SMD resistor costs ~$0.001. Why should you leave it out! If you spend two hours on this @$30/hour, that is equivalent of 60.000 resistors. Thus it is also bad economics. – Oldfart Mar 11 '18 at 19:35
• This question is more curiosity than the real problem. The board is already designed with resistors in place. And spending years in company working a job that makes you feel miserable and compensating that with an overpriced SUV car is bad economics as well. But you see it people doing all around. The point being, you cannot put a price on some things and curiosity is one of them. – ercegovac Mar 11 '18 at 19:48

It would be a very bad idea to do this in a product where reliability was of any importance, particularly if more than a few I/Os were being abused in this way. Even if the actual current is not high enough to shorten the life of the LED you may shorten the life of FPGA

Read up on electromigration failures, and read the fine print on maximum current per I/O bank GND/Vcc and such like.

Tolerances for things like current (MOSFET Idss in this case) can be very broad in semiconductor processing. An "8mA" (for the purposes of briefly charging/discharging stray capacitance) might be 16mA or 24mA. There is not a precision current source/sink in there, it's just a MOSFET.

• So basically, setting the drive current is only meant to be used as a mean to limit the transient current, and not in steady state? – ercegovac Mar 11 '18 at 22:37
• Yes, if you don't need fast rise and fall times then there is no point slamming it from rail to rail as fast as possible, it just adds to EMI. – Spehro Pefhany Mar 11 '18 at 23:12

You don't specify an FPGA, but looking at datasheets for a couple of common ones, I see min VOH specs and max VOL specs only. In other words, the datasheets specify that the resistance of the transistor will be under a certain value. They do not guarantee that the resistance will be over any particular value, so do not assume it.

• This has nothing to do with those specifications. Those are guaranteed VOL/VOH. The question was, how does FPGA implement current limiting on the pin and can one rely on that for static load driving (such LED driving). – ercegovac Mar 12 '18 at 10:58

FPGA current strength setting allows you to chose the minimum current that the output pin should be able to deliver while respecting the $$\V_{OH}\$$ / $$\V_{OL}\$$ levels and the slew rate specifications. This setting doesn't specify the maximum/typical current a pin can deliver, which will be substantially higher. Even a pin which happens to deliver the minimum allowed current will exceed the minimum current setting when connected to a low-impedance load, instead violating the above-mentioned signal specsifications.

Connecting a LED directly to an FPGA pin will almost certainly violate the $$\V_{OH}\$$ / $$\V_{OL}\$$ levels, at which point all bets about the current value will be off.