If you don’t put USB on your project, you have to decide on a programming header to use. But everyone does it their own way: Sonoff has theirs, wESP32 has another, many projects have them and they’re all different!
That sucks, so let’s fix it by deciding what we think should be the conventional programming header format for our projects.
My goals are:
- Define a convention for programming headers on ESP8285, ESP8266, and ESP32 boards.
- Use that header in our own projects, so that it becomes common and interchangeable.
- Lobby ITEAD to use the same header in future Sonoff models.
And the stretch goal: Convince Espressif to document it as a recommended header format for new ESPxx projects.
If we’re super-lucky, maybe we can convince ITEAD to fix the incomplete Sonoff programming header by adding RESET and GPIO0, and make all our lives easier in future.
Places to discuss this
- Sonoff programming header usage guide
- wESP32-Prog by Patrick Van Oosterwijck
- ESProg by iohippo
- ESProg by me
- ESP32 Programmer by Mike Rankin
- A different ESP32 / ESP8266 Programmer by Mike Rankin
- ESP Prog by Espressif
We need to decide on a physical format, and also whether to supply 3.3V or 5V to the target board from the programmer. The pins we need are:
Physical format options include:
- 1×6 0.1″ header
- 2×3 0.1″ header
- 1×6 2mm header
- 2×3 2mm header
- Something else? Ideas please!
The design considerations for the physical format include:
- Similarity to existing designs including Sonoff, wESP32, ESProg, and ESP32 Programmer
- Cheap and easy to use, with easy to source connectors
- Small footprint on the target device
- Perhaps leverage some existing standard such as P-MOD
- Ability to mount permanently as a sub-board in the project if required
Considerations for the choice of 3.3V or 5V include:
- Sonoff already requires 3.3V on the header
- 5V can be useful in some cases
- Switchable voltage would be possible, but could be dangerous and would lead to fragmentation of the convention
- Connection of programmer directly to VCC on target, compared to input of onboard 3.3V VREG
This has the advantage that it’s well documented, and many people have made adapters for it.
Already implemented on the wEPS32. 5V supply means the input can be diode-isolated from other supply sources on the board. 4 of the pins match the Sonoff header, except that Sonoff requires 3.3V so it’s not a perfect match.
wESP32-Prog header, but with 3.3V
This is the closest we could have to matching the Sonoff header while extending it to add the GPIO0 and RESET lines.
Documented by Espressif. Uses a 2×3 header, which is nice in terms of compact size. Unfortunately there’s no useful overlap with the ESP-01 header.
Doesn’t seem to match up with anything else in terms of pin order, but is perhaps the closest match electrically in a 1×6 format: all the necessary pins, with 3.3V supplied.
ESP32 Programmer by Mike Rankin
Nice 2×3 format header. If power was added this would be a nice format, but it doesn’t have anything to differentiate it from the ESP-Prog format from Espressif.
Other ESP32 Programmer by Mike Rankin
This one has a 1×5 header, which has all the pins we want except power.