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.

CC1120 wrong RSSI value returned

Other Parts Discussed in Thread: CC1121, CC1120

Hi all,

I use CC112X and I have a strange behavior on some devices.

When I read several time RSSI0 and RSSI1 (via SPI) I get  this :

CC112X_RSSI1    (0x2F71) =    0x7F
CC112X_RSSI0    (0x2F72) =    0x47

That means CS and RSSI are valid but value is wrong : 127dBm...

Basically what I do :

  1. Strobe Rx mode
  2. wait until mode = RX and RSSI_VALID flag is set
  3. get RSSI1 and RSSI0 registers
  4. print RSSI

Thanks to help me.

Marco

  • Hi,

    You need to subtract the RSSI Offset (102 for CC1121) from the value obtaining from the RSSI Register to get the actual RSSI value.

    Please refer to section 6.9 of CC1120 User Guide (SWRU295) for further details. The following is the link to the user guide.

    http://www.ti.com/lit/ug/swru295e/swru295e.pdf

    Thanks,

    PM

  • thanks for your reply.

    This value has been already substracted and calibrated from a RF generator in conductive emission.

    RSSI reading works fine most of time but sometimes fail.

    To figure this out, the RSSI reading function return a filtered value now but I don't know why that happens. I've read and take into account all recommandations provided in 6428.RSSI.pdf


    Marco

  • Have you set AGC_GAIN_ADJUST.GAIN_ADJUSTMENT to something different from 0x00? Does the RSSI read fail for all signal levels at the input? If GAIN_ADJUSTMENT is set equal to the RSSI offset wrap around could happen if the input signal is low.
  • (sorry for the delay)

    ok for that. RSSI seems not to fail for all signal levels (I could try with RF generator).

    I set GAIN_ADJUSTMENT to -119 (= 0x89 signed char) and AGC_CS_THR to -100 dBm.

    In fact , I implement my own carrier sense to achieve LBT function and sometimes (in the same way than before) Tx remains stuck.

    My own LBT function has been tested as below :

    • get RSSI through SPI and compare it to my own threshold. According to that Tx is allowed or delayed
    • get CS flag through SPI. According to that Tx is allowed or delayed
    • use GPIO1 to flag CARRIER_SENSE (GPIO1_CFG = 17) and MCU port is read. According to that Tx is allowed or delayed

    For all of these solution I get a failure.

    You said "If GAIN_ADJUSTMENT is set equal to the RSSI offset wrap around could happen if the input signal is low." >> Can you explain me please in more details.

    Thanks again,

    Marco

  • Hi Marco,

    AFAIU, the wrap around is happening something like this.

    Because the RSSI1 register stores a 2's complement value, it has a range of -128d(b 1000 0000) to +127d(b 0111 1111). For a value less than -128d; for example -129d, the 2's complement value is (0b 1111 1111 0111 1111). If this value is stored in the 8-bit RSSI1 register, it only takes the least significant byte(0b 0111 1111 = +127d). Thus, the 8-bit 2's complement value in RSSI1 register wraps around for numbers less than -128d. 

    When the GAIN_ADJUSTMENT is set to the RSSI offset value, noise less than -128 dBm will be interpreted as some higher value like ~ +127 dBm in the RSSI1 register. This rssi value is greater than the CS_THR of -100 dBm and the CS_THR fails. Thus, it is better to have the following register settings.

    {AGC_GAIN_ADJUST,    0x00},

    {AGC_CS_THR,               0x13},  // CS_THR of (-100 - (-119) = 19) for rssi offset of -119 and carrier sense threshold of -110 dBm.

    Then, subtract the rssi offset from the RSSI1 register value in the software. This way the carrier sense will work as expected and the wrap around will not happen.

    Best regards,

    Vihang

  • ok thanks.

    UserGuide and app notes say that  the RSSI  is a  12 bits  two's complement number with 0.0625  dB

    resolution hence ranging from  –128 to 127 dBm.


    Then RSSI[11:0] can return value below -128 ? Even with RSSI_VALID flag set ?

    In source code TrxEB RF PER Test Software (swrc219) , RSSI reading function is :

    /*******************************************************************************
     * @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;
    }

  • Marco,

    Yes, that is correct. The RSSI[11:0] has a resolution of 0.0625 dB. Thus, the 8 MSB of the RSSI[11:0] that are stored in the CC112X_RSSI1[7:0] register represent the decimal value of the rssi and the 4 LSB of the RSSI[11:0] that are stored in the CC112X_RSSI0[6:3] represent the fraction value of the rssi. This is where the 0.0625 dB resolution comes from,. But as far as the code snippet is concerned, it only reads the decimal value of the rssi(from CC112X_RSSI1) and then subtracts the rssi offset from it.

    Then RSSI[11:0] can return value below -128 ? Even with RSSI_VALID flag set ? No, the size of the register does not allow to store a value less than -128.0 (<- The fraction here has its significance) in the first place.

  • Hi,

    I have changed the GAIN_ADJUSMENT and CS_THR registers because I don't want to have overflow problem.
    Should I change also the AGC_REF?

    AGC_REF = 10 log (RX FILTER BW) -92 - RSSI_OFSSET

    What is a value used in this formula?
    It is measured RSSI_OFFSET value, or the value used in the GAIN_ADJ register.

    Thank you in advance for explanation

  • To my knowledge AGC_REF is not affected by GAIN_ADJUSTMENT.