MCP23017 I/O Expander for ESP8266
Created: Aug 10, 2017
No description available.
The MCP23017 device is a 16-bit input-output port expander that can be used to extend the number of general-purpose pins in a microcontroller. Through I2C communication, the MCP23017 can give 16 more general-purpose pins to a microcontroller or microprocessor. Each of the 16 pins can be used as an output or an input with a pull-up. By powering the device from a power supply ranging from 2.7V up to 5.5V, a pin can sink or source current up to 20mA. The MCP23017 can be assigned with eight different addresses, so eight MCP23017 devices can share the same I2C bus and provide 128 extra pins.
This reference design features a circuit wherein the MCP23017 device provides additional GPIO pins to a WiFi module. The WiFi module used in this design is the ESP8266. It is a self-contained system on chip (SoC) with integrated TCP/IP protocol stack that can connect a microcontroller to a WiFi network. When paired with a microcontroller, the ESP8266 can use the GPIOs of the microcontroller to control external devices. But when it is used as a standalone device, the ESP8266 can’t control many devices since it has limited number of GPIO pins. In this design, the MCP23017 expands the GPIO pins of the ESP8266 so that it can control up to 16 devices in standalone configuration. The GPIO0 and GPIO2 pins of the ESP8266 were used to communicate with the MCP23017 through its I2C port. The 16 GPIO pins of the MCP23017 can be used through the header pins at J3.
The MCP23017 has two interrupt pins INTA and INTB that are associated with GPAn pins and GPBn pins, respectively. It also has three I2C address pins (A0, A1, A2) that can be individually pulled HIGH or LOW to select the address of the device from (0x20-0x27). This could be done through headers J5-J7. The header J2 can be used to communicate with the ESP8266 or program it. The ESP8266 operates with a 3.3V power supply. Since the MCP23017 can operate within the range of 2.7V-5.5V, its supply pin is tied together with the ESP8266 supply pin to a 3.3V power supply. The 3.3V power supply can be provided by inserting a 4.75V-18V external power supply at the power jack X1 or inserting a 3.3V power supply directly to J3 pin 2. If an external 3.3V is used at J3 pin 2, be sure to remove the shunt jumper at J4.