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


http://blog.163.com/baly_bao/blog/static/12848655720101173140957/

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();
}

 

由于没有找到哪里调用了函数 macRadioSetTxPower(uint8 txPower),我也就没法修改它的形参。于是,我采用在函数中直接赋值的办法进行了修改,如上面红色部分所示。熟悉这一块的朋友们可以告诉我一下,先谢啦。

 

推荐阅读:

电子行业网址大全

Zigbee协议栈--OSAL的任务调度

Zigbee 协议栈(2530开发板)--修改波特率

Zigbee协议栈(2530开发板):串口采用中断方式




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值