Update bad wording

Andre Thomas 2018-12-10 08:34:27 +02:00
parent f594c468be
commit d7f89c0d47
1 changed files with 15 additions and 13 deletions

@ -8,7 +8,7 @@ Generally available breakout boards for the MCP23017 look similar to this:
![https://github.com/andrethomas/images/raw/master/mcp230xx/mcp23017_breakout.jpg](https://github.com/andrethomas/images/raw/master/mcp230xx/mcp23017_breakout.jpg)
The MCP23008 has 8 IO pins which the MCP230xx driver uses as D0 - D7. The MCP23017 has 16 IO pins which the MCP230xx driver uses as D0 - D15. This is visualised in the circuit diagram below but it's important to note that the MCP23017 actually differentiates between PORTA (being A0 to A7) and PORTB (being B0 to B7) - The MCP230xx driver combines the two ports in sequence to translate to pins represented as D0 through D15 for the MCP23017.
The MCP23008 has 8 IO pins which the MCP230xx driver uses as D0 - D7. The MCP23017 has 16 IO pins which the MCP230xx driver uses as D0 - D15. This is visualized in the circuit diagram below but it's important to note that the MCP23017 actually differentiates between PORTA (being A0 to A7) and PORTB (being B0 to B7) - The MCP230xx driver combines the two ports in sequence to translate to pins represented as D0 through D15 for the MCP23017.
The chip, can however, be wired up quite easily especially if you can source the DIP version of the chip. Here's a basic outline of what a typical circuit would require to be functional:
@ -28,7 +28,7 @@ OUTPUT functionality is however available as pinmode 5 (Documented later in this
The driver is disabled by default in the Tasmota firmware so the only way to gain its use would be to perform a manual compilation of your own firmware.
There are three different levels in which functionality may be enabled, in the following order, by uncommenting the relevant lines in the user_config.h file (or added to the user_config_override.h file if you are using that option.)
There are three different levels in which functionality may be enabled, in the following order, by removing the remove the comment (#) out the relevant lines in the user_config.h file (or added to the user_config_override.h file if you are using that option.)
```
#define USE_MCP230xx // Enable INPUT mode (pinmode 1 through 4)
#define USE_MCP230xx_OUTPUT // Enable OUTPUT mode (pinmode 5)
@ -63,7 +63,7 @@ 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
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
In order to use the MCP23008/MCP23017 in your build you need to remove the comment (#) for 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
@ -163,7 +163,7 @@ Where:
**2** = Immediate TELEMETRY only (no EVENT caused)
Weak interal pull-up resistors are only enabled for pinmode 1 through 4 (being INPUT of nature) but the same parameter may also be used to set the default state of an OUTPUT pin on reset/power-up. If your device is configured to SAVE_STATE (setoption0 = 1) then this will be ignored during power-up/reset and the last known state of the pin will be applied during power-up/reset.
Weak internal pull-up resistors are only enabled for pinmode 1 through 4 (being INPUT of nature) but the same parameter may also be used to set the default state of an OUTPUT pin on reset/power-up. If your device is configured to SAVE_STATE (setoption0 = 1) then this will be ignored during power-up/reset and the last known state of the pin will be applied during power-up/reset.
### IMPORTANT NOTICE ON USE OF INTERRUPTS
@ -183,7 +183,7 @@ Examples of some pin configuration options:
Pull-up resistor support is valid for all modes from 1 through 4
Default telemetry logging will occur for all pins as per the configured logging interval of the ESP8266 as configured in the Tasmota firmware options. The telemetry logging will push out to log and mqtt a JSON as follows:
Default telemetry logging will occur for all pins as per the configured logging interval of the ESP8266 as configured in the Tasmota firmware options. The telemetry logging will push out to log and MQTT a JSON as follows:
```
tele/sonoff/SENSOR = {"Time":"2018-08-18T16:13:47","MCP230XX": "D0":0,"D1":0,"D2":1,"D3":0,"D4":0,"D5":0,"D6":0,"D7":1}}
```
@ -203,7 +203,7 @@ Interrupt message on LOW for input pin 1
MQT: stat/sonoff/RESULT = {"Time":"2018-08-19T16:04:50","MCP230XX_INT":{"D1":0,"MS":519}}
```
The state of the pin captured during the interrupt is reported as Dx=y where x is the pin number and y is the state of the pin. In addition the number of milliseconds since the last interrupt occured for the particular pin is also reported as MS=xx where xx is the number of milliseconds recorded.
The state of the pin captured during the interrupt is reported as Dx=y where x is the pin number and y is the state of the pin. In addition the number of milliseconds since the last interrupt occurred for the particular pin is also reported as MS=xx where xx is the number of milliseconds recorded.
In addition to the MQTT message the driver will also execute an event command in the following format:
@ -235,7 +235,7 @@ In the example above the rule would respond to an interrupt of HIGH on pin 0 of
See the Wiki on [Using Rules](https://github.com/arendst/Sonoff-Tasmota/wiki/Rules) for more information on how this can be helpful to your requirements.
If you require only one of the two reporting methods you may use the sensor29 command to configure the interrupt behaviour according to your requirements using command:
If you require only one of the two reporting methods you may use the sensor29 command to configure the interrupt behavior according to your requirements using command:
`sensor29 pin,pinmode,pullup,intmode`
@ -254,7 +254,7 @@ These include the following
* INTDEF - Interrupt Deffer, being able to control the number of interrupts that are ignored on a specific pin before reporting would occur via telemetry and/or EVENT.
* INTTIMER - Interrupt Timer which allows for time based counter reporting, specifically reporting the number of times an interrupt has occurred on interrupt enabled pins.
* INTCNT - Works with INTTIMER to enable/disable counting for a specific pin.
* INTRETAIN - Keep track of whether an interrupt occured or not and defer reporting to next telemetry message.
* INTRETAIN - Keep track of whether an interrupt occurred or not and defer reporting to next telemetry message.
The above additions are described in further detail below.
@ -284,7 +284,7 @@ sensor29 intpri,10 // interrupt polled every 10*50 milliseconds, approximated
### ADVANCED FUNCTION #2 - INTERRUPT DEFER (INTDEF)
This setting is useful if you need to defer the reporting of an interrupt by event or telemetry until it has occured at least X number of times.
This setting is useful if you need to defer the reporting of an interrupt by event or telemetry until it has occurred at least X number of times.
Syntax:
```
@ -298,7 +298,7 @@ sensor29 intdef,pin,5 // Will only report interrupt when it occurs 5 times
sensor29 intdef,pin,10 // Will only report interrupt when it has occured 10 times
```
Interrupts occuring a number of times prior to the setting will be counted but ignored for reporting purposes.
Interrupts occurring a number of times prior to the setting will be counted but ignored for reporting purposes.
### ADVANCED FUNCTION #3 - INTERRUPT TIMER (INTTIMER)
@ -321,7 +321,7 @@ sensor29 intcnt,pin // Readback current setting of interrupt counting for
sensor29 intcnt,pin,x // Enable/Disable interrupt counting for pin (x=0=OFF,x=1=ON)
```
Use case example could be if you want to count the number of times an interrupt occured on a D0 over a period of 60 seconds. For this we will need the following:
Use case example could be if you want to count the number of times an interrupt occurred on a D0 over a period of 60 seconds. For this we will need the following:
```
sensor29 inttimer,60 // Enable interrupt timer for 60 second interval
sensor29 intcnt,0,1 // Enable interrupt counter for pin D0
@ -341,7 +341,9 @@ If this is enabled for a particular pin and the pin has an interrupt mode config
{"Time":"2018-12-06T23:59:26","MCP_INTRETAIN": {"D0":1,"D1":0,"D2":1,"D3":1,"D4":0,"Value":13}}
```
In the example above it means that an interrupt occured at some point during the previous telemetry period for pins D0, D2, and D3 as indicated by the 1's present for each pin - Pins with a value of 0 means that although the pin was configured for interrupt retain that no interrupt occured during the previous telemetry period for that particular pin. For the sake of handling bitwise operations within your home automation software the decimal value of the respective bits are also aggrevated into the Value output included in the telemetry message.
In the example above it means that an interrupt occurred at some point during the previous telemetry period for pins D0, D2, and D3 as indicated by the 1's present for each pin - Pins with a value of 0 means that although the pin was configured for interrupt retain that no interrupt occurred during the previous telemetry period for that particular pin.
For the sake of handling bit-wise operations within your home automation software the decimal value of the respective bits are also aggregated into the Value output included in the telemetry message.
Syntax:
```
@ -351,7 +353,7 @@ sensor29 intretain,pin,x // Enable/Disable interrupt counting for pin (x=0=O
***
### OUTPUT FUNCTIONS (PIN MODES 5 AND 6)
Enable OUTPUT support by uncommenting the following compiler directive to your user_config.h
Enable OUTPUT support by removing the comment (#) for the following compiler directive to your user_config.h
`#define USE_MCP230xx_OUTPUT`