I have an issue about the Low power standy mode on a S1 microcontroler powered with 5V alimentation, and with a 3V backup battery.
In my application, the micro (initialy powered with 5V alimentation) must enter "low power" when the alimentation is shutdown and the voltage crosses (decreasing) the 4.02V threshold (Vdet1_2). Here, all is good, S1 is in low power (@3V thanks to backup battery) with a 3uA current consumption.
Then, the micro must wake up from low power when the voltage crosses (increasing) the 4.02V threshold. But at this step, nothing happening, S1 stays in low power.
Below, my Low Voltage Detection Init :
HRD_LPM.p_api->init(HRD_LPM.p_cfg); HRD_LPM.p_api>lowPowerCfg(LPM_LOW_POWER_MODE_STANDBY,LPM_OUTPUT_PORT_ENABLE_HIGH_IMPEDANCE,LPM_POWER_SUPPLY_DEEPCUT1,LPM_IO_PORT_RESET); HRD_LPM.p_api->wupenGet(&loc_WUPENRegVal); HRD_LPM.p_api->wupenSet(loc_WUPENRegVal | WUPEN_LVD1); // WUPEN_LVD1 0x00040000 // bit18 == LVD1
And the HRD_LVD_Callback :
HRD_LPM.p_api->operatingPowerModeSet(LPM_OPERATING_POWER_LOW_SPEED_MODE, LPM_SUBOSC_SELECT); HRD_LPM.p_api->lowPowerModeEnter();
My S1 never execute the last while(1) operation to do a reset....
Is anyone have a explanation about that ??? Thanks in advance for your answers.
In reply to adboc:
In reply to Mathieu:
Hi Mathieu,So now WUPEN is configured for LVD2 interrupt only? Unfortunately I can not check LVD module, but I've configured the LPMv2 driver to wake up on IRQ3 interrupt using DK-S124 board (S2 user button) and it works as expected.When the device wakes up on interrupt, the MCU should execute a corresponding ISR.
I suggest reading section 10.7.2 Canceling Software Standby Mode of the S124 hardware manual.
Additionally, I'm not sure if LVD interrupt will work when the MCU enters low power mode during ISR execution - could you refactor your code and move entering LPM to the main loop?