ESP8266 is relatively new and cheap in price. It comes with an inbuilt firmware which supports serial interface and can be controlled using AT commands. Even though we can use this module to offload WiFi functionality from another micro controller or any other processor, this module is not just a serial to WiFi transceiver!
In this post, I am willing to discuss the 3rd option, how to use Arduino IDE to program ESP8266.
There are already built packages under releases. Once it is downloaded and launched we have select the board and the programmer.
Tools -> Board -> Generic ESP8266 board
Tools -> Programmer -> esptool
Now the hardware part. See below schematic for the configuration.
J1 should be connected with a USB to TTL adapter accordingly.
In order to burn Arduino sketch to the ESP8266 module S1 switch should be enabled. In other words GPIO_0 should be grounded when binaries are being uploaded to the chip.
Once it is done. Toggle power to the module and that's it! your program should be up and running on ESP8266!
For the demonstration purpose I have written a simple Arduino sketch to drive 2 LEDs using GPIO pins available on ESP8266 (ESP-01). LEDs are connected to GPIOs of the module with 220Ω resistors. See below schematic.
As I mentioned earlier they have ported Arduino IDE to support ESP8266. But Arduino is basically based on AVR microcontrollers. So the people who ported Arduino IDE to support ESP8266 have rewritten lots of existing functionalists to support ESP8266. Due to that reason it doesn't support all the existing Arduino functions and modules. But it supports a lot! Let me list down things that work by the time of writing this post.
Basic GPIO functions including interrupts
Timing and delays
WiFi shield library (ESP8266WiFi)
I2C(Wire Library) - only master mode supports at the moment
And few other libraries. please find a complete updated list of supported libraries from their github project home. Hope this may be helpful for you to start developments with ESP8266 with Arduino IDE.