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

Using P0.26 with App Timer

I have an application that toggles an LED on P0.26 based on a timer and that's working fine. Now I need to add a few more timers so I decided to use the APP_TIMER library with the RTC, but when I make the call to nrf_drv_clock_lfclk_request(), I am no longer able to control P0.26. I see that this pin is connection for the 32kHz crystal but I don't actually have an external reference.

Do I still lose functionality of this pin even without an external crystal?

Parents
  • I'm not using the softdevice. I was able to work around by using this:

      NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
      NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
      NRF_CLOCK->TASKS_LFCLKSTART = 1;
    
      // Wait for the low frequency clock to start
      while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {}
      NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    

    instead of nrf_drv_clock_lfclk_is_running(). Does that make sense?

Reply
  • I'm not using the softdevice. I was able to work around by using this:

      NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
      NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
      NRF_CLOCK->TASKS_LFCLKSTART = 1;
    
      // Wait for the low frequency clock to start
      while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {}
      NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    

    instead of nrf_drv_clock_lfclk_is_running(). Does that make sense?

Children
No Data
Related