Announcements

Robots are revolutionizing our lives in many ways. Join our webinar to learn about Infineon’s broad portfolio of robot building blocks.
Click here to register.

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

PSoC™ 4 Forum Discussions

Kinrin
Level 1
Level 1
5 questions asked 10 sign-ins 5 sign-ins

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
5 Replies
Gautami_12
Moderator
Moderator
Moderator
250 replies posted 250 sign-ins 50 solutions authored

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
250 replies posted 250 sign-ins 50 solutions authored

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 1
Level 1
5 questions asked 10 sign-ins 5 sign-ins

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
500 solutions authored 1000 replies posted 750 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
This widget could not be displayed.