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
  • I am not using the Keil tool, I am using a editor like eclipse, this is called KDevelop, so I can not debug, however I saw that if I enable the interrupt and connect the interrupt pin to GND and occasionally generate an interrupt manually connecting to Vdd, the systems works fine, no restart. But, if once that the system is running, I connect the pin directly to the sensor's pin that has the high rate pulse the system gets restarted. The fact that the restart happens once that the system is running on an infinite loop and not at the beginning indicates that the error is not during the initialization but later.

Reply
  • I am not using the Keil tool, I am using a editor like eclipse, this is called KDevelop, so I can not debug, however I saw that if I enable the interrupt and connect the interrupt pin to GND and occasionally generate an interrupt manually connecting to Vdd, the systems works fine, no restart. But, if once that the system is running, I connect the pin directly to the sensor's pin that has the high rate pulse the system gets restarted. The fact that the restart happens once that the system is running on an infinite loop and not at the beginning indicates that the error is not during the initialization but later.

Children
No Data
Related