Reference
This article delves into sensor communication protocols, detailing register commands for system configuration and calibration.
Communication Protocol Description
| Register name | Register address | Command | Description |
|---|---|---|---|
| System recovery | 0x00 | MODADDR 06 00 00 00 01 CRCH CRCL | Write 0x01, the sensor restores the default setting |
| Alarm threshold | 0x02 | MODADDR 06 00 03MH ML CRCH CRCL | MH alarm threshold high bit, ML alarm threshold low bit, threshold setting range 40~4000mm |
| Baud rate setting | 0x04 | MODADDR 06 00 04 00 00 CRCH CRCL | Write 0x00, baud rate 2400 |
| MODADDR 06 00 04 00 01 CRCH CRCL | Write 0x01, baud rate 4800 | ||
| MODADDR 06 00 04 00 02 CRCH CRCL | Write 0x02, the baud rate is 9600 | ||
| MODADDR 06 00 04 00 03 CRCH CRCL | Write 0x03, the baud rate is 19200 | ||
| MODADDR 06 00 04 00 04 CRCH CRCL | Write 0x04, the baud rate is 38400 | ||
| MODADDR 06 00 04 00 05 CRCH CRCL | Write 0x05, baud rate 57600 | ||
| MODADDR 06 00 04 00 06 CRCH CRCL | Write 0x06, baud rate 115200 | ||
| MODADDR 06 00 04 00 07 CRCH CRCL | Write 0x07, baud rate 230400 | ||
| MODADDR 06 00 04 00 08 CRCH CRCL | Write 0x08, baud rate 460800 | ||
| MODADDR 06 00 04 00 09 CRCH CRCL | Write 0x09, the baud rate is 921600 | ||
| Timing preset time (not recommended to modify, default 200MS) | 0x07 | MODADDR 06 00 07 TIMEBUDGETH | TIMEBUDGET: 20-1000 ms, can be changed to 0x0014-0x03e8 |
| Measurement interval (not recommended to modify, default 50MS) | 0x08 | MODADDR 06 00 08 PERIODH PERIODL CRCH CRCL | PERIOD :1-1000 ms, can be changed to 0x0001-0x03e8 |
| ID setting | 0x1A | MODADDR 06 00 1a 00 MODADDRL CRCH CRCL | Can write 0x00~0xFE |
| Measurement data | 0x34 | MODADDR 03 00 34 00 01 CRCH CRCL | Read, the upper 8 bits of the distance to the lower 8 bits of the distance |
| Output state | 0x35 | MODADDR 03 00 35 00 01 CRCH CRCL | Read: 0x07, sensor No Update |
| Read: 0x00, Sensor Range Valid | |||
| Read: 0x01,Sensor Sigma Fail | |||
| Read: 0x02, Sensor Signal Fail | |||
| Read: 0x03, Sensor Min Range Fail | |||
| Read: 0x04, Sensor Phase Fail | |||
| Read: 0x05, Sensor Hardware Fail | |||
| Measurement mode | 0x36 | MODADDR 06 00 36 00 01 CRCH CRCL | Write 0x01, short distance (up to 1.3m, better environmental immunity) |
| MODADDR 06 00 36 00 02 CRCH CRCL | Write 0x02, middle distance (up to 3 meters) | ||
| MODADDR 06 00 36 00 03 CRCH CRCL | Write 0x03, long distance mode (up to 4 meters) | ||
| Calibration mode | 0x37 | MODADDR 06 00 37 00 04 CRCH CRCL | Write 0x04 to enter the calibration state |
| MODADDR 03 00 37 00 01 CRCH CRCL | Read: 0x01, start calibration | ||
| MODADDR 03 00 37 00 02 CRCH CRCL | Read: 0x02, calibration failed | ||
| MODADDR 03 00 37 00 03 CRCH CRCL | Read: 0x03, calibration is complete |
Was this article helpful?
