Hello.
I am implementing full stop mode using S12P64.
CPMUPROT = 0x26;
CPMUOSC_OSCE=0; // full stop mode
CPMUCLKS_PSTP=0; // full stop mode
CPMUPROT = 0x01;
asm ANDCC #0x7F; // Stop Mode Enable
asm STOP; // stop mode
I checked XTAL through Oscilloscope and there is no oscillation.
But still main loop is working and ECU spend current (7mA)
I used external Oscillator (CPMUOSC_OSCE=1) for source clock.
Should I do more thing?
Please help me..Thanks.
Hello,
Use the app note AN3937 MC9S12P Family Demo Lab Software. There are example projects for Low Power Modes and System Clocks which are helpful for your case.
http://cache.freescale.com/files/microcontrollers/doc/app_note/AN3937.pdf
http://cache.freescale.com/files/microcontrollers/doc/app_note/AN3937SW.zip
It seems like you didn't configure the system clock so it was not initialized. I recommend to test it on Internal Clock firstly. This is so called PEI mode:
/* initialise the system clock PEI - 50MHz VCO, 12.5MHz Bus CLK, from 1MHz Internal Clock */
CPMUPROT = 0x26; /* Clear PROT bit, disable protection of clock configuration registers */
CPMUSYNR = 0x58; /* SYNDIV = 31, VCO frequency 48 - 64 MHz */
CPMUPOSTDIV = 0x01; /* POSTDIV = 1 */
CPMUCLKS = 0x80; /* PLLSEL = 1 */
while (CPMUCLKS != 0x80); /* Verify CPMUCLKS configuration */
CPMUPROT = 0x01; /* Set PROT bit, enable protection of clock configuration registers */
while(!CPMUFLG_LOCK); /* wait for PLL to lock */
Also, i've attached an example code of STOP mode written for S12XET256 target MCU. This is for a reference only to see how it is done.
Regards,
Ivan