PSoC5LP : Repeat the operation of Low power mode and Active mode

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

cross mob
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Dear Sirs and Madams,

We are considering the low power mode of PSoC5LP.

Hibernate mode ⇔ active

Sleep mode ⇔ active

PSoC5LP repeats the above state transitions.

When the master clock of PSoC5LP is set to 68MHz (using PLL),

The operation is always stuck by the return CyPmRestoreClocks () ;.

The reproducibility of this problem is 100%.

/******** Software excerpt ********/

CyDelayUs(20);

CyPmSaveClocks();

CyPmHibernate();

CyPmRestoreClocks(); // <= Stack in this process

CyDelayUs(20);

However, when the master clock is set to 24MHz (using PLL),

This stacking problem does not occur at all.

Is Cypress aware of this issue?

Do you have a countermeasure plan?

Regards,

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I may be missing something, but when I tried with CY8CKIT-059 with the following setup it seems to be working.

schematic

I use SW1 to enter low power mode, and also exit from that mode.

LED blinks during the normal mode, and turns off in low power mode.

002-schematic.JPG

pins

003-pins.JPG

clock settings

004-clocks.JPG

Tera Term output

001-TeraTerm-log.JPG

main.c

======================

#include "project.h"

#include "stdio.h"

#define LED_ON 1u

#define LED_OFF 0u

#define STR_LEN 64

char str[STR_LEN+1] ;

void print(char *str) ;

void cls(void) ;

void splash(char *prog_name) ;

void init_hardware(void) ;

volatile int sw_flag = 0 ;

CY_ISR(sw1_isr)

{

    SW1_ClearInterrupt() ;

    sw_flag = 1 ;

}

int main(void)

{

    init_hardware() ;

   

    splash("5LP Repeated LowPower Test") ;

    LED_Write(LED_ON) ;

   

    for(;;)

    {

        if (sw_flag) {

            print("Entering Low Power Mode ... ") ;

            CyDelay(10) ;

            CyDelayUs(20);

            CyPmSaveClocks();

            LED_Write(LED_OFF) ;

            CyPmHibernate();

            CyPmRestoreClocks(); // <= Stack in this process

            CyDelayUs(20);

            print("Woke Up!\n\r") ;

            sw_flag = 0 ;

        }

        LED_Write(!LED_Read()) ;

        CyDelay(500) ;

    }

}

void init_hardware(void)

{

    CyGlobalIntEnable; /* Enable global interrupts. */

   

    LED_Write(LED_OFF) ;

   

    UART_Start() ;

   

    SW1_ClearInterrupt() ;

    isr_1_ClearPending() ;

    isr_1_StartEx(sw1_isr) ;

}

void print(char *str)

{

    UART_PutString(str) ;

}

void cls(void)

{

    print("\033c") ; /* reset */

    CyDelay(20) ;

    print("\033[2J") ; /* clear screen */

    CyDelay(20) ;

}

void splash(char *prog_name)

{

    cls() ;

    if (prog_name && *prog_name) {

        print(prog_name) ;

    }

    print(" (") ;

    print(__DATE__) ;

    print(" ") ;

    print(__TIME__) ;

    print(")\n") ;

}

======================

moto

View solution in original post

2 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

MaMi,

Hi.  Are you setting the MASTER_CLK to 68MHz in the DWR/Clock tab or are you setting this frequency programmatically?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I may be missing something, but when I tried with CY8CKIT-059 with the following setup it seems to be working.

schematic

I use SW1 to enter low power mode, and also exit from that mode.

LED blinks during the normal mode, and turns off in low power mode.

002-schematic.JPG

pins

003-pins.JPG

clock settings

004-clocks.JPG

Tera Term output

001-TeraTerm-log.JPG

main.c

======================

#include "project.h"

#include "stdio.h"

#define LED_ON 1u

#define LED_OFF 0u

#define STR_LEN 64

char str[STR_LEN+1] ;

void print(char *str) ;

void cls(void) ;

void splash(char *prog_name) ;

void init_hardware(void) ;

volatile int sw_flag = 0 ;

CY_ISR(sw1_isr)

{

    SW1_ClearInterrupt() ;

    sw_flag = 1 ;

}

int main(void)

{

    init_hardware() ;

   

    splash("5LP Repeated LowPower Test") ;

    LED_Write(LED_ON) ;

   

    for(;;)

    {

        if (sw_flag) {

            print("Entering Low Power Mode ... ") ;

            CyDelay(10) ;

            CyDelayUs(20);

            CyPmSaveClocks();

            LED_Write(LED_OFF) ;

            CyPmHibernate();

            CyPmRestoreClocks(); // <= Stack in this process

            CyDelayUs(20);

            print("Woke Up!\n\r") ;

            sw_flag = 0 ;

        }

        LED_Write(!LED_Read()) ;

        CyDelay(500) ;

    }

}

void init_hardware(void)

{

    CyGlobalIntEnable; /* Enable global interrupts. */

   

    LED_Write(LED_OFF) ;

   

    UART_Start() ;

   

    SW1_ClearInterrupt() ;

    isr_1_ClearPending() ;

    isr_1_StartEx(sw1_isr) ;

}

void print(char *str)

{

    UART_PutString(str) ;

}

void cls(void)

{

    print("\033c") ; /* reset */

    CyDelay(20) ;

    print("\033[2J") ; /* clear screen */

    CyDelay(20) ;

}

void splash(char *prog_name)

{

    cls() ;

    if (prog_name && *prog_name) {

        print(prog_name) ;

    }

    print(" (") ;

    print(__DATE__) ;

    print(" ") ;

    print(__TIME__) ;

    print(")\n") ;

}

======================

moto