-->
Page 1 of 1

how to pull GPIO2 LOW during boot?

PostPosted: Wed Sep 26, 2018 2:20 am
by SilverNodashi
Hi,

I have a 16 channel multiplexer connected to GPIO's 5, 4, 0 and 2, and a MCP3208 connected to GPIO14, GPIO13, GPIO12 and GPIO15.

The 16 channel multiplexer drives 16x PNP transistors, which in turn drives 16 relays. At the other end of the relays is a 48V battery bank. Each relay connected to it's own 12V, 200A battery. 4 batteries are connected in series to form 48V. There's 4 strings of 4 batteries in total.

the problem I am facing is that when the NodeMCU power cycles, for example when the power has failed, two or sometimes three random relays activate at the same time, causing those relays to burn out if they're in the wrong string.


How do I get GPIO2 to not activate while the NodeMCU power cycles? I have tried with a 10K resistor between the 4 GPIO pins and ground but that didn't work.

Re: how to pull GPIO2 LOW during boot?

PostPosted: Thu Sep 27, 2018 5:03 am
by btidey
For an ESP module to boot up into normal run mode then the pins must be

GPIO0 = high
GPIO2 = high
GPIO15=low

during the boot period.

Also bear in mind most of the pins have a weak pull up (~36K) so that must be taken into account when trying to pull pins low during the boot period. A 4k7 gives a decent logic low.

To avoid problems I would try avoid GPIO0,2 for the mux ouputs. Although 12,13,14 are needed for SPI you can use any pin for the CS so you can use say GPIO0 for that and free up GPIO15 for mux output, As GPIO15 needs to be pulled low anyway that is fine.

You still have to deal with GPIO2. GPIO16 goes high during boot so that is not a straightforward swap.

If not using serial then I think you could use RX (GPIO3). There are reports of that causing a boot issue on some modules but I haven't experienced that.

The other way is to invert the sense of the logic so that GPIO usage is active low rather than active high. That makes it easier to use pull ups as the default state.

Re: how to pull GPIO2 LOW during boot?

PostPosted: Thu Sep 27, 2018 5:17 pm
by SilverNodashi
btidey wrote:For an ESP module to boot up into normal run mode then the pins must be

GPIO0 = high
GPIO2 = high
GPIO15=low

during the boot period.

Also bear in mind most of the pins have a weak pull up (~36K) so that must be taken into account when trying to pull pins low during the boot period. A 4k7 gives a decent logic low.

To avoid problems I would try avoid GPIO0,2 for the mux ouputs. Although 12,13,14 are needed for SPI you can use any pin for the CS so you can use say GPIO0 for that and free up GPIO15 for mux output, As GPIO15 needs to be pulled low anyway that is fine.

You still have to deal with GPIO2. GPIO16 goes high during boot so that is not a straightforward swap.

If not using serial then I think you could use RX (GPIO3). There are reports of that causing a boot issue on some modules but I haven't experienced that.

The other way is to invert the sense of the logic so that GPIO usage is active low rather than active high. That makes it easier to use pull ups as the default state
.


Hi,

Please explain this?