ESP-210

From Electronic Sweet Peas
Jump to: navigation, search
Esp-210-1-iso.png



Make sure you read all about the entire node.IT concept
Now available for preorder in our new web shop


The ESP210 is a ESP8266 based module with a USB transceiver, 3.3V voltage regulator (you can run it from 5v or the USB port) and a 32MBit (that is 4 MByte !!) FLASH memory. Unlike many other ESP8266 based modules this module comes prepared for anyone that wants to tinker and play around with it without having to connect external adapters and power supplies to it. In fact, to start playing with it you only need to plug it in to your computers USB port. The device will take all of its power from the USB port. The ESP210 also has a user definable LED on the board so you can start of by running your first blink test.

The Board

Version 0.1 (Early prototypes)         Version 2.0/2.5 (Customer samples)                   
ESP-210-gpio.png Esp210-overview.png



Pin UART0 UART1 I2C SPI I2S IRDA PWM Version 0.1 Version 2.0/2.5 Description
Spare NA X Spare pin for use in future +One modules. Added on 2.0 boards
GPIO16 X X Connect to RST# when using deep sleep
GPIO3 RX0 O_DATA PWM3 X X
GPIO1 TX0 PWM1 X X
GPIO5 PWM5 X X This pin controls the on board blue LED
GPIO4 PWM4 X X
GPIO0 (SCL) PWM0 X X When using the SPI interface SCL can be moved to this pin.
GPIO2 TX1 SDA O_WS PWM2 X X Has a 4k7 pull up resistor
GND X X System Ground
GPIO14 SCL SCK I_WS PWM14 X X Also see comments on I2C usage on pin GPIO0
GPIO12 MISO I_DATA PWM12 X X
GPIO13 MOSI I_BCK PWM13 X X
ADC X X 10 bit analog input. The signal must be between 0 and 1 Volt
GPIO15 SS O_BCK PWM15 X X
RST# X X RST# is pulled high on the module. If external reset is required simply add a push button to this pin.
3.3V X X 3.3V output or input. Make sure your stack or peripherals connected here does not consume more than 500 mA
5V X X 5V input. This input voltage must be in the 4.75 - 5.25 Volt range. Lower power sources should be connected through a diode.
PD# NA X Power Down. By pulling this pin low the voltage regulator on the module is disabled.

(NA = Not Available on this module, X = Pin is available on this module)

Information

The USB transceiver

The ESP210 includes a Silabs CP2104 USB to serial transceiver with TX and RX connected to the ESP8266 device. The outputs of the CP2104 are defined as open collector and have an internal weak pull up. This allows you to use the RX/TX signals of the ESP8266 freely in your application. The CP2104 will not interfere when not used. The same applies to the RTS and DTR signals which are connected to the ESP reset and GPIO0 respectively.

The CP2104 allows you to load firmware into the ESP8266 with speeds up to 921600 baud. This drastically reduces the time it takes to flash the ESP210 and when doing heavy development work this is a really nice to have feature. The module supports up to 430800 baud standalone and if you want to have the full 921600 bauds you need to connect a strong (4.7Kohm) pull up (to 3.3Volt) resistor to pin GPIO3.

A Linux quirk If you are developing code and connecting the ESP210 to a Linux computer you need to be aware on how Linux handles serial ports. By default Linux will pulse RTS while lowering the DTR line. This is a part of an ancient protocol to talk to a modem. For embedded systems this is normally not a problem since standard embedded systems will not have the RTS or the DTR lines connected to reset or any other pins to set the system in boot mode. On the ESP210 we do just that ! The RTS is connected to reset and DTR is connected to GPIO0 that determines the running mode it will enter when reset (RTS) is released. So by simply opening a serial port on Linux the ESP210 will go into programming mode.

If you are going to use the USB connection for anything else than programming you will need to address this. The simplest way to do this is to select a serial terminal software that can control RTS and DTR when the port has been opened. This way you can set both DTR and RTS to the correct states and the ESP210 will function normally. What I use is the Python program Miniterm which is an integral part of the pySerial library. The following line will start the terminal emulator, reset the ESP210 and start showing what comes on the USB line.

 python -m serial.tools.miniterm --rts=0 --dtr=0 --baud=115200 /dev/ttyUSB0

Mac/Windows Drivers

If you intend to connect the ESP210 to a windows machine or a Mac, you need to install the appropriate driver. Instructions and downloads can be found here: http://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx

