This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Driving LEDs from an MSP430 (chip/port pin current limits)

Other Parts Discussed in Thread: TCA6507

I'm using a LaunchPad v1.4 with a 'G2231 to prototype a battery-powered application which will involve turning various combinations of LEDs on and off.  There appear to be four overlapping design concerns:

  1. How bright can I make a given LED? (max port pin current)
  2. How many LEDs can be fired at once without losing brightness? (max MSP430 chip current)
  3. During debugging, it's inevitable that on some occasions I will halt the MSP430 with one or more LEDs lit.  How can I keep them from "smoking" when this occurs? <grin>
  4. How can I minimize my power drain? I hope to use solar power at some point.

Here are links to previous discussions of port pin and chip current in the E2E MSP430 forum:

    How much current can an MSP430 I/O port pin source or sink ?
    http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/94929.aspx#330731

    Output max current
    http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/111157.aspx#393701

    Current sourcing with multiple pins
   http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/119244.aspx#424405

And here are some LED specs:

  Kingbright APTL3216CGCK (green, 3x2mm. Don't sneeze near them!):

  • Vf = 2.1V (typical) / 2.5V (max)
  • If.max = 30mA
  • If.peak = 150mA (@ 10% duty, 0.1sec max pulse width)

Some additional points:

  • If I "pulse" the LEDs with Timer_A or the WDT, it will help with items (1), (2), and (4).
  • Omitting the usual LED current-limiting resistors will help with (1), will affect (2), and makes (3) a serious concern.
  • Adding "outboard" transistors would help me avoid many of my concerns, but would also increase the parts count.  At least initially, I'd like to avoid this.

Assuming its running at 3.0V/25degC, Figure 9 from the 'G2231 datasheet shows what happens as a load sucks more and more current from a (sourced) port pin: the drive voltage drops. (It helps if you mentally flip this graph right-to-left).

In other words, in a worst-case scenario, for a single pin (using Vf=2.5V), the port pin HIGH voltage will drop too low to light the LED when current drain exceeds about 15mA. This leads me to ask:

Q1: Can I expect "better" results from a single pin (more current at the same voltage) if I'm sending short pulses through it? And, of course, how short does "short" have to be in order to get what kind of results?

Q2: When pulsing a port pin or pins, how much port pin current can I provide (source) from multiple pins before the overall chip limit of 48mA comes in to play? For example, three port pins each providing 15mA to an LED leaves... 3mA(!) for the processor.  This sounds like a tight margin, perhaps indicating that I should never have more than two LEDs lit at the same time. Are my calculations (roughly) correct?

Q3: If, in an effort to improve light levels at the cost of power, I connect my LEDs directly to the port pins -- that is, sans resistors -- and my debugger stops with (say) only P1.1 HIGH and an LED connected, what happens? Does the LED with (say) Vf=2.1V go out as its current drain pulls the HIGH voltage down? Does it oscillate (probably at a high rate of speed)? Or what?

Q4: Given my goals, is there anything else I'm overlooking? <grin!>

My thanks for any advice you can offer.

Frank McKenney

--
  A complex system that works is invariably found to have evolved
  from a simple system that worked ...A complex system designed from
  scratch never works and cannot be patched up to make it work.  You
  have to start over, beginning with a working simple system.
                             -- Grady Booch

  •  Complex post with no clean stated what you need you wish to do or need...

     How many led?

     Amount of real average current

     Duty cycle

     Multiplex level.

     Regards

     

  • You can do some triangulation. grab your geometry tools :)

    The MSP output port has a roughly linear relation between output voltage and output current.
    On a current of 0mA, the port has VCC as output voltage. And the datasheet tells you the output drop (voltage reduction) on certain currents. This Draw a line through these two points and you roughly know the output voltage on any current.

    Now try the same with the LED. On voltage x, it draws current y. Where the two lines cross is the 'working point' when you connect the LED directly to the MSP output. If this point is outsid ethe LEDs or MSPs spec, you can use a resistor to alter the port output voltage (by the additional voltage drop cause by the resistor at a given current) and 'recalculate' the crossing point.

    In other words: if you directly connect the LED to the port pin, the resulting stable (non-oscillating) point is when current caused by the voltage on the LED is the same that causes exactly this output voltage on the port pin. There are no regulation loops or other things that could cause oscillation. Just a field effect transistor and a diode.

    Of course it is possible that the resulting current is so low that the LED doesn't shine brightly enough. Then there's nothing you can do except using an external amplifier (transistor). Or the current is too high for either the LED ot the MSP. Then you'll need the said resistor. In most cases neither is necessary.

  • Jens-Michael Gross said:
    On a current of 0mA, the port has VCC as output voltage. And the datasheet tells you the output drop (voltage reduction) on certain currents. This Draw a line through these two points and you roughly know the output voltage on any current.

     Hi Jens, this can be true on zero thermal resistance, on real mosfet they appear to burn when excessive power is generated at junction...

     At middle voltage @40mA MSP mos has to dissipate (1.8*40)mW so every pin driver generate about 72mW of heat, two or 3 pin and MSP can burn out.

      Output desaturate near 40mA, @ that current VDS voltage approach 1V and RDSon can be 25 Ohm, for more than 1V of VDS the output mosfet drive load @constant current (30-40mA), MSP become hot in a short time.

     25 Ohm RdsOn are too much to drive just a single LED so a better Mos is needed. An sot23 with rdson under 40mOhm cost few cent driving a lot of led @ higher current and also from higher voltage than VCC of MSP.

     To overcome debug trouble a resistor can be paralleled to source gate then gate driven with a capacitive coupling. When drive is PWMed then capacitor has no voltage or small one, when PWM stop capacitor charge to VCC leaving the gate without drive after few RC constants. When PWM restart, capacitor discharge again and drive reappear after few cycles but twice the time to remove drive.

     Regards

  • Jens-Michael Gross said:

    You can do some triangulation. grab your geometry tools :) ...

    Jens-Michael,

    Thank you for the reply.

    I'll look over the datasheets and post a mode detailed response.


    Frank
  • Roberto,

    Thank you for your responses.

    Roberto Romano said:
    At middle voltage @40mA MSP mos has to dissipate (1.8*40)mW so every pin driver generate about 72mW of heat, two or 3 pin and MSP can burn out.

    ( I assume you mean that if 2 or 3 MSP430 pins are "loaded" to the point that they fall to Vcc/2... )

    I definitely think I'd like to avoid that. <grin!>

    Roberto Romano said:
    Output desaturate near 40mA, @ that current VDS voltage approach 1V and RDSon can be 25 Ohm, for more than 1V of VDS the output mosfet drive load @constant current (30-40mA), MSP become hot in a short time.
    25 Ohm RdsOn are too much to drive just a single LED so a better Mos is needed. An sot23 with rdson under 40mOhm cost few cent driving a lot of led @ higher current and also from higher voltage than VCC of MSP.

    Hm. I need to think this part over a bit to make sure I inderstand. The constraints, I mean, not the "hot" part. <grin!>

    Roberto Romano said:
    To overcome debug trouble a resistor can be paralleled to source gate then gate driven with a capacitive coupling. When drive is PWMed then capacitor has no voltage or small one, when PWM stop capacitor charge to VCC leaving the gate without drive after few RC constants. When PWM restart, capacitor discharge again and drive reappear after few cycles but twice the time to remove drive.

    This sounds good, but I'm having trouble picturing how the components connect from your description. The best I could come up with wat something like this:

      P1.x: o--+--| |------>|---+
               |   C      LED   |
               \                |
             R /                |
               \                |
               /                |
               |                |
      Gnd:  o--+----------------+

    Is that what you had in mind?

    Frank

  • Roberto Romano said:
    on real mosfet they appear to burn when excessive power is generated at junction...

    That's what I was addressign with my last sentences. However, the 'curve' you get with two known points shows you where you are. You can gray-out the area where the power on the MSP is too much (P = Iout*(Vcc-Vout)< Pmax)

  • Frank McKenney said:

    Output desaturate near 40mA, @ that current VDS voltage approach 1V and RDSon can be 25 Ohm, for more than 1V of VDS the output mosfet drive load @constant current (30-40mA), MSP become hot in a short time.
    25 Ohm RdsOn are too much to drive just a single LED so a better Mos is needed. An sot23 with rdson under 40mOhm cost few cent driving a lot of led @ higher current and also from higher voltage than VCC of MSP.

    Hm. I need to think this part over a bit to make sure I inderstand. The constraints, I mean, not the "hot" part. <grin!>

    [/quote]

     Hi Frank, from zero current and zero Vds to 40 mA and the Vds voltage approaching 1V MSP mosfet are in the resistive area, so Vds=RdsOn*Ids.

     Over that threshold resistive area leave place to saturation zone where channel cannot grow over, current is near constant from 30 to 40mA and voltage vary from external load. Tis area has higher internal resistance, infinite if pure current generator. In this area current is the max pin current and voltage imposed by external load so a red LED with 1.8V direct biasing fix this voltage and current too. @ this quiescient workpoint power dissipation is half on led and half on MSP, msp cannot be loaded from more than 2 or 43 pin load at these worst condition.

     SO if you apply two led MSP case become very hot.

     About led I was thinking a dynamic drive of mosfet that it remove itself when pin stuck at 1. You can also do Capacitive isolation, but C2 require to be in the range of tens or hundred of uF.

     Regards

  • Hi,

    TI has a nice Low-Voltage 7-Bit I2C and SMBus LED Driver With Intensity Control and Shutdown - the TCA6507 (http://www.ti.com/product/tca6507). The device is ideal for 'fun light' applications.

    The device gives you seven LED Driver Outputs (On, Off, Blinking, Fading at Programmable Rates). Its Open-Drain outputs directly drive LEDs up to 40 mA max (per output at up to 6.5V max.).
    So it's propably more easy to use in intergarted device than building a discrete driver stage for each LED.

    aBUGSworstnightmare

**Attention** This is a public forum