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.

CC2538读取RSSI寄存器值

Other Parts Discussed in Thread: CC2538

cc2538我用读取RSSI寄存器的值是不是读取的结果就是RSSI的值呢?为什么每次我读取的值都差不多,距离远近都差不多。我读取的时候是先判断RSSI_VALID是否为1。RSSI_VALID第一次为1后会不会自动清零呢?我设置FRMCTRL0寄存器的值把AutoCrc和AutoAck以及ENERGY_SCAN都设置为0。会不会有影响呢?

  • 1.建议用TI的per_test源码测试下,在per_test中的while(!basicRfPacketIsReady());  语句后面添加以下代码,可以实现RSSI读取。

    while(!basicRfPacketIsReady());  

    flagreg=RSSISTAT;
    if(flagreg==0x01)
    {

    temp_rssireg=RSSI;

    if(temp_rssireg<128) temp_rssireg=temp_rssireg-halRfGetRssiOffset();
    else temp_rssireg=(temp_rssireg-256)-halRfGetRssiOffset();

    temp_rssireg=0-temp_rssireg;

     }

  • 2.AutoCrc和AutoAck这两个参数一般不影响RSSI,但是ENERGY_SCAN会有影响:

    There are two ways the radio can update the RSSI register after it has first become valid. If FRMCTRL0.ENERGY_SCAN = 0 (default), the RSSI register contains the latest value available, but if this bit is set to 1, a peak search is performed, and the RSSI register contains the largest value since the energy
    scan was enabled.你设置为0的操作是正确的。