You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The interrupt flag is set to reset automatically at every read action from the value (IO) registers.
Issue:
The interrupt does not seem to always reset and the behavior is sporadic.
Possible fixes:
According to the datasheet, a write action to read-only IO registers is required to reset the flag.
I ended up doing this in my code in a dirty way by writing to these registers in the python code.
def reset_interrupt_flags(self, i2c):
# Write to both registers to reset the interrupt flag
buffer = bytearray(2)
buffer[0] = 0x00
buffer[1] = 0x00
i2c.write(buffer)
i2c.write_then_readinto(buffer, buffer, out_end=1, in_start=1)
#print(buffer)
time.sleep(0.1)
buffer[0] = 0x01
buffer[1] = 0x00
i2c.write(buffer)
i2c.write_then_readinto(buffer, buffer, out_end=1, in_start=1)
time.sleep(0.1)
This logic should be abstracted out in the software so that every read automatically resets the interrupt or have a method expose to explicitly reset the interrupt.
You can see my project code that utilizes AW9523 here:
I tried to have a look into this, I'm not able to find reference in the datasheet to what you mentioned about needing to write to a read-only register being required.
If you're still around and happen to know any more specific where to find that within the datasheet please let us know.
Expected behavior:
The interrupt flag is set to reset automatically at every read action from the value (IO) registers.
Issue:
The interrupt does not seem to always reset and the behavior is sporadic.
Possible fixes:
According to the datasheet, a write action to read-only IO registers is required to reset the flag.
I ended up doing this in my code in a dirty way by writing to these registers in the python code.
This logic should be abstracted out in the software so that every read automatically resets the interrupt or have a method expose to explicitly reset the interrupt.
You can see my project code that utilizes AW9523 here:
https://github.com/ubopod/ubo-sdk/blob/main/ubo_keypad/ubo_keypad.py
On the hardware side, it is best not to have floating input pins in hardware and make sure they are pulled up/down)
The text was updated successfully, but these errors were encountered: