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

nRF52811 GPIOTE problem

Dear all,

I have a problem with nRF52811 GPIOTE input interrupt.

I have one sensor interrupt pin at GPIO P0.30 with external pull down resistor.
I am able to config P0.30 to gpiote input.

But when GPIO0.30 goes high (3.3V), interrupt never happen.

Could you please help me to figure out why interrupt never fire.

Thank you.

volatile uint32_t x = 0;
static void on_smoke_alarm(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
	x  = 1; // insert breakpoint here to check interrupt, but it never fire
}

void smoke_detector_config_io_initialize()
{
	 #define SENSOR_SMOKE_PIN                      (30)
        /* Initialize interrupt pin */
        ret_code_t err_code;

	if (!nrf_drv_gpiote_is_init())
        {
            err_code = nrf_drv_gpiote_init();
            APP_ERROR_CHECK(err_code);
        }
        

        // Enable smoke detector pin
	nrf_drv_gpiote_in_config_t smoke_detector_config = NRFX_GPIOTE_CONFIG_IN_SENSE_HITOLO(false);		// I also tried with low to high, toggle, high to low, true or false

	smoke_detector_config.pull = NRF_GPIO_PIN_PULLDOWN;		// I also tried with pullup and no pull but interrupt never happen
        err_code = nrf_drv_gpiote_in_init(SENSOR_SMOKE_PIN, &smoke_detector_config, on_smoke_alarm);
        if(err_code == NRF_ERROR_INVALID_STATE)
        {
            return;
        }

        nrf_drv_gpiote_in_event_enable(SENSOR_SMOKE_PIN, true);
}

Related