Can the output current of the esp32 GPIO be reduced?

roctwo
Posts: 95
Joined: Mon Nov 28, 2016 3:12 am

Can the output current of the esp32 GPIO be reduced?

Postby roctwo » Fri Jun 02, 2017 1:35 am

The output current of the esp32 GPIO is 12ma,Can the current be reduced?

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Can the output current of the esp32 GPIO be reduced?

Postby ESP_Sprite » Fri Jun 02, 2017 3:36 am

No, the *maximum* output current of the ESP32 is 12mA. Sinking/sourcing more than 12mA from it may damage the pad. It's up to you to use e.g. a resistor to limit that current.

2023 edit: The 12mA number is an old figure that we used because we didn't properly test the GPIO capabilities at that time yet. Turns out they're a lot more capable than the conservative 12mA number. See the reply later on in this topic, and please always check the latest datasheets for the most recent figures.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Can the output current of the esp32 GPIO be reduced?

Postby WiFive » Fri Jun 02, 2017 6:32 am

ESP_Sprite wrote:No, the *maximum* output current of the ESP32 is 12mA. Sinking/sourcing more than 12mA from it may damage the pad. It's up to you to use e.g. a resistor to limit that current.
datasheet appendix C.1(8) wrote:Each digital output pin is associated with its configurable drive-strength. Column “Drive
Strength” in Table IO_MUX lists the default values. The drive strength of the digital output
pins can be configured into one of the following four options:
• 0: ~10 mA
• 1: ~20 mA
• 2: ~40 mA
• 3: ~80 mA
The default value is 2.
Also latest datasheet is not copyable/searchable...again.

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: Can the output current of the esp32 GPIO be reduced?

Postby rudi ;-) » Fri Jun 02, 2017 8:40 am

ESP_Sprite wrote:No, the *maximum* output current of the ESP32 is 12mA. Sinking/sourcing more than 12mA from it may damage the pad. It's up to you to use e.g. a resistor to limit that current.
i am sure you mean *minimum*
please edit or comment - why you think this is so.
we get today the revise revision PCB's ( sharing CLK pSRAM with SPI Flash was wrong )
----

datasheet appendix C.1(8) wrote: Each digital output pin is associated with its configurable drive-strength. Column “Drive
Strength” in Table IO_MUX lists the default values. The drive strength of the digital output
pins can be configured into one of the following four options:
• 0: ~10 mA
• 1: ~20 mA
• 2: ~40 mA
• 3: ~80 mA
The default value is 2.
honest - i do not understand further things here!

is the standard output now 40mA or not, can we now set the output to max 80mA or not.

there are things missing between the application ingenieur and the digital ingenieur and sure the documenting ingenieur.

but i understand now why we get no answeres on difference things.

@jeroen thats the reason why i allways explode and be emotional.
that have nothing to do with you personaly - cause - i like you and your knowledge --- since 2002/2003 ---

keep smile! nobody is perfect.
i got the datasheet from espressif -
i got it too from XTX and Lyontek.
and the pSRAM will work this weekend here too -
john lee promise this - that he need 3 days after chin holidays
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Can the output current of the esp32 GPIO be reduced?

Postby ESP_Sprite » Fri Jun 02, 2017 9:59 am

EDIT: Modifying the numbers to what's currently known as this comes up as a Google result. Where it says '40mA' now, it used to say '12mA' as the datasheet at the time said '12mA'. Sorry if that makes this post a bit odd when taken into account what's said in the rest of the thread.

The 40mA *is* the maximum amount of current you can safely pull from the ESP32 [2]. A real chip actually can deliver much more: feel free to try it by making a pin high and using a multimeter in mA mode to measure the current to ground. (Not for too long, as I said, in theory it can damage the chip, although a few seconds probably won't harm.) You'll probably measure a current of 50mA'ish. Pull this current for too long, however, and you risk damaging the pad driver.

"Drive strength", when talking about VLSIs and digital logic, actually has a pretty narrow meaning: it relates to the fanout of a chip, which essentially is how many digital inputs you can drive from it [1]. The problem is that if you have a drive strength that is very low, the parasitic capacitance inherent in the input pins can take a while to charge. This leads to issues when you output e.g. a high-frequency clock signal: when you output a clock pulse (L->H->L), your clock signal has gone low again before the signal level on your output pin, slowed down because it has to charge the parasitic capacitance, has raised enough to indicate a high level. You want to raise the drive strength in this case: setting it to 80mA means that for the short while that the parasitic capacitance needs to charge, the pin can deliver 80mA. [3]

Now, why would we then make the drive strength adjustable instead of keeping it at max all the time? That has something to do with impedances. If the parasitic capacity is very low, or there's a parasitic inductance as well, driving a pin high as fast as possible can lead to overshoot and ringing and nasty EMI-related side effects. That is why you can set it per pin to whatever you need.

So concluding: the ESP32 can drive 40mA or so on an output pin. You can modify the drive strength of the pin in software if the output impedance gives you issues with AC signals, but do not assume this sets the DC current.

[1]: It's actually somewhat more complex than that, but as far as I know, fanout is the reason they came up with a number for this.

[2]: I see now that there has a very recent change in the datasheet that changes a value called 'Imax', or 'Maximum drive strength' from 12 to 80mA, seemingly replacing any value for DC current. I will look into getting this cleared up or corrected, but I highly doubt our analog team decided the ESP32 pins can drive a DC current of 80mA now. EDIT: It's cleared up, the current datasheet currently gives 40mA as the max number.

[3]: For a slightly more experimental approach to understanding drive strengths, seehttp://www.thebox.myzen.co.uk/Raspberry ... tputs.html. It relates to the Raspberry Pi so the values are different and I'm not 100% sure if our pad drivers work in exactly the same way, but it may help to give you some intuition for this stuff.

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Can the output current of the esp32 GPIO be reduced?

Postby ESP_Sprite » Fri Jun 02, 2017 10:25 am

Also, apologies for the non-searchable datasheet. I poked the doc team to regenerate the it... see if I they can make some sort of procedure to stop this from happening, it's irritating.

BuddyCasino
Posts: 263
Joined: Sun Jun 19, 2016 12:00 am

Re: Can the output current of the esp32 GPIO be reduced?

Postby BuddyCasino » Fri Jun 02, 2017 11:39 am

Thanks for the explanation! I don't really want to add low S/N comments like this one, but since the forum does not have "+1" or "like" buttons...

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: Can the output current of the esp32 GPIO be reduced?

Postby rudi ;-) » Fri Jun 02, 2017 12:26 pm

+1
thank you jeroen!

( this like button i miss here too. )

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Can the output current of the esp32 GPIO be reduced?

Postby WiFive » Fri Jun 02, 2017 2:31 pm

Very good info! So adjustable drive strength for high speed signals, 12mA DC source/sink max per pin, and what is overall combined pin max per power domain?

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Can the output current of the esp32 GPIO be reduced?

Postby ESP_Sprite » Fri Jun 02, 2017 3:48 pm

I'll see if I can get that info somewhere. We'll need to make the drive strength / DC current distinction more clear in the datasheet anyway.

Who is online

Users browsing this forum: Baidu [Spider] and 190 guests