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.

Compiler/CC430F5137: How to Check RSSI Value ?

Part Number: CC430F5137

Tool/software: TI C/C++ Compiler

Hello,

I am using CC430f5137 SoC's. I applied some logic from document for getting RSSI value.

please find below function.

void RSSI_Check(void)

{

if(RSSIcheckFlg)
{
RSSIcheckFlg = 0;
rssi_reg = RxBuffer[RSSI_IDX];
rssi_onescomp = rssi_reg ^0xFF; 
rssi_onescomp = ++rssi_onescomp; 

if (rssi_reg >= 128)
{
rssi_dbm = (long)((long)( rssi_reg - 256) / 2) - 74;//rssi_offset;

}
else
{
rssi_dbm = (rssi_reg / 2) - 74;//rssi_offset;
}

}

}

When I check with on received flag it shown a value above 65000,so how can get correct DBm value.

  • Hi,

    Have you add a chance to consult the following app note? I would also advise you to have a look to this thread.

    I hope this will help,

    Regards,

  • Hello,

    Thank you very much.

    I have check related note and application document.

    I modified my code as per below function, I see that my value of RSSI goes negative what's it shows.

    it's vary between -160 to -33.

    is it correct?

    void RSSI_Check(void)
    {
    if(RSSIcheckFlg)
    {
    RSSIcheckFlg = 0;
    //rssi_reg = RxBuffer[RSSI_IDX];
    //rssi_onescomp = rssi_reg ^0xFF; //I think this ok,RSSI_IDX
    //rssi_onescomp = ++rssi_onescomp; //add 1 rxPosition - 1

    rssi_reg = ReadSingleReg(RXFIFO);

    if (rssi_reg >= 128)
    {
    rssi_reg = (int)((int)( rssi_reg - 256) / 2) - 74;//rssi_offset;

    }
    else
    {
    rssi_reg = (rssi_reg / 2) - 74;//rssi_offset;
    }

    RSSI_HB = rssi_reg >> 8;

    RSSI_LB = rssi_reg & 0xff;


    }
    }

    void pktRxHandler(void) {
    unsigned char RxStatus;
    unsigned char bytesInFifo;

    // Which state?
    RxStatus = Strobe(RF_SNOP);

    switch(RxStatus & CC430_STATE_MASK)
    {
    case CC430_STATE_RX:
    // If there's anything in the RX FIFO....
    if (bytesInFifo = MIN(rxBytesLeft, RxStatus & CC430_FIFO_BYTES_AVAILABLE_MASK))
    {
    // Update how many bytes are left to be received
    rxBytesLeft -= bytesInFifo;

    // Read from RX FIFO and store the data in rxBuffer
    while (bytesInFifo--) {
    RxBuffer[rxPosition] = ReadSingleReg(RXFIFO); 
    rxPosition++;
    }
    if (!rxBytesLeft){
    LED_RX_ON
    packetReceived = 1;
    FrameReceived = TRUE;
    RSSIcheckFlg = 1;
    receiving = 0;
    lengthByteRead = 0;
    ReceiveOff();
    DataRcvFlg = TRUE;
    ReceiveOn();
    LED_RX_OFF
    }
    }
    break;
    default:
    if(!packetReceived)
    {
    packetReceived = 1;
    }

    rxBytesLeft = 0;
    receiving = 0;
    ReceiveOff();

    break;
    }
    } // pktRxHandler

  • Hi,

    Your results look good!

    Always happy to help.

    Kind regards,

  • Hello,

    It is great helping notes and discussion.

    Rest of that thing I have some doubt, my RSSI value continue scrolling doesn't matter it will be 1 meter or 50 meter.

    How can stable that value on any distance. like you told that 1m it was 70dbm to 80dbm.

    I have only this issue.

    If need any code details I will provide to you.

    Kindly revert back. 

  • Hi,

    We are waiting for reply.

    Kindly revert back.

  • Greetings,    (interested outsider here...)

    Feel your pain - irregular and/or inconsistent/unexpected 'RSSI' readings do (not) build confidence.

    As my group does not employ your device - these suggestions may not (fully) apply.    (Yet are generally useful when employing RF)

    • What is the 'background RSSI reading' - when your remote device is 'Inactive?'
    • You may benefit by comparing the (above) 'Background reading vs. the Active reading.'    (i.e. active when your remote is transmitting)    It is the 'signal delta' (difference) which truly counts.
    • Have you an RF Signal Generator - which may be set to 'known (and stable) RF outputs?'    Should your RSSI readings (still) prove unstable your 'RSSI measurement method may be faulty.'
    • Have you a 2nd "CC430F5137" with which to experiment?    Does the same instability continue?
    • You may benefit from 'standardizing' upon a ~10 meter - clear 'line of sight' - separation between devices.    Variation from your 'standard' adds unwanted signal variables to the mix - often 'masking' your issue.

  • Hi,

    Thank you.

    Sorry for taken follow up.

    I just to submit my project but without RSSI it takes delay.

    I want know what exact RSSI value comes after sending data by every 70msec at distance of 4-5meter.

    As per queries please find below.

    1)  background reading I have give after end of this discussion.When remote is inactive it won't have any value I have use checked only after Rx on.

    2) Right now I don't have signal generator, do you have any other method.

    3)I have checked  2-3 board reading are same.

    I have place one buffer and after every 70msec data receive and RSSI value comes at distance of 2meter.

    One more thing my transmitter and receiver is full duplex mode. don't get confuse.

    Buff unsigned int[50] RSSI Value 2's complement of decimal number
    [0] unsigned int 0x0000 0
    [1] unsigned int 0xFF9E -98
    [2] unsigned int 0xFF9F -97
    [3] unsigned int 0xFF7E -130
    [4] unsigned int 0xFFD8 -40
    [5] unsigned int 0xFFB6 -74
    [6] unsigned int 0xFFC8 -56
    [7] unsigned int 0xFFA8 -88
    [8] unsigned int 0xFFBD -67
    [9] unsigned int 0xFFE8 -24
    [10] unsigned int 0xFFB9 -71
    [11] unsigned int 0xFF94 -108
    [12] unsigned int 0xFFB1 -79
    [13] unsigned int 0xFFDD -35
    [14] unsigned int 0xFFF1 -15
    [15] unsigned int 0xFF93 -109
    [16] unsigned int 0xFF77 -137
    [17] unsigned int 0xFFAF -81
    [18] unsigned int 0xFF93 -109
    [19] unsigned int 0xFF91 -111
    [20] unsigned int 0xFF7A -134
    [21] unsigned int 0xFFAD -83
    [22] unsigned int 0xFFAF -81
    [23] unsigned int 0xFFEE -18
    [24] unsigned int 0xFFA0 -96

      

  • Hi back,

    Thank you - your data listing & response to questions are likely to aid (my team) & vendor agents.   (possessing actual device experience/expertise)

    May we ask - "How was the first listing '0' on your chart attained?"    (it is suspected that this was not a 'Background and/or residual noise signal level reading' attained when the remote device is NOT transmitting and the receive device is 'receiving.')   Obtaining a reading of '0' seems (highly) unlikely - thus our question.

    Your results reveal an 'RSSI Signal Range' of '-137 to -15' which is believed to be 'excessive and/or error-laden.'    We note 7 readings of -100 or more and 5 readings of -40 or less (50% of your 24 reading total).   In my group's (reasonable) RF experience - that difference in signal level raises concern.

    Based upon these results - might you try:

    • If possible (and just for our testing) switch away from full duplex to half duplex
    • and increase the delay between transmissions by a factor of 10 (i.e. to 700mS)    It is believed that 70mS may not provide sufficient time for your device to 'settle' - impacting readings.
    • and - while under (both) of these conditions - measure & report the RSSI value when your remote is (Not) transmitting.   (we seek the background noise floor level)

    Are you making 'ALL' such measurements at 'just one' device?   (i.e. not measuring both devices - just one)

    Assuming your device accepts a standard 'RF Signal Generator's' output (minus any unique device 'modulation') that remains the 'classic' means to determine receiver sensitivity - and the 'likely success of the proposed RF transmission link or path.'    Minus that Signal Gen. you WILL benefit from acquiring a 'much lower cost' RF detector IC' and/or an appropriate RF voltmeter - spec'ed to operate at your operating frequency.    In such cases you will likely require a suitable 'Pass-Band Filter' - able to substantially reject 'Out of Band' noise & signals - which will impact your readings...

    And - is there not (some) forum - which focuses more highly on such an RF device?    It is expected that 'other device users' have encountered your 'exact issue' - and their reports & findings are, 'SURE to add good value to your RSSI (and general device) investigation.'