If anyone here faced the same problem:
Infinite loop of resetting/restarting.
Mostly the error message contains "rst cause 2", "boot mode (3.7 (or 6))", "Exception (0)".
This error happens even with simple code like:
Uploading sketches to ESP8266EX-01 is done using Arduino Mega 1280 and Arduino IDE 2.
Wiring during uploading sketch:
ESP.....Mega
RX.....RX
TX.....TX
3V3.....3V3
GND.....GND
EN.....3V3
IO0.....GND
IO2.....OPEN
RST.....OPEN
During serial monitoring; I pull IO0 out and leave it open. Mega's reset pin is connected to ground.
The module was working at first but after two days or so this problem happened. Anyone know how to solve this problem?
Tried other esp cores versions, also not working. I can only use 2.7.2 or older due to the support of Firebase library.
A voltage divider is not really necessary. A simple 2.2K-3.3K series resistor will work just as well on any ESP pins that connect to a 5V device. The idea is to limit current to a safe value that will not fry the ESD clamping diodes in the ESP. Thoe diodes are good for >1mA on any properly designed chip.
i connect it to ground only when uploading a sketch.
After a sketch is uploaded, i remove the usb cable, and pull the IO0 pin out, then re insert the usb cable. Maybe i'm following wrong instructions?
No that is fine, a more practical solution is 2 buttons, 1 that connects GPIO0 to GND and 1 that connects RST (on the esp) to GND. You only need to GND GPIO 0 at the time the esp starts up to get it into upload mode.
Or free floating. Actually the same goes for GPIO 1 which is also the TX pin.
A voltage divider is better, why cut out the resistor. These things are fragile. I actually use 1K- 1K - 1K which comes to 3.33v the 2.2K - 1k shown in #4 results in 3.44v closer to 3.3v or even below it, is better. check this list for reset causes etc. If you are getting strange errors that you didn't have previously, i guess the ESP-01 is broken, which can be expected without the voltage divider. You have some resistors right ?
yep i have plenty here, but i have some questions:
Should I connect the 3v3 pin (ESP) directly to 3v3 pin(Mega)? Or should i use also a voltage divider?
Does this also apply to EN pin?
The RX &TX of the ESP are switched after uploading to allow serial communication with mega, should i also use voltage divider with two pins?
directly, the voltage divider is only there to reduce the 5v logic level of the Mega TX to near 3.3v for the ESP RX. that is all. The ESP TX of 3.3v easily triggers the Mega RX. So the voltage divider should be on the ESP RX (GPIO 3) side of things.
Just to confirm, the ESP unit you have looks like the one in post #4 ?
yes but in this case a simple voltage divider on the Mega Tx will work OK
a level shifter would be required where there are bidirectional signals, e.g. I2C
yes, a bidirectional level converter converts signals from one logic level (e.g. 5Volts) to a different logic level (e.g. 3.3volts) and vice versa
some 3.3V loigic microcontrollers, e.g. PIC24FJ1024GB610, have some GPIO pins which are 5V tolerant to enable the direct connection of external 5V devices
I have dozens of ESP01 modules from many sources and I have never seen an on-board pullup. Even if there is, and I doubt it, an external pullup would assure that RST is high.
I think it's internal on the chip. I was of the same believe as you, and i still connect them the way you do, but i have been convinced (probably by someone on this forum) there is actually no need.
The pullup on the chip is very weak. The specs say this about rst: External reset pin, active low
The "active low" means pulled up internally. How? we don't know. Likely in the tens of KΩ or more. I just don't trust it and it certainly can't hurt to make sure the rst pin is high with an external 10KΩ resistor.