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