hi all,
I have a End device. I use a MC1313.
What functions I can use ? PWRLib_MCUStop3? PWR_CheckForAndEnterNewPowerState? or others ?
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 ???
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
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 ?
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