Hi,
Where can I find examples of how to implement deep sleep and how to achieve the less power consumption for the KW41Z microcontrollers running ZigBee protocol?
I've tried the ZigBee End Device generic and LTO sensor SDK examples but I can't get too much power saving with it.
Hi Alejandro, I hope you're doing well!
There's a document called Power Management for Kinetis MCUs explaining the different existing power modes in Kinetis MCUs, as well as example code, transitions explanations, enabled modules in each power mode, along with other relevant information.
The document can be found here.
Specifically, for ZigBee 3.0 Stack SDK examples and projects, some additional definitions must be changed to enable the use of low power and sleep modes:
For more information, could you please take a look at the ZigBee 3.0 Stack User Guide pdf included in the SDK package for the KW41Z?
It can be found in the following path:
<…\SDK_SDK_2.2.1_FRDM-KW41Z\docs\wireless\Zigbee\ZigBee 3.0 Stack User Guide.pdf>
Please let me know if you need more information.
Best regards,
Sebastian
I just activated the Low power with the macros, but i think there is a problem in the firmware of the ZigBee End Device example. The first time before joining network it just works fine. It enters this section in app_end_device_node.c the APP_cbTimerPoll method:
Cofigures mode 4 of deepsleep, and in the pwrm_shim.c file I can debug this section
the method PWR_CheckIfDeviceCanGoToSleep() returns TRUE so it can go to sleep.
But after node joins a network, it enters here in app_end_device_node.c the APP_cbTimerPoll method:
And vStopAllTimers(); should clear all timers that prevents enter low power mode, but there still is one timer that doesn't clear the global variable mLPMFlag that keeps value of 1, so, this method:
bool_t PWR_CheckIfDeviceCanGoToSleep(void)
{
bool_t returnValue;
OSA_InterruptDisable();
returnValue = mLPMFlag == 0 ? TRUE : FALSE;
OSA_InterruptEnable();
return returnValue;
}
Always returns false. So in the pwrm_shim.c, the code after condition could never be executed to enter low power mode:
if(PWR_CheckIfDeviceCanGoToSleep() && ((TRUE == s_bWakeTimerActive)||(3 != PWR_GetDeepSleepMode())))
{
PWRLib_WakeupReason_t wakeupReason;
wakeupReason = PWR_EnterLowPower();
...
}