I picked up these neat little esp8266 USB dongles from Shenzhen. They incorporate a CH240g, 3.3v voltage regulator and esp8266.
This creates a complete stand alone esp8266 stick, so you no longer need a USB serial interface or external voltage regulator.
It certainly helped me better understand how the boot mode was selected: A PNG is here.
And a SVG you can load in Inkscape with the board sides aligned so you can follow traces is here.
For reference, here’s some of the information from the original Chinese seller: For reference, to start the board in flash mode you can use the following (does this anyway): I’ve been working with the esp8266 spi driver by Metal Phreak located here.
One of the issues I’ve found is that duplex transfers (where you want to both send and receive at the same time) don’t work correctly.
If you attempt to call spi_transaction specifying 8 dout_bits and 8 din_bits 16 clocks will be sent (IIRC a receive followed by a transmit).
The misunderstanding is likely down to the fact that the esp8266 has very little documentation. However the Arduino guys seem to have figured it out and it works correctly in the Arduino IDE board pack for the esp8266. There are 3 bits which control the direction of transfer SPI_USR_MOSI, SPI_USR_MISO and SPI_DOUTDIN (bits 27,28 and 0).
In order to send and receive you need to set SPI_DOUTDIN and SPI_USR_MOSI but NOT SPI_USR_MISO. I made the following modification to spi_transaction to fix this.
This is a bit odd, but it does mean that you don’t need to switch jumpers to change modes which is nice.
Startup board in normal mode, you need to execute the following in python: You can then read data using python with “ser.readline()”.
If there’s interest in these boards I’ll write up some further notes on how to work with the board using minicom.
I also stripped one of the boards down, this might prove helpful with debugging.