This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how does Z-Stack power saving actually work?

Other Parts Discussed in Thread: CC2530, Z-STACK

Hi all,

I've configured a Z-Stack CC2530 End Device build (based loosely on GenericApp) to enable POWER_SAVING.  Everything seems to behave as it should, but I am keen to understand a bit more about how the power saving is handled.

Looking at the source code, it's clear that low power mode is only entered when there are no events to be processed in osal_start_system.  What I'm not 100% clear on is which mode is entered, and how that mode is subsequently exited.

It looks like a sleep timer is being set in halSleep, and this sleep timer will then bring the device out of low power mode at short, regular intervals.  This in turn suggests that the low power mode is PM2, since the sleep timer is disabled in PM3.  All of this would explain how my end device is still able to exchange radio packets with the coordinator.

Does that seems right so far?

For the next step, I'd like to be able to configure the amount of time that the device spends in and out of sleep mode (I can't find any compile options which can be used to tweak this). So, assuming my above analysis is correct, I need to know what value is being passed to the sleep timer, and how that value is being obtained.  Can anyone tell me how that works?

  • It appears that you've discovered the basics on POWER_SAVING by digging through code. Most of the questions you've asked should be answered in the "Power Managment For The CC2530" document that is supplied with your Z-Stack installation. As you'll see, the OSAL system determines the amount of time that the device will sleep (PM2), based on the next OSAL timer to expire. Code snippets in that document show you where sleep is invoked and where the sleep time value comes from.

  • Thank  you, can't believe I forgot about that document!