Reference

This article offers a detailed exploration of the UART communication protocol, covering baud rates, data formats, and timing diagrams, providing essential insights into frame data and checksums.

Communication Protocol Description

1、communication instructions

Interface Baud rate Data bit Stop bit Check bit
UART 115200bps 8 1 None

2、Timing diagram

Timing diagram

Note: T1 ≥ 19ms; T2 ≈ 13ms

3、UART output format

Frame data Output data Description Bytes
Frame header 0XFF Frame header, fixed as 0XFF 1 byte
H_DATA 0X07 Higher 8 bits of distance data 1 byte
L_DATA 0XA1 Lower 8 bits of distance data 1 byte
SUM 0XA7 data checksum 1 byte

SUM= (header+Data_H+ Data_L)&0x00FF

=(0XFF + 0X07 + 0XA1)&0x00FF

=0XA7;

Distance value = DATA_ H * 256+DATA_L = 0x07A1;

Decimal conversion is equal to 1953;

Was this article helpful?

TOP