MCF51QE128 - Low Power Modes - stop4, stop3

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

MCF51QE128 - Low Power Modes - stop4, stop3

1,119 Views
Parker
Contributor I
Hi,

I am pretty new to the QE128. Right now I am wondering, if there are some code examples somewhere in the net. I only found some examples in this document here (http://www.freescale.com/files/microcontrollers/doc/user_guide/QE128QRUG.pdf?fsrch=1) but nothing to the low-power modes.

How can I put the CPU to stop4 mode? Right now I am doing all my work in ISR's and the CPU is in a "while(1)" loop. Now I want to put it to stop4 or even stop3 if possible.

But how does it work? I tried the following code for stop4:
  SPMSC2 &= ~ 0x80;  // LPR
  SPMSC2 &= ~ 0x01;  // PPDC;
  asm {  mov3q #4,d0; bclr.b d0,SOPT1; stop #0x2000; }
but after that my ISR's are not executed any longer...

Does somebody have any idea what the reason could be?

Ciao,
Uli
Labels (1)
0 Kudos
1 Reply

311 Views
leopard86
Contributor II

It is an old post but I'll give an answer to help out people working on stop modes:

 

PPDC is a write once bit, so must be set in the __initialize_hardware procedure.

 

Care must be paid if you're working with the debugger attached or detached. If it is attached XCSR[ENBDM] is set to 1, hence if calling  STOP3 and STOP2 will go into STOP4 mode instead. I currently have problems with the debugger detached (Flexis DEMOJM, P&E Multilink cyclonepro via USB) because when calling a stop3 or stop4 I get a Reset.

 

Bye

0 Kudos