PSOC3 will not stay in hibernate

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

cross mob
Anonymous
Not applicable

Hi, I am attempting to use a soft power switch configuration with our PSOC3 driven product and having an issue with hibernate mode, in that the cpu seems to come out ofCyPmHibernate() right after going into it  - without the power switch being turned on.

   

Prior to the hibernate call I am sleeping /stopping all components, clearing interrupts, etc. and re-configuring clocks per the System Reference guide. There are ample delays for some servo motor commands prior to powering down, so I'm not worried about debounce of the switch. Below is a code snip from the power down routine.

   

I have had to put in a loop that waits for the power switch to be turned on, so the unit is sitting in this loop using about 7ma - not good, but I am having to ship product like this until I have a solution.

   

As I understand it the PICU is the only way to wake up from hibernate. I assume that I'm overlooking something that is waking things up, any suggestions/ideas on where to look next?

   

...

   

PWR_SW_ClearInterrupt();

   

CyPmSaveClocks();     //Save Clock configuration before entering Hibernate
   
    CyPLL_OUT_Stop();                    // change clock configuration for hibernate
    CyIMO_SetSource(CY_IMO_SOURCE_IMO);
    CyMasterClk_SetSource(CY_MASTER_SOURCE_IMO);
    CyPLL_OUT_Stop();
    CyXTAL_Stop();
    CyXTAL_32KHZ_Stop();
   
    PWR_SW_ClearInterrupt(); // again

    CyPmHibernate();      // put the device into hibernate mode
     
//***** CPU is supposed to stay ^ Here until power switch turned on *****//
      
    while (powerSwState = PWR_SW_Read());  // DEBUG - wait here till power sw is low (on)       
   
    PWR_SW_ClearInterrupt();
       
    CyPmRestoreClocks();

   

...

0 Likes
2 Replies
BoKa_4383376
Level 1
Level 1

I have the same question - but unlike the OP, I do call

CyPmSaveClocks

before I call hibernate.

So I'm assuming an interrupt is occurring, bringing the uC out of hibernate - can I read a reg to know which interrupt caused the resume out of hibernate?

0 Likes
KrDe_284951
Level 4
Level 4
10 replies posted 10 questions asked 5 replies posted

Hi,

I'm no expert in this matter (iI struggle with similar issues using CyPmSleep()) but what I suppose is that when using PmCyHibernate() the IO pins of the processor become high impedant (at least they don't have the same behaviour as when using CyPmSleep()).. This could cause a involuntary interrupt when a IO pin driffts from high to low or vice versa.

Kris

0 Likes