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.

CC2510 RSSI Calculation

Other Parts Discussed in Thread: CC2510, TEST2

Hello Support,

We notice a flatter slope for the RSSI dynamic range that is listed in the CC2510 data sheet. Using a scale of -20dBm to -100dBm, we are recording -25dBm to -95dBm. Will you please verify following code snippet of reading and calculating RSSI?

  uint8 i = 0;
  uint8 rssiVal = 0;
  uint8 rssiWindow = 255;
  int16 RssiOffset = 74;
  int16 RssiSum = 0;               
  int16 rssiDec = 0;

 
  // Switch radio to RX
  RFST = RFST_SRX;  
  while (MARCSTATE != MARC_STATE_RX) ;

 
  // Get the average RSSI value
  for (i=0; i < rssiWindow; i++) {
    // Convert RSSI value from 2's complement to decimal value.
    rssiDec = (int16) RSSI;

    // Convert to absolute value (RSSI value from radio has resolution of
    // 0.5 dBm) and subtract the radio's appropriate RSSI offset.
    if(rssiDec < 128){
        RssiBuf[i] = (rssiDec/2) - RssiOffset;
    }
    else{
        RssiBuf[i] = ((rssiDec - 256)/2) - RssiOffset;
    }
  
    // Add the new RSSI value to sum.
    RssiSum += RssiBuf[i];
   
    // Wait a bit before the next sample
    for (uint8 x=0; x<0xFF; x++) {
      asm("NOP");
    }
  }
 
  RssiSum /= rssiWindow; 
 
  // Convert the (-)RSSI value to a positive string value
  rssiVal = (uint8)abs(RssiSum);

  return (rssiVal);

Thanks for your help,

Chris

  • Chris,

    The difficulty may be that you're not waiting long enough for the RSSI to settle after going into RX mode.  Please see DN505 (http://focus.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=swra114) and the RSSI example code (rnd_rssi.c) in the CC2510 code examples (http://www.ti.com/litv/zip/swrc117), which has this snippet:

     

    /* Radio is now in IDLE.
           Strobe command SRX takes radio to RX. */
        RFST = RFST_SRX;

        /* Wait until RX is entered. */
        while ((MARCSTATE & MARCSTATE_MARC_STATE) != MARC_STATE_RX);

        /* Wait a little longer than expected RSSI response time
         * (see design note DN505). Note that the below loop is inaccurate,
         * so the user must implement a proper delay according to DN505.
         */
        for(rssiValidCnt = 0; rssiValidCnt < RSSI_VALID_TIME; rssiValidCnt++);

    Regards, GrantC

  • Hi Grant,

    Thanks for the help. This definately solves the slope problem. However, now we are reading an RSSI value a few dB higher than expected. We are using a signal generator to insert  signals from -20dBm to -103dBm (compensating 1dB of cable loss verified with spectrum analyzer). The RSSI readback values closely follow this slope at -24dBm to -105dBm. We are using a datarate of 9600 baud and an rssi_offset value of 72, which was the recommended value from TI support for all data rates (9.6k to 230.4k). Does the rssi_offset need to be changed? Is there a formula for finding this value?

    Thanks again,

    Chris

  • Hello Support,

    Any ideas for the RSSI offset issued mentioned above?

    Thanks,

    Chris

  • Chris,

    Table 68 of the CC2510 data sheet recommends an RSSI offset of 74 dB at 10 kbaud.  I guess that's 2 dB -- are you off more than that?

    -GrantC

  • Hi Grant, thanks for the response.

    With an offset of 72, we are -4dBm across the band (i.e. expect -20dBm, get -24dBm). Changing the offset to74 would make it -6dBm lower across the band.

    ~Chris

  • Chris,

    I guess the next step is to separate hardware and software.  Have you tried the RSSI measurement using SmartRF Studio for comparison?

  • Hi Grant,

    Here's the results of plugging our register settings into SmartRF Sudio and using the TI evaluation board with RSSI offset set to 74.

    Sig.Gen.          RSSI

    -20dBm           -28dBm
    -30dBm           -37dBm
    -40dBm           -48dBm
    -50dBm           -58dBm
    -60dBm           -68dBm
    -70dBm           -78dBm
    -80dBm           -86dBm
    -90dBm           -96dBm
    -100dBm        -105dBm

    The radio settings are:

      FSCTRL1   =     0x08;       // Frequency Synthesizer Control
      FSCTRL0   =     0x00;       // Frequency Synthesizer Control
      FREQ2     =     0x5C;       // Frequency Control Word, High Byte
      FREQ1     =     0x5C;       // Frequency Control Word, Middle Byte
      FREQ0     =     0xEC;       // Frequency Control Word, Low Byte
      MDMCFG4   =     0x78;       // Modem configuration
      MDMCFG3   =     0x83;       // Modem Configuration
      MDMCFG2   =     0x13;       // Modem Configuration
      MDMCFG1   =     0x23;       // Modem Configuration
      MDMCFG0   =     0x8A;       // Modem Configuration
      CHANNR    =     0x4A;       // Channel Number
      DEVIATN   =     0x44;       // Modem Deviation Setting
      FREND1    =     0x56;       // Front End RX Configuration
      FREND0    =     0x10;       // Front End TX Configuration
      MCSM0     =     0x14;       // Main Radio Control State Machine Configuration
      FOCCFG    =     0x16;       // Frequency Offset Compensation Configuration
      BSCFG     =     0x6C;       // Bit Synchronization Configuration
      AGCCTRL2  =     0x43;       // AGC Control 
      AGCCTRL1  =     0x40;       // AGC Control 
      AGCCTRL0  =     0x91;       // AGC Control 
      FSCAL3    =     0xA9;       // Frequency Synthesizer Calibration
      FSCAL2    =     0x0A;       // Frequency Synthesizer Calibration
      FSCAL1    =     0x00;       // Frequency Synthesizer Calibration
      FSCAL0    =     0x11;       // Frequency Synthesizer Calibration
      TEST2     =     0x88;       // Various Test Settings
      TEST1     =     0x31;       // Various Test Settings
      TEST0     =     0x09;       // Various Test Settings
      PA_TABLE0 =     0xFE;       // PA Power Setting
      PKTCTRL1  =     0x04;       // Packet Automation Control
      PKTCTRL0  =     0x05;       // Packet Automation Control

    Thanks,

    Chris 

  • Chris,

    The RSSI offset value can vary significantly from device to device (and over temperature and power supply), which probably explains your results.  The RSSI measurement is meant to be an indicator of received signal strength, but the variation makes it not the best absolute RSSI indicator.

    -GrantC

  • OK, so you're saying this variation is expected. I just want to make sure I'm setting up the radio correctly.

    Thanks,

    Chris

  • Yes, that's correct.