This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Confirmation on GPIOTE Port Interrupt.

Hi,

I have two pins, one handles a system wake-up event and the other reacts to an external uvlo event.

The wake-up event is the only PIN that can interrupt and it configures itself to disable the sense on the pin. This event will only happen when the CPU is in full sleep mode. The interrupt routine will then enable the uvlo event.

The uvlo event uses the pin latch feature. Technically I could use the same approach to disable the sense, and maybe I should, but the latch seems to offer the same feature. My first question is - without using latch one can't determine which pin interrupted in the gpiote int?

My handler is

void GPIOTE_IRQHandler (void) {

  if ((NRF_GPIO->LATCH >> CFG_PIN_POWERMANAGER_UVLO) & 1) {
    POWERMANAGER_EventUvlo();
    return;
  }

  SHUTDOWN_Awake();
}



Again in sleep the latch feature for uvlo pin is disabled, so it hits SHUTDOWN_Awake(), which then runs code to disable the sense for the uvlo pin and enable the sense & latch for the uvlo feature. The uvlo pin may trigger multiple times but the latch prevents the int from refiring.

Just wanting to check I have the correct approach!

Cheers, Andrew

Parents
  • Hello,

    The latch feature is not much used in our SDK, since this is a new feature in the nRF52-series, and for backwards compatibility with the nRF51-series and the fact that the interrupt handler execute so quickly (e.g. a few us) that the pin still is active and can be read from the interrupt directly and/or the pin only go inactive when the third party sensor that caused the interrupt is handled. In such cases the latch feature is typically not required. That said, you description seems straight forward and in-line with what I can find in the product specification on how latch is intended to be used: 
    https://infocenter.nordicsemi.com/topic/ps_nrf52810/gpio.html

    Best regards,
    Kenneth

Reply
  • Hello,

    The latch feature is not much used in our SDK, since this is a new feature in the nRF52-series, and for backwards compatibility with the nRF51-series and the fact that the interrupt handler execute so quickly (e.g. a few us) that the pin still is active and can be read from the interrupt directly and/or the pin only go inactive when the third party sensor that caused the interrupt is handled. In such cases the latch feature is typically not required. That said, you description seems straight forward and in-line with what I can find in the product specification on how latch is intended to be used: 
    https://infocenter.nordicsemi.com/topic/ps_nrf52810/gpio.html

    Best regards,
    Kenneth

Children
No Data
Related