Hello all,
how to enter Stop or Wait mode when mcu is running?
PS: MC9S12P128.
Solved! Go to Solution.
The purpose of this forum is to ask questions about how to use the forums, not how to use the products.
Please ask your question in the appropriate 8 or 16 bit forum, but SEARCH those forums first to see if someone else has already asked your question.
These forums can be accessed directly under the "Products" section of the "Home" page.
Can one of the Administrators move this post please?
Tom
For entrance into STOP and WAIT mode you should use directly CPU instructions.
You can use for example:
asm STOP; //STOP mode
asm WAI; //force the MCU into wait mode
In case of STOP mode, there is necessary also clear S bit in CCR register prior you use STOP instruction, otherwise STOP instruction will be executed as NOP.
So, you can use this code:
asm ANDCC #0x7F; //clear S bit - enable the stop mode. If the S bit is not
//cleared then STOP instruction has no effect and is
//executed as a dummy instruction NOP.
asm STOP; //STOP mode
Note: S bit will be restored during next reset.
The purpose of this forum is to ask questions about how to use the forums, not how to use the products.
Please ask your question in the appropriate 8 or 16 bit forum, but SEARCH those forums first to see if someone else has already asked your question.
These forums can be accessed directly under the "Products" section of the "Home" page.
Can one of the Administrators move this post please?
Tom
Thanks