Skip to content

Issue with clearing the Interrupt signal #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zytegalaxy opened this issue Aug 18, 2023 · 1 comment
Open

Issue with clearing the Interrupt signal #9

zytegalaxy opened this issue Aug 18, 2023 · 1 comment

Comments

@zytegalaxy
Copy link

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.

    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:

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)

  • disabling interrupt for register bit (pins) that are not listening in the code.
@zytegalaxy zytegalaxy changed the title Issue with Interrupt Reset Issue with clearing the Interrupt signal Aug 19, 2023
@FoamyGuy
Copy link
Contributor

FoamyGuy commented Nov 6, 2024

Sorry there was such a delay before a response.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants