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.

Configuring the Output Voltage level for GPIO Pins?

I am using Stellaris LM4f120h5qr

Can the output voltage level of GPIO Pins be configure to 5V output?

I've read on the forum that it isn't possible but I made a short connection between 3.3V and Voltage line of GPIO and it gave 5 Volts.

What harm will it cause to the board?

  • Anurag Meena said:
    Can the output voltage level of GPIO Pin be configured to 5V?

    Often yes - but not the way you've described.

    Many Stellaris GPIO will accept 5V when configured as input.  (there are exceptions - such as ADC, few others - which do not allow)

    Referencing MCU data manual - see if that specific GPIO enables output configuration as, "Open Drain."  If it does - and same manual indicates that GPIO Output may reach to 5V - you then add a pull-up Resistor to 5V.  You must choose the resistance value so that it is within the GPIO drive capability - so that the MCU's GPIO can then, "pull-down" this output (adequately) - when GPIO switches to output LOW.  (one expects that 2mA current flow - when low - is safe resistor value choice - thus 2K7 should do the job...)

  • So what if I need more output current? I will then need to increase the 5v source current, correct ? will that effect the gpio it self ? and I was thinking of using 8mA GPIO driver, what resistor do I need in that case? I am using TIVA c TM4C123 by the way. Thanks in advance.
  • Abdelrahman Tarief said:
    So what if I need more output current? I will then need to increase the 5v source current, correct ?

    The MCU is best (sometimes only) able to source 3V3 when GPIO is set to output.   You must check to see that each/every candidate GPIO pin you seek to use to output 5V has "5V acceptance" capability.   (many do not)

    In many cases - 3V3 proves sufficient - although usually not if the device you seek to drive demands a "real" 5V input.   Should that be your case - your use of a standard, multi-channel voltage translator IC, proves best.   MCUs are not really intended to effectively "deliver power" - in fact if you give the MCU manual a good read you'll note the "Caution" based upon, "Output current limitations" upon (even) the four individual SIDES of the MCU!

    I recommend an IC designed to your output current purpose - NOT forcing your MCU into a mode for which it was not intended - and which may cause irreparable damage...

  • Let's say I am going to stick with the 8mA driver of the GPIO, what is the maximum current I can use with the 5v source ? and what resistor is required in that case. For the 5v tolerance, I guess most of the pins are fine except few.
  • You've pretty well answered your question - w/in the question - have you not? (i.e. 8mA - but that's at 3V3 levels - NOT at 5V)

    You MUST check each candidate pin of your MCU to see if it may be pulled up to 5V - and then survive. Now - assuming that MCU and that particular GPIO are accepting of being "pulled up" to 5V - you calculate the pull-up resistor's value by: I = 5/.008 ≈ 620Ω.

    Important! That is the current that will flow through that pull-up AND the MCU's GPIO when that GPIO is driven LOW. When driven Low by the MCU - almost NO Current is available to the outside world! Did you realize that?

    Now when not driven low by the MCU - you are "stuck" w/a 620Ω R in series w/your external load. That may prove too high a resistance in certain cases.

    Again - as past stated - there exist 4, 8 perhaps even higher number of "Voltage Translated" Outputs - resident w/in a proper, voltage translator IC. And again - that is my recommendation...