StamPLC: Interrupt of IO expander AW9523
-
I have a M5Stack StamPLC. According to the PCB schema, the ESP G14 (SYS_INT) is connected to the AW9523 INTN. According to AW9523 specs INTN indicates state changes of IO ports and it should be 0 (low-level active), if new state (interrupt request). Unfortunately INTN is always active. It doesn't matter how the AW9523 interrupt enable register is configured or whether data was already read. It's always active. According to AW9523 specs, a 4.7 kΩ resistor is needed to make INTN work properly. I can't see that on the PCB schema of StamPLC. But why is INTN then connected to the ESP? Or is any other IC in the StamPLC putting SYS_INT constantly to 0? Any hints?
-
Hello @nvko23
well, according to the schematics, SYS_INT is connected to multiple ICs, including PI4IOE5V6408, RX8130, AW9523, LM75 and INA226.
The required pull-up resistor (5.1k) is R10 - it's drawn near PI4IOE5V6408 on the CPU schematic.
Edit: I ran some tests - this is what I found:
- Without any connections to Inputs 1 - 8 SYS_INT is high (as expected).
- However if any input is asserted while powering up M5StampPLC SYS_INT goes low even though AW9523 interrupts are disabled during its initialization. See here.
Adding
_io_expander_b->resetIrq();
in the M5StapPLC library after disabling interrupts changes SYS_INT back to high.My conclusion: AW9523 by default at power up has interrupts enabled and any interrupt sticks even when interrupts are disabled later on.
Thanks
Felix