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.

RSSI calculation

Other Parts Discussed in Thread: CC1120

Hi

I've a problem with CC1120 RSSI register. I can see from User Guide that I can read two register (RSSI1 and RSSI0)  for a 12 bits number, or using 8 bits from RSSI1, but result is different.

Maybe I've to change other registers/settings to change RSSI resolution?

Code I use is:

cc112xSpiReadReg(CC112X_RSSI1, &rssiMSB, 1);
rssi = (rssiMSB - 102); // 102 is an offset as I read in PER Test

cc112xSpiReadReg(CC112X_RSSI1, &rssiMSB, 1);
rssi = (rssiMSB - 102); // 102 is an offset as I read in PER Test
rssiConverted = (rssi - 256)/2;

but I get very high values (about 180 dBm). With SmartRF Studio, in "Continuous RX", I get reasonable values, about -50 dBm. 

If there are some examples or application already written I'll be very grateful.

  • Try the function we use in our software:

    /*******************************************************************************

    * @fn          perCC112xRead8BitRssi

    *   

     * @brief       Reads MSB RSSI value from register, converts the dBm value to

    *              decimal and adjusts it according to RSSI offset

    *

    * input parameters

    *

    * @param       none

    *

    * output parameters

    *

    * @return      decimal RSSI value corrected for RSSI offset

    */

    int8 perCC112xRead8BitRssi(void)

    {

      uint8 rssi2compl,rssiValid;

      int16 rssiConverted;

     

      cc112xSpiReadReg(CC112X_RSSI0, &rssiValid,1);

      if(rssiValid & 0x01)

      {

        /* Read RSSI from MSB register */

        cc112xSpiReadReg(CC112X_RSSI1, &rssi2compl,1);

        rssiConverted = (int16)((int8)rssi2compl) - cc112xRssiOffset;

        return rssiConverted;

      }

      /* keep last value since new value is not valid */

      return rxData->rssi;

    }

  • Function is very useful.

    There's only 1 problem: with a data rate of 100 kbps, with registers 

    {CC112X_DRATE2, 0xA9},
    {CC112X_DRATE1, 0x99},
    {CC112X_DRATE0, 0x9A},

    I get a RSSI of -69 dBm, and it's ok. If I change ONLY data rate settings to 32.7 kbps, with these values

    {CC112X_DRATE2, 0x90},
    {CC112X_DRATE1, 0xC6},
    {CC112X_DRATE0, 0xF8},

    RSSI is about -120 dBm, and I think is too little (it's also less than sensitivity). 

  • Maybe I found problems in settings AGC register. I can't understand these values, and if I change them, like threshold, RSSI and range of coverage change a lot.

  • In most cases you don't have to adjust the AGC registers. Find the case in Smart RF Studio that is closest to the datarate/ deviation you want to use and use these AGC settings.  

  • Thanks, now I've reasonable values.

    I set a RSSI offset of 102 dBm, as I read in PER test. Is this value right for every data rate or frequency? How can I set it?