-->
Page 1 of 2

Pull up/down resistor mandatory on each pin ?

PostPosted: Thu Apr 16, 2015 10:30 am
by Sylvain Leroux
Hi,

I'm in the process of learning how to use an ESP-7 module. I understand that GPIO are ... well ... "general purpose" and can be configured either as input or output ... For example, from a previous mistake, I learned that GPIO0 is CLK_OUT on boot. So, it is mandatory to pull it up to VCC (resp. down to GND) through a few kOhm resistors. However, I'm wondering about the other pins, as the various examples I found on the Internet sometimes use resistors, sometime not. So:

  • Are pull up/down resistors mandatory too on CH_PD ?
  • And on RSET ? It is safe to let it floating as there is an internal pull-up ? Or is it recommended to pull it up externally (once again through a resistor, or could it be safely tied directly to VCC?)
  • And the unused GPIO ? Is it wise to let them float or should I pull them up/down externally ?

Thanks in advance,
- Sylvain

Re: Pull up/down resistor mandatory on each pin ?

PostPosted: Fri Apr 17, 2015 2:40 am
by m-cin
For many reasons (like noise resistance) it is wise not to leave any pin floated. For another reasons (like current limiting in case of unintended shortcuts or in/out circuit failure) it is wise to use pull-up/down resistors. In order to bypass unstable conditions at power-up it is good to add a capacitor to RST.

It may be that your circuit without any of the above works correct, but the probability of such event in noisy environment is rather low :) Please read here about problems with even simple relay switching...

Kind regards
M.

Re: Pull up/down resistor mandatory on each pin ?

PostPosted: Fri Apr 17, 2015 6:51 am
by Sylvain Leroux
Thank you for your answer.

Things are now much more clear: there are a lot of informations on the forum, but it is not always easy to find it. Two more questions though if I may:

  • What about the ADC pin? I've read somewhere the ADC is used internally to monitor transmission power. Wouldn't connecting it externally alter those readings ? I've read it accepts 1V max too -- so it should be tied, eventually, on GND ?
  • More generally, floating pins should be pulled-up or -down ? Does doing it one way or the other has any consequences (noise immunity, power consumption, ...) ?

For now, here is what I understood as the recommended wiring:

ESP8266MOD-Schematic.png



- Sylvain

Re: Pull up/down resistor mandatory on each pin ?

PostPosted: Fri Apr 17, 2015 10:00 am
by metalphreak
The ADC module internally is connected to more than one thing through a mux. One of those things will be the external ADC pin. When it's reading the internal value for the radio the mux switches the inputs. So tying it to ground externally will have no effect.

GPIO pins in general shouldn't need to be tied high or low if you aren't using them.


GPIOs 0/2/15 are read during boot to determine the mode. After this, you can do whatever you want with them. You use a weak pull up/down (higher resistor value) so that the GPIO pin or anything connected to it, doesn't have to sink/source a large current to change the GPIO pin voltage.

Resistor's should be used on GPIO pins. If you connect GPIO2 directly to 3.3V for example, then enable GPIO2 as an output, set it low, you are effectively shorting 3.3V to Ground through the GPIO pin. Internal resistance (and perhaps some protection devices internally) may limit the current so it's not fatal but it may exceed the allowable current of 25mA. Not to mention it will heat up the chip package and waste some power.