1_CC2530 Zstack 2.5.1a low power consumption mode, and 1_cc2530zstack

Source: Internet
Author: User

1_CC2530 Zstack 2.5.1a low power consumption mode, and 1_cc2530zstack

Recently studying the low Power Consumption mode of CC250, from the official document Measuring Power Consumption of CC2530 With Z-Stack.PDF documents to understand the content of the need to configure, combined With their own testing experience, rough introduction. The Zstack version is as follows:

ZigBee 2007 Release
Version 2.5.1a
A6l 25,201 2


The CC530 power consumption mode is as follows:

(1) LITE Sleep, we call the PM2 mode, with the power consumption at the ma level, will be awakened by the task timer or external interruption (Button interruption)

(2) Deep Sleep, PM3 mode, with the lowest power consumption. At the uA level, it enters when no task needs to be executed. It can only be awakened by external interruptions or Reset.


Pay attention to five points when entering the low-power mode:

1. The environment we use is IAR. First, we need to add POWER_SAVING to the compilation options to enable the low-power mode. Other unused functions can be removed, such as serial port and LCD. My configuration is as follows. The preceding x indicates that this 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


After the configuration is complete, it can be called in the osal_run_system () function to enter the low power consumption mode:

# If defined (POWER_SAVING)
Else // Complete pass through all task events with no activity?
{
// Enter the low power consumption mode
Osal_pwrmgr_powerconserve (); // Put the processor/system into sleep
}
# Endif


2, f8wConfig. cfg file-DRFD_RCVC_ALWAYS_ON = FALSE-DPOLL_RATE = 0 // default 1000-DQUEUED_POLL_RATE = 0 // default 100-drew.se_poll_rate = 0 // the introduction of several parameters below the default 100 is excerpted from the Internet, the End Point Device of the Z-stack project is disabled for power management by default. The function of automatically polling messages is enabled. There are four polling options, each of which is controlled by a different time delay parameter. When the power management function is enabled (POWER_SAVING is added), the setting of any polling option will affect the sleep mode. The time delay setting cannot be used in Deep Sleep polling, which limits power consumption. The three round robin options are as follows:
(1) Data Request Polling-periodically sends Data requests to the parent node to poll the message queue. The polling interval is set by NLME_SetPollRate () or gNWK_POLL_RATE. If it is not enabled in advance, the polling will be performed immediately during the call.
(2) Queued Data Polling-after receiving the Data instruction, a message is requested from the parent node. This interval can be set by NLME_SetQueuedPollRate () or gQUEUED_POLL_RATE.
(3) Response Data Polling-after receiving the Data Confirmation instruction, the Response message will be requested from the parent node. The interval can be set by NLME_SetResponsePollRate () or gRESPONSE_POLL_RATE.
Function Description:
NLME_SetPollRate () -- sets/changes the network detection rate, which is available only for terminal devices.
NLME_SetQueuedPollRate () -- sets/changes the queue detection rate, which is only available on terminal devices.
NLME_SetPollRate () -- sets/changes the response detection rate, which is available only on the terminal device.
If you only use the default polling frequency to enter the sleep state, you can only enter LITE sleep. In order to enter DEEP sleep, you must set gNWK_POLL_RATE to 0, so that it will not be repeatedly polling. You can set these three options to implement multiple polling methods. For example, if a device does not need to receive messages, set these three options to 0 after it is added to the network. If the APS layer uses ACK, you must ensure that polling is enabled after the message is sent to the receipt of ACK. In some systems, you may need to use a variable polling frequency and set it based on the specific application. In fact, in f8wConfig. the last round robin in the cfg file is-DREJOIN_POLL_RATE = 440. Literally, when the join fails, it will find the Coordinator again after milliseconds, network access operations are expected. Yesterday, I ignored this parameter. Yesterday, I just performed an experiment on End Device power-on, but I didn't perform the experiment on the Coordinator. As a result, the terminal was always in rejoin. So what I saw yesterday was going into PM2, and then immediately come out, and then enter again, and then repeat again. Therefore, we can also set this value to 0, which means that when there is no coordinator in the trial, we only need to use a terminal to perform experiments. If we can access the network, we will not wake up the after milliseconds. -DREJOIN_POLL_RATE = 0 // default 440

3. configure a polling program or a program that will interrupt the timer. Obviously, the APS layer tasks that we define to periodically send data belong to this scope, generally, the osal_start_timerEx function is called to start the next time-out period. As a result, the system can only enter PM2, and the system will wake up from pm2. This program mainly includes the following two parts: (1) void 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); // round robin Method
HalKeyConfig (HAL_KEY_INTERRUPT_ENABLE, OnBoard_KeyCallback); // interrupt method
}
}
Press the key program. The default method is polling. The above method has been changed to interrupt.
(2) In a SampleApp task, if periodic data transmission exists, there may be a program similar to the following structure. We must resolutely block it, osal_start_timerEx (SampleApp_TaskID,
SAMPLEAPP_SEND_PERIODIC_MSG_EVT,
SAMPLEAPP_SEND_PERIODIC_MSG_TIMEOUT );

4. Note that void osal_pwrmgr_init (void) is the property of power management)
{
// Pwrmgr_attribute.pwrmgr_device = PWRMGR_ALWAYS_ON; // Default to no power conservation.
Pwrmgr_attribute.pwrmgr_device = PWRMGR_BATTERY; // battery
Pwrmgr_attribute.pwrmgr_task_state = 0; // Cleared. All set to conserve. All tasks support power saving
}
By default, the power supply is always on. We need to switch to the battery power supply mode. At the same time, pwrmgr_task_state = 0 indicates that all tasks support power saving.
5. If you want to reduce power consumption, You need to disable unused peripherals and pull the General IO internally.
To achieve the above five points, the Zstack can achieve a real low-power consumption mode. Currently, only the 0.1ma multimeter is used for testing, and only the minimum ma can be tested. Later, devices with higher precision will be used to test power consumption.






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.