Posts: 3
Joined: Wed Mar 02, 2016 3:55 pm

MCP23017 issues

Postby TillmanZ » Fri Feb 17, 2017 12:38 am

Hi there!

I have a MCP23017 on a custom pcb powered with 5vdc connected to a Pi3.
The I2C is directly connected.

Initially I was using only the internal pull-ups on the GPIOs but even though I am heavily debouncing (100ms guard time) in software I still was seeing lots of flipping. For each GPIO port there are two wires of approx. 5-10m length. One wire connected to the GPIO pin and the other to GND. The two wires are connected to magnetic switches and partially also to opto couplers.

Now I thought that maybe the internal pull ups were too weak so I connected 4.7k external pull-ups additionally.
However when I connect the MCP to my bench power (without even connecting to the Pi and the GPIOs just connected to 5VDC via 4.7k) I can see it pulling 2A - obviously only for some seconds as I quickly shut off the power to avoid frying the poor MCP.

So my questions would be:
a) is my wiring off with the external pull-ups or am I missing something?
b) what would be the recommended way to make sure I get proper readings on my long lead switches?
User avatar
Posts: 2608
Joined: Sat Jan 05, 2013 7:28 pm

Re: MCP23017 issues

Postby mikronauts » Fri Feb 17, 2017 1:42 am

2A says you have a short somewhere.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi
Posts: 3
Joined: Wed Mar 02, 2016 3:55 pm

Re: MCP23017 issues

Postby TillmanZ » Fri Feb 17, 2017 3:05 pm

...well, turns out I had my pcb markings mixed up.
No wonder you get a short when GND and VDD are swapped.

So I will test if the larger pull-ups will actually help me get rid of the flipping inputs issue.