deep sleep mode setting

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

cross mob
Kinrin
Level 2
Level 2
10 replies posted 25 sign-ins 5 replies posted

Dear guys,

 

In order to save power, I need to set the MCU into deep sleep mode when there is no working for MCU.

I found a API (CySysPmDeepSleep())of entering to deep sleep mode from code example, and I just use it simply in my code.

but it seems I got same current consumption with previous software which doesn't contain deep sleep API.

Now the current consumption will always be 5/6mA from VDD(3.3V), but my target is less than 10uA.

so I got failure in this trying.

can any body tell me how to use this API to enact deep sleep mode?

here is my function about how to set mcu to deep sleep mode:

void SleepCmd(void)
{
if((CHMode == M_CHOFF)&&(UI_BTDETECT_Read() == 1)&&(F_ONOFF == 0)&&(BATCloseLEDCount == 0)&&(OCPLEDCount == 0))
{
SleepDelay++;
if(SleepDelay >= 200)
{
SleepDelay = 0;
Meas_ENOP_VREF_Write(0);

CySysPmDeepSleep();
}
}
else
{
SleepDelay = 0;
Meas_ENOP_VREF_Write(1);
}
}

0 Likes
1 Solution
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @Kinrin ,

Please refer to the link What-to-do-before-Entering-into-the-deep-sleep-mode .

Warm Regards,
Gautami J

View solution in original post

0 Likes
12 Replies
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @Kinrin ,

Please refer to the link What-to-do-before-Entering-into-the-deep-sleep-mode .

Warm Regards,
Gautami J

0 Likes

Hi Gautami,

 

thanks for your explain! I think I can realize the deep sleep mode for my program.

but when I go to deep sleep, all GPIO will also be stopped. this will cause power off in my circuit.

So actually, I need a low power mode and without influence to GPIO status.

do you know how to enact this?

 

thank you!

0 Likes
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @Kinrin ,

Please go through PSoC™ 6 MCU low-power modes and power reduction techniques app note.
Also, you can refer to the read me section of the mbed-os-example-wlan-lowpower code example and measure the current consumed at low power mode.

Please let us know if you have any more queries.

Warm Regards,
Gautami J

0 Likes
Kinrin
Level 2
Level 2
10 replies posted 25 sign-ins 5 replies posted

Hi Gautami,

 

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 */
            CySysPmDeepSleep();           
            /* starts execution after waking up, start IMO */
            CySysClkImoStart();
            /* change HF clock source back to IMO */
            CySysClkWriteHfclkDirect(CY_SYS_CLK_HFCLK_IMO);

 

but all GPIO will be shut off, after these sentence. I don't know why deepsleep can cause GPIO off.

0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

@Kinrin ,

Can you share your project here?  Can you share your design schematics as well?

In general, the PSoCs have multiple low-power modes.   Each level of low-power turns off power to more internal resources.

The first level of low-power turns off most clocks which ends up stopping the CPU.  This also means that the fixed function blocks and UDBs will be stopped as well.   This is because 80% of CPU current consumption occurs because of clock switching from 1 to 0 and 0 to 1.

Normally the GPIOs will be retained at their last known state before switching to low-power mode.   If a '1', they remain a '1'.  If a '0', they remain a '0'.   If the GPIO is being driven by some internal logic like a clock or resource such as UART, it will remain in this state without further toggling.

Is it possible that one or more of your GPIOs are driving a static load in low-power (LP)?

For example: If your GPIO is a '1' during LP and there is a 1K ohm resistor to GND then your GPIO will be sourcing 5V/1000 = 5mA constantly.

The same can be said if the GPIO is connected to a pull-up of 1K ohms and the GPIO is set to '0' in LP.

Suggestion:   Check your GPIO pin states when in LP and see if there is static load.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Hi Len_CONSULTRON,

 

thanks for your reply! I understand why you said about the possible reasons. but unfortunately, I can't share the schematic,due to some copyright issues. actually, I develop the software based on an on-shelf product. I did a test with the product, and I found the current consumption is about 88uA when no load is working. I'm pretty sure that I don't have any working pull-up/down resistors during switch off status. 

I think the original design must have deep sleep mode setting during standby mode. but it's really difficult to complete setting for the deep sleep mode.   I suppose the current consumption is still consumed by internal source, maybe the clock. So maybe I have to look further into the clock setting.

0 Likes

@Kinrin ,

If you are using one of Infineon's evaluation boards or kits, there can be some parasitic current paths on some of the GPIO pins when put in low-power modes.

What off-the-shelf board are you using?

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Hi Len_CONSULTRON,

 

I'm not using an Infineon's evaluation board or kits, I run my program on PCBA which taken out from a product. 

0 Likes

Hi,

Are you reading the current during sleep with a current sense resistor and an oscilloscope or a DMM?

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Hi, 

I connect  a digital multi meter to battery in series. 

0 Likes

@Kinrin ,

A DMM normally averages multiple measurements within a period of time.  Therefore the 88uA you are seeing may be the average of some percentage of sleep mode (< 10uA) and some percentage of awake mode (> 1mA) if your application wakes up every so often on a timer.

Using an oscilloscope and a current sense resistor, you can plot out the sleep versus awake current in time.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Hi Len,

I think I've solved the issue for deep sleep mode. but then I got new issue when I want to wake up the program from deep sleep. Currently, I can wake up my program with tact-switch, and everything is ok. but I also have to wake up the program by falling edge of one GPIO port, because this port will monitor charging status. it will be pulled to Low from High Level. when I create interrupt function for this GPIO, I can't compile my program correctly. 

here is the two interrupt functions, and error tips:

CY_ISR(WakeUpSwitchISR)
{
/* Clear the pending interrupts */
isr_WakeUp_ClearPending();
UI_BTDETECT_ClearInterrupt();
}

CY_ISR(WakeUpPowerISR)
{
/* Clear the pending interrupts */
isr_WakeUp_2_ClearPending();
Com_PonRX_ClearInterrupt();
}

Pin Error: (Mixed Interrupt Signal. Cannot assign 'UI_BTDETECT(0)' with Interrupt Signal UI_BTDETECT to physical port 0 where 'Com_PonRX(0)' with Interrupt Signal Com_PonRX is already placed.).

 

Can you help to me to solve this issue?

thank you!

 

0 Likes