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.

PGA460: Distance Calculation

Part Number: PGA460

Hi,

Could you please tell me the reason why "MSB << 8 (8-bit left shift)" is applied when calculating the distance between the transducer on PGA460 and the target object ?

Best regards,
Kato

  • Hi Kato-san,

    UART Command 5 in Table 3 shows that Bytes 1-2 are the MSB and LSB bytes of the object time of flight in microseconds. The time of flight value is a 16-bit value, so the MSB and LSB 8-bit bytes must be concatenated to create the 16 bit value. This is why the 8-bit left shift is applied in the conversion to distance equation.

    For example, if UART Command 5 returns the following values for one object: 0x{40,1B,62,23,68,B6}, then the raw values are:

    • 0x40 is the diagnostic byte
    • 0x1B is the echo time of flight MSB
    • 0x62 is the echo time of flight LSB
    • 0x23 is the echo width
    • 0x68 is the echo amplitude
    • 0xB6 is the checksum

    Whereby the time of flight in microseconds is 0x1B62 = 7010us --> 1.2m in distance.

  • Hi Akeem-san,

    Thank you for your prompt reply.

    I understood.

    Best regards,
    Kato