GPIO max current


12 posts
by throstur62 » Thu Jul 26, 2012 1:57 pm
Hi,
A simple question, that I can't find any clear answare for:
What is the maximum current allowed from a GPIO pin?

I also se different numbers for the maximum allowed current for the 3v3 pin (pin 1). Anyone clear over what the maximum is.

Regards
TJ
User avatar
Posts: 7
Joined: Thu Jul 26, 2012 1:34 pm
by jbeale » Thu Jul 26, 2012 2:24 pm
First, some terminology: normally "GPIO pin" refers to general-purpose input/output pins from a CPU, microcontroller or SoC, but on the RPi board, the issue is confused by the fact that among the 13x2 "GPIO Header" pins are two actual power rails, 3V3 and 5V.

The data input/output pins are limited by what the SoC on-chip drivers can source and sink, which is actually configurable:
GPIO input hysteresis (Schmitt trigger) can be on or off, output slew rate can be fast or limited, and source and sink current is configurable from 2 mA up to 16 mA. Note that chipset GPIO pins 0-27 are in the same block and these properties are set per block, not per pin. See GPIO Datasheet Addendum - GPIO Pads Control. Particular attention should be applied to the note regarding SSO (Simultaneous Switching Outputs): to avoid interference, driving currents should be kept as low as possible.
... from http://elinux.org/Rpi_Low-level_periphe ... .28GPIO.29


The current output from the 3V3 rail should be limited to 50 mA (same page as above). The current from the 5V rail is up to your judgement, but you'll be limited by the 750 mA power input fuse that also supplies everything on the board including the USB devices. Although, note you can actually power the board by +5V INPUT on this pin- but then you are not protected by the fuse, or the power diode overvoltage crowbar on the normal microUSB power input.
User avatar
Posts: 1887
Joined: Tue Nov 22, 2011 11:51 pm
by throstur62 » Thu Jul 26, 2012 5:15 pm
Thanks for your replay jbeale. The link was very usefull. However it confuses me also as the child school equation V = IR is burned in my head.
When a GPI pin is configured as output, it can be looked at as a voltage source but not current source. Therefore teh outside resitance controls the current via the pin. The current can not be controlled programaticly in this case.
So does this current-configuratoin apply only to the pins when configured as input pins?
In that case I don't understand this either as you can configure those for example with a pullup-resistor and then that resistor is controlling the current (when the outside switch is not shunting the input pin).

The only thing I understand here is the hysterisis rise and fall.
User avatar
Posts: 7
Joined: Thu Jul 26, 2012 1:34 pm
by jbeale » Thu Jul 26, 2012 11:08 pm
I don't actually know what the configurable drive current configures, this is intended to be a digital output and not a current source/sink. It may be that you get a configurable "current boost" for a short time during transition from 0-1 or 1-0 to increase switching speed into a capacitive load, but the static DC current delivered after that remains at some fixed, probably low level.

The outputs are designed to deliver 0V or 3V3 levels into CMOS inputs (high input impedance) and they can source or sink at least 3 mA into a resistive load (that is, resistors as low as 1k ohm should be OK). Beyond that, I do not know. I vaguely recall that one person experimentally determined that R-Pi GPIO outputs can deliver about 30 mA into a LED load, with voltage sagging to 2V or below, but I haven't tried that and I would experiment with caution.

Or for a better answer, see: viewtopic.php?f=44&t=12248#p131518
User avatar
Posts: 1887
Joined: Tue Nov 22, 2011 11:51 pm
by Grumpy Mike » Fri Jul 27, 2012 8:44 am
I vaguely recall that one person experimentally determined that R-Pi GPIO outputs can deliver about 30 mA into a LED load, with voltage sagging to 2V or below,


That sort of current is likely to damage the GPIO pin. The damage might not show up immediately but it is damaged and might fail much sooner than normal. It is like saying I smoke 100 a day and I am still alive. Yes but for how long?

Also that is not saying you can do that for every pin.
Unfortunately the full data sheet has nothing to say about absolute maximum pin currents, it is a tricky thing to characteristic anyway. So just stick to the figures I gave in the linked thread above.
User avatar
Posts: 755
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
by rgh » Wed Aug 15, 2012 7:51 pm
GPIO input hysteresis (Schmitt trigger) can be on or off, output slew rate can be fast or limited, and source and sink current is configurable from 2 mA up to 16 mA. Note that chipset GPIO pins 0-27 are in the same block and these properties are set per block, not per pin. See GPIO Datasheet Addendum - GPIO Pads Control. Particular attention should be applied to the note regarding SSO (Simultaneous Switching Outputs): to avoid interference, driving currents should be kept as low as possible.
... from http://elinux.org/Rpi_Low-level_periphe ... .28GPIO.29

Does anyone have a copy of that "GPIO Datasheet Addendum - GPIO Pads Control"? The link on the wiki is broken - target document has been deleted.. Thanks.
Posts: 219
Joined: Fri Nov 25, 2011 3:53 pm
by Gert van Loo » Wed Aug 15, 2012 9:35 pm
That document had a major error in it. I accidentally deleted it instead of putting up a new version.
The new one is correct and also has A LOT more text on how to interpret the data.

http://www.scribd.com/doc/101830961/GPIO-Pads-Control2
User avatar
Raspberry Pi Engineer
Raspberry Pi Engineer
Posts: 1843
Joined: Tue Aug 02, 2011 7:27 am
by Grumpy Mike » Wed Aug 15, 2012 9:38 pm
Have you read this?
http://www.thebox.myzen.co.uk/Raspberry/Understanding_Outputs.html
It tries to explain what it means.

I was just going to post it but Gert intervened before the post was finished. It was too big to post anyway.
User avatar
Posts: 755
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
by jojopi » Thu Aug 16, 2012 5:59 am
Gert van Loo wrote:http://www.scribd.com/doc/101830961/GPIO-Pads-Control2:
V_IL = 0.8V means that if the output is Low it will be <= 0.8V
Should that not be V_OL? Or are we saying that the drive strength is the current at which the noise margin will be zero?

Also, the document implies that we might want to decrease the drive strength if the load is capacitive. But is that not also a case where we might sometimes need a higher drive strength than suggested by the static discipline, in order to maintain acceptable rise/fall times?

(I have updated both links that I could find in the wiki.)
User avatar
Posts: 1873
Joined: Tue Oct 11, 2011 8:38 pm
by andig2 » Wed Feb 13, 2013 7:14 pm
I'd like to add the question of what a safe voltage is for the 3.3V raspi GPIOs. How much is too much?
Posts: 23
Joined: Wed Oct 31, 2012 9:34 pm
by joan » Wed Feb 13, 2013 8:05 pm
andig2 wrote:I'd like to add the question of what a safe voltage is for the 3.3V raspi GPIOs. How much is too much?

Mine shows 3.63V on the 3.3V pin (no load other than the Pi).
User avatar
Posts: 4214
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by jojopi » Thu Feb 14, 2013 12:59 am
joan wrote:Mine shows 3.63V on the 3.3V pin (no load other than the Pi).
Either the meter is wrong, or your RG2 is well out of spec. It should be 3.235V to 3.365V, according to the OnSemi data sheet.

Anyway, I think the question was what voltages will the GPIO pins tolerate. The answer to that is 0V to 3.3V. If you go more than a small fraction of a volt outside that range, the SoC's ESD clamping diodes will begin to conduct. Unlike on some 8bit microcontrollers, the diodes in the BCM2835 are not rated for any continuous current. So there is a risk of damage even at 3.6V.
User avatar
Posts: 1873
Joined: Tue Oct 11, 2011 8:38 pm