DBC Files & Signal Packing

Module 4: CAN Application & Message Design35 min

DBC Files & Signal Packing

What is a DBC File?

A DBC (Database CAN) file is the industry-standard format for describing the complete communication matrix of a CAN network. It defines every message, every signal within each message, and how raw CAN data bytes map to physical values.

DBC File Example

VERSION ""

NS_ :

BS_:

BU_: EngineECU TransmissionECU ClusterECU

BO_ 256 EngineData: 8 EngineECU

SG_ EngineRPM : 0|16@1+ (0.25,0) [0|16383.75] "rpm" ClusterECU,TransmissionECU

SG_ EngineTemp : 16|8@1+ (1,-40) [-40|215] "degC" ClusterECU

SG_ ThrottlePos : 24|8@1+ (0.392157,0) [0|100] "%" TransmissionECU

SG_ EngineRunning : 32|1@1+ (1,0) [0|1] "" ClusterECU

Decoding Signal Definitions

For SG_ EngineRPM : 0|16@1+ (0.25,0) [0|16383.75] "rpm":

PartValueMeaning
Signal nameEngineRPMHuman-readable identifier
Start bit0Bit position in data bytes
Length16Number of bits
Byte order@1@1 = Intel (little-endian), @0 = Motorola (big-endian)
Value type++ = unsigned, - = signed
Factor0.25Physical = raw × factor + offset
Offset0Physical = raw × 0.25 + 0
Min/Max0 / 16383.75Physical value range
UnitrpmEngineering unit
Conversion: If raw bytes = 0x1A2B (6699 decimal), then EngineRPM = 6699 × 0.25 = 1674.75 rpm.

Motorola vs Intel Byte Ordering

  • Intel (Little-Endian, @1): LSB at lower byte address. Native for x86/ARM processors.
  • Motorola (Big-Endian, @0): MSB at lower byte address. Used by Motorola 68k and many automotive ECUs.
Common Mistake: European OEMs predominantly use Motorola byte order. Japanese OEMs often use Intel. Always check the DBC file — never assume. Getting byte order wrong means garbage values for anything exceeding one byte.

Signal Packing Best Practices

  • Align multi-byte signals to byte boundaries when possible
  • Group related signals in the same message
  • Leave unused bits as reserved for future expansion
  • Minimize message count — fewer messages with more signals reduces overhead
  • Choose factor and offset to match required physical resolution
Exercise: Create a DBC file for a body controller with three messages: DoorStatus (ID 0x380), ClimateControl (ID 0x390), and SeatPosition (ID 0x3A0). Define all signals with appropriate factors, offsets, and value ranges.