You are here

What to do before Entering into the deep-sleep mode | Cypress Semiconductor

What to do before Entering into the deep-sleep mode

Summary: 11 Replies, Latest post by carlsmith.sms_1616011 on 11 Oct 2016 12:33 AM PDT
Verified Answers: 2
Last post
Log in to post new comments.
carlsmith.sms_1616011's picture
User
14 posts

Hi Everyone,

I am Anthony, an Embedded Software Engineer. Currently, I am working on bluetooth-controlled padlock project for which we use PSoC BLE module (CYBLE-224110-00). In this project, we add low-power feature after unlocking the lock from the lock owner's phone app using bluetooth message. So, I put the code which enter into the deepsleep mode after unlock. But even after I put all modules and pin into sleep mode and stop the ble module before entering into CySysPmDeepSleep(); , the current consumption is so high after the device is sleep. I want to know what are the steps to do before entering into the sleep mode. Thanks.

HIMA's picture
Cypress Employee
207 posts

Hello

 

Please have a look at the application note "AN92584 - Designing for Low Power and Estimating Battery Life for BLE Applications" Link:http://www.cypress.com/documentation/application-notes/an92584-designing....

 

Thanks,

Hima

carlsmith.sms_1616011's picture
User
14 posts

Hello,

Thanks for your reply. I looked into the link that you gave me and I used it in my application. But there is no change and I don't completely understand about their clock management system.

I used these codes before I enter into deepsleep.

/* change HF clock source from IMO to ECO, as IMO is not required and can be stopped to save power */
            CySysClkWriteHfclkDirect(CY_SYS_CLK_HFCLK_ECO);
            /* stop IMO for reducing power consumption */
            CySysClkImoStop();            
            /* put the CPU to sleep */
            CySysPmSleep();           
            /* starts execution after waking up, start IMO */
            CySysClkImoStart();
            /* change HF clock source back to IMO */
            CySysClkWriteHfclkDirect(CY_SYS_CLK_HFCLK_IMO);

but I changed CySysPmSleep() into CySysPmDeepSleep().

ionascu.marianemanuel_1654946's picture
User
36 posts

Hello Carl,

In AN the code posted by you is mention in the part of the application when your processing is done but BLE module still have work to do. I think that in the same document the BLE states are also stated. Please know that if BLE is in other event than CYBLE_BLESS_SATE_EVENT_CLOSE then you are not allowed to put the CPU in deep sleep. BLE will prevent it from going there.

When you have a connection with the BLE you can only put the chip in DeepSleep in between 2 consecutive connection intervals/ advertisement intervals. If you need more deepsleep you should stop BLE communication more frequently, if this helps.

Hope this help.

carlsmith.sms_1616011's picture
User
14 posts

Hello Emanuel,

Really thanks for your reply. Actually, I stop the BLE module before entering into the deep sleep but the current consumption is still really high for my application. The multimeter shows 1.69mA but we want only less than 5uA.

I put all my non-BLE components into the sleep before entering into the deep-sleep. Am I need to do something?

user_1377889's picture
User
9625 posts

Did you disable debugging by setting the pins to GPIO?

 

Bob

carlsmith.sms_1616011's picture
User
14 posts

Hi Bob,

Thanks for your reply. I haven't set the debug SWD pin to GPIO. So I set these pins to GPIOs and it works. But Now I got a new problem. Before I enter into the deep sleep, I set my used GPIOs int Analog HiZ for lesser power consumption and it worked too. But after the CPU wakes up some of the GPIOs don't turn ON even I set them into their specific drive states.

 

user_1377889's picture
User
9625 posts

Answered here.

 

Bob

ionascu.marianemanuel_1654946's picture
User
36 posts

Hello Carl,

This is strange. I have managed to reduce the power consumption in deep sleep to about 5uA. I did the measurements using an oscilloscope. Please check to see if your multimeter makes some averages or try to measure using an oscilloscope and a shut resistor like I did, or if you have the possibility to measure using an oscilloscope with ammeter probe. 

Also please consider to stop the ECO clock if you do not need the BLE. The ECO is by default at 24 MHz. Try to stop it in code or disable it if never needed from creator. Check also what Bob suggested.

carlsmith.sms_1616011's picture
User
14 posts

Thanks, Emanuel,

After I turned off ECO and set debug SWD pins into GPIOs, I can reduce the current down to 4uA.

But now I face a new problem. Before I enter into the deep sleep, I set my used GPIOs int Analog HiZ for lesser power consumption and it worked too. But after the CPU wakes up some of the GPIOs don't turn ON even I set them into their specific drive states.

cjoachim_1597296's picture
User
75 posts

I did an attempt to make power handling easier. I read through the documentation I found (API doc, application notes, forum posts), and ended up with the following code: https://github.com/cypress-speedycat/EasySleep . There are comments in the code that explains the steps taken.

I use it in my application and it seems to work well.

Log in to post new comments.