How to make a cheap USB-TTL "programmer" work
Having built LanternScape I wanted to make it accessible to all wallets.
To then end I started looking for the cheapest versions of the various electronic. That lead me to the ESP-01s.
The ESP-01s requires a TTL programmer to add the firmware, which if you already have a programmer is great, if not you need one those too.
So I purchased a cheap TTL programmer....
It turns out what is sold as a programmer, won't actually program.
Where can I get one?
- ESP-01 Programmer Adapter USB To ESP8266 (Amazon link)
- ESP-01 Programmer Adapter USB To ESP8266 (You don't have to do anything to this, it just works (has handy button to press)) (Amazon link)
The Amazon links are affiliate links, the tiny sum I might get may help me keep doing this.
A little background
In normal operations the ESP8266 can't be programmed, you can't write to the chip, it doesn't respond.
To write to the chip you have put it into programming mode. To do this the programming pin has to be pulled low (connected to ground).
The circuitry on the USB-TTL programmer has no way of pulling the programming pin low and so placing the ESP-01s into programming mode.
How can fix this?
There are a couple of approaches to this solution
- Get 2x programmers, leave one as is, the other solder a wire between the programming pin and ground. Use one as a programmer the other to run.
- Add a momentary switch to the board that when pressed joins the programming pin and ground. Make sure the switch is pressed when you plug it in to enter programming mode.
- Add a 3 pin header and a jumper. The jumper in one position is in run mode and in the other position is in program mode.
- A two position switch, circuit closed programming pin is connected to ground.
- There a probably lots of other options....but you get the idea.
I'm going to be adding a 3 pin header (I had the stuff laying around and I didn't want to faff with having to press a button as I plugged in the programmer).
Unplug the USB-TTL programmer from you PC (or Mac)
Grab a 3 pin header and a jumper
Bend the middle pin of the header to the right (until it's about touching the right hand pin.
Solder the header to the USB-TTL programmer
Celebrate a job well done with nice cup of coffee (or tea) (....and possibly cake).
Remember when changing to programming to run (or visa versa) to unplug the programmer.