0
\$\begingroup\$

I am currently designing a circuit with a MSP430 MCU supposed to blink a LED (5mm round green). The circuit is a powered by a CR2 cell which the voltage will vary between 3V and 2V.

Assuming that I would choose the proper value of the limiting resistor between my GPIO and my LED, I am currently wondering if I can connect a 5mm led with a If=20mA and a Vf = 2V directly to my GPIO (with resistor of course) or if I absolutely need to use a transistor in between?

I suppose the MSP 430 will not be able to supply 20mA from its GPIO port?

\$\endgroup\$
9
  • \$\begingroup\$ What does the uC datasheet say about it? \$\endgroup\$ – The Photon Aug 13 '16 at 5:46
  • \$\begingroup\$ At 3V, an MSP430G2xxx part (I've no idea what the OP is using) is tested (they don't spec it) to drop no more than 600mV when supplying 6mA (100 ohms.) It typically does about 60 ohms from my experience. But that's at Vcc=3V. It's a little worse at 2.2V, perhaps 30% worse. The pins will actually handle 20mA (at a drop of almost 1.5V.) I can't speak for what is happening to the interconnects in the die, though. Metal migration, probably. I've no idea if they make them wide enough for 20mA, continuous. \$\endgroup\$ – jonk Aug 13 '16 at 5:54
  • 2
    \$\begingroup\$ You don't really need 20mA to light a led. Modern leds do just fine with 2-5 mA. \$\endgroup\$ – Mike Aug 13 '16 at 5:56
  • \$\begingroup\$ @Mike , ok this is what I was wondering and was unclear about. So normally a GPIO should be able to supply this \$\endgroup\$ – chris Aug 13 '16 at 5:57
  • 1
    \$\begingroup\$ @chris: then sure. I've temporary tested 20mA LEDs on a GPIO of an MSP430. I was running at 3.6V rail at the time, though. But I probably wouldn't design them to use more than 10-12mA in anything I gave anyone else. \$\endgroup\$ – jonk Aug 13 '16 at 6:00
4
\$\begingroup\$

Yes, it will work just fine. Keep on mind as you source or sink current, the output will drop or rise (respectfully). On page 18 the stated drop at 6 mA should only be VCC - 0.3V. On Page 19, they have graphs that show the voltage drop based on VCC at 2? 2V and 3V. At 3V it should only see 0.5V drop at 20 mA. At 2.2V it will be 0.75 to 1 V. Your actual specs will vary.

In practice, all this means is that the brightness will vary as the battery gets drained. Aim for 10 mA @ 2.5V for a good comprise.

And I have powered a LED in this set up without issue.

\$\endgroup\$
4
\$\begingroup\$

Under some assumptions, this will work well:

  • You don't care about a precise LED current and brightness.
  • This is a one-off project.

You need to look at this graph from the datasheet:

enter image description here

There is a corresponding graph for a VCC of 3 V as well.

Naïvely, you will take a quick look, see that it can source 20 mA, and leave it there. Note however that the output voltage drops to a volt or less. What that means is that your LED won't ever draw 20 mA from this port. As long as the LED will try to draw more current, the voltage will drop, until there is a balance between LED current and LED voltage.

All this means that it's almost impossible to select a good "dropper" resistor. Especially considering you plan to run it from 2 V to 3 V. At 2 volts, you really don't have any headroom.

If I were you, I would take advantage of the table on page 18 - Outputs - Ports Px.

PARAMETER TEST CONDITIONS VCC TYP UNIT
VOH (High-level output voltage) I(OHmax) = -6 mA 3 V VCC - 0.3 V
VOL (Low-level output voltage) I(OLmax) = 6 mA 3 V VSS + 0.3 V

Assume a LED current of 6 mA, assume that the voltage on the pin will drop 0.3 volts, then calculate a resistor value from there.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.