Sunday, July 10, 2016

Programming ESP-01. No cable? how 'bout some XBee Explorers

Nothing too complex or new, it's just that i spent some time hooking up an ESP8266 to Arduino, trying to use it as a programmer. Then, after 2 cups of coffee, i saw some XBee Explorers over my desk. ( FTDI chip + 3v3 Inside ;) )


TL;DR


I Had some ESP8266 modules laying around and i was thinking, since they can be programmed it might be no need to hook it up to an extra, and less powerful, Arduino board and throw some AT commands, but to load a firmware directly into the ESP8666 MCU.

The software setup is very simple. we can add support for the ESP8266 in the Arduino IDE through the Boards Manager. Instructions are in the following link, this will install libraries, configuration and boards descriptions, and the compilers/tools for Espressif/Xtensa ESP8266 boards.

https://github.com/esp8266/Arduino

Tutorials about how to program the ESP modules are all over the Internet, you just need an FTDI like 3v3 capable TTL to USB cable.

There was just one problem, i had no FTDI cable to program it. So i tried to pass through the Arduino UNO, since it has a 3v3 regulator. NO SUCCESS! (What i did was to tie RESET to GND on the UNO)

Here's how to connect the ESP-01 with Arduino UNO:
https://forum.arduino.cc/index.php?topic=283043.0

And here's where i came with the idea of using the uno as programmer, obviously it didn't woked. (although it could receive and respond to AT commands without any trouble):
http://stackoverflow.com/questions/31539424/using-arduino-as-ftdi-programmer-to-program-esp8266-esp-12

That was for ESP-12 (NodeMCU boards and the like)

There was when i saw the picture of a FTDI chip in my mind, i have a bunch of XBee Explorer Boards. all have a very decent 3v3 regulator and FTDI chip + mini usb connector (Basically a programmer)

The Explorer is too big for a half-breadboard, if you want to align it to get a row of holes on either side of the breadboard. you'll notice you can't.

However, you only need one side, the one with the pins: 3v3, GND, DIN, DOUT.



So, i made the same connections referenced above on he links to my explorer, left the RESET of the ESP-01 pulled up to 3v3 with a 10Kohm resistor and the GPIO-0 wired in the breadboard next to another jumper cable going to GND.

Use this GPIO-0 cable as a switch to put ESP-01 in programming mode when connected to ground after reset (Shortly pull down to GND the 3v3 pulled-up RESET pin, while GPIO-0 is Grounded)

It looks awful like this:



Compiles awesome like this:



Nothing too complicated, but fun if you have seen the hooking up with Arduino uno i was doing before. it had even a logic level converter for the serial line and stuff. and still didn't work

Now i need to think what to code inside this little boards. how cool!! :)

No comments :

Post a Comment