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

nRF9160 interrupt on pin change

Which digital IO pins on the nRF9160 support interrupt on pin change?

I'm implementing an antenna MUX control routine where the MUX control (3 pins out of nRF9160) depends on 3 pins in (need interrupt on change on all three) and internal states of the nRF9160. This is essentially a look-up table. It contains very little code but must run quickly after an external pin change is detected. 

What is the deepest sleep mode where the nRF9160 can still have a quick interrupt handle response to external pin change?

Thanks!

Børge

  • Hi Børge,

     

    I'm implementing an antenna MUX control routine where the MUX control (3 pins out of nRF9160) depends on 3 pins in (need interrupt on change on all three) and internal states of the nRF9160. This is essentially a look-up table. It contains very little code but must run quickly after an external pin change is detected. 

     Switching in/out antennas for the nRF9160? I would recommend that you look at MAGPIO/COEX if that is the case. The Thingy91 hardware files also includes more complex switching, although for antenna tuners and not the antenna itself.

     

    If this is other sorts of switching (ie. application specific switching), you can use either the GPIOTE PORT event or a dedicated GPIOTE IN channel to detect (rising or falling edge).

     

    A GPIOTE IN channel consumes approx. 30 uA in sleep. GPIOTE PORT event (level triggered wake condition) is lower power.

     

    Which digital IO pins on the nRF9160 support interrupt on pin change?

     Any unused GPIO. The pin crossbar is configurable.

     

    What is the deepest sleep mode where the nRF9160 can still have a quick interrupt handle response to external pin change?

    Imcuonidle, also known as systemon idle mode on the nRF5-series devices. The systemoff mode will be reset on wakeup condition, so that isn't quick. 

    What is your timing requirement for handling the pin-change?

    you can try this example to evaluate:

    https://github.com/nrfconnect/sdk-zephyr/blob/master/samples/basic/button/src/main.c#L71

    That specific line enables GPIOTE IN channel to be used, actually; all EDGE configurations do.

    While if you change to a specified level, like GPIO_INT_LEVEL_HIGH, it will use GPIOTE PORT event (lower power, but might not work for your scenario)

      

    Kind regards,

    Håkon

Related