I have some problems in standby mode exit with MPC5606S CPU
The source code is based on "Low power modes" from freescale examples for MPC5606S.
The purpose of the source code is to wait from 2 wakeup sources to exit from standby mode
#define IN_IGNITION 19 // IN_IGNITION -> PB3 GPIO uC_PIN 110
#define IN_HNBR_L_SW1 75 // IN_HNBR_L_SW1 -> PF5 GPIO uC_PIN 117
In run mode, the code checks what is the wake-up source and flashes some LED. If the wakeup GPI line is low, come back to standby mode.
Additionally in run mode the main clock is send out by PH GPIO to check the frequency.
The system seems to be working correctly but there are some problems that I can't fix.
Starting from power supply OFF to ON, the CPU need 3 or 4 wake-up event to start to flash the LED.
Checking the power consumption, when the wake-up GPI line is active, the CPU current consumption increase and flash some LED very fast.
Checking the clock output line. I see that:
1) In the cases that the CPU works (LED flashing) the clock is 64MHz and the system works fine
2) In the cases that the CPU not wake-up OK (very fast LED flash), the clock start to oscillate for 500ns and then stabilize the frequency at 64MHz for 3us, after these 3us, the oscillation stop.
I do the same test using different clocks source (XTAL, PLL and internal 16MHz rc oscillator) and the results are the same.
I thing I'm doing something wrong but I can't fine the mistake.
Can somebody help me to fine the problem.
Miquel Soler i Mir
Original Attachment has been moved to: main.c.zip