@@ -18,10 +18,11 @@ Related to the PCF8575 16 channel IO expander library https://github.com/RobTil
1818This library gives easy control over the 8 pins of a PCF8574 and PCF8574A chip.
1919These chips are identical in behaviour although there are two distinct address ranges.
2020
21- | TYPE | ADDRESS-RANGE | notes |
22- | :---------| :-------------:| :------------------------:|
23- | PCF8574 | 0x20 to 0x27 | same range as PCF8575 !! |
24- | PCF8574A | 0x38 to 0x3F | |
21+ | type | address-range | notes |
22+ | :-----------| :---------------:| :-------------------------:|
23+ | PCF8574 | 0x20 to 0x27 | same range as PCF8575 ! |
24+ | PCF8574A | 0x38 to 0x3F |
25+
2526
2627So you can connect up to 16 PCF8574 on one I2C bus, giving access
2728to 16 x 8 = 128 IO lines. To maximize IO lines combine 8 x PCF8575 + 8 x PCF8574A giving
@@ -45,24 +46,44 @@ There are two examples to show how interrupts can be used:
4546- PCF8574_rotaryEncoder.ino
4647
4748
49+ #### Related
50+
51+ 16 bit port expanders
52+
53+ - https://github.com/RobTillaart/MCP23017_RT
54+ - https://github.com/RobTillaart/MCP23S17
55+ - https://github.com/RobTillaart/PCF8575
56+
57+
58+ 8 bit port expanders
59+
60+ - https://github.com/RobTillaart/MCP23008
61+ - https://github.com/RobTillaart/MCP23S08
62+ - https://github.com/RobTillaart/PCF8574
63+
64+
4865## I2C Clock
4966
5067Tested on UNO with ** PCF8574_performance** showed that the PCF8574 still works at 500 KHz and failed at 600 KHz.
5168These values are outside the specs of the datasheet so they are not recommended.
5269However when performance is needed you can try to overclock the chip.
5370
54- | clock speed | Read | Write | Notes |
55- | :-----------:| :------:| :-------:| :------------------|
56- | 100000 | 236 | 240 | spec datasheet |
71+ | clock speed | Read | Write | Notes |
72+ | :-----------:| :------:| :-------:| :-------------------- |
73+ | 100000 | 236 | 240 | spec datasheet |
5774| 200000 | 132 | 140 |
5875| 300000 | 104 | 108 |
59- | 400000 | 96 | 96 | max advised speed |
60- | 500000 | 92 | 92 | not recommended |
76+ | 400000 | 96 | 96 | max advised speed |
77+ | 500000 | 92 | 92 | not recommended |
6178| 600000 | crash | crash |
6279
6380
6481## Interface
6582
83+ ``` cpp
84+ #include " PCF8574.h"
85+ ```
86+
6687** PCF8574_INITIAL_VALUE** is a define that can be set compile time or before
6788the include of "pcf8574.h" to overrule the default value used with the ** begin()** call.
6889
@@ -144,11 +165,11 @@ This can typical be used to implement a VU meter.
144165
145166## Error codes
146167
147- | name | value | description |
148- | :-------------------| :-----:| :------------------------|
149- | PCF8574_OK | 0x00 | no error |
150- | PCF8574_PIN_ERROR | 0x81 | pin number out of range |
151- | PCF8574_I2C_ERROR | 0x82 | I2C communication error |
168+ | name | value | description |
169+ | :-------------------- | :------- :| :-- ------------------------|
170+ | PCF8574_OK | 0x00 | no error |
171+ | PCF8574_PIN_ERROR | 0x81 | pin number out of range |
172+ | PCF8574_I2C_ERROR | 0x82 | I2C communication error |
152173
153174
154175## Operation
@@ -160,6 +181,17 @@ It is advised to use pull-up or pull-down resistors so the lines have a defined
160181
161182## Future
162183
163- -
184+ #### Must
185+
186+ - keep in sync with PCF8575
187+
188+ #### Should
189+
190+
191+ #### Could
192+
193+ - move code to .cpp
194+
195+ #### Wont
164196
165197
0 commit comments