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

How to implement interrupt using GPIO (not GPIOTE) peripheral

Hi all,

I am trying to create a very simple program with GPIO peripheral (not GPIOTE) that toggles the state of an output pin through an interrupt handler, when an input pin is toggled (i.e button).

I have already seen the pin_change_int example that uses the GPIOTE peripheral to create an interrupt. But since this peripheral has 8 channels (correct?) and I need more that 10 inputs to trigger interrupt I thought  to use the GPIO peripheral because  In the nRF52840 datasheet (Chapter 6.9 page149) it says that GPIO peripheral features interrupt triggering on state changes on any pin.

I tried to implement the GPIO interrupt by adding the nrf_gpio.h in my main but there is no INTENSET register or some function for GPIO peripheral that I can use to create an interrupt.

So what am I doing wrong here?

Thank you

Parents Reply
  • Hi, Thank you for the reply. Indeed it helps a lot but this is for gpiote peripheral not gpio.

    I notice that most of the questions regarding basic implementation of interrupts refer to the pin_change_int where the gpiote is used but not tte gpio peripheral 

    I would like to learn if I can do the same thing with GPIO peripheral and how it is done and if not why..

    I suspect that it can be done with detect signal and sense mechanism of the GPIO but I cannot understand how to combine an interrupt with that mechanism (if this is the way it can be done)

    Thanks

Children
Related