How to enter Stop or Wait Mode?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to enter Stop or Wait Mode?

跳至解决方案
3,224 次查看
aguo1223
Contributor III

       Hello  all,

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

                                                                PS:  MC9S12P128.

标签 (1)
1 解答
2,009 次查看
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 项奖励
回复
3 回复数
2,008 次查看
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.


2,010 次查看
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 项奖励
回复
2,009 次查看
aguo1223
Contributor III

Thanks

0 项奖励
回复