您好!
我使用的是无线 MCU CC1352P7、发现了一些射频功率控制问题: 有时(通常在上次最后完成的传输之后) RF_postCmd ()使用的射频功率设置不被接受,而是将射频功率设置为无线电初始化期间函数 RF_OPEN (structure RF_cmdPropRadioDivSetup)使用的水平。
什么时候会发生? 什么情况会导致此操作忽略由 RF_postCmd ()启动的新功率设置? 如何修复它?
谢谢。
亚历克斯
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.
您好!
我使用的是无线 MCU CC1352P7、发现了一些射频功率控制问题: 有时(通常在上次最后完成的传输之后) RF_postCmd ()使用的射频功率设置不被接受,而是将射频功率设置为无线电初始化期间函数 RF_OPEN (structure RF_cmdPropRadioDivSetup)使用的水平。
什么时候会发生? 什么情况会导致此操作忽略由 RF_postCmd ()启动的新功率设置? 如何修复它?
谢谢。
亚历克斯
你好、Siri、
我附加了基于参考软件设计的代码。 问题是射频功率由功能 radioSetPower(GetPwr()设置的射频功率有时不被接受:射频功率在初始化时由 radioInit()设置的原始12.5dBm。 也许应该插入一些延迟、或者应该检查某些条件?
谢谢。
亚历克斯
--------------- ti_radio_config.c rfc_CMD_PROP_RADIO_DIV_SETUP_PA_t RF_cmdPropRadioDivSetup = { .commandNo = 0x3807, .status = 0x0000, .pNextOp = 0, .startTime = 0x00000000, .startTrigger.triggerType = 0x0, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, .condition.rule = 0x1, .condition.nSkip = 0x0, .modulation.modType = 0x1, .modulation.deviation = 0x2F8, .modulation.deviationStepSz = 0x0, .symbolRate.preScale = 0xF, .symbolRate.rateWord = 0x50000, .symbolRate.decimMode = 0x0, .rxBw = 0x5D, .preamConf.nPreamBytes = 0x7, .preamConf.preamMode = 0x0, .formatConf.nSwBits = 0x18, .formatConf.bBitReversal = 0x0, .formatConf.bMsbFirst = 0x1, .formatConf.fecMode = 0x0, .formatConf.whitenMode = 0x0, .config.frontEndMode = 0x0, .config.biasMode = 0x1, .config.analogCfgMode = 0x0, .config.bNoFsPowerUp = 0x0, .config.bSynthNarrowBand = 0x0, .txPower = 0xB224, .pRegOverride = pOverrides, .centerFreq = 0x0393, .intFreq = 0x0600, .loDivider = 0x05, .pRegOverrideTxStd = 0, .pRegOverrideTx20 = 0 }; --------------- radio.c // // Function: void radioNop(void) // // Description: // sends a NOP command to the radio and waits till the end // void radioNop(void) { ASSERT_(rfHandle); RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdNop, RF_PriorityNormal, NULL, RF_EventLastCmdDone); ASSERT_(result & RF_EventLastCmdDone); } // // Function: void radioInit(void) // // Description: // radio initialisation // void radioInit(void) { rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams); ASSERT_(rfHandle); radioNop(); // runs the NOP command to finish power up } // // Function: void radioSetFreq(u32 freq) // // Description: // Loads the synthesizer with the new frequency. // void radioSetFreq(u32 freq) { u16 frequency = GetMHz(freq); u16 fractFreq = GetFract(freq); RF_cmdFs.frequency = frequency; RF_cmdFs.fractFreq = fractFreq; RF_cmdFs.synthConf.bTxMode = 0x1, RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0); } // // Function: void radioSetPower(u8 indx) // // Description: // sets power level determined by indx to the table txPowerTable_868_pa13[]. // void radioSetPower(u8 indx) { RF_TxPowerTable_Value value; value.rawValue = 0; value = txPowerTable_868_pa13[indx].value; immOpCmd.commandNo = CMD_SCH_IMM; immOpCmd.startTrigger.triggerType = TRIG_NOW; immOpCmd.startTrigger.pastTrig = 1; immOpCmd.startTime = 0; cmdSetPower.commandNo = CMD_SET_TX_POWER; cmdSetPower.txPower = (u16)value.rawValue; // point the Operational Command to the immediate set power command immOpCmd.cmdrVal = (uint32_t) &cmdSetPower; hSetPower = RF_postCmd(rfHandle, (RF_Op*)&immOpCmd, RF_PriorityNormal, NULL, 0); ASSERT_(RF_ALLOC_ERROR != hSetPower); } // // Function: void radioStartTransmission(void) // // Description: // Starts transmission. // void radioStartTransmission(void) { hTransmission = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, NULL, 0); ASSERT_(RF_ALLOC_ERROR != hTransmission); } // // Function: void radioEndTx(void) // // Description: // Waits till the end of Tx // void radioEndTx(void) { RF_EventMask result = RF_pendCmd(rfHandle, hTransmission, 0); ASSERT_(result & RF_EventLastCmdDone); } // // Function: void modeTx(void) // // Description: // Transmit mode. void modeTx(void) { currentFreq = hopNextFreq(); radioSetFreq(currentFreq); // hopping frequency is setup always properly radioSetPower(GetPwr()); // RF power is not accepted sometimes (power 12.5dBm 0xB224 is taken from the RF_cmdPropRadioDivSetup instead) radioStartTransmission(); pktTxData(); radioEndTx(); }
请提供完整的代码、以便我可以测试您实际在做什么。
为了演示该问题、请使用最新 SDK 中的 rfPacketTX 示例并对其进行修改、以更改按照您在应用中的方式发送的每个数据包之间的输出功率。
这样、我就可以尝试在这里重现问题。
还包括您的 sysconf 文件、因为我不知道您的设置命令来自哪里(为什么 .pRegOverrideTxStd 和.pRegOverrideTx20 设置为0)
此外、为什么你不使用 这里描述的 RF_setTxPower 函数: rflib:RFCC26X2.h 文件参考(TI.com)
改变输出功率呢?
请注意、RF_setTxPower 也会更新设置命令、而不仅仅是发送 CMD_SET_TX_POWER (或 CMD_SET_TX20_POWER )。
如果只立即发送命令以更新输出功率、则此新输出功率将只在下一次射频内核断电并再次打开之前有效。 如果是、则运行已兑现的安装命令版本、您将从 setup 命令而不是从 CMD_SET_TX_POWER/CMD_SET_TX20_POWER 命令获得输出功率)
Siri
我不精简无线电是空闲的。
如果您在不进行修改的情况下使用我们的功率驱动器、并且计划的 TX 是未来的某个时候、射频内核将自动关闭、以便有足够的时间关闭它。 例如:
void *mainThread(void *arg0) { RF_Params rfParams; RF_Params_init(&rfParams); GPIO_setConfig(CONFIG_GPIO_GLED, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW); GPIO_write(CONFIG_GPIO_GLED, CONFIG_GPIO_LED_OFF); RF_cmdPropTx.pktLen = PAYLOAD_LENGTH; RF_cmdPropTx.pPkt = packet; RF_cmdPropTx.startTrigger.triggerType = TRIG_ABSTIME; RF_cmdPropTx.startTime = RF_getCurrentTime(); /* Request access to the radio */ rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams); /* Set the frequency */ RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0); while(1) { packet[0] = (uint8_t)(seqNumber >> 8); packet[1] = (uint8_t)(seqNumber++); uint8_t i; for (i = 2; i < PAYLOAD_LENGTH; i++) { packet[i] = rand(); } RF_cmdPropTx.startTime += (uint32_t)(4000000*0.1f); RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0); } }
在上面的代码中、每100ms 发送一个数据包。
功率驱动器将确保射频内核断电并且器件将在数据包之间处于待机模式。
这意味着如果您在设置命令中将输出功率设置为+10 dBm、 然后、 运行 TX 命令后、立即发送一条命令以更改输出功率、在下一次迭代中、该功率仍为+dBm、因为射频内核将被关闭、并且在下一个 TX 之前会运行设置命令的缓存版本。
如果您使用我们的 API 来设置输出功率、您将同时更新 setup 命令、这样就不会出现问题。
Siri