Thursday, February 18, 2016

ESP8266 Programming

The ESP8266 is an amazing little unit.  I've had some ESP8266-01 boards on hand for some time now, but haven't had an opportunity to start fiddling with them until recently.  My interest in this board was originally for use as a WiFi enabler for another microcontroller (an AVR), but this article caused me to rethink things.  With a little effort, the ESP8266 can be reflashed to both act as a WiFi device as well as run your logic.

I started out using the hackaday article to build a programmer.  It was a vile, ugly thing.  I didn't go to school for electrical engineering, and it probably shows through in this thing:


It probably goes without saying that this rat's nest of wires didn't work well, so I built a different rat's nest:


The truth of the matter is that the first one didn't work well because I was powering the ESP8266 through my USB-TTL-Serial device.  This device had a convenient 3.3V pin, but it put out nowhere near the current required by the module when it starts talking WiFi.  So, I added a 3.3V power regulator, capable of 800mA, along with a 330uF capacitor to the circuit.  This yielded repeatable results -- much more satisfying than intermittent results.

My third programmer revision was inspired from an article I found when searching for ESP8266 stuff.  This board works reliably and I had the forethought to include headers to supply easy access to GND, GPIO0, and GPIO2.




It wasn't long before I realized that my brilliant forethought to add headers for GND, GPIO0, and GPIO2 forgot to include a pin for VCC.  Thus, it was no longer brilliant and needed an amendment.  Since I was making changes, I added some other improvements to include fancy button label stickers and a stress relief for the wires going to the barrel jack.  Eventually I'll get a female barrel jack that I can solder to the protoboard directly, but this will work for now.  Revised:




For programming the device, I opted to go for the Arduino software with the ESP8266 plugin.  The lack of intellisense and some other professional IDE software features are a bit of a turn off, but it is a free and easy to use option for the time being.  Well, easy to use from a toolchain and device flashing perspective -- not so much coding.


No comments:

Post a Comment