You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,20 @@ MCP23x08 Pin # | MCP23x17 Pin # | Pin Name | Pin ID
35
35
-- | 7 | GPB6 | 14
36
36
-- | 8 | GPB7 | 15
37
37
38
+
# Use of HW address pins for SPI device
39
+
40
+
Library supports MCP23Sxx HW pin addressing (A2, A1, A0 for S17 and A1, A0 for S08)
41
+
To use it provide HW address to begin_SPI(CS, SPI, HW_ADDR) function, and as a result each SPI message will contain correct chip address.
42
+
43
+
Example:
44
+
mcp.begin_SPI(10, &SPI, 0b101);
45
+
46
+
MCP23S08 uses addr pins by default. For MCP23S17 address recognition must be enabled by enableAddrPins() function. **NOTE** Calling enableAddrPins() will enable IOCON.HAEN bit for all active (CS low) devices on SPI bus.
47
+
**NOTE**
48
+
There is hardware bug in the MCP23S17 chip, see "MCP23S17 Rev. A Silicon Errata".
49
+
As a result, if using device with A2 = high, and not using addressing, hw address must be set to 0b1XX
50
+
In such case, even if not using addressing, initalize your MCP23S17 chip with 0b1XX address, eg: mcp.begin_SPI(10, &SPI, 0b100);.
51
+
38
52
# Warning
39
53
40
54
Some people have reported an undocumented bug that can potentially corrupt the I2C bus.
0 commit comments