主题中讨论的其他部件:CC1101,
您好,
如何 使用TI驱动程序库获取频率偏移? 不是TI驱动程序
是否有示例代码可用?
谢谢
Mohanraj
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.
Mohanraj,您好 !
您可以查看从CC1101迁移指南中的“14.1 频率偏移补偿”一节。 见 https://dev.ti.com/tirex/explore/content/simplelink_cc13x0_sdk_4_20_01_03/docs/proprietary-rf/proprietary-rf-users-guide/proprietary-rf/cc1101-migration.html?highlight=frequency%20offset#frequency-offset-compensation
我们建议您使用RF驱动程序。 要读取频率偏移,您可以使用以下代码(从迁移指南中复制)
//frequency_dev is the deviation given in Hz.
static int16_t offset = 0;
rfc_CMD_READ_RFREG_t RF_cmdReadRfregFreqOffset =
{
.commandNo = 0x0601,
.address = 0x5154,
.value = 0,
};
// Place in the RX part of the code
RF_runImmediateCmd(rfHandle, (uint32_t*)&RF_cmdReadRfregFreqOffset);
offset = (RF_cmdReadRfregFreqOffset.value) * frequency_dev/ 64;
为什么不想使用RF驱动程序? 如果需要,您可以查看RF驱动程序源代码,以确定驱动程序如何读取频率偏移。
此致,
Nikolaj
您好,
谢谢你们反应快,希望用
感谢您的理解
谢谢
Mohanraj
您好,
我不确定是否可以正常工作,但您是否尝试过直接 读取内存地址 0x4004.5154万来读取DEMMAFC0寄存器?
您可以使用 https://dev.ti.com/tirex/explore/content/simplelink_cc13x0_sdk_4_20_01_03/docs/proprietary-rf/proprietary-rf-users-guide/proprietary-rf/cc1101-migration.html?highlight=frequency%20offset#frequency-offset-compensation的14.1 部分中提到的公式 来确定频率偏移。
此致,
Nikolaj
如果您希望实现与我们在驱动程序中相同的功能,您通常会获得接近相同大小的功能。
查看RF驱动程序的内存消耗后,您是否使用 了单客户端或 多客户端(请参阅 https://dev.ti.com/tirex/explore/node?node=AOng5xFsavzvQ16.KytQHg__eCfARaV__LATEST)?单客户端的内存占用空间较小。
Mohanraj,您好!
您是否也在使用RF驱动程序接收数据包,或者仅使用它读取频率偏移。
由于仅使用8个最低有效位,因此不应期望DEMMAFC0的值为0x0007FF。
我已尝试重现您的问题,但我无法再现。 我正在使用 来自simplelink_cc13x0_SDK_4_20_01_03 SDK的rfPacketRx_CC1310_LAUNCHXL_tiltos_CCS示例。
我修改 了rfPacketrx.c中的回调函数,因此它现在如下所示(我已将第6行添加到第14行)。
void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
if (e & RF_EventRxEntryDone)
{
rfc_CMD_READ_RFREG_t RF_cmdReadRfregFreqOffset =
{
.commandNo = 0x0601,
.address = 0x5154,
.value = 0,
};
// Place in the RX part of the code
RF_Stat status = RF_runImmediateCmd(h, (uint32_t*)&RF_cmdReadRfregFreqOffset);
/* Toggle pin to indicate RX */
PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,
!PIN_getOutputValue(Board_PIN_LED2));
/* Get current unhandled data entry */
currentDataEntry = RFQueue_getDataEntry();
/* Handle the packet data, located at ¤tDataEntry->data:
* - Length is the first byte with the current configuration
* - Data starts from the second byte */
packetLength = *(uint8_t*)(¤tDataEntry->data);
packetDataPointer = (uint8_t*)(¤tDataEntry->data + 1);
/* Copy the payload + the status byte to the packet variable */
memcpy(packet, packetDataPointer, (packetLength + 1));
RFQueue_nextEntry();
}
}
我正在使用SmartRF Studio (与单独的板一起)传输数据包。 当我在SmartRF Studio中更改传输数据包的频率时,RF_cmdReadRfregFreqOffset.value的值会相应地更改(RF_cmdReadRfregFreqOffset.value的值 已使用CCS中的调试器确定)。
您的项目是否基于SDK中的示例? 如果没有,您是否能够根据SDK中的示例重现问题?
谢谢!
Nikolaj