Cannot capture high-speed GPIOTE interrupts

Hello, I tried to use pin_change_example in SDK to catch Interrupts (at first line) but I'm missing lots of them.

How can I catch all the interrupt events without delay?
At present, I am using the ble_app_uart template.

This is the code of GPIOTE init and handler functions

void DRDY_pin_handle(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{

//nrf_gpio_pin_toggle(RST2);
drdy_3 = !drdy_3;
nrf_gpio_pin_set(RST2);
__nop();
nrf_gpio_pin_clear(RST2);

}


void ADS127L01_GPIO_Init(void)
{

// Reset OUTPUT Config
nrf_gpio_cfg_output(RST3);
nrf_gpio_pin_clear(RST3);
// Start Output Config
nrf_gpio_cfg_output(START3);
nrf_gpio_pin_clear(START3);
// NCS Output Config
nrf_gpio_cfg_output(NCS3);
nrf_gpio_pin_clear(NCS3);

// GPIO config for testing
nrf_gpio_cfg_output(RST2);
nrf_gpio_pin_clear(RST2);

// DRDY Input Config
// nrf_gpio_cfg_input(DRDY3, NRF_GPIO_PIN_NOPULL);

ret_code_t err_code; // hold error value
err_code = nrf_drv_gpiote_init();
nrf_drv_gpiote_in_config_t in_config = NRFX_GPIOTE_CONFIG_IN_SENSE_HITOLO(true); // Falling edge interrupt detection
in_config.pull = NRF_GPIO_PIN_PULLUP;
err_code = nrf_drv_gpiote_in_init(DRDY3, &in_config, DRDY_pin_handle); // Initialize the interrupt pin
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_event_enable(DRDY3, true); // Enable the interrupt events

}

Parents
  • Do nothing in interrupt service routine if you dont want to lose data.

    void DRDY_pin_handle(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
    
    //nrf_gpio_pin_toggle(RST2);
    drdy_3 = !drdy_3;
    nrf_gpio_pin_set(RST2);
    __nop();
    nrf_gpio_pin_clear(RST2);
    
    }

    Do this instead:

    void DRDY_pin_handle(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
    bool flag = true;
    
    }
    
    //somewhere in your code check for flag like this
    
    if(flag){
    
    //nrf_gpio_pin_toggle(RST2);
    drdy_3 = !drdy_3;
    nrf_gpio_pin_set(RST2);
    __nop();
    nrf_gpio_pin_clear(RST2);
    
    
    }

    if this is not the issue, you may need to give some detail about your feed line to gpiote pin. Is there a cap for low pass filter or a schmidtt trigger to sharpen the edges and so on.

Reply
  • Do nothing in interrupt service routine if you dont want to lose data.

    void DRDY_pin_handle(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
    
    //nrf_gpio_pin_toggle(RST2);
    drdy_3 = !drdy_3;
    nrf_gpio_pin_set(RST2);
    __nop();
    nrf_gpio_pin_clear(RST2);
    
    }

    Do this instead:

    void DRDY_pin_handle(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
    bool flag = true;
    
    }
    
    //somewhere in your code check for flag like this
    
    if(flag){
    
    //nrf_gpio_pin_toggle(RST2);
    drdy_3 = !drdy_3;
    nrf_gpio_pin_set(RST2);
    __nop();
    nrf_gpio_pin_clear(RST2);
    
    
    }

    if this is not the issue, you may need to give some detail about your feed line to gpiote pin. Is there a cap for low pass filter or a schmidtt trigger to sharpen the edges and so on.

Children
No Data
Related