ADP5589 - Clearing /INT

Figure 13 in the data sheet implies the /INT output (via EVENT_INT) deasserts when the FIFO is empty but that isn't the behavior I observe. My code monitors when /INT goes low then reads the event count register then reads that many FIFOs. But even though I empty the FIFO, I then have to specifically clear EVENT_INT by writing 0x01 to register 0x01. What's disturbing is this write operation even deasserts /INT when the FIFO is not empty, possibly causing my code to miss an event. How should I configure and interpret the registers so I can't miss or accidentally dump a key event in the FIFO based on monitoring the /INT signal?

  • 0
    •  Analog Employees 
    on Aug 27, 2015 1:14 AM

    Hello,

    I am using an ADP5589 to perform the following to attempt to recreate your issue:

       Set register 0x4D to 0x80 (oscillator enable)

       Set register 0x4E to 0x01 (Enable Event Interrupts)

       Set register 0x49 to 0xFF (Set all pins to KP)

       Set register 0x4A to 0xFF (Set all pins to KP)

       Set register 0x4B to 0x07 (Set all pins to KP)

       All other registers are left to default 0.

       At first, I note there is no interrupt.

       I press and release a key in order to load two events into the FIFO, and I get the interrupt.

       Reading the event count, I get 2.

       Writing to Event Int, I attempt to clear the interrupt, but it does not clear (as expected).

       I read register 0x03 (could be any FIFO register) to remove one element from the FIFO. It returns key press 1.

       Reading the event count now returns 1.

       Writing to Event Int, I attempt to clear the interrupt, but it does not clear (as expected).

       I read register 0x03 (could be any FIFO register) to remove one more element from the FIFO. It returns key release 1.

       Reading the event count now returns 0.

       Writing to Event Int, I attempt to clear the interrupt, and it clears (as expected).

    From this example, it appears the interrupt pin is working as expected, and can only be cleared when the event count is 0.

    1. What register settings are you using, specifically from 0x48 to 0x4E?

    2. What type of event are you using to trigger the interrupt.

    I can try to recreate the issue with settings closer to your configuration if you supply them.

    Thanks,

    RSchnell

  • Thanks for the prompt reply. I can't duplicate the original problem! It now works as you describe. The only thing I'm doing different from your example is my key matrix is 5 rows (R0-R4) and 6 columns (C0-C5) and I'm using the remaining pins as GPIO outputs. I'm only capturing key press/release events. My code initializes the registers as follows. Everything else is reset/defaults.


    GENERAL_CFG_B> 0x4D = 0x80 (OSC_EN)

    INT_EN> 0x4E = 0x01 (EVENT_IEN)


    PIN_CFG_A> 0x49 = 0x1F (R7-R5 = GPIO, R4-R0 = ROW)

    PIN_CFG_B> 0x4A = 0x3F (C7-C6 = GPIO, C5-C0 = COL)

    PIN_CFG_C> 0x4B = 0x00 (C10-C8 = GPIO)


    GPIO_DIRECTION_A> 0x30 = 0xE0 (GPIO 8-6 = OUTPUT)

    GPIO_DIRECTION_B> 0x31 = 0xC0 (GPIO 16-15 = OUTPUT)

    GPIO_DIRECTION_C> 0x32 = 0x07 (GPIO 19-17 = OUTPUT)


    GPIO_DATA_OUT_A> 0x2A = 0xE0 (Set GPIO 8-6 HIGH)

    GPIO_DATA_OUT_B> 0x2B = 0xC0 (Set GPIO 16-15 HIGH)

    GPIO_DATA_OUT_C> 0x2C = 0x07 (Set GPIO 19-17 HIGH)


    GPIO_DATA_OUT_A> 0x2A = 0x00 (Set GPIO 8-6 LOW)

    GPIO_DATA_OUT_B> 0x2B = 0x00 (Set GPIO 16-15 LOW)

    GPIO_DATA_OUT_C> 0x2C = 0x00 (Set GPIO 19-17 LOW)


    After initialization, I poll /INT and if it's asserted, read the FIFO count. I can now only clear /INT after the FIFO is empty so it works properly. I'll keep playing with this to see if I can reproduce the original problem but everything is working fine now. Somehow I must have been reading all the FIFO contents without realizing it.

  • 0
    •  Analog Employees 
    on Aug 28, 2015 10:28 PM

    That's good news! Please let me know if you find any issues, or have any questions.

    RSchnell

  • 0
    •  Analog Employees 
    on Aug 2, 2018 3:10 PM
    This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin