Hi,
See the following document where you can download set of example projects:
LAMA's S12XE unofficial examples
Find the projects demonstrating usage of Stop mode such as 'XEP100-STOP-WakeUp-CW47.zip'.
The most important thing in order to enter stop mode is to clear S-bit in CCR register and then execute stop instruction, therefore two codelines:
//-----------------------------------------------------------------------------------------
asm ANDCC #0x7F; //clear S bit - enable stop mode
asm STOP; //enter stop mode
/*If the S bit is not cleared then STOP instruction has no effect and is executed as a dummy instruction NOP*/
//----------------------------------------------------------------------------------------
Have a great day,
iggi
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------