cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Contributor II

 I have a PSCO 4200 project that spends most time in Deep Sleep.

   

An interrupt on pin wakes the device and it runs a small bit of code and goes back to sleep.

   

I need to knwo if the battery is getting low but hoping not to need external resistors and use either ADC or Comparator.

   

The program needs to simply get a flag that indicates whether battery is above or below 2.95V but not reset the device.

   

Looking at the technical reference, I found the Low Voltage Detect API. It looks as though I could use CyVdDigitEnable(0,4) and this would set low limit at 1.7V + 4 x 0.25V (2.95V). 

   

If I leave the "Reset" parameter set to "0" as above, will this mean I get a flag I can read but not physically reset the device?

   

Would there be a small snippet of Code showing how to use the API?

   

Thanks

0 Likes
Reply
8 Replies
Contributor II

 Sorry, that was the PSCO3/5 ref.

   

Would this be the way to do it for PSCO4?

   

Also, could I enable the functoin when the device is woken up from deep sleep and then disable the function when going back to sleep? Or, would I leave it active all the time.

   

void init(void){  //some startup code 
   CySysLvdEnable(CY_LVD_THRESHOLD_2_90_V);
}

   

void myroutine(void){
 uint8 BatFlag;

   

 if(CySysLvdGetInterruptSource() == CY_SYS_LVD_INT){
        BatFlag = 0;
    }   else { 
        BatFlag = 1;
    }
}

0 Likes
Reply
Esteemed Contributor II

You should use the GlobalSignal component with a connected interrupt. Set up the LVD with CySysLvdEnable() and enable/disable/ignore the interrupt as you like.

   

 

   

Bob

0 Likes
Reply
Esteemed Contributor

Once woken up the LVD can be used.

   

 

   

From the architecture TRM -

   

The LVD is available only in Active and Sleep power modes.
If LVD is required in Deep-Sleep mode, then the chip should
be configured to periodically wake up from deep sleep using
WDT as the wake up source; the LVD monitoring should be
done in Active mode. LVD circuits generate interrupts at pro
grammable levels within the safe operating voltage. The trip
point of the LVD can be configured between 1.75 V to 4.5 V
using the LVD_SEL field in the PWR_VMON_CONFIG reg
ister

   


Some useful ref material if you have not already seen it -

   

 

   

    

   

         

   

http://www.cypress.com/?rID=78797     AN86233 - PSoC® 4 Low-Power Modes and Power Reduction Techniques

   

http://www.cypress.com/?rID=96072     AN90114 - PSoC® 4000 Family Low-Power System Design Techniques

   

 

   

video.cypress.com/video-library/search/psoc+4+low+power/

   

 

   

 

   

Regards, Dana.

0 Likes
Reply
Contributor II

 Thank you Bob and Dana for the advice.

0 Likes
Reply
Esteemed Contributor

You are always welcome !

   

 

   

Dana.

0 Likes
Reply
Contributor II

I now have the low voltage detection working.

   

With regard to Deep Sleep mode. I have a PSCOC 4545PVI-283 device that measures current 35uA at room temperature when in Deep sleep.

   

I simply called the CySysPmDeepSleep() API, is there anything else I can do to lower this current? My target is 10uA.

   

The device only needs to retain RAM and wake up on a pin interrupt from another device.

   

The current appears 10uA higher than before I implemented the LVI detection using the GlobalSource LVI interrupt, even when I only enable LVI after wake up and then disable it when putting back to deep sleep.

0 Likes
Reply
Contributor II

 Device is 482 not 483.

0 Likes
Reply
Esteemed Contributor

You are aware of these ap notes ?

   

 

   

    

   

         

   

http://www.cypress.com/?rID=78797     AN86233 - PSoC® 4 Low-Power Modes and Power Reduction Techniques

   

http://www.cypress.com/?rID=96072     AN90114 - PSoC® 4000 Family Low-Power System Design Techniques

   

http://video.cypress.com/video-library/search/psoc+4+low+power/

   

 

   

 

   

Regards, Dana.

0 Likes
Reply