Skip to content
Back to skills

Can Protocol Fundamentals

ASecurity

Reference for CAN 2.0 and CAN FD at the frame, bit and error-handling level - frame formats, DLC mapping, arbitration, bit timing, CRC and stuffing, error states, timestamps and direction. Use when designing frame handling, decode, adapters, bit-rate settings or validating CAN data.

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 5, 2026
development

Security analysis

A100/100

Scanned December 5, 2026

npx -y skills add afri-bit/candb-studio --skill can-protocol-fundamentals --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Can Protocol Fundamentals?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Can Protocol Fundamentals
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/afri-bit-can-protocol-fundamentals/badge)](https://www.skillsdirectory.com/skills/afri-bit-can-protocol-fundamentals)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: can-protocol-fundamentals
description: Reference for CAN 2.0 and CAN FD at the frame, bit and error-handling level - frame formats, DLC mapping, arbitration, bit timing, CRC and stuffing, error states, timestamps and direction. Use when designing frame handling, decode, adapters, bit-rate settings or validating CAN data.
---

# CAN and CAN FD fundamentals (ISO 11898-1)

## Frames
| Aspect | Classic CAN | CAN FD |
|--------|-------------|--------|
| ID | 11-bit (base) or 29-bit (extended, IDE=1) | same |
| Payload | DLC 0-8 -> 0-8 bytes | DLC 0-8 -> 0-8; 9..15 -> 12, 16, 20, 24, 32, 48, 64 bytes |
| Remote frame | RTR bit; no data | **not supported** (RRS bit instead) |
| Flags | RTR, IDE | FDF/EDL=1, **BRS** (faster data phase), **ESI** (transmitter error-passive) |
| CRC | CRC-15 | CRC-17 (<=16 data bytes), CRC-21 (>16); stuff-bit counter in CRC field |
| Max bit rate | 1 Mbit/s | arbitration up to 1 Mbit/s; data phase typically up to 5-8 Mbit/s |

Rules: DLC > 8 on classic CAN means 8 bytes. In FD, payload length must be one of the valid sizes; a 9-byte "FD frame" is invalid - pad to 12. Identifier priority: **lower numeric ID wins arbitration** (dominant 0 beats recessive 1); 11-bit base IDs beat extended frames with the same base because of the IDE/SRR ordering. Treat `(id, extended)` as the frame key - 0x123 standard and 0x123 extended are different frames.

## Bit timing
Nominal bit = Sync + Prop + Phase1 + Phase2 time quanta; sample point typically 75-87.5 %; SJW resynchronises. FD has separate **nominal** and **data** bit timing. Mismatched data-phase settings produce error frames, not garbage - treat them as errors.

## Error handling
Error-active -> error-passive (TEC or REC > 127) -> **bus-off** (TEC > 255). Error frames (6 dominant bits + delimiter) and overload frames exist on the wire; most adapters surface them as special events. Surface them; never decode them as data.

## Timestamps and direction
Frame timestamps come from **hardware** (adapter clock, best), **driver** or **host** (worst, jitter in ms). Record the source. Tx echo (loopback confirmation) is distinct from Rx; do not double-count. Multiple channels need a channel id per frame; do not mix clock domains without conversion.

## Implementation checklist
- Validate DLC/length consistency for classic vs FD before decode.
- Keep `fd`, `brs`, `esi`, `extended`, `rtr`, `dir`, `channel` on every frame; never infer FD from length alone.
- Test boundaries: DLC 0, 8, 9->12, 15->64; ID 0x7FF and 0x1FFFFFFF; zero-length FD.
- Bus load estimate: bits per frame (incl. stuffing) x frames/s / bit rate; useful for monitor stats.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.