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":
| Part | Value | Meaning |
|---|---|---|
| Signal name | EngineRPM | Human-readable identifier |
| Start bit | 0 | Bit position in data bytes |
| Length | 16 | Number of bits |
| Byte order | @1 | @1 = Intel (little-endian), @0 = Motorola (big-endian) |
| Value type | + | + = unsigned, - = signed |
| Factor | 0.25 | Physical = raw × factor + offset |
| Offset | 0 | Physical = raw × 0.25 + 0 |
| Min/Max | 0 / 16383.75 | Physical value range |
| Unit | rpm | Engineering unit |
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.