9 Replies Latest reply on Dec 5, 2014 2:51 PM by user_14586677

    Power consumption reduction at different modes

    content.librarian

       Dear all,

         

       

         

      Currently I am using CY8C29466-24PXI to develope a device which wakes up in a short time interval and goes into sleep modes for most of the time. After reading a related application note: AN47310. I have got a brief idea how I should implement the sleep mode with different modifiers. After doing several test, this is the amount of current draw by the development board (I am using CY3210-PSoCEval1 so the current  drawn by LED and voltage regulator are also included):

         

      Operating mode: ~26mA

         

      Sleep mode (No other configurations): ~23mA

         

      Sleep mode with sleep timer activated: 15mA~17mA

         

      Sleep mode with sleep timer activated (Sleep timer API used): 23mA

         

      Sleep mode (With all configured modifiers and sleep mode is inactivated): ~9mA

         

      So I do not know how I should utilise the sleep timer module whilst minimising power consumption. So far as I observed, the PSoC does not reduce much energy with activated sleep timer module? Also, the system halts and some point when I implement sleep timer API, I have no idea how should overcome this.

         

      Enclosed please find my project file. I used the example code from AN47310 and modifed it for my own purpose.

         

      Any ideas/assistance are much appreciated. Thank you very much!

        • 1. Re: Power consumption reduction at different modes
          user_1377889

          You switch only 1 pin of port 2 and 4 pins of port1 to high-z analog. This does not reduce power to its minimum.

             

           

             

          Bob

          • 2. Re: Power consumption reduction at different modes
            content.librarian

             Thanks Bob for the reply. But all other pins are in High Z Analog by default.

               

            Some edit:

               

            Sleep mode (With all configured modifiers and sleep *TIMER MODULE* is inactivated): ~9mA

               

            Sorry for the typo error.

            • 3. Re: Power consumption reduction at different modes
              user_14586677

              You have to re-enable global interrupts after you

                 

              come out of sleep.

                 

               

                 

              void NoGpioSleep(void)
              {
                  WORD index1,index2;
                 
                  /* Configure PSoC 1 for sleep */
                  SleepPrep();                               
                 
                  /* Disable interrupts during sleep */
                  M8C_DisableGInt;                           
                 
                  /* Enable Sleep in PSoC 1 */
                  M8C_Sleep; 

                 

                   M8C_EnableGInt;      // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                 
                  SleepTimer_TickWait(50);    //Originally I would want the system to delay the program until next wake up rountine.
                                              //But the system halts at this line with current draw of 23mA...
                  WakeUpRestore();
                  M8C_ClearWDTAndSleep;
              }

                 

               

                 

               Also are you still powering the RS232 interface chip on the board ?

                 

               

                 

              I also do not see where you have set the mask -

                 

               

                 


                 

               

                 

              When the Sleep Timer rolls over, an interrupt is posted to
              the system. To allow an interrupt from the Sleep Timer to
              wake the PSoC, it must be unmasked in the INT_MSK0
              register like any other interrupt source.

                     

               

                 


              /* Set Mask for Sleep Timer Interrupts */
              M8C_EnableIntMask(INT_MSK0, INT_MSK0_SLEEP) ;


                 

              Regards, Dana.

              • 4. Re: Power consumption reduction at different modes
                content.librarian

                Hi Dana,

                   

                Thanks for the reply. Yes I didn't mask the sleep interrupt and at least the sleep timer interrupt is working fine now. =)

                But I have a doubt: The current drawn by the development board does not reduce much when I am using the SleepTimer API (eg: SleepTimer_TickWait, SleepTimer_SyncWait, etc...) The current draw is ~23mA.

                   

                So my assumption is: The PSoC wake up according to the sleep timer interrupt at designated frequency and when it does so, the current draw increases....

                   

                So does this defeat the purpose of having sleep mode? I mean, the power consumption doesn't really decrease that much if taking sleep timer interrupt into the design as the system will always wake up and check at every time interval.

                   

                Please correct me if I made wrong assumption.

                   

                PS: Yes, the RS232 chip consume some power as well. Thanks for clearing this up.

                • 5. Re: Power consumption reduction at different modes
                  user_14586677

                  The RS232 has a charge pump in it that draws a lot of power, so

                     

                  you need to lift the Vdd lead off of the PSOC and connect ammeter

                     

                  between there and Vdd. Sleep should produce, for the 29466, ~

                     

                  20 - 30 uA.

                     

                   

                     

                  Regards, Dana.

                  • 6. Re: Power consumption reduction at different modes
                    content.librarian

                     Hi Dana, 

                       

                    Thanks for the advices, again. I have connected the the direct power supply to CY8C29466 and i          t draws ~400uA when it is in sleep mode. I think this is much better compared to my very first design which has many flaws.    

                       

                    Sorry it is indeed ~4uA with only PSoC being connected to the device. Great one!!

                       

                    By the way, I failed to have an accurate sleep timer during sleep mode. For example, I am planning to put the system into sleep mode for 10 seconds. But the system will wake up at approximate 8++ seconds. Anything wrong with the code? The API SleepTimer_TickWait does the job but it won't reduce the power consumption that much.

                       

                    This is my recent codes:


                    INT stimer;
                    SleepTimer_Start();
                    SleepTimer_SetInterval(SleepTimer_1_HZ);
                    SleepTimer_EnableInt();

                    M8C_EnableGInt;
                    M8C_EnableIntMask(INT_MSK0,INT_MSK0_SLEEP);

                    while (1)
                    {
                    PGA_Start(PGA_MEDPOWER);
                    LPF2_Start(LPF2_MEDPOWER);

                    PRT1DR ^= 0xF0; // Toggle P1[4],P1[5],P1[6] and P1[7] 
                    SleepTimer_TickWait(10); //Delay program for 10 seconds, it works well

                       

                    PRT1DR &= ~0xF0; // Turn off P1[4],P1[5],P1[6] and P1[7]
                    PGA_Stop();
                    LPF2_Stop();

                    SleepPrep(); //User commands to configure sleep mode

                    M8C_EnableGInt;
                    M8C_EnableIntMask(INT_MSK0,INT_MSK0_SLEEP); //Enable sleep timer interrupt
                    M8C_ClearWDTAndSleep;

                    for (stimer = 0; stimer < 10; stimer++) //stimer to indicate sleep time interval, but it didn't work well... (Only sleep for 8++ seconds)
                    {
                    SleepTimer_SyncWait(1,SleepTimer_WAIT_RELOAD);
                    M8C_Sleep;
                    }

                    WakeUpRestore(); //User commands to wake up PSoC
                    M8C_ClearWDTAndSleep;
                    }

                    • 7. Re: Power consumption reduction at different modes
                      user_14586677

                      The sleep timer is driven by the ILO, and if you are not using

                         

                      external xtal, ranges from 15Khz to 64 Khz trimmed, so very

                         

                      inaccurate.

                         

                       

                         

                      Regards, Dana.

                         

                       

                         

                      Block Diagram of AN32200

                      • 8. Re: Power consumption reduction at different modes
                        content.librarian

                        Hi Dana and Bob,

                           

                         

                           

                        Just changed the configuration with connection to external clock. And now the system is working brilliantly!!

                           

                        Really appreciate your help and patience! Cheers!!! =)

                        • 9. Re: Power consumption reduction at different modes
                          user_14586677

                          I noticed in your code you are doing port GPIO writes. If you

                             

                          have mixed I/O in a port and are doing read modify writes on

                             

                          the port (like looking at an input pin then writing back to port)

                             

                          you must use shadow registers. See this ap note, AN2094

                             

                          www.cypress.com/  page 7.

                             

                           

                             

                          Regards, Dana.