ESP8266: Difference between revisions
Added common ESP8266 boards |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 5: | Line 5: | ||
The ESP-8266 is readily available in a dozen variants. These are my notes for the ones I most often use: | The ESP-8266 is readily available in a dozen variants. These are my notes for the ones I most often use: | ||
[[File:Wemos D1 Mini Pinout.png|thumb|Wemos D1 Mini pinout]] | [[File:Wemos D1 Mini Pinout.png|thumb|Wemos D1 Mini pinout ]] | ||
[[File:NodeMCU v3 Pinout.png|thumb|NodeMCU v3 board and pinout]] | [[File:NodeMCU v3 Pinout.png|thumb|NodeMCU v3 board and pinout]] | ||
== General ESP8266 notes == | |||
The ESP-8266 (and 8285 variant) is a 3v3 microcontroller. The GPIO pins are 5V tolerant for binary inputs, but it's probably not a good idea to go throwing 5v data lines around with it. | |||
'''If you're not using a DEV (Wemos / NodeMCU / etc) board:''' | |||
* '''Pull RST (reset) HIGH''' to keep it from floating. (GND it to hw reboot) | |||
* '''Pull EN (enable) HIGH''' to make device run. | |||
=== GPIO dragons === | |||
At first blush it looks like the ESP-8266 has lots of GPIOs, but in reality only about half a dozen are universally usable. Common stumbling blocks / warnings: | |||
* The pin numbers on Wemos / NodeMCU / &etc "dev boards" don't match the ESP-8266 datasheet GPIO numbers. Refer to the pinout diagrams to see the actual mappings. | |||
* '''GPIO1''', '''GPIO2''', '''GPIO3''', '''GPIO16''' all strobe HIGH at boot. If you put a transistor or relay on them, be prepared for it to intermittently strobe high uncommanded every time the uC reboots. | |||
* '''GPIO0''', '''GPIO2''' are pulled-high, and '''device will not boot if they're pulled low.''' | |||
* '''GPIO1''' (TX) will cause device not to boot if '''pulled low'''. | |||
* '''GPIO15''' is pulled low and '''device will not boot if pulled high''' | |||
* '''The raw A0 analog input pin is 0-1VDC.''' The "dev boards" (NodeMCU, Wemos D1 &etc) all put a 3.3:1 voltage divider network in front of it. So be aware of the specific implementation you're using | |||
=== '''Flashing''' === | |||
The default way to flash the program space in an ESP-8266 is to '''tie GPIO0 to GND during boot'',''''' this puts the device into firmware update mode. | |||
Modern dev boards can be reset and flashed via the USB port using the '''[https://github.com/espressif/esptool esptool.py]''' (which is also utilized by PlatformIO) | |||
Momentarily grounding RST will reset the device. Tie RST high (if not already) the rest of the time to prevent it from floating. | |||
[[File:ESP-12F Module.png|thumb|ESP-12F Module and pinout]] | [[File:ESP-12F Module.png|thumb|ESP-12F Module and pinout]] | ||
Latest revision as of 11:47, 24 January 2025
The venerable Esprissif chip with wifi, and the foundation for so much Internet of Things shit in the world.
The ESP-8266 is readily available in a dozen variants. These are my notes for the ones I most often use:


General ESP8266 notes
The ESP-8266 (and 8285 variant) is a 3v3 microcontroller. The GPIO pins are 5V tolerant for binary inputs, but it's probably not a good idea to go throwing 5v data lines around with it.
If you're not using a DEV (Wemos / NodeMCU / etc) board:
- Pull RST (reset) HIGH to keep it from floating. (GND it to hw reboot)
- Pull EN (enable) HIGH to make device run.
GPIO dragons
At first blush it looks like the ESP-8266 has lots of GPIOs, but in reality only about half a dozen are universally usable. Common stumbling blocks / warnings:
- The pin numbers on Wemos / NodeMCU / &etc "dev boards" don't match the ESP-8266 datasheet GPIO numbers. Refer to the pinout diagrams to see the actual mappings.
- GPIO1, GPIO2, GPIO3, GPIO16 all strobe HIGH at boot. If you put a transistor or relay on them, be prepared for it to intermittently strobe high uncommanded every time the uC reboots.
- GPIO0, GPIO2 are pulled-high, and device will not boot if they're pulled low.
- GPIO1 (TX) will cause device not to boot if pulled low.
- GPIO15 is pulled low and device will not boot if pulled high
- The raw A0 analog input pin is 0-1VDC. The "dev boards" (NodeMCU, Wemos D1 &etc) all put a 3.3:1 voltage divider network in front of it. So be aware of the specific implementation you're using
Flashing
The default way to flash the program space in an ESP-8266 is to tie GPIO0 to GND during boot, this puts the device into firmware update mode.
Modern dev boards can be reset and flashed via the USB port using the esptool.py (which is also utilized by PlatformIO)
Momentarily grounding RST will reset the device. Tie RST high (if not already) the rest of the time to prevent it from floating.
