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 时出现问题

Guru**** 2769425 points

Other Parts Discussed in Thread: CC1101

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1600068/cc1101-issue-in-reading-rssi-using-register-address

部件号: CC1101

 我正在使用 CC1101 连续接收模式进行接收测试,在正常的包中,我得到适当的 RSSI 在包的最后一个字节,但当我使用信号发生器(用于传输)所以我得到连续接收 RSSI 进行测试,我想从寄存器读取 RSSI , 但每次不改变 RSSI 时得到相同的值,意味着寄存器是提供相同的值,而不是根据接收功率改变 RSSI ,而之前 (1) 我把 CC1101 置于接收模式,这是接收由其他 CC1101 传输的数据,所以接收模式工作正常. 我已经使用寄存器证明了 readrssi 功能  

int8_t CC_ReadRSSI_dBm(void)
{
    unsigned char raw;
    int8_t rssi_dbm;
	spi_delay();
			CS_LOW();
			//spi_delay();
			byte_write(0x34 | 0x80);     // to read	
			//spi_delay();
			raw = byte_read();	
		//	spi_delay();
			CS_HIGH();

    // Convert to signed dBm
    if (raw >= 128)
        rssi_dbm = ((int16_t)raw - 256) / 2 - 74;
    else
        rssi_dbm = (raw / 2) - 74;

    return rssi_dbm;
}
in main() function
  while (1)
    {
  		
				
   uint8_t marc = CC_ReadReg(0xF5) & 0x1F;
   rssi_dbm = CC_ReadRSSI_dBm();
   sprintf(msg, "MARC=0x%02X   RSSI=%d dBm\r\n", marc, rssi_dbm);
    HAL_UART_Transmit(&huart1, (uint8_t*)msg, strlen(msg), 100);
   HAL_Delay(1000);
	
    //  Auto recover if RX FIFO overflow occurs
    if (marc == 0x11 ||marc == 0x01 )   // RXFIFO_OVERFLOW
    {
        sidle();
        chip_sfrx();
        set_receive();
        HAL_Delay(100);
    }
	}