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

nRF52840 SDK16 - Configure and create an Interrupt

Hi everyone,

I suppose that this is a simple question but I cannot figure out what I am doing wrong. I am trying to set up an interrupt for a GPIO

I call the createInterrupt() function on the main() to configure, initialize and enable the interrupt.

void createInterrupt() {

  nrf_drv_gpiote_init(); //Initialize GPIOTE module

  // configuration
  nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true); // Indicates that the input pin (WC_CHG) will generate an event when the input value is changed from HIGH to LOW, meaning that the system has been placed on the charger
  in_config.pull = NRF_GPIO_PIN_PULLUP;                                       // Configure the pin to have pull-up

  nrf_drv_gpiote_in_init(WC_CHG, &in_config, chargingInterrupt); // Initialize the interrupt

  nrf_drv_gpiote_in_event_enable(WC_CHG, true); // Enable event and corresponding interrupt
  
}

I want to interrupt from HIGH to LOW so, during configuration I enable the pull up resistor of WC_CHG. However, I do not measure any voltage on WC_CHG (this is GPIO P1.14) after compiling the code.. I was expecting to measure the source of the pull-up resistor. Is this normal?

Do I have to take anything else into account while creating the interrupt?

Thanks in advance

Nick

Related