mirror of https://github.com/arendst/Tasmota.git
Updated MCP23008 MCP23017 (markdown)
parent
9f7a48d8a4
commit
ac9cb05314
|
@ -14,10 +14,14 @@ The chip, can however, be wired up quite easily especially if you can source the
|
||||||
|
|
||||||
![Manual Wiring for MCP23008 / MCP23017](https://github.com/andrethomas/images/blob/master/mcp230xx/mcp230xx_manual_wiring_v2.png)
|
![Manual Wiring for MCP23008 / MCP23017](https://github.com/andrethomas/images/blob/master/mcp230xx/mcp230xx_manual_wiring_v2.png)
|
||||||
|
|
||||||
You will need to pick an I2C address in either of the above scenario's but the driver will detect the address automatically. Address mapping according to pin A0,A1 and A2 as from the datasheet is as follows:
|
You will need to pick an I2C address in either of the above scenario's using the address mapping according to pin A0,A1 and A2 as from the datasheet as follows:
|
||||||
|
|
||||||
![MCP23008 / MCP23017 I2C Address Map](https://github.com/andrethomas/images/blob/master/mcp230xx/i2c_address_map.png)
|
![MCP23008 / MCP23017 I2C Address Map](https://github.com/andrethomas/images/blob/master/mcp230xx/i2c_address_map.png)
|
||||||
|
|
||||||
|
You will need to define the address you are using in the user_config.h or user_config_override.h (if you use that method) for the driver to know which address the MCP23008/MCP23017 is expected to be found.
|
||||||
|
|
||||||
|
`#define USE_MCP230xx_ADDR 0x20`
|
||||||
|
|
||||||
The MCP23008/MCP23017 chips allow for both INPUT and OUTPUT - Most of the functionality of the driver is focused on INPUT mode - especially since they allow interrupt reporting and are 5V tolerant.
|
The MCP23008/MCP23017 chips allow for both INPUT and OUTPUT - Most of the functionality of the driver is focused on INPUT mode - especially since they allow interrupt reporting and are 5V tolerant.
|
||||||
|
|
||||||
OUTPUT functionality is however available as pinmode 5 (Documented later in this Wiki) as an additional option for those who want to use the OUTPUT functionality using the sensor29 command at the expense of ~1Kbyte of flash.
|
OUTPUT functionality is however available as pinmode 5 (Documented later in this Wiki) as an additional option for those who want to use the OUTPUT functionality using the sensor29 command at the expense of ~1Kbyte of flash.
|
||||||
|
@ -59,9 +63,14 @@ If you do not find it, check your wiring and pin configuration.
|
||||||
|
|
||||||
The configuration of MCP23008/MCP23017 by using sensor29 commands via serial, web console or MQTT messages
|
The configuration of MCP23008/MCP23017 by using sensor29 commands via serial, web console or MQTT messages
|
||||||
|
|
||||||
This option only requires the main define to be uncommented prior to compilation
|
In order to use the MCP23008/MCP23017 in your build you need to uncomment the following two lines in your user_config.h or user_config_override.h as the MCP chip support is not enabled by default
|
||||||
|
|
||||||
`#define USE_MCP230xx`
|
```
|
||||||
|
#define USE_MCP230xx
|
||||||
|
#define USE_MCP230xx_ADDR 0x20
|
||||||
|
```
|
||||||
|
|
||||||
|
The MCP23008/MCP23017 supports I2C address range of 0x20 through 0x27 so be careful you are not using an address which is already used by another device (e.g. 0x27 is a known address for some I2C Liquid Crystal Displays)
|
||||||
|
|
||||||
The behaviour of all pins on the MCP23008/MCP23017 can be reset to a specific setting/mode globally to simplify the initial configuration as follows
|
The behaviour of all pins on the MCP23008/MCP23017 can be reset to a specific setting/mode globally to simplify the initial configuration as follows
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue