Wake up from Low power Standby Mode (R7FS12477, SSP1.3.0)

Hi all,

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_LVD.p_api->open(HRD_LVD.p_ctrl,HRD_LVD.p_cfg);

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();

while(1);

 

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.

Mathieu

  • Hi Mathieu,

    Have you selected both slopes (drop and rise) for LVD? Which SSP version are you using?
    Could you check if LVD correctly detects crossing the threshold (both slopes) without using low power mode?

    Regards,
    adboc
  • In reply to adboc:

    Hi,

    Yes, the both slopes have been selected.
    My SSP version is 1.3.0 (I found the same comportment with SSP 1.3.3).

    I have noted that after switch on back the power (@5V), my application consums 20mA more than before Low power mode.
    My conclusions could be :
    - The S1 is not in Low power mode anymore
    - The firmware is not running (i've not seen any actions on my application)

    Could the S1 be in a high power mode ???
  • In reply to Mathieu:

    Hi all,

    Just another thought...

    I see that in S1 microcontroler, Backup Battery hardware is not present.
    On my application, the voltage from 5V to 3V is applied on the same pin VCC on the S1.

    My question is :
    Is the S1 abble to wake-up from Standy mode (initially entered with 3V) when the voltage goes to 5V ?
    Is there any interrupt which allow the wake-up when voltage changes ?
  • In reply to Mathieu:

    Hi Mathieu,

    According to the manual, S124 is able to wake up on LVD2 interrupt also - it may be the case that this interrupt is fired when crossing 5V, could you check if this is enabled in WUPEN register?

    Are you using printf in your application?

    Could you check if LVD correctly detects crossing the threshold (both slopes) without using low power mode? This will give you information if LVD is configured properly and works as expected.

    Regards,
    adboc
  • In reply to adboc:

    Thanks a lot adboc for your feed back.

    I've tried to add LVD2 interrupt...with same result.
    I've tried the LPM2 too instead of the LPM... with same result.

    The S124 enters in Standby mode properly, but after the supply switch on back (@5V), I don’t know exactly what the S124 do ?
    Because current consumption of my application increases at this time, I think S124 has "started". But I don’t see any reset or execution on the HRD_LVD_Callback or HRD_LPM2_Callback.

    Is there any "configuration" to set in reset handler after a (possibly) wake up from standby mode ?
  • In reply to Mathieu:

    Hi Mathieu,

    I haven't noticed earlier you've used LPMv1 driver - it's strongly recommended to use LPMv2 version.
    I meant that LVD2 might be already enabled (for some reason) and thus resulting in leaving Standby mode after the power supply is 5V. Maybe accidentaly there is something more enabled as a possible wake-up factor, could you please write the value of WUPEN register just before entering Standby mode?

    Regards,
    adboc
  • In reply to adboc:

    WUPEN is 0x00080000

    Just before entering standby mode, I think all is OK.
    This is when the wake-up occurs (or an other action which drain current) that i don't know the S124 doing.
  • 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?

    Regards,
    adboc

  • In reply to adboc:

    Hi adboc,

    Thank you very much for your support, I'm sure we willl find the solution...

    I've tried your recommandation about entering LPM to the main loop.
    I've got the same result : S124 is entering Standby mode but the LVD can not wake-up corretly the µcontroler.
    LVD1 or LVD2 have the same comportment.

    I think that the voltage's fall from 5V to 3V makes S124 a random behavior.
    Can the S124 wake-up be done by a LVD interrupt ? (maybe physical IRQx only)

    Regards,
    Mathieu
  • In reply to Mathieu:

    Hi adboc,

    I've found solution to my problem !

    I've added an other module (Common stack on Configuration.xml) of the LVD driver.
    So, one is configured with a decrease threshold. The other is configured with a increase threshold (not the 2 slopes in the same driver).
    Each LVD driver own his proper IT Callback, that's why i can enter Standby mode in the first LVD Callback and exit this mode in the second LVD Callback.

    I did not know that LVD driver could be split in several "driver module"...
    This solution seems to be perfect for my application ;)

    Thanks for your support,
    Mathieu