If you are a Windows user and need a good and simple terminal software to log your debug prints we can recommend Termite (http://www.compuphase.com/software_termite.htm). This terminal works very well together with the ESP210. Just remember to set Flow Control to XON/OFF and you are good to go.

Power

The ESP210 can be powered in a few different ways, here's a list of different options:

  1. USB, when powered by USB the internal voltage regulator generates the required 3.3Volts.
  2. Pin 16, This pin can be used to supply the ESP210 with +5V. This pin is also connected to the VUSB (through a polyfuse) so be careful not to exceed 5V when having it connected to a USB port at the same time. If the ESP210 never gets connected to a USB port this pin can handle up to +7.5Volts.
  3. Pin 15, When the ESP210 is powered by a USB cable or by pin 16 this is an output containing +3.3Volts. This pin can also be used to supply the ESP210 with +3.3Volts. The supply must be +3.3Volts ±5%

When the ESP210 is powered through USB or Pin 16 it will get slightly warm. This is as it should be and comes from the on board linear voltage regulator.

GPIO

GPIO2 have a 4.7 Kohm pull up resistor connected to it, allowing you to use it directly to connect DS18B20 temperature sensors. Keep in mind though that the I/O is still 3.3V only.

The board also has an on board blue LED that is connected to GPIO5. The LED is controlled using normal logic, i.e. setting the port to 1 (HIGH) will light the LED and setting it to 0 (LOW) will turn the LED off. The LED is connected through a MOSFET driver which allows you to use the pin both as an input as well as an output pin. If you use the pin as an input the LED will show you the state of the pin which can be useful to debug your design.

Developing using NodeMCU

The NodeMCU environment is a high level environment that allows you to create IoT applications very rapidly. To use this you need to flash the ESP210 with the NodeMCU firmware. If you are using Linux here's a short instruction on how to flash the ESP210 with NodeMCU. In this example we are flashing the Integer version.

esptool.py -p /dev/ttyUSB1 --baud 115200 write_flash -fs 32m 0 nodemcu_integer_0.9.5_20150318.bin
  • Start your terminal emulator and type the following to see that it is alive:
 gpio.mode(1, gpio.OUTPUT)
 gpio.write(1, gpio.LOW)

This will light up the blue LED on the board and that is it. Your board is alive and ready to rock.

Developing using the Arduino IDE

You can also use the standard Arduino IDE to develop your software. For simplicity and stability we currently recommend that you use this way of working with the ESP210. We have found it to be very stable and causing less headaches than the other SDK's. Anyway if you are new to this there is a great README on their github @ https://github.com/esp8266/Arduino. Here's just a short rundown on how to download and install the ESP8266 add on.

  • Make sure you have the Arduino IDE installed. You must have version 1.6.4 or higher for this to work.
  • Open the preferences dialog. You will find this under "File->Preferences".
  • Enter the following URI in the "Additional Boards Manager URLs" field: http://arduino.esp8266.com/package_esp8266com_index.json and click on OK
  • Open Boards Manager from "Tools->Board" menu and install esp8266 platform (This will take a few minutes)
  • Select the ESP210 board from the "Tools->Board" menu.

That's it. You are ready to rock. We have ourselves tested a number of Arduino libraries and so far everything seem to work much better than we anticipated.

To run the Arduino Blink example:

  • In Arduino IDE, select File->Examples->01.Basics->Blink
  • In the Blink file change the pin number from 13 to 5. (ESP210 has a blue led connected to pin 5).
  • Upload

As mentioned previously you can upload using serial speeds up to 921600 baud (with a pull up) which is very handy since the binaries tend to become quite big.

Over The Air (OTA) updates information

If your system is implementing an OTA system that relies on software reset to restart your system, you might end up in difficulties. Read this paragraph to understand what happens and how to avoid a lot of frustration. Of course this information also applies to other types of situations where you need to use the software reset mechanism to restart your ESP210.

So, the situation that you might end up in is that the USB transceiver on the board is pulling the DTR signal low. The DTR signal in turn is connected to GPIO0 on the ESP8266. GPIO0 is involved in the boot type selection of the ESP8266, so when your OTA system causes the ESP8266 to reset, the device will look at GPIO0 and see that it is being pulled low and enter an incorrect boot mode.

An example of an OTA system that is affected by this is the one included in the ESP8266 Arduino framework. This OTA uses the system reset feature to restart the system after an update sequence have completed and if you have an active USB connection to the board that holds the DTR signal low the OTA will not restart properly.

The solution to this problem is to make sure that you don't have an active connection to your ESP210 when testing. Usually when your system is deployed it will not have an active connection so this is rarely a problem in those situations.

These problems are most prominent when you are using a Linux host for development, specifically Ubuntu 14.04 for some reason, but can also be seen on other Linux hosts and Windows based hosts depending on how your host is connected to the device.

A quick note about using GPIO0 as SCL instead if GPIO14

In the case where you want to use both I2C and SPI in your application you need to move SCL to pin 0 instead of pin 14. This is because the SPI interface shares the clock signal (SCK) with the I2C interface.

All +One modules are prepared for this and can easily be reconfigured using on board solder jumpers.

When using Pin 0 (GPIO0) as SCL you will end up in a situation similar to that in the OTA case. When opening your host USB connection to the ESP210 device, the USB transceiver will pull the DTR signal low, creating a conflict with the SCL signal and corrupting your I2C transaction.

The solution to this problem is make sure you have a terminal software that does not pull the DTR low. The python miniterm terminal is a good choice for this.

Technical Specifications

  • 32-bit 80mhz microprocessor
  • 802.11 b/g/n Wi-Fi radio built-in
  • 4MB of Flash, 80 KB RAM (~40 KB available for user code)
  • 11 Digital I/O Pins (interrupts on 10 digital pins)
  • 1 Analog Pin (Analog input 0 - 1Volt)
  • PWM on all Digital Pins (up to 6 active at a time)
  • Sleep and Deep Sleep modes for low power usage
  • Ability to read the voltage of its power source (for battery monitoring)
  • Board dimensions: 27.5mm) x 17.5mm
  • Serial Speeds
4800 Baud
9600 Baud
19200 Baud
38400 Baud
57600 Baud
115200 Baud
230400 Baud
460800 Baud
921600 Baud
  • Voltage Regulator: 3.3V max 800mA

Downloads

Tips, Tricks and useful links

Nothing here yet.