about the STOP mode of MC1321x

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

about the STOP mode of MC1321x

1,919 Views
Beijing2008
Contributor I
Hi all:
  I'm using MC1321x and CW6.1,I hope my device can reduce current consumption,So I'm considering the STOP mode.
  As far as I knew,I should close the RF module and then MCU(HCS08) enter the STOP mode ,code as below:
/*************************************************************************/
#define ENTER_LOW_POWER _asm stop
#define MCU_STOP3_MODE()    SPMSC2 = 0x04; ENTER_LOW_POWER;        
#define MCU_STOP2_MODE()   SPMSC2 = 0x07;ENTER_LOW_POWER;                   
#define MCU_STOP1_MODE()    SPMSC2 = 0x06; ENTER_LOW_POWER; 
........
UseMcuClock();
(void)MLMEHibernateRequest();    //hibernate the RF module
MCU_STOP3_MODE();     //enter stop3 mode
.......
/************************************************************************/
IS IT RIGHT?
 
Otherwise,whether can use the STOP1 or STOP2 mode?
There is a Button on my device,whether can automatically wake up it by pressing the Button(that is a KBI interrupt)?
Call the MLMEWakeRequest() can wake-up the RF module,but how to quit the STOP mode? In other words,how to recovery it form the STOP mode to normal running mode?
So many problems,Please give me some suggestions.
 
Thanks and best regards,
Charly
Labels (1)
0 Kudos
4 Replies

455 Views
Brodek
Contributor II

This is my startup code. I don't save any registe because I want only to wake up the MCU from stop2!! To see if the MCU exit from stop2 I use an amperometer ( if the code works right I expect fluctuation in the current value but now I only read a fixed 0,5mA current absorbed by the 13213-SRB board).

 

Where I'm wrong?

 

 

__EXTERN_C void _Startup(void){

asm{

  LDX #initSOPT;
  STX SOPT;
   
  LDX #initSPMSC1;
  STX SPMSC1;
 
  LDA IRQSC
  ORA #$10   //IRQ ON
  STA IRQSC
    
  LDX #$17   //RTI CFG
  STX SRTISC  

  LDA SPMSC2;
  AND #$08; //check PPDF
  BEQ Start_App;
              
INIT:
       
   //if i'm coming from stop 2
   LDA     initSPMSC2; //enable stop2
   ORA     #$07;
   STA     SPMSC2;
   JMP main;
    
Start_App:

   //Init stop mode ( first execution )

   LDA     initSPMSC2; //enable stop2
   ORA     #$03;
   STA     SPMSC2;
      
end:
  
   JMP main;    

}


/****************************************************************/

#include "MC9S08GB60.h"


void main(void){
 
          for(;;){
                       
            SRTISC = 0x57;
            asm{
              stop
            }
           
          }

};

 

0 Kudos

455 Views
Brodek
Contributor II

Also I've some problem with stop mode 2!!

 

I've configured registers for stop and RTI timer clocked internally with 1Khz oscillator, but the MCU never reset itself... also if I don't write the recover procedure in the "start08.c" file but I leave to restart like a power up the MCU simply Sleep forever.

0 Kudos

455 Views
DylanSu
Contributor I

I have the same question……How can i enter the "stop3" mode?

Thanks

0 Kudos

455 Views
viswanath
Contributor I

Hi,

     I am viswanath, I did on STOP modes, Configurations for stop modes are right but the usage is

     not correct, i mean u have to call _asm STOP when ever and where ever u want to use.

     One more thing is Low Power modes(Hibernate & Doze) are for MODEM and STOP modes are for

     MCU.

 

     Regards,

        Viswanath K

      

0 Kudos