CAN basics guides

Start here if CAN is new to you. These guides explain how CAN works, how to connect to a bus safely, and how to send and receive frames from Python, C++ and embedded C.

10 guides Read them in this order

  1. What Is CAN Bus? A Simple Guide for Engineers Learn what CAN bus is, how CAN messages work, why vehicles use it, and what you need to start reading CAN data. 7 min read Beginner Guide
  2. How to Use CAN Bus: A Simple Step-by-Step Guide Learn how to connect to a CAN bus, set the bitrate, record frames, send a test frame, and decode data with a DBC file. 8 min read Beginner Tutorial
  3. CAN Frame Types Explained: Data, Remote, Error, and Overload Understand CAN data, remote, error, and overload frames. Learn to identify each in CAN logs, read RTR and FD flags, and check examples with candump and Python. 22 min read Beginner Tutorial
  4. CAN FD explained: why classical CAN had to evolve CAN FD extends classical CAN without abandoning the familiar ecosystem. Learn what changed in the frame, why payload and bitrate mattered, and when CAN FD is the better choice. 10 min read Beginner Guide
  5. CAN Bus Python Example: Send and Receive Messages Use python-can with SocketCAN to send, receive, filter, and test CAN messages in a small working Python example. 8 min read Beginner Tutorial
  6. CAN Bus C++ Example: Send and Receive with SocketCAN Build a small C++ SocketCAN program that opens can0, sends a CAN frame, waits for a frame, and prints the ID and data. 9 min read Intermediate Tutorial
  7. How to Enable CAN Bus in Embedded C Code Learn the steps to initialize a CAN peripheral, configure bit timing and filters, start CAN, and send a frame from embedded C code. 9 min read Intermediate Tutorial
  8. CAN bit timing and sample point: how to calculate them How to work out the CAN prescaler, time segments, SJW and sample point for any clock and bitrate. Worked examples for 8 to 80 MHz, a Python calculator, oscillator tolerance, SocketCAN settings and CAN FD. 11 min read Intermediate Tutorial
  9. CAN bit stuffing, CRC and arbitration, bit by bit What a CAN frame looks like on the wire. Build one frame bit by bit in Python, calculate its CRC-15, insert the stuff bits, and watch three IDs arbitrate. Covers the CAN FD differences: CRC-17, CRC-21 and the stuff count. 10 min read Intermediate Tutorial
  10. CAN acceptance filters and mailboxes: how to calculate the mask How CAN ID filters work, how to calculate a filter and mask for a set of IDs, how many unwanted IDs a mask lets through, and how mailboxes and receive FIFOs lose frames. With a Python calculator, SocketCAN and candump filters. 9 min read Intermediate Tutorial

Other topics