Author Topic: MCP23017 Forgets Direction of one bank  (Read 1519 times)

0 Members and 2 Guests are viewing this topic.

Offline mentaldemiseTopic starter

  • Regular Contributor
  • *
  • Posts: 58
MCP23017 Forgets Direction of one bank
« on: February 13, 2017, 03:24:38 pm »
Has anyone experienced anything similar to this? I have an MCP23017 hooked up to a PI and running some mosfets and reading some IR LEDs on different ports. The IR read port works all the time. The MOSFET out one seems to forget its direction at seemingly random. It's not blowback from the mosfet as it happened last night while the device was just idle. I ran i2cset -y 1 0x20 0x01 0x00 in console next to the python that was still running and the outputs started working again. It seemed to work for at least 24 hours this last go, just really not sure why it's "forgetting" which direction one bank is while it's idle. :(
 

Offline senso

  • Frequent Contributor
  • **
  • Posts: 951
  • Country: pt
    • My AVR tutorials
Re: MCP23017 Forgets Direction of one bank
« Reply #1 on: February 14, 2017, 10:12:05 am »
Lack of decoupling, reset pin is floating(since input is the default reset value, it might be related).
 

Offline mentaldemiseTopic starter

  • Regular Contributor
  • *
  • Posts: 58
Re: MCP23017 Forgets Direction of one bank
« Reply #2 on: February 14, 2017, 10:23:54 am »
I wish it were that simple. I have RESET pulled high. The chip isn't resetting completely, as the IN lines don't stop working, only out. Also, a full reset from taking REST low will crash the python app and that doesn't happen either.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12858
Re: MCP23017 Forgets Direction of one bank
« Reply #3 on: February 14, 2017, 11:30:02 am »
IIRC the MCP23017 is quite buggy, and there are a number of corner cases that Microchip support are aware of and have confirmed which haven't made it into the published errata.
Googling: +"MCP23017"  forum errata will find a number of topics on various forums mentioning them, and if you dig through the dross, you will have some idea of the wide range of ways it can foul up.

I would suggest adding code to read back and confirm the device configuration as frequently as you can without compromising the intended function,  logging all I2C transactions to a ring buffer and if an unexpected configuration change is detected, dumping the ring buffer to a timestamped log file.   Then, as a patch on the problem automatically restore a valid configuration.  Its not a fix, but it will give you ammunition when you contact Microchip support.  If you've go the kit to do it, also log the Vdd supply.  You'll need a DSO that supports one-shot post-trigger with logging or a fast datalogger.  Trigger it with aspare Pi I/O pin.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf