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.

CC2500 - Calculating RSSI

Other Parts Discussed in Thread: CC2500

Hi,

I'm stuck at reading and interpreting the RSSI value of my CC2500.

I'm using the ez430-rf2500 module. I can read an write registers correctly end send the CC2500 in RX-Mode. I configured the module to a base frequency of 2.400028992GHz, a channel-spacing of 57.723999 kHz and a channel bandwidth-filter of 58.035714 kHz, resulting in round about 1400 channels.
I don't want to send or recieve but only read the RSSI.

To do so, I'm sending a command-strobe for RX-Mode, wait for calibration, read the RSSI-value, go back to IDLE and change the channel.
But all my RSSI-values are round about -29 dbm till -38 dbm while expecting values of -80 dbm.

What am I doing wrong?

Settings:

/*
 * VAL_REG.h
 *
 *  Created on: 20.01.2015
 *      Author: domgeb
 */

#ifndef VAL_REG_H_
#define VAL_REG_H_

/* Sync word qualifier mode = 30/32 sync word bits detected */
/* CRC autoflush = false */
/* Channel spacing = 199.951172 */		// 57,72399902 kHz
/* Data format = Normal mode */
/* Data rate = 2.39897 */
/* RX filter BW = 203.125000 */			// 58,0357
/* Preamble count = 4 */
/* Whitening = false */
/* Address config = No address check */
/* Carrier frequency = 2432.999908 */	// 2,400029018
/* Device address = 0 */
/* TX power = 0 */
/* Manchester enable = false */
/* CRC enable = true */
/* Deviation = 38.085938 */
/* Packet length mode = Variable packet length mode. Packet length configured by the first byte after sync word */
/* Packet length = 255 */
/* Modulation format = 2-FSK */
/* Base frequency = 2432.999908 */		// 2,400029018
/* Modulated = true */
/* Channel number = 0 */
/* PA table */
#define PA_TABLE {0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}
/***************************************************************
 *  SmartRF Studio(tm) Export
 *
 *  Radio register settings specifed with C-code
 *  compatible #define statements.
 *
 *  RF device: CC2500
 *
 ***************************************************************/

#define VAL_IOCFG2           0x29
#define VAL_IOCFG1           0x2E
#define VAL_IOCFG0           0x06
#define VAL_FIFOTHR          0x07
#define VAL_SYNC1            0xD3
#define VAL_SYNC0            0x91
#define VAL_PKTLEN           0xFF
#define VAL_PKTCTRL1         0x04
#define VAL_PKTCTRL0         0x06
#define VAL_ADDR             0x00
#define VAL_CHANNR           0x00
#define VAL_FSCTRL1          0x08
#define VAL_FSCTRL0          0x00
#define VAL_FREQ2            0x5C
#define VAL_FREQ1            0x4F
#define VAL_FREQ0            0x0E
#define VAL_MDMCFG4          0xF6
#define VAL_MDMCFG3          0x83
#define VAL_MDMCFG2          0x01
#define VAL_MDMCFG1          0x21
#define VAL_MDMCFG0          0x23
#define VAL_DEVIATN          0x44
#define VAL_MCSM2            0x07
#define VAL_MCSM1            0x30
#define VAL_MCSM0            0x18
#define VAL_FOCCFG           0x16
#define VAL_BSCFG            0x6C
#define VAL_AGCCTRL2         0x03
#define VAL_AGCCTRL1         0x40
#define VAL_AGCCTRL0         0x91
#define VAL_WOREVT1          0x87
#define VAL_WOREVT0          0x6B
#define VAL_WORCTRL          0xF8
#define VAL_FREND1           0x56
#define VAL_FREND0           0x10
#define VAL_FSCAL3           0xA9
#define VAL_FSCAL2           0x0A
#define VAL_FSCAL1           0x00
#define VAL_FSCAL0           0x11
#define VAL_RCCTRL1          0x41
#define VAL_RCCTRL0          0x00
#define VAL_FSTEST           0x59
#define VAL_PTEST            0x7F
#define VAL_AGCTEST          0x3F
#define VAL_TEST2            0x88
#define VAL_TEST1            0x31
#define VAL_TEST0            0x0B
#define VAL_PARTNUM          0x80
#define VAL_VERSION          0x03
#define VAL_FREQEST          0x00
#define VAL_LQI              0x00
#define VAL_RSSI             0x00
#define VAL_MARCSTATE        0x00
#define VAL_WORTIME1         0x00
#define VAL_WORTIME0         0x00
#define VAL_PKTSTATUS        0x00
#define VAL_VCO_VC_DAC       0x00
#define VAL_TXBYTES          0x00
#define VAL_RXBYTES          0x00
#define VAL_RCCTRL1_STATUS   0x00
#define VAL_RCCTRL0_STATUS   0x00



