How to enter Stop or Wait Mode?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to enter Stop or Wait Mode?

Jump to solution
2,536 Views
aguo1223
Contributor III

       Hello  all,

                    how to enter Stop or Wait mode  when mcu is running?

                                                                PS:  MC9S12P128.

Labels (1)
1 Solution
1,321 Views
TomE
Specialist II

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.

8-bit Microcontrollers

16-Bit Microcontrollers

These forums can be accessed directly under the "Products" section of the "Home" page.

Can one of the Administrators move this post please?

Tom

View solution in original post

0 Kudos
Reply
3 Replies
1,320 Views
RadekS
NXP Employee
NXP Employee

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.


1,322 Views
TomE
Specialist II

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.

8-bit Microcontrollers

16-Bit Microcontrollers

These forums can be accessed directly under the "Products" section of the "Home" page.

Can one of the Administrators move this post please?

Tom

0 Kudos
Reply
1,321 Views
aguo1223
Contributor III

Thanks

0 Kudos
Reply