deepsleep and sleep mode - MC1313

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

deepsleep and sleep mode - MC1313

2,018 Views
Nicolas_martel
Contributor I

hi all,

 

I have a End device. I use a MC1313.

 

I want my device remains all the time in sleep mode or deepsleep mode while it doesn't receive a interrupt -> KBIPE=0x10;
                KBISC=0x16;
And it return in sleep mode or deepsleep mode after that.

 

What functions I can use ? PWRLib_MCUStop3?  PWR_CheckForAndEnterNewPowerState? or others ?

 

If I can go into deepsleep mode, how I can go out if my device stay in deepsleep?
What functions in Beekit I must change ?
Sorry for my bad englih
Best regards 
Nico
Added p/n to subject.
Message Edited by NLFSJ on 2009-03-26 04:08 PM
Labels (1)
0 Kudos
5 Replies

571 Views
Nicolas_martel
Contributor I
Thanks for reply Mad. 
I can go into the sleep mode but when I turn off the coordinator, the end device loses sleep mode!
I must make a transportable model so it is necessary that the end device does not lose the sleep mode between power up the coordiantor.
How do that?
0 Kudos

571 Views
Nicolas_martel
Contributor I

My program doesn't wake up. I use the function : PWR_HandleDeepSleep();

 

My code :

 

INTERRUPT_KEYWORD void Switch_ISR
  (
  )
{
  mKBI_DISABLE_c;
  mKBI_ACKNOWLEDGE_c;
  PWRLib_MCU_WakeupReason.Bits.FromKBI = TRUE;
 
  if ((KBI1SC&0x10)==0x10){   
     KBI1SC=KBI1SC&0xEF;    
     TS_SendEvent(gAppTaskID, On); 
  }else{
   KBI1SC=KBI1SC|0x12;  
    TS_SendEvent(gAppTaskID, Off); 
  }
}

 

Why my end device doesn't wake up ???

0 Kudos

571 Views
Mads
Contributor V

Nicolas,

 

First of all you do NOT need to call any PWR_ functions in your application.

Low power is already integrated in the Project and is serviced from the idle task.

 

I would guess that your probem is that:

1. you are calling the PWR_HandleDeepSleep() directly in your app. This you should not do..

2. you might still have software timers running. If a timer is running, then you can not sleep.

3. if you are using a ZigBee project you need to enable the low power mode property in beekit and set the poll interval to 0 as explained by the new project wizard.

 

e.g. try start out with the HA OnOffSwitch application. It works fine with low power and wakes up on keyboard interrupt.

 

BR,

Mads

0 Kudos

571 Views
Nicolas_martel
Contributor I

Thanks for your reply Mads.

 

My end device doesn't want go in sleep mode.

 

bool_t PWR_CheckIfDeviceCanGoToSleep( void )
{
  uint8_t   ccr;
  bool_t    returnValue;
  IrqControlLib_BackupIrqStatus(ccr);/*To protect from re entrant*/
  IrqControlLib_DisableAllIrqs();
  returnValue = mLPMFlag == 0 ? TRUE : FALSE;
  IrqControlLib_RestoreIrqStatus(ccr);
  return returnValue;
}

this function retunr always FALSE. why ?

 

I use this function for stop end free the timer : TMR_FreeTimer(appTimerId);

 

Is there a function which stop end free all timer ?

0 Kudos

571 Views
Mads
Contributor V

Nicolas,

 

It is hard to guess what is problem based on the limited information in this thread.

I would again recommend you to try out the HA On/Off Switch which supports low power.

And make sure you follow the steps explained in the New project wizard.

 

If you still have problems, please register on www.freescale.com and create a service request/request help (this is the official support system).

 

If you do this please submit and source code files you changed, the solution file and step by step instructions.

 

br,

Mads

0 Kudos