2 Replies Latest reply on Sep 25, 2020 6:43 PM by MoTa_728816

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

    MaMi_1205306

      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,

        • 1. Re: PSoC5LP : Repeat the operation of Low power mode and Active mode
          LePo_1062026

          MaMi,

           

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

           

          Len

          • 2. Re: PSoC5LP : Repeat the operation of Low power mode and Active mode
            MoTa_728816

            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