1 2 Previous Next 21 Replies Latest reply on Nov 6, 2014 3:38 AM by JoMe_264151

    Wakeup PSoC on power supply recovery


      Hello Folks,




      I'm putting PSoC5LP in sleep mode as soon as it receives an int coming from the LV detection block (raised thru the Global Signal component). There's of course a battery back up feeding the CPU while the PS is off, mainly for ram retention & keeping the RTC running.


      However when the power supply comes back to life, I'm unable to wake up the processor using  CyPmSleep(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_VD).


      There is not so much doc/explanation/example about PM_SLEEP_SRC_VD used whithin CyPmSleep.


      Is anyone able to give me further explanation?



        • 1. Re: Wakeup PSoC on power supply recovery

          I understand the functioning of the CyPmSleep() just the other way round: It will wake you up when an LV situation occurs. Just for giving you a bit of time to do the absolute needed (STOP Motors!!! Freeze pins).


          Since you cannot remove the LV situation which will still exist when woken up, you will be in need to cancel LV monitoring by software until power is restored back again.





          • 2. Re: Wakeup PSoC on power supply recovery

            The system reference guide in the documentation part of Creator


            has a lot of notes regarding power control functions and exceptions.


            Maybe take a look at that to see what your code does not reflect.




            Regards, Dana.

            • 3. Re: Wakeup PSoC on power supply recovery

              Ok thx for the answers.




              Bob is right (once again ), regarding the WakeUp parameter of the CyPmSleep().


              I'm working on another solution, migth break a little bit the current design (and boards ).


              Can't learn without shattering eggs...


              See you for the omelet





              • 4. Re: Wakeup PSoC on power supply recovery



                Let's go on, as I've cooked the omelet but not eaten it yet!


                With a slight modification of the boards, I'm now able to put the proc in sleep and wake it up correctly (thru a pushbutton for the moment). This is great.


                I'm now fighting against consumption.


                The DMM is connected in series with all the Vddd/Vdda/Vddio pins. This way I'm sure to monitor the PSoC5LP current.


                I've stopped all the unnecessary blocks (xxx_Stop() : USBFS, 4xUART, EEPROM), and switched all the output pins as HZ digital input to avoid any sourcing current. All the com cables have been disconnected from the board. All the leds switched off (these pins have not been switched in HZ, but left totem pole).


                I've kept the RTC running + a few logical blocs that can't be stopped by software (Debouncer, Status Reg, Global Signal).


                In sleep mode the PSoC is drawing 6mA. Well, for a 2032 coin cell, this is approximately 25 hours, far away from what is expected.


                I've slowed down the IMO before entering sleep mode, swtiched the JTAG pins to GPIOs, and removed the Miniprog once flashed.


                I'm becoming crasy because I can't find the component which is drawing this amount of current.


                What other way I should explore ?


                One more question: would it be better to put the output pins as HZ analog input instead of digital?



                • 5. Re: Wakeup PSoC on power supply recovery

                  I presume you have seen this and followed all recommendations ?








                  http://www.cypress.com/?rID=64554     AN77900 - PSoC® 3 and PSoC 5LP Low-power Modes and Power Reduction Techniques




                  Also note there is a power estimator spreadsheet at bottom of the above ap notes page.




                  http://www.cypress.com/?rID=43337     AN61290 - PSoC® 3 and PSoC 5LP Hardware Design Considerations




                  Regards, Dana.

                  • 6. Re: Wakeup PSoC on power supply recovery

                    Thanks Dana,




                    I read again (and again) and switched off the outputs to HZ analog inputs as per AN61290 stating "If a GPIO, SIO, or USBIO is not used, it should be left floating and in the high impedance analog state..."


                    May be some few µA  less, but not significant.


                    Then I killed the USB self-powered bloc (and commented the corresponding lines of code) => went down to 1.5mA (I guess the corresponding 2 IO automatiquely shifted in HZ at recompilation).


                    This is more than a 2/3 cut! A comment here : putting the USB block in Stop() mode didn't significantly lower the consumption, w/o the com cable. More than 4mA : this is far away than what the datasheet mentions : IUSB_Suspended 300µA for 5V, cable disconnected. Any comment on this?





                    • 7. Re: Wakeup PSoC on power supply recovery

                      This is becoming a soap...




                      I reintegrated the USB block and used the 2 API functions _Suspend() and _Resume(). I got the same consumption 1.5mA which is currently my best.


                      I've dug a little bit deeper tracking those precious hundreds of µAmps without success. There is still a leak somewhere but hard to find it.


                      I'm gonna review the component datasheets, may be using Sleep or Suspend instead of Stop would give me more luck.




                      See you soon.





                      • 8. Re: Wakeup PSoC on power supply recovery

                        Just a thought but create an empty project with just the sleep


                        command and see if the power makes sense, if not something about


                        HW lashup that is at issue. You would still have to observe notes


                        in ap note and system reference guide.




                        Also maye a quick check of your meter with a simple R attached to Vdd,


                        see if meter makes sense when measuring current.




                        Regards, Dana.

                        • 9. Re: Wakeup PSoC on power supply recovery





                          I tried your inquiry:


                          int main()
                          //    CyFlash_SetWaitCycles(3);                                           // Reduce clock
                          //    CyDelayFreq(3000000);
                          //    CyIMO_SetFreq(CY_IMO_FREQ_3MHZ);
                              CyPmSleep(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_NONE);                   // Forever


                          With or without reducing the clock, still 1310µA (fluctuating 3 lsb) on my other DMM (the 1st one says 1.43mA).


                          All pins in Analog HZ, no components, no PLL, no USB, ILO set to 1kHz, no XTAL 32kHz.


                          Will check another board.





                          • 10. Re: Wakeup PSoC on power supply recovery

                            Michel, can you please post that project to have a look at?





                            • 11. Re: Wakeup PSoC on power supply recovery

                              Have you seen this - www.cypress.com/




                              You saw the DVK mods to measure power in appendix B of AN77900 (if


                              you are using DVK board) ?




                              Post your schematic.......




                              Regards, Dana.

                              • 12. Re: Wakeup PSoC on power supply recovery

                                Dana & Bob,




                                Thx for the help. No DVK used, it's a proto board.


                                May send you the project & schematics but I'm under a NDA with my customer.


                                Can only send by private mail which means I need your respective addresses.


                                You may join me at michel.kowalczuk@free.fr





                                • 13. Re: Wakeup PSoC on power supply recovery

                                  I was not thinking of your companie's project, but as far as I understood you, you have built a rather small example that already used quite more current than expected. This is what I'd like to see uploaded to check every setting.





                                  • 14. Re: Wakeup PSoC on power supply recovery

                                    Yes Bob,




                                    This is a rather small one...

                                    1 2 Previous Next