2024-08-28 12:32 AM
Hello,
I'm working on a project involving an STM32F103 and a mcp23017 port expander.
I've connected the mcp23017 INTA to PA15, no pull-up or down involved.
I'm able to drive the mcp23017 via I2C, no problem about that.
The problem I have is detecting the mcp23017 output status.
Two kinds of configuration works to me:
A) The mcp23017 is configured as active high output, while the PA15 as EXTI Rising edge trigger detection with no pull-up/down. This configuration works ONLY after i force a shortcut between INTA/PA15 and GND.
B) The mcp23017 is configured as active low output, while the PA15 as EXTI Falling edge trigger detection with no pull-up/down. This configuration works ONLY after i force a shortcut between INTA/PA15 and VCC.
The problem is that at every power-up, the shortcut is needed.
Seems something related to a "polarization" of the output.
I've try other configurations (opendrain on mcp23017 and pull-up/down on STM32) with any success.
I'm thinking about adding an NPN between INTA and the STM32 input. Does anyone have an idea of why I've to shortcut at any power-up, and/or how to solve this?
Thank you!
2024-09-02 08:55 AM
My mistake,
I've now realized I do not read the GPIO* registers after initializing the interrupt, this way the firmware enter a states where is expect falling and does not reset the mcp23017 that is now active low and waits for the reads of the GPIO* registers to reset.
So, in one word: SOLVED.