Benewake (Beijing) Co. Ltd.
Page12
5.2 Serial port Communication Protocol
Serial port Communication starts when pin 5 is disconnected or connected to 3.3v. It will set TF-Luna
receiving RXD from pin 2 and sending TXD on pin 3. The serial port communication protocol is defined as
follows: 8 data bits, 1 stop bit with no parity check and default baud rate of 115200 bps.
Serial port Communication Protocol data byte format:
byte 0 1 2 3~Len-2 Len-1
Description Head(0x5A) Len ID Payload Checksum
Head: Fixed 0x5A.
Len: The length of bytes from the head byte to check-sum at the end, and it has to between 4 to 255.
ID: Indicates how to parse the Payload data.
Payload: Payload data segment, Optional.
Checksum: The lower 8 bytes of the sum from Head the Payload.
Please check Appendix II Serial communication protocol for more information.
Note: Not as Checksum byte of the data frames sending from TF-Luna, those Checksum bytes that
TF-Luna are not being check as default. Thus, ANY value is acceptable on the Checksum byte, unless
checking of those bytes are required. Please check “Enable/disable checksum comparison
ID_FRAME_CHECKSUM_EN=0x08” in Appendix II Serial communication protocol to enable the feature.
The instruction makes change immediately after sending, but the current setting is not saved and will
lose after reboot. User must use “Save current setting ID_SAVE_SETTINGS=0x11” to save the change. The
full save-current-setting11s hexadecimal string is 5A 04 11 00 in this case.
5.3 I2C communication
When pin 5 is connected to ground, TF-Luna enters I2C mode, then its pin 2 is use as SDA data and
pin 3 is the SCL clock sending data. TF-Luna support up to 400kps clock speed as slave machine and its
default address is 0x10. For more information about I2C register table Appendix III I2C register table.
Write register timing:
Start Slave Addr W Ack Register Addr Ack Data1 Ack … DataN Ack Stop
Read register timing: