Enabling USE_POWER_OPTIMIZATIONS and XTAL16_SETTLED

⚠️
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.
10 posts / 0 new
Last post
hicham
Offline
Last seen:5 months 3 weeks ago
Joined:2018-01-27 12:14
Enabling USE_POWER_OPTIMIZATIONS and XTAL16_SETTLED

Hi , My project is based on prox_reporter_ext available on SDK 5.0.4. I am using GTL over UART interface and extended sleep mode. I also enabled CFG_POWER_OPTIMIZATIONS. I tried to find how many times take the XTAL16 to settle but it seems XTAL16_SETTLED is not checked on wake up when CFG_POWER_OPTIMIZATIONS is used. XTAL16_TRIM_READY seems not being used too.

I probalby missed something on how to use this flags and sleep/wake up mechanisms.

Can you tell me why this flags are not checked on wake up when CFG_POWER_OPTIMIZATIONS is used ?

Thanks for help.

Device:
PM_Dialog
Offline
Last seen:1 day 10 hours ago
Staff
Joined:2018-02-08 11:03
Hi Hicham,

Hi Hicham,

Both XTAL16_SETTLED and XTAL16_TRIM_READY are not used from the SDK. When the device wakes up, the BLE_WAKEUP_LP_Handler is executed. Every time that the DA14580 wakes up, there is a dedicated time until the settling of the XTAL16M. Could you please let me know if you have any issue with the wake up procedure?

Thanks, PM_Dialog

hicham
Offline
Last seen:5 months 3 weeks ago
Joined:2018-01-27 12:14
Hi,

Hi,

XTAL16_SETTLED seems to used when CFG_POWER_OPTIMIZATIONS is disabled in BLE_WAKEUP_LP_Handler.

I have an issue when temperature is high and i suspect XTAL16M settling time.

For that i tried to compute it and see if it change when temperature is rising (up to 50°C).

How can i do it if both XTAL16_SETTLED and XTAL16_TRIM_READY are not used ?

How can i get a time base to compute different duration ?

Thanks for help.

PM_Dialog
Offline
Last seen:1 day 10 hours ago
Staff
Joined:2018-02-08 11:03
Hi Hicham,

Hi Hicham,

You are not able to compute a different time of crystal settling. Do you have a custom board, or you are using any of our development boards?

Thanks, PM_Dialog

hicham
Offline
Last seen:5 months 3 weeks ago
Joined:2018-01-27 12:14
Hi,

Hi,

Yes i am using a custom board.

你有一组方法来知道吗tling time i need in extrem temperature conditions ?

XTAL16M Trim Procedure depends on CLK_TRIM_WAIT_CYCLES and this parameter has a default value set to 1000. I don't know how this value is defined.

Is this parameter CLK_TRIM_WAIT_CYCLES depending on my quartz behavior when temperature increases ?

Thanks.

PM_Dialog
Offline
Last seen:1 day 10 hours ago
Staff
Joined:2018-02-08 11:03
Hi Hicham,

Hi Hicham,

Let me check it and if there is a method to know the settling time, I will get back to you.

Thanks, PM_Dialog

hicham
Offline
Last seen:5 months 3 weeks ago
Joined:2018-01-27 12:14
Hi,

Hi,

I am waiting for your answer about XTAL16 settling time when temperature is high.

Thanks for help.

PM_Dialog
Offline
Last seen:1 day 10 hours ago
Staff
Joined:2018-02-08 11:03
Hi hicham,

Hi hicham,

Apologies, the answer is my mistake. I will delete it and i will post it in the correct thread. I don't have any update regagridng the settling time. I will get back to you as soon as i have any update.

Thanks,PM_Dialog

hicham
Offline
Last seen:5 months 3 weeks ago
Joined:2018-01-27 12:14
Hi Dialog,

Hi Dialog,

Any update on this subject ?

Hicham

PM_Dialog
Offline
Last seen:1 day 10 hours ago
Staff
Joined:2018-02-08 11:03
Hi Hicham,

Hi Hicham,

The settling time of the XTAL16M is the time interval between the BLE_WAKEUP_LP_Handler and BLE_SLP_Handler. The BLE_WAKEUP_LP_Handler hits in twirq_set_value ms and the BLE_SLP_Handler hits in twirq_reset_value ms. In the “PROGRAM CORE DEEP SLEEP” code section of rwip.c file, if you are using the XTAL32 (arch_clk_is_XTAL32()) and if you are using the power optimization, first the twirq_set_value and then the twirq_reset_value. By default the settling time of the XTAL16M is around 2.9ms and the time could be change by modifying the MINIMUM_SLEEP_DURATION, LP_ISR_TIME_XTAL32_CYCLES, XTAL16M_SETTLING_IN_XTAL32_CYCLES macros. If you want to increase the settling time, for example around 5.6 ms, you could do the following modifications in order to increase the time between the aforementioned handlers :

#define MINIMUM_SLEEP_DURATION (3750)

#define LP_ISR_TIME_USEC (6256)

#define LP_ISR_TIME_XTAL32_CYCLES (205)

These values are fixed from the SDK and is recommend it not modify it. However, you can give a try with e values above.

Thanks, PM_Dialog