This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2632: Differentiate Rising/Falling edge interrupt when triggering on both

Part Number: AM2632

Hi Team,

When using a GPIO Interrupt triggering on Rising and Falling edge, when you get an interrupt is there a good way to differentiate a rising edge or a falling edge other than polling the GPIO pin itself?

Thanks!

-Jack

  • Hello Jack,

    The interrupt won't provide an indicator of whether it is a rising or falling edge. Polling the GPIO is one method.

    Another that I haven't personally tested is to check the trigger registers. The TRM notes the following:

    Reading the SET_RIS_TRIG or CLR_RIS_TRIG register returns the value of the RIS_TRIG register. Reading from the SET_FAL_TRIG and CLR_FAL_TRIG register returns the value of the FAL_TRIG register.

    My initial take on reading the TRM section is that for this to be viable, you'd also have to take the step to clear the trigger registers. So the process would be to ensure both are cleared, when you get an interrupt, check them, and then clear the one that is set.

    Not sure that really nets anything versus polling the IO however.

    Best Regards,

    Ralph Jacobi