nRF51 RTX 4.74.0-3 SoftDevice S210 V4.0.1-3
Created a timer for 5 seconds interval. It turned to be 4.4 seconds. with or without softdevice enabled.
Anybody else has the same issue?
nRF51 RTX 4.74.0-3 SoftDevice S210 V4.0.1-3
Created a timer for 5 seconds interval. It turned to be 4.4 seconds. with or without softdevice enabled.
Anybody else has the same issue?
What do you use as clock source for the RTC? I assume you're using a 32 kHz perhaps? Depending on which clock source you use for the RTC, the timer will have the same accuracy. So if you for example use the non-calibrated on board 32 kHz RCOSC you will have quite "bad" accuracy on the clock source used for the timer.
What do you use as clock source for the RTC? I assume you're using a 32 kHz perhaps? Depending on which clock source you use for the RTC, the timer will have the same accuracy. So if you for example use the non-calibrated on board 32 kHz RCOSC you will have quite "bad" accuracy on the clock source used for the timer.
External crystal, which is the default int RTX_Conf_CM.c
int os_tick_init (void)
{
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK->TASKS_LFCLKSTART = 1;
while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)
{
// Do nothing.
}
NRF_RTC1->PRESCALER = OS_TRV;
NRF_RTC1->INTENSET = RTC_INTENSET_TICK_Msk;
NRF_RTC1->TASKS_START = 1;
return (RTC1_IRQn);
}
You say that it changes when you enable the softdevice. Which clock source do you input towards the softdevice enable call? That will override the setting you do manually.
Hi Thanks for the reply. What do you mean by "which clock source do you input towards the softdevice"? You may be hitting at something, but I need to understand your suggestions first :-)
Ok I guess I got what you meant: This is what I got in the software for enabling the soft device: err_code = sd_softdevice_enable(NRF_CLOCK_LFCLKSRC_XTAL_50_PPM, softdevice_assert_callback); APP_ERROR_CHECK(err_code);