主题中讨论的其他器件:CC2400、 CC2500、 CC2640
尊敬的 TI:
我们正在设计一款采用 CC2640R2F 的专有模式的新产品、我们需要从 CC2400接收数据包。但这 两个芯片之间的 CRC 似乎不同。是否有任何方法可以使这两个 CRC 兼容? 或者可以为我们提供 计算 CC2400 CRC 的代码?
此致、
LN
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.
尊敬的 TI:
我们正在设计一款采用 CC2640R2F 的专有模式的新产品、我们需要从 CC2400接收数据包。但这 两个芯片之间的 CRC 似乎不同。是否有任何方法可以使这两个 CRC 兼容? 或者可以为我们提供 计算 CC2400 CRC 的代码?
此致、
LN
您好!
下面介绍了如何更改 CRC 设置:
您还可以尝试使用 Smart RF Studio 对无线电设置进行实验、以分析数据包结构。
此致、
尊敬的 Arthur:
以下是两组不同的数据:
75 f2 5F 72 40 02 5e af 99 F7 af 88 42 |-25 CRC 错误//固定长度13字节
75 f2 5F 72 40 02 5e af 99 F7 af 88 42 AD b0 |-19 CRC 错误///固定长度 15字节
75 f2 5F 79 40 07 5e 38 1a aa 2f 86 4b |-25 CRC 错误///固定长度 13字节
75 f2 5F 72 40 07 5e 38 1a ac 2f 86 4b AD 3c |-24 CRC 错误///固定长度 15字节
您好、Nan、
CC2400使用什么数据编码(GRMDM.DATA_FORMAT[1:0])? 您可能需要考虑在 两者上尝试曼彻斯特(尽管不建议对 CC2640R2F 使用传统解决方案)。 TA12012讨论了用于此 相关 E2E 主题中8/10编码的 SimpleLink 软件解决方案。
此致、
Ryan
您好、Ryan、
我在两者都尝试曼彻斯特、但仍然不起作用。
我认为唯一的问题是不同的 CRC 规则。CC2640R2可以正确接收来自 CC2400的数据、但 CRC 排除了错误。
TI 的代码是否显示 CC2400 (或 CC2500 PKTCTRL0.CC2400_EN = 1) CRC 算法?
我在这两个芯片之间发布了不同的内容:

此致、
LN
Nan、您好!
以下是模仿 CC2400中使用的算法的 C++代码:
#include <bitset>
#include <vector>
#include <iostream>
std::vector<uint16_t> packet1 = {0x08,0x00,0x00,0x48,0x65,0x6c,0x6c,0x6f};
std::vector<uint16_t> packet2 = {0x12,0x34,0x56,0x78,0x9A,0xBC,0xDE,0xF0,0xF1,0xE2,0xD3,0xC4,0xB5,0xA6,0x07};
uint16_t new_crc_value(uint16_t poly, uint16_t crc_register, uint16_t byte_in)
{
std::bitset<16> temp1;
std::bitset<16> temp2;
std::bitset<16> byte_in_bs;
std::bitset<16> poly_bs;
byte_in_bs = byte_in;
poly_bs = poly;
temp1 = crc_register;
for (int j = 0; j <= 7; j++)
{
temp2[0] = temp1[15] ^ byte_in_bs[7 - j];
for (int i = 1; i <= 15; i++)
{
if (poly_bs[i] == true)
{
temp2[i] = temp1[15] ^ temp1[i - 1];
}
else
{
temp2[i] = temp1[i - 1];
}
}
temp1 = temp2;
}
return (uint16_t)temp1.to_ullong();
}
uint16_t crc_cc2400(std::vector<uint16_t> data)
{
std::bitset<16> CRC_POL_16{0x8005};
std::bitset<16> CRC_New{0x0000};
std::bitset<16> CRC_Data_int{0x0000};
for (uint16_t data_byte: data)
{
CRC_New = new_crc_value(CRC_POL_16.to_ullong(), CRC_Data_int.to_ullong(), data_byte);
CRC_Data_int = CRC_New;
}
return CRC_Data_int.to_ullong();
}
int main()
{
std::cout << std::hex << crc_cc2400(packet1) << std::endl;
std::cout << std::hex << crc_cc2400(packet2) << std::endl;
return 0;
}
请告诉我们这是否对您有用。 但是、正如您可能已经知道的、您必须禁用 CC2640侧的 CRC 校验、并自行计算 CRC。
此致、
Arthur