Skip to content

CAN Protocol ​

Use J1939 for all new projects (CAN FD models can also enable CANFD83). CANopen is a custom-firmware feature; contact HiPNUC if required, and see "CANopen (Custom Firmware)" at the end of this chapter.

Bus Parameters & Wiring ​

ItemJ1939CANFD83 (CAN FD models only)
Factory bit rateNominal 500 kbit/sNominal 500 kbit/s, data phase 4 Mbit/s
Node address SA8 (range 1–127, avoid host address 0x55)Same
Frame format29-bit extended, 8 bytesFD + BRS extended, up to 64 bytes
Data formatFixed-point integers (G, deg/s)float32 (m/s², rad/s)
  • Termination & ACK: place 120 Ω resistors at both ends of the bus and ensure at least one node sends ACK (without ACK, the transmitter retries and stops).
  • Bus load: one classic 8-byte extended frame is ~131 bits (~13 kbit/s at 100 Hz); the 4 default PGNs use ~52 kbit/s (~10% of a 500 kbit/s bus). Scale linearly with node count.
  • Multiple nodes: all modules ship with node address 8. Connect one at a time to assign unique addresses and reboot before joining the shared bus.

J1939 Data Protocol ​

J1939 29-bit extended CAN ID structure
text
CAN_ID = (P << 26) | (R << 25) | (DP << 24) | (PF << 16) | (PS << 8) | SA

All data PGNs use priority P = 3 and broadcast format PF = 0xFF, giving CAN ID = 0x0CFF[PS][SA] (e.g. 0xFF41 from node 8 is 0x0CFF4108).

WARNING

J1939 payloads are little-endian (opposite to Modbus big-endian): a 32-bit value 0x12345678 is sent as 78 56 34 12.

PGN List & Field Definitions ​

Periods are in ms (1–32767, 0 = off). Unlisted bytes are reserved and should be ignored.

PGNFactory PeriodPeriod AddrByte Layout & FieldsTypeScale & Unit
0xFF2FOff0x012F0–5: year-2000 / mo / day / hr / min / sec; 6–7: msu8×6, u16Date populated when UTC synced; 0 when unsynced
0xFF3410 ms0x01340–1 / 2–3 / 4–5: Acc X / Y / Zi16× 0.00048828 G (16/32768)
0xFF3710 ms0x01370–1 / 2–3 / 4–5: Gyro X / Y / Zi16× 0.061035 deg/s (2000/32768)
0xFF3AOff0x013A0–1 / 2–3 / 4–5: Mag X / Y / Zi16× 0.030517 μT (1000/32768)
0xFF3D10 ms0x013D0–3: Roll; 4–7: Pitchi32× 0.001 deg
0xFF4110 ms0x01410–3: Compass heading (0–360° CW); 4–7: Raw yaw (±180° CCW)i32× 0.001 deg
0xFF43Off0x01430–1: Temperature (2–7 reserved)i16× 0.01 °C
0xFF46Off0x01460–1 / 2–3 / 4–5 / 6–7: Quaternion qw / qx / qy / qzi16× 0.0001
0xFF4AOff0x014A0–3: X inclination; 4–7: Y inclination (fixed RFU)i32× 0.001 deg
0xFF5BOff0x015BCANFD83 variable frame (CAN FD models only, below)——

J1939 acceleration, angular rate, and magnetic field saturate at ±16 G, ±2000 deg/s, and ±1000 μT; pressure and MRU fields are not output. 0xFF2F is output-only and cannot set module time — use PPS Time Sync.

Decoding Examples & SDK ​

CAN ID (SA=8)8-Byte Payload (Hex)Decoded Result
0x0CFF3408EC FF 23 00 00 08 00 00Acc: X = −0.0098 G, Y = 0.0171 G, Z = 1.0000 G
0x0CFF41086D DE 01 00 93 21 FE FFCompass 122.477° (CW); raw yaw −122.477° (CCW)
0x0CFF2F081A 06 12 0E 1E 2D 58 022026-06-18 14:30:45.600 UTC

Official C99 decoder and tools: c/hipnuc/hipnuc_can.c, Linux SocketCAN example read_can.c, and signal database dbc/J1939.dbc.

CANFD83 Variable Frame ​

Applies only to CAN FD models. Default nominal rate is 500 kbit/s and data-phase rate is 4 Mbit/s. PGN = 0xFF5B, priority 3, extended ID = 0x0CFF5B00 | node_id, FD=1, BRS=1.

