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?