How to use timer to wake-up?

Learn MoreFAQsTutorials

6 posts / 0 new
Last post
GGQ_in
Offline
Last seen:2 weeks 4 days ago
Joined:2019-07-23 04:41
How to use timer to wake-up?

Hi,

I use the DA14580 modle in EXT sleep mode, I want to wake it up with timer but failed.It were allways sleep, How to configure it,please?

Device:
PM_Dialog
Offline
Last seen:8 hours 38 min ago
Staff
Joined:2018-02-08 11:03
Hi GGQ_in,

Hi GGQ_in,

You should use the app_easy_timer() API in order to wake up the device. As soon as the device goes into sleep mode, you should configure the timer. Upon its expiration, you should place your preferable functionality in the callback function. This can be achieved by setting the timer as shown here:

app_easy_timer(100,cb_my_timeout);

The first argument specifies the timer to time out after 100 * 10 ms = 1000ms = 1s. At this time the callback cb_my_timerout() get's called.

Thanks, PM_Dialog

GGQ_in
Offline
Last seen:2 weeks 4 days ago
Joined:2019-07-23 04:41

Hi PM_Dialog,

Here is part of the code:

do { // schedule all pending events schedule_while_ble_on(); } while (app_asynch_proc() != GOTO_SLEEP); //Timing serial print string wake_up_timer_used = app_easy_timer(1000, Led_sock); if (((!BLE_APP_PRESENT) && (check_gtl_state())) || (BLE_APP_PRESENT)) { GLOBAL_INT_STOP(); // get the allowed sleep mode sleep_mode = rwip_power_down(); printf(" sleep_mode= %x \r\n", sleep_mode); if ((sleep_mode == mode_ext_sleep) || (sleep_mode == mode_deep_sleep)) { //power down the radio and whatever is allowed arch_goto_sleep(sleep_mode); if ((GetWord16(SYS_STAT_REG) & DBG_IS_UP) == DBG_IS_UP) { wdg_freeze(); // Stop watchdog timer } WFI(); //resume operation arch_resume_from_sleep(); } ...

I ran into the following problems:

1)当我设置580新型ARCH_EXT_SLEEP_ON模式,turn the peripherals and the radio off, but the serial port(U1) besides can print the timer callback,also print the sleepmode variables all the time.And it also send Bluetooth broadcasts, so I don't know if it's asleep or not ?

1.1) Then I changed the serial port to U2, and the serial port no longer prints sleepMode variables during sleep time,why the U1 can not stop to print during sleep time,Is that because I have the wrong configuration?

2) When I set 580 modle ARCH_DEEP_SLEEP_ON mode, timer callback function and serial and Bluetooth no longer have output and send broadcast, how to wake up when deep sleep?

3) I have a board of my own design, using DA14580, but I want to replace the 32K active crystal oscillator with the 32K passive one.

Is this feasible and how should I connect and configure it?

I tried it and it seemed to go into sleep mode after a while, but there were no Bluetooth radio transmissions or serial print.

Thanks.

PM_Dialog
Offline
Last seen:8 hours 38 min ago
Staff
Joined:2018-02-08 11:03
Hi GGQ_in,

Hi GGQ_in,

The code snippet that you have attached is SDK file. It is strongly recommend NOT modifying any of the SDK files. All the changes should be applied in the application layer which contains all the file that start with “user_”

Regarding your 1/ and 2/ questions, to be honest I am not able to understand what you have done in the code, so please provide extra information. I would suggest take a look at theTutorial 4 : configuring sleep mode on DA1458xdocuments.

There is a Chinese version as well :(Chinese version) Tutorial 4 : configuring sleep mode on DA1458x

3/ What do you mean with passive and active XTAL23K ?

Thanks, PM_Dialog

GGQ_in
Offline
Last seen:2 weeks 4 days ago
Joined:2019-07-23 04:41

Hi,

Thank you for your answer. I make the main to print sleepmode before sleep.

My mean is 32k Active crystal oscillator and 32K Passive crystals,do you known?

Thanks.

PM_Dialog
Offline
Last seen:8 hours 38 min ago
Staff
Joined:2018-02-08 11:03
Hi There,

Hi There,

Can you share the part numbers?

Thanks, PM_Dialog