• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » MSP430™ Microcontrollers » MSP430 Ultra-Low Power 16-bit Microcontroller Forum » Driving LED from MSP430 ports
Share
MSP430™ Microcontrollers
  • Forum
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
MSP430 Resources
  • MSP430 Product Folder
  • MSP-EXP430G2 - MSP430 LaunchPad Value Line Development kit
  • MSP430 Getting Started Guide
  • MSP430 Microcontroller Projects
  • More Resources >
  • Forums

    Driving LED from MSP430 ports

    This question is not answered
    Hithesh
    Posted by Hithesh
    on Aug 08 2012 12:37 PM
    Expert2010 points

    I tried to drive an IR LED from MSP430 - anode connected to a port and cathode grounded. It worked, but the brightness wasn't enough. So I connected the cathode of the LED to another port. So, when the port driving the anode was high, the port connected to the cathode was low. I got significantly higher brightness with this circuit. 

    What I am not sure is - when one port is high and other port is low, is the current 2x compared to the first method?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Jeff Tenney
      Posted by Jeff Tenney
      on Aug 08 2012 13:34 PM
      Guru10805 points

      You would have to measure the current to answer your question.  The current demanded by the LED is not linear with the voltage driving it.  And the voltage held by the MSP430 is dependent on the current being drawn (see data sheet for your specific MSP430 model).

      However, I think it is fair to say that two MSP430 pins can provide twice the power (P=IV) of a single pin, up to a limit.  Eventually, though, adding more pins gives diminishing returns as the total current through the MSP430 power distribution approaches limits.

      Your configuration using two MCU pins makes twice the power available to the LED, but we still cannot say the LED is using twice the power because it may have reached a flatter part of its power curve.

      Jeff

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • eltury
      Posted by eltury
      on Aug 08 2012 14:36 PM
      Expert1795 points

      The OP had one pin sourcing and one pin sinking.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jeff Tenney
      Posted by Jeff Tenney
      on Aug 08 2012 15:32 PM
      Guru10805 points

      eltury
      The OP had one pin sourcing and one pin sinking.

      Oh.  That makes his observation of higher LED output pretty strange.

      Hithesh, can you measure the anode and cathode voltages for both configurations?  Can't help but be curious.

      Does your MCU offer "full" drive strength and "reduced" drive strength?  By chance to did you tweak these settings (in the PxDS registers)?

      Jeff

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jason Work
      Posted by Jason Work
      on Aug 08 2012 15:59 PM
      Expert7605 points

      Hithesh

      I tried to drive an IR LED from MSP430 - anode connected to a port and cathode grounded. It worked, but the brightness wasn't enough. So I connected the cathode of the LED to another port. So, when the port driving the anode was high, the port connected to the cathode was low. I got significantly higher brightness with this circuit. 

      What I am not sure is - when one port is high and other port is low, is the current 2x compared to the first method?

      What is the forward voltage for the rated current associated with the desired brightnes for the LED you are using?  If the MSP430 voltage is high enough you may be able to souce the current.  If the MSP430 voltage was not high enough, you would have to sink the current.

      Some insight into LEDs might help.

      LED brightness can vary between batches of LEDs in the manufacturing process.  To account for this, they are binned.  The brightness of the LED should be either be specified in the part number, or by the manufacturer's binning.  If you're using cheaper LEDs, they may have skipped the binning process to save cost in which case you can expect some variation between LEDs even when they each use the same power.

      For any one particular LED, its brightness is roughly proportional to its current.  In approximate terms, doubling the current will double the brightness.  The best way to regulate an LED's brightness is to regulate the current through it.  The cheaper option is to set the current once and pulse width modulate the output above 100 Hz to vary the brightness.

      For each current, the LED has an associated forward voltage.  Since forward voltage is not proportional to brightness using the voltage to regulate the brightness is not recommended.  However if you limit the voltage to set the current at just one point, you can get away with this inexpensive solution if you also pulse width modulate.  The tradeoff for this cheap approach is the voltage for the same brightness might change from one LED to another (due to poor binning, or different LED colours).  To compensate the current limitng resistor from your voltage souce might need to be deterimned on a LED by LED basis, or you could just live with the variation and set one resistor for all. 

      You will also need to consider how much the MSP430 you are using can source and sink on each pin.  Find, "Typical Characteristics, Outputs," in the data sheet and the graphs should have the data you're looking for.  Consider the forward voltage of the LED's compared to the MSP430 Vcc when looking at the design.  Referring to the MSP430-LED8x8-BOOSTERPACK may also be helpful.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on Aug 09 2012 10:27 AM
      Guru140650 points

      Hithesh
      . So, when the port driving the anode was high, the port connected to the cathode was low. I got significantly higher brightness with this circuit. 

      This is really strange. The current should be less because the current causes twice the voltage drop, once on the sourcing pin and once on the sinking pin.
      The current is definitely not twice of that of a single pin with fixed ground. But it exposes the MSP to twice the power loss.

      What might have happened is that you were over-driving the LED. Depending on diode material, this may lead to a shift in the color and also a reduced brightness. And increased temperature :). So more current is less good above a certain threshold.

      The method of two complementary pins is only useful for two applications: first, if multiplexing segments. For a dual multiplex, you can mount the diodes of batch 1 with anode to the common pin and for batch two with the cathode. So when setting the common pin to low, the separate pins control batch one, else batch two. (can be expanded to 3 or four batches, but then each batch with its own common pin).
      The other one is to enlarge the voltage swing. If you mount a speaker between two port pins, you can source it with +-VCC instead of just GND/VCC. Especially on piezo speakers this gives a significantly louder output.

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andy Neil
      Posted by Andy Neil
      on Aug 09 2012 14:13 PM
      Guru31995 points

      Jens-Michael Gross
      The other one is to enlarge the voltage hub.

      can't say I've ever heard "hub" used in that context before?

      I think the more conventional term is, "voltage swing"?

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on Aug 10 2012 05:33 AM
      Guru140650 points

      Andy Neil
      I think the more conventional term is, "voltage swing"

      Right. A false friend. 'Hub' is the proper German word. (derived from 'heben' which means 'lifting')

      I changed it in my original post.

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Tony Philipsson
      Posted by Tony Philipsson
      on Aug 10 2012 16:38 PM
      Intellectual760 points

      You should not drive a LED directly with a msp430 pin, they are only rated 4mA

      I do drive a IR_Led with a 1k resistor directly
      and I use the pin to sink it to turn it on as N-channel normally are more efficient.
      To turn it off I simple turn it back to input.

      bic.b   #1<<3,&P2OUT           ; P2.3 Ir-LED   if set as output = sink
      bic.b   #1<<3,&P2DIR            ; P2.3 Ir-LED input = off  
      bis.b   #1<<3,&P2DIR            ; P2.3 Ir-LED output = on

      For high brightness LED application, use a small signal mosfet to turn it on.

       

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on Aug 13 2012 11:05 AM
      Guru140650 points

      Tony Philipsson
      You should not drive a LED directly with a msp430 pin, they are only rated 4mA

      Depends on the MSP and the allowed voltage drop.

      MSP pins are CMOS drivers. The higher the current, the higher the voltage drop. The rated current is for a specified voltage drop. If driving an LED, the voltage drop may be significantly higher. Effectively an equilibrium of diode forwared voltage and port pin voltage drop at a certain current. The resulting current is where diode forward voltage + port pin voltage drop == VCC.

      For a diode with 1.7V forward voltage and VCC=3V, this may be at a current as high as 30mA. (well at some point the maximum power dissipation of the MSP needs to be checked too)

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hithesh
      Posted by Hithesh
      on Aug 15 2012 03:40 AM
      Expert2010 points

      Update: I took a 13 ohm resistor, connected between port 1.2 and port 1.5 (MSP430F2013)

      P1.2 was driven high, P1.5 was low.

      The current was around 45mA. When I connected the resistor between port1.2 and ground, the current was around 60mA

      I guess connecting an LED between 2 ports wouldn't increase the current compared to connecting to port and ground.

      Can anyone care to double check this?

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on Aug 15 2012 07:46 AM
      Guru140650 points

      Hithesh
      I guess connecting an LED between 2 ports wouldn't increase the current compared to connecting to port and ground.

      As I already said, using two port pins only increases the voltage drop by the drop on the second port pin. More voltage drop on the pins means less voltage on the resistor, which means less current through the resistor, which means less voltage drop on the port pins which means more voltage on the resistor which means more current on the resistor...
      The equilibrium seems to be at 45mA through the resistor = 0.585V voltage for two port pins and 60mA = 0.78 for only one.

      Assuming VCC=3V, it means that you have 2.22V drop on one port pin for 60mA. Producing 133mW heat on the port pin. Two pins produce a voltage drop of 2.42V for 45mA which means only 1.21V drop per pin but also 54mW heat per pin (=108mW total). Both far above the specs and risking a burnout.

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Avi Chami1
      Posted by Avi Chami1
      on Aug 15 2012 08:09 AM
      Mastermind7405 points

      If you want to achieve high currents, the best way is to put the microcontroller out of the loop. Drive a bipolar or FET transistor with the MSP, and achieve whatever current you need on the LED (of course within the limits needed to, for example, saturate the bipolar transistor driver. If more current is needed, you can cascade transistors).

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on Aug 15 2012 14:31 PM
      Guru140650 points

      I always suggest the ULN2003. It contains 7 transistors wich can be directly driven by MSP output. THe transistors sink anly source to a common GND and contain free-running diodes. Maximum current per Transistor is IIRC ~500mA, with a total limit for all 7 together. The chip is cheap and small (SOIC16) and reliable. I use it to drive relay, LED, whatever.

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use