DBC Overview

A DBC file is a CAN database of decoded CANBus signals. This way you can see CANBus data in a more readable format. For example, if you know your steering wheel volume up button has the data C8 C0 a DBC file can translate that to Volume Up.

SavvyCAN DBC Structure

SavvyCAN’s DBC structure can be broken down into three main pieces, nodes, messages, and signals.

  • Node: A node can be thought of as a car module, for example, BMW’s SZL module is the Steering column control unit.
  • Message: A message can be thought of as the ID sending or receiving the packets. For example, the steering wheel buttons on my BMW fall under the ID 0x1D6 which itself falls under the control module SZL. Starting to make a little more sense?
  • Signal: A signal is the final piece, it can be thought of as the actual data. For example, volume up is C8 C0.

Now that we understand how a DBC file is structured in SavvyCAN we can start adding our decoded signals.

Creating a DBC File

To create a DBC file in SavvyCAN first click “File” -> “DBC File Manager”. This is where you will load and save your .dbc files. Click “Create new DBC” this will create a new DBC named “UNNAMEDFILE”. Now click save, this will bring up the file manager where you can choose where to save your new DBC file, and also give it a name. For this tutorial, I have created a DBC file called demo.dbc.

Editing a DBC File

To start editing, double-click your file in the DBC File Manager window. A new window will open called “DBC Editing Window”. You will also see there is a default node in there called “Vector__XXX – Default node if none specified”. Creating nodes is optional, if you prefer you can put all your messages under this default node. Although personally, I like to keep things as organized as possible, especially when dealing with 100s of messages.

Creating a Node

If you chose to create a node, click the “New Node” button. This will create a new node with a random name like “Unnamed9933”. To edit the name simply double-click it, you can also edit the default Vector__XXX node. You can also leave a comment, for this tutorial I created a node called SZL with the comment “Steering column control unit”. That way I can quickly look at it and know what the module abbreviation is and what it’s for.

Creating a Message

Now that we have created our node, we can add messages to it. To add a message simply click the node you wish to add it to and click “New Message”. This creates a blank message which will have a name like “0x000 SZLMsg278”. To edit the message double-click it. Now you will get a window that a bit more advanced looking. Here is where we can start adding some data. First is the frame ID, this is the CAN ID you identified in your decoded message. In my case that is 0x1D6. Next is the message name, this is just a name you would like to give it. In my case I chose SteeringButtons. The final thing you want to add is the Frame Length. This is how many bytes your data take up, for my message (C8 C0) that is 2. You can also choose to set the text and background colors to make it easier to see in your capture window. Below is a screenshot of what my new message looks like.

Creating a Signal

Now we can start creating a signal that can identify what is happening in human-readable form. First click the message you created, then “New Signal”. This will create a blank signal with a name like “SteeringButtonsSig352”. To edit the signal double click. Now the signal editor window may look daunting but there is a way to decode what information it’s asking for.

Let’s start simple, the first box is “Name” this is where you name your signal, for example, “Volume_UP”. Next is “Bit Length” this is where you tell it how many bits are going to change. For my example, I know that it is only 1 bit (On or Off). The rest of the boxes underneath get a bit more complicated so to keep this guide short and simple I will link it here. https://www.savvycan.com/docs/signaleditor.html

Start Bit Grid

Now we can move on to the scary-looking “Start Bit” grid. What this grid is basically asking for is what binary bit is going to flip when I push the volume up button. For my example, I know that C8 C0 is the signal for when I push the button. But it’s important to know what that value is when it’s not pushed so we can see which bit changes. For me, I know that when nothing is pushed, CAN sends out a C0 00 signal. Now we just have to convert that hex code to binary, there’s a great calculator HERE. We know Byte 0 (C8 for on, C0 for off) is the first one to change we will plug that into the calculator. In the table below we can see our binary values and the bit order.

ByteBit Order (b7 b6 b5 b4 b3 b2 b1 b0)
C81100 1000
C01100 0000

Now looking at our bit order we can see it counts down not up. Comparing our on and off bytes we can see bit 3 (b3) is the first bit to flip to 1. This is our start bit! Now that we have our start bit we just simply click it in the grid. On the left, you can see the Bytes, and along the top are our Bits. We know that C8 is byte 0 in our signal so that’s the row we want to be in. We also know that bit 3 is our start bit so we just click 3. Below you can see an image of our newly created signal. The boxes filled in with grey lines mean we already used that bit in another signal. For me, that’s the rest of the buttons on my steering wheel.

Conclusion

I hope this guide has made it a little easier for you to understand how signals work in SavvyCAN. I know for me at first it was a bit difficult to understand what was happening. In this guide, I only covered how to create a signal with a bit length of 1 for a switch. Meaning it can only be on or off. But what if you want to read more complex data like RPMs or speed? I will try to cover this in another post when I get a little more free time, when I do I will link it here!

If you have anything you would like to contribute, or any questions feel free to leave a comment here or join the discord HERE! YouTube video version coming soon!

Comments are closed