12 posts / 0 new
Last post
mohit3112
Offline
Last seen:7 months 1 week ago
Expert
加入:2014-08-04 13:45
sleep after connection

int一pp_connection_function i started a timer for 5 sec to enable extended sleep mode , but i saw the current consumption reduced from 500uA to 100uA, not to 2uA .
so is it possible to make da14850 sleep between connection intervals.

code
in app_connection_func
// Calling timer
ke_timer_set(FLIP_MAIN_TIMER,TASK_APP,500);

// Timer Handler
int flip_main_timer_handler(ke_msg_id_t const msgid,
void const *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
app_set_extended_sleep();
return (KE_MSG_CONSUMED);
}

this results in 100uA current , can i make this lower like 30 uA or 5uA
I am using SDK 3.0.8
Thanks
Mohit

JE_Dialog
Offline
Last seen:1 day 17 hours ago
工作人员
加入:2013-12-05 14:02
Hello Mohit, how are you

Hello Mohit, how are you measuring the current ? please note that if you are using the power profler in smart snippets (on expert / PRO board), the measurement circuit has a high offset current. From the examlpe below, you can see the device going into extended sleep after connection event, although the waveform doesn't go down to zero : this is offset in the measurement on the amplifier-ADC on the development board . To measure the uA level, you do need a high resolution DMM as described in AN-B-015.

BR JE_Dialog

mohit3112
Offline
Last seen:7 months 1 week ago
Expert
加入:2014-08-04 13:45
i am measuring current using

i am measuring current using a digital multimeter it shows average current. I am using PAN1740 usb dongle.

Here is the experiment i did:-

1. when device is advertising and after 5 sec i switch to ext sleep mode the current consumption is 5uA to 2uA.
// code in timer handler
app_adv_stop()
app_set_extended_sleep();

2. when device is connected and after 5 sec i switch to ext sleep mode thecurrent consumption is 100uA i know this cannot be offset current as i have achieved 5uA in case 1.
//code in timer handler
app_set_extended_sleep();

my problem is that in connected state even after enabling sleep peripheral is communicating with the phone and not going to sleep mode

I am not using keyboard project , i have modified the template project for testing

Thanks
Mohit

JE_Dialog
Offline
Last seen:1 day 17 hours ago
工作人员
加入:2013-12-05 14:02
Hi Mohit, thanks : in

Hi Mohit, thanks : in connected state, what is the connection interval that is set by the phone ? you are measing average current...

Consider an average connection event takes approx 5uC... if you have a connection interval of say 100mS, then you will consume 50uC per second just on connection events (ignoring a small amount of sleep energy) : thats equivalent to 50uA on connection events alone. If its a 1 second connection interval, then it comes down to average of 5uA....

BR JE_Dialog

mohit3112
Offline
Last seen:7 months 1 week ago
Expert
加入:2014-08-04 13:45
currently my connection

currently my connection interval is around 45ms , but as central device decides the connection interval is it possible to get connection interval of 1 sec always .

Also for measuring the connection interval i am adding SysTick Timer code in BLE_EVENT_HANDLER in rwble.c file , is the the current place , or i have to place it somewhere else ?

JE_Dialog
Offline
Last seen:1 day 17 hours ago
工作人员
加入:2013-12-05 14:02
你好,Mohit, 45女士

你好,Mohit, 45女士connection internal, that would explain the 100uA average current.

A periperhal can request new connection paramaters to the master in connected state. This can be done using the gapc_param_update_cmd function. This is how a slave device on 14580 can request new connection parameters from the master so yes, you could request a longer connection interval.

The SYSTICK is implemented in the DA14580 as described in the Cortex M0 user guide, available from the ARM website.Registers are the same (0xE000E010-0xE000E01F).
Please be aware that when the DA14580 goes to sleep, the SYSTICK counter is stopped - so it is not suitable for measuring the connection interval.

BR JE_Dialog

mohit3112
Offline
Last seen:7 months 1 week ago
Expert
加入:2014-08-04 13:45
我需要一个精确的计时器to

我需要一个精确的计时器to measure rr interval coming from our heart rate sensor . as u said that SYSTICK is stopped in sleep mode suggest me the another timer ( guess timer0 is also stopped in sleep mode)

also i have one more doubt in sleep mode configuration , when i do app_set_extended_sleep() and app_ble_ext_wakeup_on() in advertising mode the current consumption is reduces to 5 uA and device will not advertise until it gets an external interrupt.

if i do ext app_set_extended_sleep() and app_ble_ext_wakeup_on() in connection state it means that it should wake up on ext interrupt only , but it also wakes up on interrupt given by BLE core, any explanation?

JE_Dialog
Offline
Last seen:1 day 17 hours ago
工作人员
加入:2013-12-05 14:02
你好,mohit,精确

你好,mohit,精确the timer function that you need ?

My understanding of the set-up in conenction state is different : it will wake up synchronously wiht the BLE core, as this is governed by the connection paramers as agered with central device.

BR JE_Dialog

mohit3112
Offline
Last seen:7 months 1 week ago
Expert
加入:2014-08-04 13:45
i need millisecond precise

i need millisecond precise timer, if possible microseconds , because unavailability of timer in sleep mode we are facing problem of precision loss in rr interval calculation. Is there a way to enable sleep mode with timer 0 is on , i have used lld_evt_time_get() sometimes it give zero and sometimes it give actual value , another possible solution is using ke_timer but it gives 10ms precision.

MT_dialog
Offline
Last seen:2 days 22 hours ago
工作人员
加入:2015-06-08 11:34
Hi mohit3112

Hi mohit3112

Sorry but when the da goes in sleep mode you cant use the HW timers of the chip. The only way is to use a 10ms ke_timer.

Thanks MT_dialog

jetliang
Offline
Last seen:2 years 6 months ago
加入:2014-12-02 06:50
hi,i want to know what is the

hi,i want to know what is the funtion of "lld_sleep_enter(sleep_lp_cycles, rwip_env.ext_wakeup_enable)"?

MT_dialog
Offline
Last seen:2 days 22 hours ago
工作人员
加入:2015-06-08 11:34
Hi jetliang,

Hi jetliang,

This is the fucntion that instructs the system to go to sleep, the parameters it gets are sleep_duration - after how many cycles its going to wake up and ext_wakeup is if the external interrupt is enabled or not (meaning if its going to wake-up for some external interrupt).

Thanks MT_dialog