GUIDE #04 — PART 2 · Logic Analyzer · Signal Analysis

CAN Bus
Signal Behaviour

Probe connection points, captured signals and the physical meaning of each channel — from circuit layer to CAN frame structure.

6 ChannelsLogic Analyzer
500 kbpsCAN Speed
SaleaeDevice
4 MHzSample Rate

Probe Connection Points

Logic analyzer probes were connected to 6 measurement points. Each probe corresponds to a wire colour — this colour coding simplifies signal interpretation.

Probe connection points on the circuit
D0 · CH1 · Brown
CAN_H
CAN Bus line — between the two transceivers
Analogue differential · 2.5V–3.5V · Rises on dominant
D1 · CH2 · Red
CAN_L
CAN Bus line — between the two transceivers
Analogue differential · 1.5V–2.5V · Falls on dominant
D2 · CH3 · Orange
ESP32 TX
GPIO17 — TWAI driver TX output
Digital · 0V / 3.3V · Signal visible
D3 · CH4 · Yellow
ESP32 RX
GPIO16 — TWAI driver RX input
Digital · 0V / 3.3V · Signal visible
D4 · CH5 · Green
BBB TX
P9.20 — SocketCAN TX output
Digital · Active only during ACK bit
D5 · CH6 · Blue
BBB RX
P9.19 — SocketCAN RX input
Digital · 0V / 3.3V · Signal visible
ℹ GND connection The logic analyzer GND wire (black) is connected to BBB pin P9_1. Without a common reference point, digital signals cannot be measured accurately.

Differential Signal & Digital Conversion

CAN bus bridges two different signal worlds: the digital signals (0V / 3.3V) that microcontrollers speak, and the differential signals (CAN_H and CAN_L) carried on the physical wire. The transceiver is the bridge between these two worlds.

TX DIRECTION

Digital → Differential

When ESP32 GPIO17 sends a dominant bit (0), the SN65HVD230 pushes both lines in opposite directions simultaneously:

LineRecessive (1)Dominant (0)Direction
CAN_H~2.5V~3.5V↑ rises by ~1V
CAN_L~2.5V~1.5V↓ falls by ~1V
CAN_H − CAN_L~0V~2V→ differential grows to ~2V

In the recessive state both lines sit at ~2.5V — the difference is near zero. In the dominant state CAN_H rises and CAN_L falls; the ~2V gap between them carries the signal. Because noise affects both lines equally, it cancels out in the differential — this is what makes CAN bus highly noise-resistant.

RX DIRECTION

Differential → Digital

The receiving transceiver measures the CAN_H − CAN_L difference. If the difference exceeds 0.5V → dominant (0); below that threshold → recessive (1). This digital output is then delivered to ESP32 GPIO16 and BBB P9.19.

⚠ Why D0 (CAN_H) cannot be reliably decoded by a logic analyzer A logic analyzer reads signals against a digital threshold — typically ~1.65V on a 3.3V system. CAN_H sits at ~2.5V (recessive) and ~3.5V (dominant). Both values remain above the threshold, so the logic analyzer sees CAN_H as permanently HIGH and cannot detect bit transitions. CAN_L, by contrast, drops to ~1.5V during dominant bits — clearly crossing the threshold — which is why the CAN decoder is assigned to D1.
CONCLUSION

Optimal Signal Detection Point

Comparing all available measurement points for digital decoding:

ChannelRecessiveDominantCrosses threshold?Result
D0 — CAN_H~2.5V~3.5V✗ always aboveNot readable
D1 — CAN_L~2.5V~1.5V✓ clearly crossesBest choice ✓
D2 — ESP32 TX3.3V0V✓ full swingReadable ✓
D3 — ESP32 RX3.3V0V✓ full swingReadable ✓
D4 — BBB TX3.3V0V (ACK only)✓ ACK pulse onlyPartial
D5 — BBB RX3.3V0V✓ full swingReadable ✓

D1 (CAN_L) is the correct detection point for CAN bus decoding with a single-ended logic analyzer. It is the only differential line whose voltage swing reliably crosses the digital threshold in both directions. For true differential measurement of CAN_H, a differential probe and oscilloscope are required.

Signal Propagation — Step by Step

The logic analyzer capture below shows the moment ESP32 transmits a single CAN frame. The progression of the signal across each channel is examined step by step.

Logic analyzer capture — all channels
STEP 1

ESP32 TX — First bit is placed on the line

When 1 is typed in the Serial Monitor, the ESP32 TWAI driver constructs the frame and begins transmitting it bit by bit from GPIO17. Each bit is held at a fixed voltage for approximately 2 µs (500 kbps → 1 bit = 1/500,000 s = 2 µs). This bit pattern is clearly visible on channel D2.

STEP 2

Transceiver — Digital signal converts to CAN_H / CAN_L

Each bit leaving ESP32 GPIO17 is converted to a differential signal by the SN65HVD230 transceiver. When a dominant bit (0) is transmitted CAN_H rises to ~3.5V and CAN_L falls to ~1.5V. These voltage transitions are observed on channels D0 and D1 — starting simultaneously with D2, with only nanosecond-level propagation delay.

STEP 3

D1, D3, D5 — All receive the same signal simultaneously

The CAN_L line is physically connected to all nodes. Since both ESP32 RX (D3) and BBB RX (D5) are listening on the same wire, the moment the first bit is placed on the line, D1, D3 and D5 show identical waveforms simultaneously. Propagation delay due to cable length is negligible at this scale.

STEP 4

D4 (BBB TX) — Stays silent throughout the frame

BBB is in receiver mode for this frame. Throughout transmission, BBB's TX pin (P9.20 → D4) sends nothing; the line remains silent. Channel D4 reads as a steady HIGH during this period.

