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

Problems when a high rate interrupt is connected

I am using the nrf52 development board, when I try to connect to one of its pins a signal from a sensor that generates an interrupt signal every 1ms the programs stops or it is restarted. Here is how I am doing it:

     nrf_gpio_cfg_sense_input(27, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH);
     err_code = nrf_drv_gpiote_init();	// Function for initializing the GPIOTE module. 
     APP_ERROR_CHECK(err_code);          
     nrf_drv_gpiote_in_config_t config; 
     memset(&config, 0, sizeof(nrf_drv_gpiote_in_config_t));
     config.sense =  NRF_GPIOTE_POLARITY_LOTOHI;  
     config.pull = NRF_GPIO_PIN_PULLDOWN;
     config.hi_accuracy = true;
     config.is_watcher = false;     
     err_code = nrf_drv_gpiote_in_init(27, &config, pin_event_handler);
     APP_ERROR_CHECK(err_code);
     nrf_drv_gpiote_in_event_enable(27, true); 

On the Interrupt handler I am just setting and clearing a led from the board. When I do the exact same procedure with another pin connected to one of the switches, it works fine. I don't know if maybe the interrupt frequency is to high. Does any one have an idea why this could be happening?

Is there any step that I am missing? Thanks in advance for your attention.

Parents Reply Children
No Data
Related