1_cc2530 Zstack 2.5.1a Low power mode

Source: Internet
Author: User

recently in the study of CC250 's low-power mode, from official documents The measuring Power consumption of CC2530 with z-stack.pdf documentation about what needs to be configured, combined with the experience of your own testing, is probably described below. The following versions of Zstack are used:

ZigBee Release
Version 2.5.1a
April 25, 2012


The power modes of the CC530 are as follows:

(1) LITE Sleep, we call the PM2 mode, power consumption at the MA level, will be awakened by the task timer or external interrupt (key interrupt)

(2) Deep SLEEP,PM3 mode, the lowest power consumption, at the UA level, when no task needs to be executed, will enter; can only be awakened by external interrupts or reset.


There are five points to note when entering a low-power mode:

1, we use the environment is IAR, first need to add power_saving in the compilation option, enable low power mode, other unused can be removed, such as serial, LCD and other functions. My configuration is as follows, the front with an x indicates that the function is blocked;

Nwk_auto_poll
Xztool_p1
Xmt_task
Xmt_sys_func
Xmt_zdo_func
Xlcd_supported=debug
Power_saving
Xnv_restore
Xnv_init
Xhold_auto_start


Once configured, the Osal_run_system () function can then be called into a low-power mode:

#if defined (power_saving)
else/complete pass through all tasks events with no activity?
{
Enter low-power mode
Osal_pwrmgr_powerconserve (); Put the Processor/system into sleep
}
#endif


2,f8wconfig.cfg File-drfd_rcvc_always_on=false-dpoll_rate=0//default-dqueued_poll_rate=0//default-dresponse_poll_rate=0 //default     under the introduction of several parameters are extracted from the Internet, Z-stack project end point Device is turned off by default for power management, and automatic polling for messages is enabled. There are four polling options, each controlled by a different time delay parameter. When the power management feature is turned on (add power_saving), the settings of either polling option will affect sleep mode. The setting of the time delay cannot be used for polling in deep sleep, so it limits the power loss. The three polling options are as follows:
(1) The data request polling-periodically sends requests to the parent node to poll the message queue. The polling interval is set by Nlme_setpollrate () or gnwk_poll_rate, and if it is not enabled in advance, it is immediately polled at the time of invocation.
(2) Queued data polling-requests a message to the parent node after it receives a signal. This time interval can be set by Nlme_setqueuedpollrate () or gqueued_poll_rate.
(3) Response data polling-requests a response message to the parent node, which can be set by Nlme_setresponsepollrate () or gresponse_poll_rate after it receives an indication of the acknowledgement.
Function Description:
Nlme_setpollrate ()--set/change the network detection rate, only the terminal equipment is available.
Nlme_setqueuedpollrate ()--set/change the queue detection rate, only the terminal equipment is available.
Nlme_setpollrate ()--set/change the response detection rate, only the terminal device is available.
If you just go to sleep using the default polling frequency, you can only enter Lite sleep. In order to enter deep sleep you must set Gnwk_poll_rate to 0 so that it does not poll repeatedly. Setting this three option enables a variety of polling methods, for example, for a device that does not need to receive messages, after it joins the network, the three options are set to 0. If the APS layer uses an ACK, it is necessary to ensure that polling is enabled after the message is sent to the time the ACK is received. In some systems, it may be necessary to use a variable polling frequency, which can be set depending on the application. in fact, at the end of the f8wconfig.cfg file There is a poll,-drejoin_poll_rate=440, literally, should be when the join is unsuccessful, will be after 440ms, re-look for the Coordinator And look forward to the operation of the network. Yesterday I just ignored this parameter, just yesterday also only to end device on electricity to do experiments, did not give the coordinator power, resulting in the terminal has been rejoin, so yesterday saw the phenomenon is into the PM2, and then immediately out, and then enter, repeatedly. So we can also set this to 0, this is the trial in no coordinator, just use the terminal to do the experiment, usually if you can access the network, will not wake CC2530 after 440ms. -drejoin_poll_rate=0//default

3, configure a program that has polling , or that generates a timer interrupt obviously, similar to our definition of periodic send data of the APS layer task, all belong to this scope, generally call the Osal_start_timerex function to start the next time to timeout, this will cause the system can only enter PM2, After the timeout, it wakes from PM2. Such procedures mainly include the following two parts:(1) Key polling procedurevoid Initboard (Uint8 level)
{
if (level = = Ob_cold)
{
IAR does not zero-out this byte below the Xstack.
* (uint8 *) 0x0 = 0;
Interrupts off
Osal_int_disable (Ints_all);
Check for Brown-out Reset
Chkreset ();
}
else//! Ob_cold
{
/* Initialize Key Stuff */
Halkeyconfig (hal_key_interrupt_disable, onboard_keycallback);//Polling method
Halkeyconfig (hal_key_interrupt_enable, onboard_keycallback);//Interrupt Mode
}
}
key program, the default way is polling mode, the above has been changed to break mode.
(2)SampleApp task, if there is a period of time to send data, there may be similar to the following structure of the program, we must resolutely shield off, Osal_start_timerex (Sampleapp_taskid,
SAMPLEAPP_SEND_PERIODIC_MSG_EVT,
Sampleapp_send_periodic_msg_timeout);

4, the last place to note is the properties of power managementvoid Osal_pwrmgr_init (void)
{
Pwrmgr_attribute.pwrmgr_device = pwrmgr_always_on; Default to no power conservation.
Pwrmgr_attribute.pwrmgr_device = pwrmgr_battery;//Battery powered
pwrmgr_attribute.pwrmgr_task_state = 0;  Cleared. All set to conserve. All missions support power-saving
}
By default, power is always on and we need to switch to battery-powered mode. At the same time Pwrmgr_task_state = 0 indicates that all tasks support power saving.
5, if you want to be more power-saving, need to be unused peripherals shut down, normal IO internal pull-up.
To do the above five points, CC2530 Zstack can achieve a true low-power mode, currently only with 0.1ma multimeter test, only test to the lowest 0.1ma, after the use of higher precision equipment testing power consumption.






1_cc2530 Zstack 2.5.1a Low power mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.