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.

CC1101读取RSSI寄存器一直为定值

Other Parts Discussed in Thread: CC1101

尊敬的TI技术支持,你好

我用stm32读取CC1101的RSSI寄存器(0x34),结果发现不管距离远近都是定值-58,读取位置和转换都参考网上的资料,不知道哪里出了问题,希望得到解答。代码如下

这是主函数的部分程序,执行顺序为先设置为RX模式,再接收字节,再读取RSSI

CC1101_Set_Mode( RX_MODE );
i = CC1101_Rx_Packet( g_RF24L01RxBuffer ); //接收字节
rssi=CC1101_Read_RSSI_Reg();//读取rssi值
drv_delay_ms(10);

stren=CalculateRssi(rssi);

这是读取RSSI寄存器的值的程序

u8 CC1101_Read_RSSI_Reg(void)
{
u8 rssi;
CC1101_SET_CSN_LOW( );

drv_spi_read_write_byte( 0x34 | 0x80); //单独读命令 及地址

rssi = drv_spi_read_write_byte( 0xFF ); //读取寄存器
CC1101_SET_CSN_HIGH( );

return rssi;
}

计算RSSI的值是参考网上的,应该没有问题,就不贴上来了。

谢谢你们