Closed FelixWeichselgartner closed 2 years ago
Btw. if the library completely works for me, I will probably do a port for the RPi in the future. I see a lack of good MCP23017-library with full functionality there.
As it seems the problem was caused by some weird pointer error interaction.
I saved the MCP23017 objects in another object.
GPIO* gpio;
In the setup, I initialized the object.
This is good and works:
gpio = new GPIO();
This is bad and causes weird interactions:
*gpio = GPIO();
Hi, so I'm experiencing a weird problem, that I can't identify correctly.
In the Arduino (I'm using an Arduino Uno, 2.2K pull-ups on I²C-bus) setup function I do the following configuration:
In the loop, I have a test program, which turns each pin on individually (all others 0, the tested pin to one; I'm ignoring the ones that are configured as input ofc) to test if the output is working. I monitor the pin states with a 28 pin logic analyzer and therefore see which pin is working. To set the pin states I use the below functions.
My issue is that if I write any pin to the mcp_address-module, pin 10 of the mcp_data_misc-module is not changing its state anymore.
Obviously, I thought this might be a PCB issue (schematic and layout of the PCB for reference). However, I tried 2 copies of the PCB and the issue persists.
One of those PCBs I already tested months ago with the MCP23017-library of WiringPi (obv. on a Raspberry Pi; I had level conversion there for 3.3V RPi GPIO to 5V MCP23017 levels) and back then all pins were working in a similar test.
So my question: Is there anything one has to keep in mind when working with multiple MCP23017? Has anybody experienced a similar issue? Is my configuration or the functions I use wrong?
TY for any help in advance.