WREN 12S ME SDK – I2C GPIO
The WREN 12S ME SDK uses the popular MCP23017 I2C GPIO Expander to interface to the Motor Controller and Input Controller.
Using an Arduino library, such as one available from Adafruit MCP23017, you are easily able to control both the inputs and outputs with simple lines of code. An example of code can be found in the WREN 12S ME SDK – Board Bring Up and Test Code
An expanded external generic Arduino MCP230174 Tutorial can be found on tronixstuff
Home Automation, such as Tasmota, also supports as standard the MCP23017. A specific datasheet is available from Tasmota.
A list of the GPIOs is shown below, taken from WREN 12S ME SDK – GPIO Matrix
GPIO | NET | Pin | Input | Output | Notes |
---|---|---|---|---|---|
/RST | /RST | 1 | Y Pull Up | CHIP_PU 10k to 3v3 | |
ADC | DC_ADC | 2 | Y | ADC - Input Volt Sense 30V Potential Divider | |
EN | EN | 3 | Y Pull Up | Pull Down To Disable. UART DTR | |
16 | /LBLUE | 4 | Y | Blue LED - Low for Active LED | |
14 | TP | 5 | |||
12 | /LGREEN | 6 | Y | Green LED - Low for Active LED | |
15 | TP | 7 | Y | Y | |
VCC | 3V3 | 8 | |||
GND | GND | 9 | |||
13 | IO_INT | 10 | Y Pull Up | MCP23017 INTB Out | |
2 | /LRED | 11 | Y | Red LED - Low for Active LED. via 100R | |
0 | GPIO0 | 12 | Y Pull Up | UART RTS | |
4 | SDA | 13 | I2C SDA | ||
5 | SCL | 14 | I2C SCL | ||
RXD | RXD | 15 | UART RXD | ||
TXD | TXD | 16 | UART TXD | ||
GPA0 | EN_A | #21 D0 | sensor29 0 | MCP23017 - 0x20 | |
GPA1 | OUT_1A | #22 D1 | sensor29 1 | MCP23017 - 0x20 | |
GPA2 | OUT_2A | #23 D2 | sensor29 2 | MCP23017 - 0x20 | |
GPA3 | EN_B | #24 D3 | sensor29 3 | MCP23017 - 0x20 | |
GPA4 | OUT_1B | #25 D4 | sensor29 4 | MCP23017 - 0x20 | |
GPA5 | OUT_2B | #26 D5 | sensor29 5 | MCP23017 - 0x20 | |
GPB0 | IN_1A | #1 D8 | sensor29 8 | MCP23017 - INTB OUT - 0x20 | |
GPB1 | IN_1B | #2 D9 | sensor29 9 | MCP23017 - INTB OUT - 0x20 | |
GPB2 | IN_2A | #3 D10 | sensor29 10 | MCP23017 - INTB OUT - 0x20 | |
GPB3 | IN_2B | #4 D11 | sensor29 11 | MCP23017 - INTB OUT - 0x20 | |
GPB4 | /TALM | #5 D12 | sensor29 12 | MCP23017 - INTB OUT - 0x20 |