STEP 5

ACK slot — BBB pulls dominant, D4 becomes active

Once all frame bits have been transmitted, the CRC field and CRC delimiter follow. Then the ACK slot opens: the transmitter (ESP32) leaves this bit recessive (1). If BBB received the frame without errors, it pulls the line dominant (0) to acknowledge. At exactly this moment a short pulse appears on D4 — this is the ACK bit. ACK DEL and the 7-bit EOF follow; the frame is complete.

✓ Observed sequence D2 active → D0/D1/D3/D5 follow simultaneously → D4 delivers ACK pulse at frame end. This sequence is the expected behaviour of the CAN bus protocol.

CAN Frame Structure — Bit by Bit

Frame decoded from the logic analyzer capture: ID=0x123 · DLC=1 · DATA=0x01 (LED ON) and CRC-15=0x25FE.

FieldValueBitsDescription
SOF01Start of Frame — dominant bit, all nodes synchronise
Identifier0x123 (291)1100100100011 — standard 11-bit ID, used for bus arbitration
RTR01Remote Transmission Request — 0 = data frame, 1 = remote request
IDE01Identifier Extension — 0 = standard (CAN 2.0A), 1 = extended
r001Reserved bit — always 0
DLC00014Data Length Code — indicates 1 byte of data
Stuff bits+NInserted automatically after 5 consecutive identical bits (see S5)
Data[0]0x01800000001 — LED ON command
CRC-150x25FE15Error check sequence — receiver independently calculates and compares this value
CRC DEL11CRC delimiter — recessive
ACK01BBB acknowledged by pulling dominant — this is the ACK pulse seen on D4
ACK DEL11ACK delimiter — recessive
EOF11111117End of Frame — 7 recessive bits marking frame completion
IFS1113Intermission — minimum gap between frames

Bit Stream — Identifier + Control Fields

0
SOF
0
ID10
0
ID9
1
ID8
0
ID7
0
ID6
S
stuff
1
ID5
0
ID4
0
ID3
0
ID2
S
stuff
1
ID1
1
ID0
0
RTR
0
IDE
0
r0
0
DLC3
0
DLC2
0
DLC1
1
DLC0

Stuff Bits — Bit Synchronisation Mechanism

CAN does not use a dedicated clock line. Every node runs on its own clock. In long monotone bit sequences (many consecutive 0s or 1s) the receiver can lose track of bit boundaries. Stuff bits solve this problem.

RULE

5 Consecutive Identical Bits → Opposite Stuff Bit Inserted

Original data: 0 0 0 0 0 1 0 1 After stuffing: 0 0 0 0 0 [1] 1 0 1 ↑ stuff bit (automatically inserted) Original data: 1 1 1 1 1 0 1 0 After stuffing: 1 1 1 1 1 [0] 0 1 0 ↑ stuff bit (automatically inserted)

The receiver removes stuff bits automatically — data integrity is preserved. In the logic analyzer, stuff bits appear highlighted in a distinct colour in the bit stream view.

ℹ Stuff bits are not errors The bit pattern of ID 0x123 (00100100011) naturally produces multiple stuff bits. In this frame, stuff bits were observed at the DLC→Data transition and within the CRC field. The system is operating correctly.

Error Analysis

CRC-15

Why is the CRC value 0x25FE?

CRC-15 is computed by XOR-ing all bits in the frame (from SOF to the end of the data field, including stuff bits) against the 0x4599 polynomial defined by the CAN standard. Every unique frame content produces a unique CRC.

Two different commands were observed in this capture:

CommandDataCRC-15
LED ON0x010x25FE
LED OFF0x000x6067

When the data byte changes by a single bit (0x01 → 0x00) the CRC produces a completely different value. This demonstrates the sensitivity of CRC-15 — even a single-bit error yields a different result, which the receiver will detect.

MechanismStatusObservation
Bit stuffing ACTIVE Stuff bits inserted at DLC→Data transition and within CRC field — synchronisation maintained
CRC-15 check PASSED ✓ 0x25FE (LED ON) / 0x6067 (LED OFF) — receiver independently computed and verified
ACK acknowledgement RECEIVED ✓ D4 (BBB TX) produced a dominant pulse at frame end — every frame acknowledged
Form check PASSED ✓ CRC DEL, ACK DEL, EOF recessive in all frames — no format errors
Bit monitoring PASSED ✓ ESP32 read back each transmitted bit — no errors detected
D4 decoder warning EXPECTED "Identifier bits 10..4 must not be all recessive" — D4 carries only the ACK bit, not a full frame
Bus state ERROR-ACTIVE ✓ Both node error counters at zero — bus healthy

What We Observed in This Section

  • 6 probe points established — CAN_H/L, ESP32 TX/RX, BBB TX/RX
  • D1 (CAN_L) selected for decoding — drops below threshold on dominant bits, clean decode
  • D0 (CAN_H) cannot be reliably decoded by a logic analyzer — remains above threshold in both states
  • D1 ≈ D3 ≈ D5 observed — same physical line, different measurement points
  • D4 (BBB TX) active only during the ACK bit — dominant bit principle observed
  • Frame decode confirmed: ID=0x123, DLC=1, DATA=0x01, CRC=0x25FE
  • Stuff bits observed — bit synchronisation mechanism active
  • CRC-15 value is unique to frame content — a single-bit change produces a different CRC
  • All CAN error mechanisms passed — system healthy
  • Fast Bitrate must be set to 500,000 bps in all decoders (the default 2,000,000 is for CAN FD)
  • The D4 decoder warning is expected — it will disappear once BBB transmits full frames