Architectural Challenge
High-throughput automotive networks require migrating from Classical CAN (1 Mbps max) to CAN-FD (up to 5-8 Mbps in data phase). Achieving bit-timing margins without frame errors requires precise register configuration.
1. Nominal vs Data Phase Timing Segments
- Nominal Bit Rate (Arbitration): Typically 500 kbps across network nodes.
- Data Bit Rate (Payload): 2 Mbps or 5 Mbps with Transceiver Delay Compensation (TDC).
#include "stm32g4xx_hal.h"
void MX_FDCAN1_Init(FDCAN_HandleTypeDef *hfdcan) {
hfdcan->Instance = FDCAN1;
hfdcan->Init.FrameFormat = FDCAN_FRAME_FD_BRS;
hfdcan->Init.Mode = FDCAN_MODE_NORMAL;
hfdcan->Init.AutoRetransmission = ENABLE;
hfdcan->Init.TransmitPause = ENABLE;
// Nominal Bit Timing (500 kbps, 80% sample point at 80 MHz clock)
hfdcan->Init.NominalPrescaler = 1;
hfdcan->Init.NominalSyncJumpWidth = 16;
hfdcan->Init.NominalTimeSeg1 = 127;
hfdcan->Init.NominalTimeSeg2 = 32;
// Data Bit Timing (2 Mbps, 75% sample point)
hfdcan->Init.DataPrescaler = 1;
hfdcan->Init.DataSyncJumpWidth = 4;
hfdcan->Init.DataTimeSeg1 = 29;
hfdcan->Init.DataTimeSeg2 = 10;
HAL_FDCAN_Init(hfdcan);
}2. Physical Layer Integrity & Termination
- Split Termination: Use two 60Ω resistors with a 4.7nF capacitor to ground for common-mode filtering.
- Common Mode Choke: Place a CAN-FD rated choke (e.g. TDK ACT1210R) within 15mm of the connector.
- ESD Protection: Dual bidirectional TVS diode array (PESD2CANFD) rated for 30kV contact discharge.
3. Firmware Queue & Task Priority Architecture
- Isolate the FDCAN RX interrupt to a dedicated high-priority FreeRTOS task using direct-to-task notifications.
- Ensure ring buffers are sized to prevent overrun during burst message traffic.
Designing a Custom Microcontroller or IoT Board?
Embedded India provides schematic design, impedance-controlled layouts, and HIL verification test benches.
Related Engineering Articles
High-Density Interconnect HDI Microvias Differential Pair Skew Matching in 8-Layer PCBs
Practical engineering blueprint and implementation guide for High-Density Interconnect HDI Microvias Differential Pair Skew Matching in 8-Layer PCBs. Includes schematics, layer stackups, and C firmware.
Embedded ElectronicsOptimizing Ultra-Low Power Sleep Modes on ESP32-S3 IoT Endpoints
Practical engineering blueprint and implementation guide for Optimizing Ultra-Low Power Sleep Modes on ESP32-S3 IoT Endpoints. Includes schematics, layer stackups, and C firmware.
Embedded ElectronicsHardware Design Strategies for Minimizing EMI and ESD on Industrial CAN-FD Nodes
Practical engineering blueprint and implementation guide for Hardware Design Strategies for Minimizing EMI and ESD on Industrial CAN-FD Nodes. Includes schematics, layer stackups, and C firmware.
Ready to engineer your next embedded system?
Speak directly with an Embedded India systems architect to evaluate your technical requirements and timeline.