MKW21 RSSI and Link Quality relation?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MKW21 RSSI and Link Quality relation?

Jump to solution
2,902 Views
vmatlapudi
Contributor II

Hello,

I am working on TWR-kw21D256 development board. I had Coordinator and End device Synchronized and connected. I am trying to qualify the radio strength based on obstructions and distance between them. I have problem getting RSSI value, instead i have Link Quality when i receive message from Sender. Link Quality ranges from 0x00 to 0xFF,

Any idea what would be the ideal pass or failure for link Quality?

How would i get RSSI VAlue?

Labels (2)
1 Solution
1,898 Views
andrei_f
NXP Employee
NXP Employee

Hi Vijay,

You can find latest source code for both MAC and SMAC on the website as standalone installers. The current implementations use KSDK 1.2 (http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KINETIS-SDK) which you might find more attractive.

For the retrieval of RSSI out of LQI you could try the following code.

uint8_t lqi_to_rssi(uint8_t read_lqi)

{

     uint32_t tempRSSI = read_lqi;

     uint8_t   comp = MC1324xDrv_IndirectAccessSPIRead(LQI_OFFSET_COMP);

     //if this condition is not met, just return the lqi

     if(25*(tempRSSI+comp) > 4360)

     {

         return read_lqi;

     }

     /*liniarization

                           4360 - 25* RSSI      (4360 - 25* RSSI)*7085 >> 18;

            abs(rssi)=---------------  <=>

                                  37

     */

    tempRSSI = ((4360 - 25*(tempRSSI + comp))*7085)>>18;

    return (uint8_t)(0x000000FF & tempRSSI);

}

This function should return a good approximation of the absolute value of the per-packet RSSI. So, if it returns 10, that means -10dBm.

You need to feed this function with mpRxParams->linkQuality from what I see in your description.

If you read RSSI_CCA_CONT, you might not find RSSI information correlated with the most recently received packet.

I hope this helps.

Regards,

Andrei

View solution in original post

4 Replies
1,899 Views
andrei_f
NXP Employee
NXP Employee

Hello Vijay,

If you are using our latest MKW2xD release, there might be a quick work-around if you need to obtain per-packet RSSI.

In the PhyISR.c file you can find this function PhyGetLastRxRssiValue. If you have the latest source files, you will notice that the implementation of this function applies some formula and you can do the following:

1) In your app declare: extern uint8_t PhyGetLastRxRssiValue();

2) When a data indication is triggered, call this function and store the return value (remember that this is the absolute value, but the RSSI is negative).

This function might not give an exact RSSI but it gets close (since some approximations were necessary).

Remember that there is no per-packet RSSI in 802.15.4 MAC. This function exists in Phy because SMAC uses it and MAC and SMAC have a common Phy.

Regards,

Andrei

1,899 Views
vmatlapudi
Contributor II

Hello Andrei,

Thank you for the response.

I couldn't find the function PhyGetLastRxRssiValue(). Looks like i don't have latest files on Latest files on BeeKit 3.0.2.

Please advice how to get the latest files, I am using MAC 2006

I found something like this in the the phy source code

mpRxParams->linkQuality = MC1324xDrv_DirectAccessSPIRead((uint8_t) LQI_VALUE);

Can i replace LQI_VALUE(0x25) with RSSI_CCA_CONT(0x26)

Thanks,

Vijay

0 Kudos
1,899 Views
andrei_f
NXP Employee
NXP Employee

Hi Vijay,

You can find latest source code for both MAC and SMAC on the website as standalone installers. The current implementations use KSDK 1.2 (http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KINETIS-SDK) which you might find more attractive.

For the retrieval of RSSI out of LQI you could try the following code.

uint8_t lqi_to_rssi(uint8_t read_lqi)

{

     uint32_t tempRSSI = read_lqi;

     uint8_t   comp = MC1324xDrv_IndirectAccessSPIRead(LQI_OFFSET_COMP);

     //if this condition is not met, just return the lqi

     if(25*(tempRSSI+comp) > 4360)

     {

         return read_lqi;

     }

     /*liniarization

                           4360 - 25* RSSI      (4360 - 25* RSSI)*7085 >> 18;

            abs(rssi)=---------------  <=>

                                  37

     */

    tempRSSI = ((4360 - 25*(tempRSSI + comp))*7085)>>18;

    return (uint8_t)(0x000000FF & tempRSSI);

}

This function should return a good approximation of the absolute value of the per-packet RSSI. So, if it returns 10, that means -10dBm.

You need to feed this function with mpRxParams->linkQuality from what I see in your description.

If you read RSSI_CCA_CONT, you might not find RSSI information correlated with the most recently received packet.

I hope this helps.

Regards,

Andrei

1,899 Views
antonioconcio
NXP Employee
NXP Employee

Hi Vijay,

Here below some info that AlanCollins put together about ED vs RSSI vs LQI.

  • Energy Detect (ED) means to measure the "energy" in a specific channel (frequency). When we talk about 2.4GHz frequencies, this energy or power measurement is the sum of noise + any 802.15.4 radio transmitting + any other radio working on the same frequency like WiFi (802.11) or Bluetooth. This value is represented in dBm.

     Key differentiation = energy in the channel at anytime you measure it.

  • Received Signal Strength Indication (RSSI) is the measurement of power present in a received radio signal. This value is represented in dBm.

      Key differentiation = energy in the channel while receiving a message.

  • Link Quality Indicator (LQI) is the quality of the real data received in a signal. This is a value from 0 to 255, being 255 the best quality.

      Key differentiation = Quality of the modulated bits in the received signal.

Quick example:

The scenario can have multiple devices sending data on the same frequencies. WiFi, BlueTooth, ZigBee, etc. Then two ZigBee nodes communicate between each other.

ED can be high becuase of the noisy environment.

RSSI can be similar to ED depending on the exact moment the ED measurement is taken

LQI can be low because the collisions OTA would degradate the signal that really means something for the modulation used by ZigBee (802.15.4).

Hope that helps,

Antonio