Hello Forum members,
I am trying to implement 'STANDBY' mode on SPC5602D MCU. I am using EIRQ (PA12/EIRQ17) to enter into standby mode and wakeup siganl (PE0/WKUP6) to get out of it. When executed, code works fine and device enters STANDBY mode but when signal triggers (transitions) on wakeup signal, it does not get out of it. I have verified the code with STOP mode and it works fine.
The page #144 in reference manual (MPC5602DRM.pdf) says as wakeup event as exit source for STANDBY mode. For other modes like STOP, it says as wakeup interrupt or wakeup event as exit source. What is the difference between wakeup as interrupt or event? How to handle wakeup as an event? Any example code for standby mode?
Thanks in advance for all your help.
Hi,
Attached is the STANDBY demo example tested on the MPC5602D EVB (with 64LQFP minimodule).
Beside this there is app note dealing with low power application on MPC560xB/C/D family.
See http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4240.pdf.
Hope it helps you.
Regards,
Petr
Hello Petr,
Thanks for your quick reply and attached code sample as well as app note.
The checked your code for my implementations. Only difference I observed is I am using falling edge for the wakeup signal as against rising edge in your code. Does that need any additional configuration for the wakeup signal?
Another question is related to interrupt vs event. The page #144 in reference manual (MPC5602DRM.pdf) says as wakeup event as exit source for STANDBY mode. For other modes like STOP, it says as wakeup interrupt or wakeup event as exit source. Does this make any sense? What is the difference between wakeup as interrupt or event? How to handle wakeup as an event?
Thanks in advance for your help.
Mike.
Hi Mike,
If you are using falling edge instead of rising one you will just configure WKUP.WIFEER register instead of WKUP.WIREER register.
The difference is that you can wakeup the MCU from STANDBY only via wakeup event; means edges on external wake-up pins, a reset, or from a periodic wake-up using a low-power oscillator. (see Table 12-1. Wakeup vector mapping of the device RM).
In addition to this the MCU can be waken up via peripheral interrupt from STOP mode.
This is also described in the AN4240 on several chapters; 9., 10.3, 10.4
Regards,
Petr
Hello Petr,
Yes, I have configured the WIFEER register only for detecting falling edge. I am seeing transition on oscilloscope also for the wakeup signal but still MCU does not enter the wakeup ISR which will exit STANDBY mode and put MCU to run mode. I tried putting break point in the ISR but even after wakeup signal goes low, the ISR does not execute. What could be the reason? This works very well in STOP mode.
And that's why I was concerned about the event vs interrupt; Whether wakeup isr will be the only source to serve the wakeup event?
Thanks for your help.
Mike.
Mike,
Wakeup to the interrupt is not possible for STANDBY mode exit. It will work only for STOP or HALT exit. For a Standby exit you can either go through the reset (into Flash) or exit to the backup RAM. The posted example uses the second option.
Note: On exit from STANDBY mode, most of the registers are reset as in a power-up reset. Power domain 0 registers are not reset, including RGM registers, ME _DRUN_MC register and PCU registers, RTC registers, CAN SAMPLER registers, and so on.
BR,
Petr
Hello Petr,
Thank you for clarifying the standby mode exit options. I was trying to get an interrupt/event for wakeup signal.
My code has option set to 'Boot from flash on standby exit' for the RGM_STDBY register. But when I do transition on wakeup signal, it does not return to normal run mode. What could be the reason? Is any configuration missing? You are also using similar implementations except the pins the edge and the exit mode used are different.
Is there any register configuration to generate a soft reset for the MCU?
Thanks in advance.
Mike.
Hello Petr,
I am trying to use the option 'Boot from Flash on Standby Exit' but some how it is not exiting the Standby mode. Is any configuration missing? What is the reason?
The reference manual states as 'system reset assertion' for exiting the Standby mode. What are the different ways to generate the system reset? Whether soft reset will serve the purpose? How to generate soft reset for this MCU? I tried finding the register for soft reset but unable to locate it.
Thanks in advance for your any help.
Mike.
Hi Mike,
When boot from Flash option is used (set by RGM_STDBY register) the MCU executes the same code as it is in normal reset.
So in your case the application does not start after wakeup, you did not reach the main function again?
Note there is an errata for low power mode exit, discussed more in EB770 (http://cache.freescale.com/files/32bit/doc/eng_bulletin/EB770.pdf), however for z0 core any workaround may not be needed if reset is acceptable within the application.
See chapter 9.1.3 “Reset sources” of the Reference Manual to see possible sources that can generate system seset.
The Software reset is also one way and it is generated with a help of Mode Entry module doing a “RESET” mode transition.
/* software reset */
Regards,
Petr