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.

CC2531: Use cc2531 to get rssi

Part Number: CC2531

HI,

There is a spectrum analyzer example in the cc25330 software example, and I'd like to use it on cc2531 USB dongle. The main function is as follows. When I used the function halSampleED() in my code, the compile went well, but after I flashed the firmware to the cc2531 USB dongle, it was not recognized by my PC. Could you please help me figure it out?

Regards,

Geoff

void main( void )
{
//int8 minRssi, maxRssi, rssiOffset;
int8 rssiOffset;

appUartRxIdle = FALSE;

halBoardInit();

halUartInit(HAL_UART_BAUDRATE_115200, 0);

appConfigTimer(1000/UART_RX_IDLE_TIME);

halLedSet(1);

halTimer32kIntEnable();

halRfSetGain(HAL_RF_GAIN_HIGH);

rssiOffset= halRfGetRssiOffset();
//minRssi= MIN_RSSI_DBM + rssiOffset;
//maxRssi= MAX_RSSI_DBM + rssiOffset;

// Set chip in RX scan mode
halSetRxScanMode();

while (TRUE) {

HAL_PROCESS();
uint8 sample;

// For each RSSI sample record
for (sample = 0; sample < SAMPLE_COUNT; sample++) {
uint8 channel;
// Sample channel 11-26
for(channel = 0; channel < CHANNELS; channel++ ) {
ppRssi[channel * SAMPLE_COUNT + sample] = halSampleED(channel+CHANNEL_11, SAMPLE_TIME);
}
}
halUartEnableRxFlow(FALSE);
halMcuWaitUs(1000);
uint8 fSuccess = FALSE;
if (halUartWrite(ppRssi, sizeof(ppRssi)) == sizeof(ppRssi))
fSuccess = TRUE;
halUartEnableRxFlow(TRUE);


}
}