ernsteryung
Posts: 2
Joined: Mon Sep 27, 2021 4:34 pm

Am i connecting this MCP23017 correctly

Mon Sep 27, 2021 4:40 pm

Hi,
im trying to connect a MCP23017 I2C IO Expander to my pi pico and would like to know if i wired it up correctly.

I understand my circuit like this:

Pico 3V output to "voltage in" and "Reset" of MCP.
Pico GND to Adress Pins and GND of MCP.
Pico SDA (GPIO 0) to SDA of MCP.
Pico SLC(GPIO 1) to SLC of MCP.
Attachments
Breadboard.jpg
Breadboard.jpg (172.18 KiB) Viewed 206 times
Schematic.png
Schematic.png (228.78 KiB) Viewed 206 times

hippy
Posts: 10728
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Am i connecting this MCP23017 correctly

Tue Sep 28, 2021 7:13 pm

You probably need pull-ups on SDA and SCL though internal pull-ups might suffice.

You could connect A0, A1, A2 to 3V3 on the left-hand breadboard which may make things tidier, reduce the number of wires between boards.

ernsteryung
Posts: 2
Joined: Mon Sep 27, 2021 4:34 pm

Re: Am i connecting this MCP23017 correctly

Wed Oct 06, 2021 2:27 pm

Thanks, you were right about the pull ups. The circuit works now.


I have a follow up question: Can i connect two gpio inputs to the same button (pull up enabled) as shown in this picture, to measure the latency of the mcp23017?
Breadboard2.jpg
Breadboard2.jpg (209.96 KiB) Viewed 113 times

hippy
Posts: 10728
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Am i connecting this MCP23017 correctly

Wed Oct 06, 2021 3:12 pm

ernsteryung wrote:
Wed Oct 06, 2021 2:27 pm
Can i connect two gpio inputs to the same button (pull up enabled) as shown in this picture, to measure the latency of the mcp23017?
Yes that should work.

If either or both of the inputs are actually outputs because of configuration or by accident it would not be electrically safe so would not be recommended generally. But if sure that neither will be output it will work.

Return to “General”