]>
Commit | Line | Data |
---|---|---|
91e85d43 BO |
1 | ------------------------------------------------------------------------------- |
2 | Microchip MCP23017 I/O expander with I2C interface | |
3 | ------------------------------------------------------------------------------- | |
4 | ||
5 | This is a set of example captures of the MCP23017 16-bit I/O expander with | |
6 | an I2C interface. For details see the MCP23017/MCP23S17 datasheet which is | |
7 | titled "16-Bit I/O Expander with Serial Interface": | |
8 | ||
9 | http://ww1.microchip.com/downloads/en/DeviceDoc/20001952C.pdf | |
10 | ||
11 | ||
12 | Logic analyzer setup | |
13 | -------------------- | |
14 | ||
15 | The logic analyzer used was a Saleae clone (samplerate 1MHz). In addition | |
16 | to the I2C datalines, 6 output pins are captured too. | |
17 | ||
18 | The host was a Raspberry Pi using Python to access the I2C port. The bitrate | |
19 | decreased after a few 100ms. | |
20 | ||
21 | Probe MCP23017 | |
22 | ------------------- | |
23 | 0 A0 | |
24 | 1 A1 | |
25 | 2 A2 | |
26 | 3 B0 / A3 | |
27 | 4 B1 / A4 | |
28 | 5 B2 / A5 | |
29 | 6 SDA | |
30 | 7 SCL | |
31 | ||
32 | ||
33 | mcp23017_counter_a_write.sr | |
34 | --------------------------- | |
35 | ||
36 | Count the Registers OLATA ascending. The lowest 6 bits of the Output A Port | |
37 | are captured too (A0 - A5). | |
38 | ||
39 | ||
40 | mcp23017_counter_init_ab_write.sr | |
41 | --------------------------------- | |
42 | ||
43 | Reset all registers, then count the registers OLATA ascending and OLATB | |
44 | descending. Both registers are set using one word write operation. The | |
45 | lowest 3 bits of both output ports are captured too (A0 - A2, B0 - B2). | |
46 | ||
47 | ||
48 | mcp23017_counter_init_ab_write_read.sr | |
49 | ------------------------------------- | |
50 | ||
51 | Reset all registers, then count the registers OLATA ascending and OLATB | |
52 | descending. Both registers are set and read using one word write operations. | |
53 | The lowest 3 bits of both output ports are captured too (A0 - A2, B0 - B2). |