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.

TM4C123GXL: How much current can a digital output pin source?

Other Parts Discussed in Thread: EK-TM4C123GXL

Name says it all. I'm trying to light some LEDs by turning on digital outputs and I'm just trying to double check how much current I can push through my LEDs. I want to get them as bright as possible without damaging my pins. Thanks!

  • Hello Zero_PD

    The digital IO spec only mentions the minimum current sourced. It can be more than that if the sink does require it but may lead to damage to the pin.

    Rather, I would suggest using the IO pin to control a transistor or FET which will work as a switch and limit the current using a series resistance between supply and collector. Example given in the EK-TM4C123GXL LaunchPad Schematic.

    Regards
    Amit
  • Hi Amar - yes, a nice mosfet/bjt high side or low side drive would definitely be the ideal solution to a nice bright LED. Unfortunately I have a big show tomorrow and space inside a wearable device I'm designing forces me to go with this option for now. If I redesign it in the future, I definitely would.

    I finally found Table 24-1 in the datasheet, which says that the absolute max rating of output for a pin is 25ma. So I'll go with 15-18 to stay safely below that?
  • Hello Zero_PD,

    Note that it also states that the Device is not guaranteed to operate properly at maximum settings and also what comes in is the per side current maximum that is given in Table 24-7

    Regards
    Amit
  • With high brightness LEDs you can probably drop that current quite a bit. A few mA is quite bright on them.

    Also check the per port and per side limits.

    Robert

    Drive as low as you can get away with.
  • The future is (indeed) already here for your project - and as Amit & Robert advise - your MCU does require that it be (evenly) distributed.

    May I propose a simple, hex inverter IC - may be "off the shelf" @ Radio Shack (some remain open) or local school or small biz. That IC will enable you to meet your desire to "distribute unevenly" - without harming your MCU.

    Inverter is the simplest , fewest component means for you to drive up to 6 Leds @ "reasonable" brightness w/out stressing your MCU.   MCU should never/ever be employed as, "Beast of Burden!"    (that was never its intent...)

  • Hello cb1,

    But the poster seeks a wearable demonstration tomorrow.

    Regards
    Amit
  • Amit Ashara said:
    But the poster seeks a wearable demonstration tomorrow.   

    Yet he (repeatedly) proclaims tomorrow's (already) here!   (which is as nonsensical as is, "affordable care")

    Wiring up FETs has to be more labor intensive than a 14 pin hex inverter.   Each/every FET must have (either) a tie to Gnd or Vcc - the IC requires a single connection - to both.   As (of course) you know - ICs were developed as they far surpass discrete components in the areas of size & insertion number & labor...

    Waiting so long to "ask this question" is the "real" issue here - and the intrusion of science-less fiction is a prime suspect in poster's plight...

  • CB1, your posts are always as incomprehensible as they are informative. It's a fascinating juxtaposition :)

    I will certainly keep hex inverters in mind in the future. For now, I can happily make do with less bright LEDs!
  • Indeed for largish numbers of LEDs a buffer or an inverter uses the least components (I use a shift register on the spi bus for the same purpose which also saves pins), however sot23 n-FETs can actually take less spare for greater drive by fitting in areas that so packages won't especially.

    On my current shift register I think we are driving 2ma per LED and I don't think we would want them any brighter. Older LEDs do take up to20 ma for full brightness but some of the high brightness ones need considerably less. Of course if they need to be seen in full daylight…

    Robert

    Bah, can't edit here. Spare above should be space
  • Might you identify even slight "incomprehensibility" in the identification of a hex inverter as your easiest, fastest and most appropriate Led driver?

    Robert's suggestion of shift register provides more efficient GPIO generation - but demands a software expertise you may not (yet) have developed...

    The (real) comprehension hurdle is your promotion of  "empty" quotes which (likely) detract from your time/effort in expanding your (reality based) skills... 

  • Hello cb1

    Not really. shift register with simple CLK, D, and RST would do the job as well.

    Regards
    Amit
  • Amit Ashara said:
    Not really. shift register with simple CLK, D, and RST would do the job as well.

    Amit - may I ask what's, "Not really?"   I mentioned (both) hex inverter & shift register.   I can justify the hex inverter as "fastest/easiest" as it (uniquely) enjoys a direct, 1:1 correspondence, between GPIO and Led.  

    Shift Registers must manage the (more complex) indirect relationship between data and shift clocks - AND unless a more complex shifter is employed (i.e. 595) "illegal data" will pass thru the shifter!   (as it must "propagate" from bit to bit - there is no such propagation via the hex inverter)

    I stand with the hex inverter as fastest & easiest method to provide boosted current w/out stressing the MCU.   (Really!)

  • Hello cb1,

    The shift register is going to operate at high frequency e.g. 1MHz using GPIO toggles. Now if 16 bits are being shifted then the effective toggle rate of the IO would be 1us*16 shifts. Assuming that only 1 bit is being changed from 0 to 1, then the bit shift will be over in ~16us that the human eye cannot resolve.

    I don't contradict your point of hex being fastest and easiest, but it would be 1:1 IO usage, while for supporting multiple LED's with minimum IOs a GPIO shift register would be good as well.

    Regards
    Amit
  • Amit, why use bit toggling to do the task spi was designed to do?

    Robert
  • Mes Amis,

    Really - we all agree!   SPI clocking of a shift-register is optimum - but perhaps NOT for this rushed, sci-fi gulping poster.

    He's managed his time such that his project (the future) is here (NOW) and his grasp of the more complex serial to parallel is uncertain.  And demonstrably - unquoted!

    For quick/dirty/ease of use - no contest - Hex Inverter is #1!    For on-going, properly prepared/knowledgeable posters - best GPIO expanding, LED driving, results from shift register clocked via SPI.

    Really!

  • Hello Robert

    Some time back i was using one of such a device for PS80 interface. If I can get the device part number, I would publish the same,

    Regards
    Amit
  • CB1, my project was not rushed. I have spent a great deal of time on every step of it. There will usually be things that are functional yet suboptimal, unless you've infinite time to perfect every detail of a project. I am a Stanford University graduate student, and infinite time is not something I have.

    Thanks for your help, everyone. The project went very well. I'll post more about it soon.

  • That's truly a great school (one of our senior investors/advisors attended the "farm") - the visual portion of any project is vital - and to my mind should have received focus far sooner. (I've some knowledge/insight into displays - co-founded - took such a firm from start-up to public!)

    Attending to the (important) visual at the last moment (and I here I quote you, "Unfortunately I have a big show tomorrow") - signals near desperation - and surely "rush!"   ... (and are we not told (endlessly) - the future is already here?)   It would appear your project - and the "future" - were both "rushed."