This is first attempt at using Sleep command on 5LP. I am starting with the code below. Just before the unit goes to sleep the current drawn is 18mA. During sleep it only drops to 15mA.
Do I have the correct settings for low power mode? (The sleep timer is set for 4096).
Which board do you have ? If the CY8CKIT-050 there are instructions
to measure in 77900, page 16 -
http://www.cypress.com/?rID=64554 AN77900 - PSoC® 3 and PSoC 5LP Low-power Modes and Power Reduction Techniques
http://www.cypress.com/?rID=43337 AN61290 - PSoC® 3 and PSoC 5LP Hardware Design Considerations
http://www.cypress.com/?rID=78797 AN86233 - PSoC® 4 Low-Power Modes and Power Reduction Techniques
The current does seem to drop when in low power mode now. I have several mA being used by the power supply and some pull-up resistors.
However, The program seems to now be halting after wake from sleep (when Sleep Timer trips). I have tried turning off the sleep Timer when done and also clearing the watchdog time in the main loop but cannot figure out what is causing the program to stop (it is acting like an invisible brakpoint). Here is my current code. The Sleep timer is set to max period around 4 seconds. The project has selectable mains/battery operation. If battery then it simply switches to low power mode and wakes up every 4 seconds to check inputs then back to sleep (at least this is what is SHOULD be doing).
MainsTripped = false;
swmode = MODE_Read();
MainsPowered = swmode& 0x01;
MainsDetect = swmode & 0x02;
MainsLongDelay = swmode & 0x04;
if(MainsLongDelay) MainsDelay = FIVEMINUTE; else MainsDelay = TENSECONDS;
MainsTripCount = MainsDelay;
TestSMS = swmode & 0x08;
Modem_Ready = SMS_Init();
Does the sleep mode interact with watchdog timer? I have cleared the wdt in main loop but not sure if needed. If wdt must be explicitly started then I should not need to reset it.