Bit timing: nominal sample point is 80% across all rates; data-phase sample point is 80% (75% at 5 Mbit/s). Match the host's nominal sample point to the module, otherwise BRS bit-rate switching skews the data phase and corrupts frames.

CANFD83 Frame Format ​

Starts with an 8-byte fixed header followed by fields packed from LSB to MSB of MAP (little-endian, IEEE-754 float32):

OffsetBytesFieldTypeDescription
04MAPuint32Bitmask of fields present in this frame
42main_statusuint16Main status word (bit12 always 0)
61ins_statusuint8INS status (ignore on IMU / AHRS)
71sequenceuint8Rolling frame counter (0–255 wrap, for drop detection)
bitFieldTypeBytesUnitOrder / Meaning
0ACC_Bfloat32×312m/s²X, Y, Z
1GYR_Bfloat32×312rad/sX, Y, Z
2MAG_Bfloat32×312μTX, Y, Z (requires magnetometer)
3RPYfloat32×312degroll, pitch, yaw (±180°)
4QUATfloat32×416—w, x, y, z
5SYSTEM_TIMEuint648μsMonotonic sample timestamp since boot
6UTCpacked8—year-2000:u8, month:u8, day:u8, hour:u8, minute:u8, second*1000+ms:u16le, reserved:u8=0; valid when UTC_UNSYNC=0
8TEMPERATUREfloat324°CModule temperature

Supported MAP mask is 0x0000017F. Configured MAP must be nonzero, contain no reserved bits, and satisfy logical length 8 + sum(selected fields) ≤ 64 (selecting all bits of 0x17F requires 92 bytes and is rejected).

Default MAP = 0x0000012B (56 logical bytes, padded on the wire to 64 bytes / DLC=15; ignore trailing zero padding):

CAN FD data bytes12162024324864
DLC code9101112131415

CANFD83 Configuration Parameters ​

Configured via the protocol below using classic 8-byte frames (FD=0, BRS=0). Data-phase bit-rate index: 0=1 Mbit/s, 10=2 Mbit/s, 11=4 Mbit/s, 12=5 Mbit/s.

ParameterAddressDefaultEffective
CANFD83 MAP0x01800x12BNext frame
CANFD83 period0x015B0 (off)Immediate (ms)
Periodic output master switch0x009D1 (on)Immediate (0/1)
Data-phase rate index0x009B11Save and reboot

Common requests for node 8, host 0x55 (request ID 0x0CEF0855, reply ID 0x0CEF5508):

ActionRequest Data (8 bytes)
MAP = 0x12B80 01 06 00 2B 01 00 00
Read MAP80 01 03 00 00 00 00 00
Period = 10 ms5B 01 06 00 0A 00 00 00

CANFD83 Frame Example ​

Example frame (constructed test data, not a hardware capture), ID=0x0CFF5B08, FD=1, BRS=1, DLC=15:

text
2B 01 00 00 00 00 00 7E
00 00 80 3F 00 00 00 C0
00 00 18 41 00 00 80 3E
00 00 00 BF 00 00 80 3F
00 00 20 41 00 00 A0 C1
00 00 F0 41 40 42 0F 00
00 00 00 00 00 00 CC 41
00 00 00 00 00 00 00 00

Decoded: ACC_B=[1, -2, 9.5] m/s², GYR_B=[0.25, -0.5, 1] rad/s, RPY=[10, -20, 30] deg, SYSTEM_TIME=1000000 μs, TEMPERATURE=25.5 °C, trailing 8 bytes are padding.

Configuration Protocol ​

The host reads and writes parameters via point-to-point extended frames 0x0CEF[DA][SA] (DA = module node address, SA = host address 0x55; module replies on 0x0CEF[SA][DA]). Send one request at a time, wait for the reply or timeout, and keep ≥ 10 ms between requests. Parameter addresses share the Modbus register map (e.g. status 0x0009, magnetic calibration 0x0008/0x000A/0x000B).

BytesFieldTypeDescription
0–1ADDRu16Parameter address (little-endian)
2CMDu80x06 write, 0x03 read
3Reservedu8Write 0
4–7VALu32Parameter value (little-endian); set upper 16 bits to 0 when writing 16-bit params; compare only the low 16 bits on readback (may be sign-extended)

Common Configuration Frames (DA=8, Request ID 0x0CEF0855) ​

Data (8 bytes, little-endian)Parameter Address & Function
[PS] 01 06 00 [VAL]Set PGN period (ms, 0 = off, immediate), e.g. 37 01 for 0x0137 (gyro)
9D 00 06 00 [VAL]0x009D periodic output switch: 1 on (default), 0 off (immediate)
9A 00 06 00 [VAL]0x009A nominal rate code: 0=1M, 2=500k, 3=250k, 4=125k (save & reboot)
9C 00 06 00 [VAL]0x009C node address 1–127 (save & reboot)
06 00 06 00 [VAL]0x0006 operating mode (0/1/4/5/7, save & reboot)
07 00 06 00 [VAL]0x0007 output axes (0 RFU / 4 ROS, save & reboot)
A6 00 06 00 [VAL]0x00A6 mounting code (e.g. 024 → 18 00 00 00, save & reboot)
A5 00 06 00 [VAL]0x00A5 attitude zeroing (0/1/2/3/5)
00 00 06 00 00 00 00 000x0000 save (0x01 = factory reset, 0xFF = reboot)

Example: change node address from 8 to 9.

text
→ 0x0CEF0855  9C 00 06 00 09 00 00 00    write node address 9
← 0x0CEF5508  9C 00 06 00 09 00 00 00    echo
→ 0x0CEF0855  9C 00 03 00 00 00 00 00    read back
← 0x0CEF5508  9C 00 03 00 09 00 00 00    value is 9 (takes effect after reboot)
→ 0x0CEF0855  00 00 06 00 00 00 00 00    save
→ 0x0CEF0855  00 00 06 00 FF 00 00 00    reboot (wait ~1 s)
→ 0x0CEF0955  9C 00 03 00 00 00 00 00    read back at new address 9
← 0x0CEF5509  9C 00 03 00 09 00 00 00    confirmed node address 9

CANopen (Custom Firmware) ​

CANopen uses 11-bit standard frames, shares the node ID with J1939 (default 8), uses little-endian payloads, and ships with all TPDO periods set to 0 (disabled).

TPDO mapping (scale factors differ from J1939 and Modbus — do not mix):

ChannelCOB-IDPeriod Index (Subindex 5)DLCContent & Scaling
TPDO10x180+ID0x18006Acc XYZ: i16 × 0.001 G (mG)
TPDO20x280+ID0x18016Gyro XYZ: i16 × 0.1 deg/s
TPDO30x380+ID0x18026Euler R/P/Y: i16 × 0.01 deg
TPDO40x480+ID0x18038Quaternion W/X/Y/Z: i16 × 0.0001
TPDO60x680+ID0x18044Pressure: i32, Pa
TPDO70x780+ID0x18058Inclination X/Y: i32 × 0.01 deg

SDO configuration: host sends to 0x600+ID, module replies on 0x580+ID (8 bytes: CS | Index_L | Index_H | SubIndex | Data0..3; read 0x40, 4-byte write 0x23, 2-byte write 0x2B). Manufacturer object index = 0x2000 + parameter address (same address map as J1939 configuration). Common frames (node 8, sent to 0x608):

OperationData (Hex)
Read node ID (0x209C)40 9C 20 00 00 00 00 00
Set node ID (1–127, save & reboot)23 9C 20 00 [ID] 00 00 00
Set CAN bit rate (0x209A: 0=1M / 2=500k / 3=250k / 4=125k, save & reboot)23 9A 20 00 [VAL] 00 00 00
Disable J1939 periodic broadcast (0x209D, save & reboot)23 9D 20 00 00 00 00 00
Set TPDO1 period 10 ms (0x1800:05; other channels per table above)2B 00 18 05 0A 00 00 00
Set heartbeat 100 ms (0x1017:00, 0 disables)2B 17 10 00 64 00 00 00
Save / Factory reset / Reboot (0x2000 = 00 / 01 / FF)23 00 20 00 [00|01|FF] 00 00 00

Notes:

  1. Manufacturer objects (0x2000 and above) require 4-byte writes (CS=0x23).
  2. For factory reset, write 0x2000 = 1 (do not use 0x1011); CAN bit rate and node ID revert to defaults.
  3. For reset, write 0x2000 = 0xFF or send NMT Reset Node (0x000: 81 <ID>). Do not use NMT Reset Communication — it clears active TPDO periods and heartbeat.

Last updated:

IMU · AHRS · INS · RTK Support Center