I try to decrease current consumed by MCU (MCF52255). I define two functions for that. First function turns MCU in low power Stop mode (deepest mode). Here is code for this action:
The second function turns MCU in low power Wait mode. In this mode, I want CPU answers to interrupts. Here is code for this action:
MCF_PMM_LPCR = MCF_PMM_LPCR_LPMD_WAIT; // Select wait mode
MCF_PMM_LPICR = 0
| MCF_PMM_LPICR_XLPM_IPL(0) // Any level can wake up MCU
| MCF_PMM_LPICR_ENBSTOP; // Activate low power mode
asm( stop #0x2000);
If I use wait or stop function, when MCU is idle and FEC is not used (MCU does not wait for a FEC interrupt), that works well. When FEC is not used, external PHY is in Power Down mode.
There is a problem when I want use wait function when MCU is idle and FEC is used: I don't know why, but Backup Watchdog Timer (BWT) resets MCU in this case (RSR register has 0x80 after MCU reset).
Do you have hints for me?