What to do before Entering into the deep-sleep mode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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.

0 Likes
1 Solution
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

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-low-power-and-estimating-ba....

   

 

   

Thanks,

   

Hima

View solution in original post

0 Likes
12 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

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-low-power-and-estimating-ba....

   

 

   

Thanks,

   

Hima

0 Likes
Anonymous
Not applicable

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().

0 Likes
manusharian
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

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.

Anonymous
Not applicable

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?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Did you disable debugging by setting the pins to GPIO?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

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.

0 Likes

Answered here.

   

 

   

Bob

0 Likes
manusharian
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

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.

0 Likes
Anonymous
Not applicable

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.

0 Likes

Hi,

I am facing the same issue.

I am using CY8CKIT-042-BLE & PSoC4 BLE module.

I have used this function for deep sleep mode.

             CySysClkWriteEcoDiv(CY_SYS_CLK_ECO_DIV8);

            CySysClkWriteHfclkDirect(CY_SYS_CLK_HFCLK_ECO);

            /* stop IMO for reducing power consumption */

            CySysClkImoStop();           

            /* put the CPU to sleep */

            CySysPmDeepSleep();          

            /* starts execution after waking up, start IMO */

            CySysClkImoStart();

            /* change HF clock source back to IMO */

            CySysClkWriteHfclkDirect(CY_SYS_CLK_HFCLK_IMO);

            CySysClkWriteEcoDiv(CY_SYS_CLK_ECO_DIV1);

And i m measuring current in Digital multi meter,It is showing me 2.5mA but it should be in uA .

Please guide me, I think I am missing few so that current consumption is so high.

0 Likes
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

Thanks speedycat for your suggestion. But my problem is happened after wake-up.

0 Likes