My project is modified from DSPS,and I want my slave device go to sleep mode after send 10 packets data to host.And after some minutes wakeup it ,repeat the process.
1.I want to know how to achieve this function.I have browsing the the datasheet-UM-B-006 and training_04,I am very confused about the two files relation.The first datasheet seems very complex,and the second only use some steps can realize sleep.Is there have a more easy understand and Exactly sheet.
thank you
Device:
Hi RandyYu,
The 580 sleeps between the advertising and the connection intervals, you would like to fall in permanent sleep ? or you dont sleep between the intervals (you have sleeping feature disabled) and you would like to keep the connection alive by enabling sleep again ? In order to enable the sleeping feature, in case you dont sleep, you can invoke the arch_set_extended sleep, this will allow you to sleep between the connection and the advertising intervals, in case you want to disconnect from the central and fall into permanent sleep you will have to issue a disconnection in order to stop all the BLE activities (dont start advertising) and invoke the arch_ble_ext_wakeup_on(), before that you will have to either setup a ke_timer or an external interrupt in order to wake up in a specific amount of time or via an external interrupt.
Thanks MT_dialog
1.My question is I don't know how to step into deep sleep mode and wake up by ke_timer.I feel the details dialog had provided is very messy.Do you have a example a deails can help me step by step to realize it
2.which function is ke_timer(can wake up device in deep mode) ?
3.I want send 10 times data ,after that I want it step into deep sleep mode.does your mean when I call arch_ble_ext_wakeup_on(),it will step into deep mode ?
4.if I want deep sleep,does external crystal 32MHZ must exist??
Hi RandyYu,
1. You can do this via a kenrel timer as i ve indicated to your previous posthttp://support.dialog-semiconductor.com/deep-sleep-mode.
2. There is no specific function in order to wake up from sleep via a kernel timer, just set a timer before going to sleep and start advertising at the timer handler.
3. You mentioned that you want to send 10 values and then fall in permanent sleep, you can not fall in permanent sleep while you are connected, you will have to disconnect and then fall in permanent sleep. The arch_ble_ext_wakeup_on() is used before sleeping and in order to declare to your system that he has to wait for an external signal in order to wake up. Its the same function in SDK3 described in the UM-B-006 document on page 12.
4. The external XTAL32 oscillator is mandatory only on boost mode, please check at the link below the related FAQ:
http://support.dialog-semiconductor.com/guide/faq-hardware-peripherals.
Thanks MT_dialog
2.does your mean any time call back function can wake the device from deep sleep mode?I have use the function app_easy_timer many times in project,if I don't want this timer handler to wake up device.Need I cancel it before sleeping??
3.when use arch_ble_ext_wakeup_on() ,only external event can wake it up?I want ke_timer wake it up
Hi RandyYu,
2. Yes any kernel timer callback can wake up your device from sleep mode, if you are sleeping and you dont want that specific timer handler to wake up your device you will have to cancel it.
3. If you have set a kernel timer before going to permanent sleep you will wake up from the timer, you dont have to use the arch_ble_ext_wakeup_on().
Thanks MT_dialog
my device can sleep and wakeup,there are some another questions
1.what's the status of Peripherals(GPIO UART ADC ect.),does them correspond to the status after reset?
2.If my device using sleep mode,can the watchdog used?They will be conflict?
Hi RandyYu,
1. I dont get your question, what do you mean what is the status of the peripherals, when you are in sleep mode the peripherals are deactivated.
2. You can use the watchdog in sleep mode, its deactivated when your device is in sleep mode, but will be active when the devices exits sleep mode.
Thanks MT_dialog
1.I mean status is pull down/up,input/output, high resistance.
and when wakeup,need I reinitialize all of this?
I have got a problem,
第一季度
.I want P03 output high,when connected to master.
Then I set in
GPIO_reservation(){
RESERVE_GPIO(STBY,GPIO_PORT_0,GPIO_PIN_3,PID_GPIO);
...
}
void set_pad_function()
{
GPIO_ConfigurePin(GPIO_PORT_0,GPIO_PIN_3,OUTPUT,PID_GPIO,true);
...
}
user_on_init()
{
GPIO_ConfigurePin(GPIO_PORT_0,GPIO_PIN_3,OUTPUT,PID_GPIO,false);//set output
...
}
in
user_on_connection()
{
GPIO_ConfigurePin(GPIO_PORT_0,GPIO_PIN_3,OUTPUT,PID_GPIO,true);//when connected set high
...
}
user_before_sleep(void)
{
arch_set_extended_sleep();
GPIO_ConfigurePin(GPIO_PORT_0,GPIO_PIN_3,OUTPUT,PID_GPIO,false);//if delete always high,else 0.916V.
}
P03 is always high if GPIO_ConfigurePin(GPIO_PORT_0,GPIO_PIN_3,OUTPUT,PID_GPIO,false);delete from
user_before_sleep(void),does it indicate that my device is not go to sleep state??
But I have measued my device current is 2.5μA,when send advertise the current is about 100-200μA,when connected the current
is 600-800μA。
Are these not sure already to sleep?If not how I can I make sure?In the Froums I had seen ,using the SmartSnippet to makesure.But I don;t konw how to use it,
does it need any other hardware?
what's wrong with it,please give me a help.
Q2:
I use JATG to debug step by step,I found,
sleep_mode = rwip_sleep(); in arch_main
the value of sleep_mode is always on mode_active.
because this sentence
if(check_sys_startup_period())
break; ///have a break here
Ifind it's always have break here.
does the debug method of mine is wrong? Or this normal.
Hi RandyYu,
第一季度. When i say that the peripherals are deactivated it means that you can't use the ADC the timers etc, regarding the GPIO's (regardless if you are connected or not) when the 580 falls to sleep the GPIOs are latched in order to maintain their status when you fall back to sleep. When waking up the periph_init runs again and initializes the GPIO's in their original state. So you will have to place a variable in the periph_init function that holds the status of the pin before going to sleep and when the periph_init() re-runs set the GPIO according to that variable.
从代码我可以告诉你' ve粘贴,you configure your pin to be true every time that the peripheral initialization runs, so regardless if you are connected or not your pin is hign if extended sleep is enabled. Smart Snippets requires the pro kit in order to operate, and its a good way to make sure that the device is sleeping or not.
Q2。If you are in sleep mode you wont be able to debug the device since the debugger is detached, so you will have to disable sleep, if you disable sleep your device will be active all the time.
Thanks MT_dialog
第一季度:
I want to know the pin voltage ,if I use a multimeter measuring it ,when go to sleep.does it keep the voltage before sleep
user_before_sleep() has set it low
Q2:Would not be able to execute WFI () before ?
Hi RandyYu,
第一季度. The reason for seen the pin low is explained in this posthttp://support.dialog-semiconductor.com/my-gpio-cant-change-state-after-...
Q2。我认为你误解了the BLE and the sleep functionality, when you are advertising and your are connected the 580 keeps falling to sleep between the advertising events and connection events. The WFI() is the command that the 580 stucks and waits for a BLE interrupt (this interrupt will occur when its time for the next BLE event).
Thanks MT_dialog