#endif /* VAL_REG_H_ */

float cc2500_readRssi()
{
	unsigned char rssi_raw = 0;
	float rssi_dbm = 0;

	rssi_raw = cc2500_readReg(RSSI);
	rssi_raw ^= 0xFF;
	rssi_raw++;

	if(rssi_raw >= 128)
		rssi_dbm = (((rssi_raw - 256) / 2) - 71);
	else
		rssi_dbm = ((rssi_raw / 2) - 71);

	return rssi_dbm;
}
for(i = 0; i < 1400; i++)
{
    cc2500_writeReg(CHANNR, i);
    itoa(i, &channel[0], 0);

    cc2500_sendCmdStrobe(CC2500_RX);

    wait_done();
    
    RSSI_value = cc2500_readRssi();

    ftoa(RSSI_value, &rssi_buffer[0], 2);

    uart_puts(&channel[0]);
    uart_putc(':');
    uart_putc(' ');

    uart_puts(sufix);
    uart_puts(&rssi_buffer[0]);
    uart_puts(LFCR);
    cc2500_sendCmdStrobe(CC2500_IDLE);
}


I hope, you can help me, please.


Edit1:

I think I found one mistake:

I change "float cc2500_readRssi()" to

float cc2500_readRssi()
{
    signed char rssi_raw = 0;
    float rssi_dbm = 0;


    if(rssi_raw >= 128)
        rssi_dbm = (((rssi_raw - 256) / 2) - 71);
    else
        rssi_dbm = ((rssi_raw / 2) - 71);

    return rssi_dbm;
}

Now I'm getting results like -150 dbm, which seems quite low. With a professional spectrum analyser I'm measuring -80 dbm.
Additionally I can't find peaks of a video-transmitter (-30 dbm) while scanning?


Edit2:

I made on of the two boards into a transmitter with a 2432.999908 MHz base-frequency, 203.125000 kHz BW-filter and 199.951172 kHz channel spacing.
The transmitter works fine. It constantly transmits 0xFF; the spectrum analyser shows the peak at the base-frequency.

After this was working fine, I programmed my reciever with the same settings like the transmitter. I'm reading out the RSSI value of the reciever and get -65 (raw value); that fits my measurings with the spectrum analyser. But when I change the channel where nothing is transmitting, I get the same RSSI-value?!

What am I doing wrong?

 
  • I have reviewed the code most of it looks ok, however there is one important thing that I found.

    The CHANNR registers is only an 8-bit register and can only hold values of 0-255, you are programming channel values all the way to 1400 this will not work.

    I can see that you are making a "spectrum analyzer" I did the same a while back and it works ok. If you want I can post the source code here - it unfortunately an IAR project.

    Regards,
    /TA
  • Here is the project I was talking about.

    It creates the following menu on the UART (9600 baud) and then you just request option 7 to get a Spectrum analyzer type sweep. The data is send via UART in text format.

    RF demonstration based on the various CCx & MSP430x

    Hardware version 1.0, Software version 1.x
    Select from items below:
    *************************************************************
    1) Reset and Idle Radio
    2) Unmodulated TX (line)
    3) Static RX (line)
    4) Modulated TX no MCU (line)
    5) TX burst BER test (line, bursts) eg.(5 1000)
    6) RX burst BER test (line, bursts) eg.(6 1000)
    7) Sweep RX, like SA (line, sweeps) eg.(7 10)
    8) Single channel RX (line, sweeps) eg.(8 10)
    9) Setup Radio page 1 (line, start freq, stop freq, tx pwr)
    10) Setup Radio page 2 (line, rx bw, chan spac, freq dev)
    *************************************************************
    Current configuration: (Device = CC2500)
    Current configuration:
    TX : 9 2405000 2500000 0
    RX : 10 200 300 25
    *************************************************************
    CMD >


    In there there you will find my code of how to do it, if you notice I do the printing to the UART while the CC2500 is in RX. The UART on this development kit is slow so I use that time to make sure the RSSI has settled.

    Regards,
    /TA

    TRX_demo_rf2500.zip

  • Thank you so much.

    I noticed my mistake with the channel numbers as well but still couldn't get it work.

    I now copied your settings for the cc2500 and it worked! But can you tell me how to calculate IF_Frequency (FSCTRL1)?
    In most of the sources I've looked up, this value has been set as close as possible or if possible to the same value as the RX filter bandwidth.

    Referring to the datasheet, RF Studio should calculate FSCTRL1 by itself, depending on base frequency, channel spacing and channel bandwidth filter. But this register stays 0x0F regardless of the changes to these three values.

     

    Best regards

     

    Dominik Gebhardt