Max time when interrupts are disabled

⚠️
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.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
kvenkatraman
Offline
Last seen:3 years 11 months ago
加入:2017-05-03 22:26
Max time when interrupts are disabled

What is the maximum time for which the interrupts are disabled in the BLE stack?

I am using DA14681 dev kit (PRO) and using pxp_reporter example. I modified the example to add a hw_timer0 and in the timer ISR, I simply toggle a I/O line and looking at the period on o-scope. The timer is configured to interrupt every 500 micro-secs, but I am seeing >200 micro-secs of jitter on o-scope. However, when I disable the pxp_reporter task (commented out the creation of this task), this jitter reduces (~ 20 micro-secs).

This is my code for timer configuration. Let me know if the timer is configured correctly.

hw_timer0_init(NULL);
hw_timer0_set_clock_source(HW_TIMER0_CLK_SRC_FAST);
hw_timer0_set_fast_clock_div(HW_TIMER0_FAST_CLK_DIV_2);
hw_timer0_set_pwm_mode(HW_TIMER0_MODE_CLOCK);
hw_timer0_set_t0_reload(2000、2000);
hw_timer0_set_on_reload(200);
hw_timer0_register_int(timer0_interrupt_cb);
hw_timer0_enable();

Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi kvenkatraman,

Hi kvenkatraman,

The problem is that before the BLE falls to sleep it disables the interrupts for about 600us and that should be causing the jitter that you are seeing, this occurs even if you have the device always active since the BLE core and the rest of the system are seperated when powering down. What you can try is use the ad_ble_stay_active(true) this will force the BLE to stay active and will reduce any interrupt latencies introduced by sleeping and waking up the BLE.

Thanks MT_dialog

kvenkatraman
Offline
Last seen:3 years 11 months ago
加入:2017-05-03 22:26
Adding "ad_ble_stay_active

Adding "ad_ble_stay_active(true)" eliminated the jitter.

Is this the only workaround? If so, what about the power consumption?

MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi kvenkatraman,

Hi kvenkatraman,

Yes this is the only valid workaround as far as i am aware, you must have the BLE core always awake in order not to have the interrupt latencies of the waking up and sleeping, regarding the power consumption, by some preliminary measurements on the proximity reporter and its about 0.4mA extra if the BLE is kept alive and not waking up in every BLE event.

Thanks MT_dialog