Page 2 of 2

Re: MCP23017

Posted: Wed Oct 20, 2021 6:48 pm
by jimhook_uk1
Hi Ben,
I tried to send you a private message but it seems stuck in outbox.

Re: MCP23017

Posted: Thu Oct 21, 2021 11:53 am
by jimhook_uk1
Hi,
I'm having a problem with ReadPortPin again. My main project is commercially sensitive and I don't want to put it up in this public forum, but I've replicated the issue in the attached that I used to test a TLC59116 that is also part of my hardware.

Problem:
The ReadPortPin seems to be ignored but the decision is following the branch where LS1 = 1 regardless of value of port pin I'm reading. The TLC branch is working fine in that it is switching the correct LED on.

I am experiencing the same issue on my main project, the ReadPortPin is not working.

Re: MCP23017

Posted: Fri Oct 22, 2021 12:56 pm
by BenR
Hello,

I'm just looking through your code and it appears your addresses might not be correct.

U16 for example has A0 pulled low and A1,A2 pulled high which should be address 0b110 or 6 but is currently set to 0b011 or 3.

Hopefully this will solve the problem for you.

Re: MCP23017

Posted: Fri Oct 22, 2021 1:11 pm
by jimhook_uk1
Some switches are normally closed and normally open contacts.

Re: MCP23017

Posted: Fri Oct 22, 2021 1:26 pm
by BenR
Hello,

The address pins A0-A2 on the U16 device look to be wired direct to 3V3 or GND.

If you like I can alter the component properties with what I beleive are the correct addresses and return the modified firmware back to you.

edit, I've sent you a PM.