Announcements
IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Smart Bluetooth

Anonymous
Not applicable

Hi,

Is there any deep sleep mode document? I met a question when use the rtc_sample App demo.

it will restart after wakeup from sleep in this demo. how can I manage do not restart when wake up from sleep. below code is what I use.

#ifdef RTC_SAMPLE_ENTER_DEEP_SLEEP_AND_ENABLE_TIMED_WAKE

                {

                                static UINT32 num_timeouts_since_boot = 0;

                                // Demo going into deep sleep with wake after 5s.

                                if (num_timeouts_since_boot++ >= 10)

                                {

                                                // If its been ~10s of ADV, configure timed wake and

                                                // enter deep sleep right now.

                                                ble_trace0("Entering deep sleep.");

                                                gpio_configurePin(0, 0, 0x100, 0);

                                                // Configure the low power manager to enter deep sleep.

                                                devLpmConfig.disconnectedLowPowerMode = DEV_LPM_DISC_LOW_POWER_MODES_HID_OFF;

                                                // Configure the wake time in mS.

                                                devLpmConfig.wakeFromHidoffInMs = 5000;

                                                // Configure the reference clock to use.

                                                // Use the external 32k.

                                                devLpmConfig.wakeFromHidoffRefClk = HID_OFF_TIMED_WAKE_CLK_SRC_32KHZ;

                                                gpio_configurePin(0, 0, 0x100, 0);

                                                // Enter deep-sleep now. Will not return.

                                                devlpm_enterLowPowerMode();

                                }

                }

#endif

Thanks,

Lei

0 Likes
1 Solution
Anonymous
Not applicable

In my experience, the chip always restarts.  It wakes up, loads from EEPROM/SFLASH to RAM, and starts executing.  You can however determine if you woke up from a:

1) POWER ON RESET - pushing the reset button or discontinuing and resupplying power

2) WAKE UP FROM A TIMER EVENT

3) WAKE UP FROM A BUTTON PUSH

We have the following logic spread in our code, so I didn't test this exact snippet, but it is basically like this:

       if (!mia_isResetReasonPor()) {

               if( mia_isResetReasonTimedWake()){

                   wake_reason = TIMED_WAKE;

                   ble_trace0("Waking from deep sleep because the TIMER went off );

              } else {

                    wake_reason  = BUTTON_PUSH;

                    ble_trace0("Waking from deep sleep because the BUTTON was pushed);

             }

       } else {

              ble_trace0("POR - POWER ON RESET - Not a timed wake.\n");

              wake_reason = POWER_ON_RESET;

       }

View solution in original post

4 Replies
BoonT_56
Employee

This is a good blog on deep sleep:

Sleep Deep_Sleep Explanation and Techniques

Are you using an external 32KHz clock or the internal 128KHz clock?

Are you doing this on the tag3?

0 Likes
Anonymous
Not applicable

we use external 32KHz clock and test it on the tag3.

0 Likes
Anonymous
Not applicable

In my experience, the chip always restarts.  It wakes up, loads from EEPROM/SFLASH to RAM, and starts executing.  You can however determine if you woke up from a:

1) POWER ON RESET - pushing the reset button or discontinuing and resupplying power

2) WAKE UP FROM A TIMER EVENT

3) WAKE UP FROM A BUTTON PUSH

We have the following logic spread in our code, so I didn't test this exact snippet, but it is basically like this:

       if (!mia_isResetReasonPor()) {

               if( mia_isResetReasonTimedWake()){

                   wake_reason = TIMED_WAKE;

                   ble_trace0("Waking from deep sleep because the TIMER went off );

              } else {

                    wake_reason  = BUTTON_PUSH;

                    ble_trace0("Waking from deep sleep because the BUTTON was pushed);

             }

       } else {

              ble_trace0("POR - POWER ON RESET - Not a timed wake.\n");

              wake_reason = POWER_ON_RESET;

       }

View solution in original post

MichaelF_56
Moderator
Moderator

Thanks for the excellent feedback Cliff.

0 Likes