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

Nrf51 Fast GPIOTE + Ble

Hi,

Im using S130softdevice.i wanna make dimmer by using experimental_ble_app_blinky project on gpioet But i have a problem with detecting 10 milisecond time (it means that i expect interrupt but it doesnt happen after each 10 milisecond)the lamb which i use flickers.

What can i do for gpioet to work better?

Thank You!

void GPIOTE_IRQHandler(void)
{

		 if(NRF_GPIOTE->EVENTS_PORT != 0)
    {
               
            NRF_GPIOTE->EVENTS_PORT= 0;
            nrf_delay_us(5000);	
		nrf_gpio_pin_set(16);
		nrf_delay_us(50);
		nrf_gpio_pin_clear( 16);
        
    }
		
}

static void gpiote_setup()
{
  uint32_t gpiote_event_addr;
  uint32_t gpiote_task_addr;
  ret_code_t err_code;

    // Initialise the button event GPIOTE
  nrf_drv_gpiote_in_config_t event_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);

  err_code = nrf_drv_gpiote_in_init(29, &event_config, button_handler);
  APP_ERROR_CHECK(err_code);

  gpiote_event_addr = nrf_drv_gpiote_in_event_addr_get(29);

  nrf_drv_gpiote_in_event_enable(29, true);

}
Parents
  • What SDK are you using?

    GPIOTE_IRQHandler() is already implemented in nrf_drv_gpiote, and you should not modify it.

    You are calling button_handler() when pin 29 goes from low to high. What does button_handler do?

    If you want high priority for the GPIOTE, this can be done in SDK 12 by changing GPIOTE_CONFIG_IRQ_PRIORITY to 1(nRF51). If you are using SDK 11, set the priority to APP_IRQ_PRIORITY_HIGH in nrf_drv_config.h

Reply
  • What SDK are you using?

    GPIOTE_IRQHandler() is already implemented in nrf_drv_gpiote, and you should not modify it.

    You are calling button_handler() when pin 29 goes from low to high. What does button_handler do?

    If you want high priority for the GPIOTE, this can be done in SDK 12 by changing GPIOTE_CONFIG_IRQ_PRIORITY to 1(nRF51). If you are using SDK 11, set the priority to APP_IRQ_PRIORITY_HIGH in nrf_drv_config.h

Children
No Data
Related