Zigbee-CC2530开发板协议栈-修改发射功率

 

CC2530 控制输出功率的寄存器是 TXPOWER:
Zigbee协议栈(CC2530开发板) 修改发射功率 - 江淮一士 - baly_bao 的博客

推荐功率设置:

Zigbee协议栈(CC2530开发板) 修改发射功率 - 江淮一士 - baly_bao 的博客

协议栈默认的设置是 0xd5,为了扩展信号传输的距离,我把TXPOWER寄存器值改为0xf5, 此时输出功率为4.5dBm.在mac_radio.c文件,做了如下修改:

void macRadioSetTxPower(uint8 txPower)
{
halIntState_t s;

/* if the selected dBm is out of range, use the closest available */
if (txPower > MAC_RADIO_TX_POWER_MAX_DBM)
{
txPower = MAC_RADIO_TX_POWER_MAX_DBM;
}

/*
* Set the global variable reqTxPower. This variable is referenced
* by the function macRadioUpdateTxPower() to write the radio register.
*
* A lookup table is used to translate the power level to the register
* value.
*/
HAL_ENTER_CRITICAL_SECTION(s);
reqTxPower = macRadioDefsTxPowerTable[txPower];
HAL_EXIT_CRITICAL_SECTION(s);

/* update the radio power setting */
//************** 自己修改 ******* 
reqTxPower = 0xF5;
//******************************* 
macRadioUpdateTxPower();
}

发布了35 篇原创文章 · 获赞 17 · 访问量 15万+

猜你喜欢

转载自blog.csdn.net/shaopengf/article/details/46790151