FORUM

SX1280 Ranging Demo

Hello,

I download a 1280 ranging demo. I the code, valLsb value is read from the RangingResult register, and then the distance is calculated like this,

val = ( double )SX1280complement2( valLsb, 24 ) / ( double )SX1280GetLoRaBandwidth( ) * 36621.09375;

this is not the same as is in the 1280 datasheet.

Does anyone know the differences? What does 36621.09375 stand for?

Thanks a lot!

Sun Dayang

Hello Sun,

You can find the corresponding equation in the datasheet SX1280/SX1281 Rev 3.2 in Table 14-63: Ranging Result Type Selection on page 139. You can find the datasheet on the product page.

The 36621.09375 comes from the 150/(2^12) factor. There is a 10^6 factor due to the fact that in the datasheet the bandwidth is expressed in MHz, but in the driver it is expressed in Hz.

I hope it helps, if it is still not clear please tell me.

Oh! I got it! Thanks very much!