MCP23017

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Dick60
Normal user
Posts: 243
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

MCP23017

#1 Post by Dick60 » 24 Jun 2018, 15:48

I have a problem with the MCP23017 i.c.w. my 8266 (GIT version: mega-20180621) in a I2C setup. The ports of the MCP23017 are working as a switch with Domoticz as Controller. After starting the 8266, all ports of the MCP23017 are working fine but after a few minutes all ports stop working. There is no sleep active on my 8266. I alread tried to disconnect the MCP23017 and connect again but that did not help to get is working. After a rst of the 8266. it start working again. More info: in my log file I see that the 8266 is still connected but no way to use the ports of the MCP23017. Does anyone recognize this behaviour?

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: MCP23017

#2 Post by papperone » 24 Jun 2018, 17:30

I use a lot MCP23017 and MCP23008 without the issue you are experiencing...
I use custom PCBs with both DIP and SMD version of above chip, how do you connect ESP to the chips?
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

Dick60
Normal user
Posts: 243
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: MCP23017

#3 Post by Dick60 » 24 Jun 2018, 19:25

I use the MCP23017 DIP SOP Bidirectional 16-Bit I/O Expander I2C IIC Serial Interface version bought on Ebay. It is connected plus and min on the two connectors and use the GPIO ⇾ SCL: GPIO-5 GPIO ⇿ SDA:GPIO-4 . It is strait forward and ik works fine for about 5 minutes and than it stops but my ESP still connected because in my log file of the esp pops up everytime
WD : Uptime 237 ConnectFailures 0 FreeMem 19600

I alredy tries another MCP but that had the same problem so I also changed the ESp, ans the same behaviour.

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MCP23017

#4 Post by TD-er » 24 Jun 2018, 19:42

Do you have something else connected to the I2C bus? (try to disable that other plugin and reboot, no need to disconnect the other device)
Do you use pull-up resistors on both I2C lines? (if not, please try)

It somewhat sounds like the I2C bus needs some reset.

Dick60
Normal user
Posts: 243
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: MCP23017

#5 Post by Dick60 » 24 Jun 2018, 19:58

there is nothing else connected it is only the MCP. About the pull up registers, I am not that experience but is that I have to place a 10K register from the GPIO ⇾ SCL: GPIO-5 and GPIO ⇿ SDA:GPIO-4 to the plus? is that correct?

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MCP23017

#6 Post by TD-er » 24 Jun 2018, 20:03

Dick60 wrote: 24 Jun 2018, 19:58 there is nothing else connected it is only the MCP. About the pull up registers, I am not that experience but is that I have to place a 10K register from the GPIO ⇾ SCL: GPIO-5 and GPIO ⇿ SDA:GPIO-4 to the plus? is that correct?
Yep, that's correct. At least when using 2 resistors, but you probably do that or else it would not work for 5 minutes.

How is the power line of the sensor connected? To the same 3.3V line as the ESP?

Dick60
Normal user
Posts: 243
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: MCP23017

#7 Post by Dick60 » 24 Jun 2018, 20:09

thanks and about the power lines, I have an external power supply of 5v connected the the Vin on the ESP and also to the MCP on the IO side. The other powerline on the MSP is connected to the esp 3.3v

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MCP23017

#8 Post by TD-er » 24 Jun 2018, 20:16

Dick60 wrote: 24 Jun 2018, 20:09 thanks and about the power lines, I have an external power supply of 5v connected the the Vin on the ESP and also to the MCP on the IO side. The other powerline on the MSP is connected to the esp 3.3v
Sorry, I was mixing up two topics in my head. (see viewtopic.php?f=5&t=5499 )
The power line is probably not an issue. (unless I am mistaken here)

Dick60
Normal user
Posts: 243
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: MCP23017

#9 Post by Dick60 » 24 Jun 2018, 20:55

An update of my testing, Still running after one hr! I can finish my project. Thanks for the support! :D

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MCP23017

#10 Post by TD-er » 24 Jun 2018, 23:13

Did you change anything?

Elektrofreak
Normal user
Posts: 22
Joined: 03 Mar 2016, 09:06

Re: MCP23017

#11 Post by Elektrofreak » 25 Jun 2019, 08:00

I have seen in the source code that the pull-up resistors are enabled by default if a GPIO is configured as an input (if I checked correctly). Is it possible to implement an improvement to configure the input pull-up in the configuration view of the input (enable or disable if needed)? Just like an input of the ESP where you can configure the pull-up and pull-down resistors.

Edit: I cannot check at the moment but are non-defined GPIOs which are used as outputs by default pulled up as well? This is what worries me the most because I would need to invert each signal in the hardware :o

This would be helpful for some projects :-)

Thank you for the support :-)

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests