Skip to content

Serial Binary Protocol ​

RS-232, TTL, RS-485, and USB virtual COM ports all use the same HiPNUC binary framing.

HI91 is the default frame; switch to HI83 when needed:

  • HI91: fixed 82-byte frame carrying acceleration, angular rate, magnetic field, air pressure, temperature, timestamp, Euler angles, and quaternion, in G and deg/s.
  • HI83: bitmap-configurable variable-length frame that trims unused fields to save bandwidth and adds microsecond timestamps, UTC, inclination, and MRU fields, in m/s² and rad/s (matching ROS sensor_msgs/Imu).

Frame Format & CRC ​

HiPNUC binary frame layout
FieldValue / RangeBytesDescription
SOF5A A52Start-of-frame sync bytes
LEN1–5122Payload byte count (little-endian), excluding SOF, LEN, and CRC
CRC—216-bit checksum (little-endian)
Payload—1–512Byte 0 is the frame tag (0x91 = HI91, 0x83 = HI83)

All multi-byte values are little-endian and floats are IEEE-754 single-precision (float). Maximum frame size is 518 bytes. Skip unknown tag values using LEN.

CRC uses CRC-16/XMODEM (polynomial 0x1021, initial value 0x0000 — not CCITT-FALSE with 0xFFFF), computed over SOF, LEN, and Payload (excluding the CRC field itself). Self-check: ASCII "123456789" yields 0x31C3.

HI91 Floating-Point Frame ​

Fixed 76-byte payload, 82 bytes total. All values are factory-calibrated and output in the active output coordinate frame.

OffsetFieldTypeBytesUnitDescription
0tagu81—Fixed 0x91
1main_statusu162—Main status word; see "MAIN_STATUS Status Word" below
3temperaturei81°CModule average temperature (integer)
4air_pressurefloat4PaBarometric pressure
8system_timeu324msMilliseconds since boot (wraps every 24 h) when unsynced; UTC ms of day when synced
12acc_bfloat×312G3-axis acceleration XYZ (1 G = 9.8 m/s²)
24gyr_bfloat×312deg/s3-axis angular rate XYZ
36mag_bfloat×312μT3-axis magnetic field XYZ
48rollfloat4degRoll angle, ±180°
52pitchfloat4degPitch angle, ±90°
56yawfloat4degYaw angle, ±180° (counter-clockwise positive from above)
60quatfloat×416—Quaternion in W, X, Y, Z order

HI91 Test Vector ​

Captured 82-byte HI91 frame under the default axes (COORD 0) for verifying custom decoders and CRC:

text
5A A5 4C 00 18 4A 91 08 14 23 09 A2 C4 47 08 15 1C 00 CC E8 61 BE 9A 35 56 3E 65 EA 72 3F 31 D0 7C BD 75 DD C5 BB 6B D7 24 BC 89 88 FC 40 01 00 6A 41 AB 2A 70 C2 96 D4 50 41 ED 03 43 41 41 F4 F4 C2 CC CA F8 BE 73 6A 19 BE F0 00 1C 3D 8D 37 5C 3F
FieldRaw Bytes (Hex)Decoded ValueUnit
SOF / LEN / CRC5A A5 / 4C 00 / 18 4ALEN = 76, CRC = 0x4A18—
tag / main_status91 / 08 140x91 / 0x1408 (WB_CONV, MAG_AIDING, SOUT_PULSE set)—
temperature / air_pressure23 / 09 A2 C4 4735 / 100676°C / Pa
system_time08 15 1C 001840392ms
acc_b (X / Y / Z)CC E8 61 BE / 9A 35 56 3E / 65 EA 72 3F−0.2206 / 0.2092 / 0.9489 (norm ≈ 0.996 G)G
gyr_b (X / Y / Z)31 D0 7C BD / 75 DD C5 BB / 6B D7 24 BC−0.0617 / −0.0060 / −0.0101deg/s
mag_b (X / Y / Z)89 88 FC 40 / 01 00 6A 41 / AB 2A 70 C27.892 / 14.625 / −60.042μT
roll / pitch / yaw96 D4 50 41 / ED 03 43 41 / 41 F4 F4 C213.052 / 12.188 / −122.477deg
quat (W / X / Y / Z)CC CA F8 BE / 73 6A 19 BE / F0 00 1C 3D / 8D 37 5C 3F−0.4859 / −0.1498 / 0.0381 / 0.8602—

HI83 Variable-Length Frame ​

An HI83 payload starts with an 8-byte fixed header, followed immediately by the selected segments packed from LSB to MSB of data_bitmap (unselected bits occupy zero bytes):

OffsetFieldTypeBytesDescription
0tagu81Fixed 0x83
1main_statusu162Main status word
3ins_statusu81INS status (ignore on IMU / AHRS)
4data_bitmapu324Bitmask of segments present in this frame
8Segments—VariablePacked in data_bitmap bit0 → bit11 order

Public data_bitmap Bits ​

Public bits are bit0–11 (mask 0x00000FFF). Set only public bits when configuring. Always advance offsets dynamically from each frame's data_bitmap rather than hardcoding frame size; drop the frame if an undefined bit is set or the accumulated length exceeds LEN.

BitNameTypeBytesUnitDescription
0acc_bfloat×312m/s²3-axis acceleration XYZ (differs from HI91 unit)
1gyr_bfloat×312rad/s3-axis angular rate XYZ (differs from HI91 unit)
2mag_bfloat×312μT3-axis magnetic field XYZ
3rpyfloat×312degEuler angles roll / pitch / yaw (yaw ±180°)
4quatfloat×416—Quaternion W, X, Y, Z (reorder to X, Y, Z, W for ROS)
5system_time_usu648μsMonotonic microseconds since boot, unaffected by UTC sync
6utcpacked8—year-2000(u8), month(u8), day(u8), hour(u8), min(u8), sec*1000+ms(u16), reserved(u8); valid only when UTC_UNSYNC=0
7air_pressurefloat4PaBarometric pressure
8temperaturefloat4°CModule average temperature (float, finer than HI91 integer)
9inclinationfloat×312degX inclination (roll ±180°, 0–360° on single-axis models), Y inclination (pitch ±90°), raw yaw (±180°); inclination is always computed in Right-Front-Up
10heave_surge_swayfloat×312mMRU 3-axis periodic displacement: heave / surge / sway (MRU models only)
11heave_surge_sway_frqfloat×312HzMRU 3-axis dominant frequency: heave / surge / sway (MRU models only)

MRU displacement tracks periodic wave motion (typical 3–20 s period) and requires 5–20 steady cycles to initialize. It does not apply to one-way translation, step displacements, or ultra-low-frequency motion above 30 s period.

Total frame size = 6 (SOF/LEN/CRC) + 8 (fixed header) + sum of selected segments (138 bytes with all bit0–11 enabled). Example layout for data_bitmap = 0x0000003B (74 bytes total):

HI83 payload layout for data_bitmap 0x0000003B

Decoding Flow & Official SDK ​

HI91 and HI83 share a single streaming state machine: scan the byte stream for 5A A5, verify LEN is within 1–512, collect 6 + LEN bytes, and check CRC-16/XMODEM. If valid, decode by tag (0x91 / 0x83) and consume the whole frame; if LEN is out of range or CRC fails, discard only 1 byte and resume scanning for the next header.

Official C99 parser source: c/hipnuc/hipnuc_decoder.c (STM32F407, Linux, Python, and ROS drivers are in the same hipnuc/products repository). In custom parsers, copy floats and multi-byte fields by offset with memcpy to avoid unaligned memory faults on MCUs.

MAIN_STATUS Status Word ​

MAIN_STATUS is a 16-bit status word present in HI91, HI83, CANFD83, and Modbus 0x0009. Bits are independent; a non-zero value is not a fault. Mask with 0x1EF8 before testing status flags to strip the bit0–2 coordinate code and reserved bits.

MAIN_STATUS 16-bit layout
BitNameMeaning When = 1Action
0–2COORDOutput coordinate frame reference (0 = RFU, 4 = ROS)Verify active axes via LOG USRCONFIG
3WB_CONVGyro bias not convergedHold stationary 3–5 s until cleared
4MAG_DIST9-axis magnetic disturbance or unverified since boot (always 0 in 6-axis)Move away from iron/motors and rotate; recalibrate if persistent
5ACC_SATAccelerometer saturated now or within the last 2 sDo not trust acceleration or attitude during this interval
6GYR_SATGyroscope saturated now or within the last 2 sDo not trust angular rate or heading during this interval
7ATT_CONVRoll/pitch not converged (excludes yaw)Stay still after power-up until cleared
8Reserved—Mask off
9STATICModule is stationaryInformational
10MAG_AIDINGMagnetometer aiding active (9-axis mode)Informational; still check MAG_DIST for heading trust
11UTC_UNSYNCUTC not synchronizedutc and HI91 system_time are valid UTC only when cleared
12SOUT_PULSEThis serial frame corresponds to an SOUT pulseHI91/HI83 only; always 0 in Modbus/CANFD83/I2C
13–15Reserved—Mask off

Timestamps & Dropped-Frame Detection ​

FieldLocationMeaning
system_time_usHI83 (bit5) / CANFD83Monotonic microseconds since boot; unaffected by UTC sync; best for relative timing and drop detection
system_timeHI91Milliseconds since boot (0–86,399,999 wrap) when UTC_UNSYNC=1; UTC+0 ms of day (no date or timezone) when UTC_UNSYNC=0
utcHI83 (bit6) / CANFD83Valid only when UTC_UNSYNC=0; see PPS Time Sync

Frames do not carry a sequence counter. In periodic mode (ONTIME), detect drops from consecutive timestamp deltas: at 10 ms (100 Hz), a 20 ms gap means 1 dropped frame and 30 ms means 2 dropped frames. Use system_time_us / 1000 on HI83; on HI91 handle 24-hour wrap with (t2 - t1 + 86400000) % 86400000 (UTC-synced HI91 deltas have small jitter, so round to the nearest multiple of the period). Reset your baseline after boot, period changes, or UTC_UNSYNC transitions.

Baud Rate & Frame Rate Limits ​

Output periods use integer milliseconds, so serial rates are 1000 / N Hz (e.g. 500 Hz = 2 ms, 200 Hz = 5 ms; exact 400 Hz is not possible). The table shows recommended / maximum frame rates (Hz) for 8N1, with 20% headroom on recommended values:

Frame TypeBytes9600115200230400460800921600
HI91829.35 / 11.6111 / 125200 / 250333 / 500500 / 1000
HI83 (bit0–7)987.81 / 9.7190.9 / 111167 / 200333 / 333500 / 500
HI83 (bit0–11)1385.56 / 6.9466.7 / 83.3125 / 167250 / 333500 / 500

When multiple periodic frames are enabled on the same port, sum their byte rates. To change baud rate or period, see ASCII Commands.

WARNING

An OK response does not guarantee the serial link has enough bandwidth. Exceeding the limits above causes the module to drop whole frames, visible as lower frame rate or multiple-period timestamp jumps. Raise the baud rate before raising the frame rate.

Last updated:

IMU · AHRS · INS · RTK Support Center