Clock speed changes after about 10s

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
UnicycleBloke
Offline
Last seen:1 week 20 hours ago
加入:2015-10-26 13:43
Clock speed changes after about 10s

DA14699 SDK D2522_SDK_10.0.1.52

When I start the software, I've noticed that the clock speed seems wrong for about 9s. I'm trying to understand what is going on. The OS is FreeRTOS, and my timers are based around FreeRTOS primitives. The FreeRTOS port appears to be using the 32,768Hz low power clock as its ticker. I've set a timer to toggle a digital output every 250ms (approx since ticks are 1/512 seconds). What is see is that the output is toggled every ~294.2ms for about 9s, and then switches to toggling at precisely 250ms. The ratio of these values is 1.177. I suppose it is conceivable that the 32,000Hz RC clock is being used for a while, and then the 32,768Hz takes over (ratio 1.024 if the RC clock is accurate). The discrepancy between the ratios seems large, though.

Can anyone suggest what might be causing this? I assume its something I have done or not done in my code, perhaps relating to the power manager, but I originally modeled my code on one of the examples.

We are trying to upgrade the SDK (breaking changes in the drivers), and have found that the device just goes to sleep after the 9s period. Aside from bringing in the new SDK and making necessary changes to the project code, nothing else was changed.

Cheers

Al

Device:
UnicycleBloke
Offline
Last seen:1 week 20 hours ago
加入:2015-10-26 13:43
I've been told that this

I've been told that this might relate to the time taken by the SDK to initialise and calibrate the crystal, or something like that. That sounds like a long time...

PM_Dialog
Offline
Last seen:20小时30分钟前
工作人员
加入:2018-02-08 11:03
Hi UnicycleBloke,

Hi UnicycleBloke,

During first 8 seconds, the device is awake and in this period is the XTAL32 settling procedure. To do so, it is expected that you don’t get accurate results because crystal is not settled yet and that’s why the system cannot be in sleep mode. After 8 seconds, which is the optimal duration, which is calculated for crystal settling, the XTAL32 has been settled, so that it can be used as a Low Power clock and the system can be put in sleep mode.

Thanks, PM_Dialog