This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to translate the result from register RSSISAMPLE to the real RSSI ?

Hi, Thank you for your kindly help.

I have get the result from the register RSSISAMPLE. The result I get from RSSISAMPLE is like this:0x00000050. As you known, the result should be a negative number. So there must be a formula or some other operation to translate it into the final result. But I haven't find any document about that. So please reply soon.

Many thans

  • This is pretty clearly stated in the nRF51 Reference Manual: "The value of this register is read as a positive value while the actual received signal strength is a negative value. Actual received signal strength is as follows: Received signal strength = -A [dBm]"

    This means that your 0x50 = 80, to be read as -80 dBm.

  • Now I have another problem. I use the example button_radio_example to get RSSI. I write code like this in PCA10000. NRF_RADIO->EVENTS_READY = 0U; // Enable radio and wait for ready NRF_RADIO->TASKS_RXEN = 1U; while(NRF_RADIO->EVENTS_READY == 0U) { } NRF_RADIO->EVENTS_END = 0U; // Start listening and wait for address received event NRF_RADIO->TASKS_START = 1U; // Wait for end of packet while(NRF_RADIO->EVENTS_END == 0U) { }

    	//get RSSI
    	NRF_RADIO->EVENTS_RSSIEND = 0U;
    	NRF_RADIO->TASKS_RSSISTART = 1U;
      while(NRF_RADIO->EVENTS_RSSIEND == 0U)
    	{
    }
    	
    	rssi = NRF_RADIO->RSSISAMPLE;
    

    When the two device is so closed. The rssi result is -72dB. And sometimes I get -82dB. I find the result is not right, it is too small. Is my code right or not? or should I consider the clock? As you known, in this example the clock is 16MHZ. We are doing a great project, please give your advice or solution soon. Many thanks.

  • The way you do it now, you wait for the packet to be completely received, and then start the RSSI measurement. This will obviously not measure the RSSI while the packet is received, which is most likely what you want. To do such measurement, I'd recommend using the shortcut between address match and RSSI start, so that RSSI measurement is started once an address is matched.

  • Hi Ole,

    Do you mean this...

    // Wait for RX address match while(NRF_RADIO->RXMATCH == 0U) { }

    ...instead of this?

    // Wait for end of packet while(NRF_RADIO->EVENTS_END == 0U) { }

    Thanks, Gil

  • No, as I said, I'd recommend using a shortcut, so that you don't even need to start this manually from code. Look at the definition for the SHORTS register in section 16.2.1. As you can see, it's possible to set a shortcut from the ADDRESS event to RSSISTART, so that the RSSI measurement will be started on every address match.

Related