CAN Interface Data Protocol¶
CAN port settings¶
- Save parameters
Frame type Save parameters Description Save user parameters, no loss after power failure Set frame PF ps PGN Data content length 255 81 65361 3 Data content: Byte Description Value 0 Frame type 0: Request frame 1: Reply frame 1 Destination address 2 Reply frame is valid 0: Save failed 1: Save successfully
- Set CAN packet type
Frame type Set CAN data packet type Description Set the type of CAN data sent cyclically Set frame PF PS PGN Data content length 255 86 65366 3 Data content: Byte Description Value 0 destination address 1 Data packet type (low byte) 0x01-accelerometer 0x02-Gyroscope 0x04-latitude and longitude 0x08-attitude Note: The package can be sent together, such as 0x03, both accelerometer and gyroscope 2 Packet type (high byte)
- Set CAN data frequency
Frame type Set CAN data frequency Description Set the frequency of CAN data sent cyclically Set frame PF PS PGN Data content length 255 85 65365 2 Data content: Byte Description Value 0 destination address 1 Data frequency 0-Quiet Mode 1-100(default) 2-50 4-25 5-20 10(0x0a)-10 20(0x14)-5 25(0x19)-4 50(0x32)-2
Get parameters through CAN port¶
Frame type Get parameters Description Get specified parameters Get frame PF PS PGN Data content length 234 255 60159 3 Data content: Byte Description Value 0 N/A 1 Parameter PF PF and PS of specific parameters, see below 2 parameter PS 2 Parameter PS
- Get the software version number
Frame type Get software version number Description Get specified parameters Get frame PF PS PGN Data content length 254 218 65242 5 Data content: Byte Description Value 0 Major Version Number 1 Minor Version Number 2 Patch Number 3 Stage Number 4 Build Number
- Get ECU ID
Frame type Get ECU ID Description Get specified parameters Get frame PF PS PGN Data content length 253 197 64965 8 Data content: Bits Description Value bits 0 Arbitrary Address Arbitrary Address bits 1:3 Industry Group Industry Group bits 4:7 Vehicle System Instance Vehicle System Instance bits 8:14 System Bits System Bits Vehicle system domain bits 15 Reserved Reserved Reserved bits 16:23 Function Bits Function Bits Function domain bits 24:28 Function Instance Function Instance bits 29:31 ECU Bits ECU Bits ECU instance domain bits 32:42 Manufacturer code Manufacturer code Manufacturer code field bits 43:63 ID bits ID bits number
- Get CAN packet type
Frame type Get CAN data packet type Description Get frame PF PS PGN Data content length 225 86 65366 3 Data content: Byte Description Value 0 destination address 1 Packet type (low byte) 2 Packet type (high byte)
- Get CAN data frequency
Frame type Get CAN data frequency Description Get frame PF PS PGN Data content length 255 85 65365 2 Data content: Byte Description Value 0 destination address 1 Data frequency
- Latitude and longitude position
Frame type Latitude and longitude position Description Data frame PF PS PGN Data content length 254 243 65267 8 Data content: Byte Description Value 0:3 Latitude 0.0000001 deg/bit 4:7 Longitude 0.0000001 deg/bit
- Attitude
Frame type Attitude Description Data frame PF PS PGN Data content length 241 25 127257 8 Data content: Byte Description Value 0 SID 1:2 yaw angle 0.0001 rad/bit 3:4 pitch angle 0.0001 rad/bit 5:6 roll angle 0.0001 rad/bit 7 Latitude
- Accelerometer data
Frame type Accelerometer data Description Data frame PF PS PGN Data content length 240 45 61485 8 Data content: Byte Description Value 0:1 Accelerometer x axis 0.01 m/s**2/bit -320 m/s**2 2:3 Accelerometer y axis 0.01 m/s**2/bit -320 m/s**2 4:5 Accelerometer z axis 0.01 m/s**2/bit -320 m/s**2 6:7 reserved
- Gyroscope data
Frame type Gyroscope data Description Data frame PF PS PGN Data content length 240 42 61482 8 Data content: Byte Description Value 0:1 gyroscope x axis 1/128 deg/second/bit -250 deg 2:3 gyroscope y axis 1/128 deg/second/bit -250 deg 4:5 gyroscope z axis 1/128 deg/second/bit -250 deg 6:7 reserved