Your chapter progress
Progress is stored on this browser when available.
The EV as a network of ECUs
ECUs share a message network
An electric car has dozens of ECUs; even an electric scooter has several. They share sensor data and commands over in-vehicle networks, mostly CAN.
| Network | Speed | Typical EV use |
|---|---|---|
| Classical CAN | Up to 1 Mbit/s (500 kbit/s common) | Powertrain, BMS, chargers, body; still the workhorse |
| CAN FD | Up to 64 data bytes; faster data phase (2โ5 Mbit/s typical) | BMS cell data, newer powertrain networks, flashing |
| CAN XL | Up to 2,048 data bytes per frame | Emerging bridge between CAN and Ethernet |
| LIN | Up to ~20 kbit/s, single wire | Low-cost sensors and actuators: switches, mirrors, HVAC flaps |
| Automotive Ethernet | 100 Mbit/s โ multi-Gbit/s | Cameras, ADAS, infotainment, central computers, OTA updates |
Classical CAN, CAN FD and CAN XL are all specified in ISO 11898-1:2024.
The VCU: the EV's main controller
VCU decision loop
The vehicle control unit turns driver inputs and the state of every subsystem into decisions: how much torque, how much regen, whether charging may start.
| VCU function | What it does |
|---|---|
| Torque management | Reads accelerator and brake pedals, gear selector and drive mode; sends a torque request to the motor controller, within BMS power limits |
| Regenerative braking | Decides how much braking comes from the motor, based on speed, battery charge-current limit and stability |
| Power-up / power-down | Sequences contactor closing, precharge and HV readiness with the BMS |
| Charging control | Coordinates the charge-port controller, on-board charger and BMS; locks out driving while charging |
| Thermal management | Requests cooling or heating for battery, motor and inverter |
| Fault handling | Collects faults from all ECUs, limits power ("limp home"), warns the driver, stores diagnostic trouble codes |
| Energy management | Estimates range, manages DC-DC and accessory loads |
In many two-wheelers there's no separate VCU: the motor controller or the instrument cluster does these jobs. In cars and commercial EVs, the VCU is a dedicated ECU, often developed to ISO 26262 and increasingly merged into zonal or central computers.
CAN bus in EVs: fundamentals
Dominant and recessive: differential signalling
- Differential pair: CAN-H and CAN-L carry opposite signals, which helps reject common-mode noise within transceiver limits. Cable routing, grounding and EMC design still matter.
- Dominant and recessive bits: a "0" is dominant (the wires are driven apart), a "1" is recessive (the wires rest at the same voltage). A dominant bit always overrides a recessive one.
- Arbitration: any node can start sending when the bus is idle. Nodes compare identifiers bit by bit as they transmit; the one with the lowest identifier wins and the others back off without the message being corrupted. Lower ID = higher priority.
- Termination: a 120 ฮฉ resistor at each end of the bus. With power off you should measure about 60 ฮฉ between CAN-H and CAN-L.
- Error handling: nodes check CRCs, bit stuffing and acknowledgements, and signal errors with error frames. Error counters move a faulty node to error-passive and eventually bus-off, but physical wiring faults or a stuck-dominant transceiver can still disrupt a network.
- Bit stuffing: after five identical bits, the transmitter inserts an opposite bit so receivers stay synchronised.
Quick bus health checkPower off: about 60 ฮฉ between CAN-H and CAN-L (two 120 ฮฉ terminators in parallel). 120 ฮฉ can suggest an absent terminator or open path; lower readings can suggest extra termination or a fault. Confirm the actual topology and OEM procedure, and measure resistance only on a safely de-energised network. Powered and idle: both lines at about 2.5 V. When active, CAN-H rises towards ~3.5 V and CAN-L falls towards ~1.5 V on dominant bits.
CAN bus in EVs: frame anatomy
Classical CAN frame field sequence
- Identifier: 11-bit (standard, 0x000โ0x7FF) or 29-bit (extended). It names the message and sets its priority.
- DLC: data length code, 0โ8 bytes for classical CAN (up to 64 for CAN FD).
- Data: the payload. Signals are packed into it bit by bit, which is why you need a DBC file to read it.
- CRC and ACK: every receiver checks the CRC and acknowledges a good frame by driving the ACK slot dominant.
A typical log line looks like 0x100 [8] E4 0D 3B FE 91 47 12 05: identifier, length, data bytes in hex. On its own it means nothing; with the DBC, it becomes pack voltage, current, SoC and more.
DBC files and byte order: Intel vs Motorola
From bytes to physical meaning
A DBC file is the dictionary of a CAN network. It's a plain-text file that lists every message and every signal inside it.
BO_ 256 BMS_PackStatus: 8 BMS SG_ PackVoltage : 0|16@1+ (0.1,0) [0|1000] "V" VCU SG_ PackCurrent : 16|16@1- (0.1,0) [-3276.8|3276.7] "A" VCU SG_ SoC : 32|8@1+ (0.5,0) [0|100] "%" VCU
| Part | Example | Meaning |
|---|---|---|
| Message | BO_ 256 BMS_PackStatus: 8 BMS | ID 256 (0x100), name, 8 bytes, sent by the BMS |
| Start bit | length | 0|16 | Signal starts at bit 0 and is 16 bits long |
| Byte order | @1 / @0 | @1 = Intel (little-endian); @0 = Motorola (big-endian) |
| Sign | + / - | Unsigned or signed (two's complement) |
| Factor, offset | (0.1,0) | Physical value = raw ร factor + offset |
| Range, unit, receivers | [0|1000] "V" VCU | Valid range, engineering unit, which ECUs use it |
| Value table | VAL_ 256 BMS_State 2 "Drive" ; | Names for enumerated values |
Motorola start bits are trickyIn a DBC, a Motorola signal's start bit is the position of its most significant bit, using the numbering where bit 7 is the top bit of byte 0 and bit 8 is the bottom bit of byte 1. Reading continues down through bit 0 of byte 0, then jumps to bit 15 of byte 1. Use the decoder below to see exactly which bits a signal uses.
Decode real-looking EV frames, switch between Intel and Motorola, and see every bit.
Open the CAN decoder โCAN Frame Decoder
Pick an example EV message (BMS, motor controller, VCU or charger), edit the data bytes, and see every signal decoded with its raw value, scaling and the exact bits it uses. Switch to "Custom signal" to test your own DBC definition. Unlock the DBC + C code pack to get the DBC text, generated C decode and encode functions, and practice frames with answers.
1. Frame
Type 1โ8 bytes separated by spaces, for example E4 0D 3B FE. Click a signal in the result to see exactly how it's decoded. Example messages are illustrative, not from a specific vehicle.
2. Decoded
โ
Bit map (byte rows, bit 7 โ 0)
๐ Get the DBC + C code pack (free)
The DBC definition for this message, ready-to-use C decode and encode functions (MCU-friendly, no libraries), a signal map, and practice frames with answers to test yourself. Copy it straight into your project.
For learning. Real vehicles use their own DBC files, which are usually confidential to the manufacturer. Decoding traffic on a vehicle you don't own or aren't authorised to work on may break laws and warranties.
Higher-layer protocols: J1939, UDS, calibration and charging
Higher-layer meaning
| Protocol | Runs on | Used for in EVs |
|---|---|---|
| SAE J1939 | CAN, 29-bit IDs | Trucks, buses and many commercial EVs, chargers and battery packs; messages identified by PGN (parameter group number) |
| UDS (ISO 14229) | CAN via ISO-TP (ISO 15765-2), or Ethernet (DoIP) | Diagnostics: reading DTCs and live data, routines, security access, ECU flashing |
| OBD (ISO 15031 / SAE J1979) | CAN | Standard emissions diagnostics on combustion vehicles; EV support varies by maker |
| XCP / CCP | CAN, CAN FD, Ethernet | Measurement and calibration while the ECU runs (tuning torque maps, regen) |
| CANopen | CAN | Some LEV motor controllers, industrial vehicles and battery systems |
| CHAdeMO, GB/T, Bharat DC-001 | CAN between vehicle and charger | DC fast charging handshake: limits, requests, status |
| DIN 70121 / ISO 15118 | Power-line communication over the charging cable | CCS DC charging; ISO 15118 adds Plug & Charge and smart charging |
Many low-voltage LEV chargers and battery packs use simple CAN protocols with 29-bit identifiers, where the BMS sends its maximum charge voltage and current and the charger replies with its output. The BMS_ChargerRequest example in the decoder follows that pattern.
Embedded software inside EV ECUs
Embedded execution pipeline
| ECU | Typical microcontrollers | Key software |
|---|---|---|
| VCU, BMS master (cars) | Infineon AURIX TC3xx, NXP S32K3, Renesas RH850 | AUTOSAR Classic, ISO 26262 safety mechanisms, UDS bootloader |
| Motor controller / inverter | TI C2000, Infineon AURIX, NXP S32K | Field-oriented control in fast interrupt loops, PWM, current sensing |
| Scooter / LEV controllers and BMS | STM32, NXP S32K1, GigaDevice and other Arm Cortex-M parts | Bare-metal or RTOS (FreeRTOS), CAN or UART comms |
| Cluster, telematics, central computers | Application processors and SoCs | Linux, Android Automotive, AUTOSAR Adaptive, OTA clients |
- Embedded C dominates ECU code; MISRA C guidelines are standard for safety-related code.
- Real-time behaviour: tasks at fixed rates (1, 10, 100 ms), with CAN messages sent and checked against timeouts.
- Model-based design: control algorithms are often built in MATLAB/Simulink and turned into C with code generators.
- Bootloaders and OTA: ECUs are reflashed over CAN (UDS) or remotely over the air, with security checks.
- Message robustness: alive counters and checksums (as in the VCU example) let receivers detect stale or corrupted data.
AUTOSAR basics for EV engineers
AUTOSAR Classic layers
AUTOSAR (AUTomotive Open System ARchitecture) is a standard software architecture, so an application written once can run on different ECUs and microcontrollers from different suppliers.
| AUTOSAR Classic | AUTOSAR Adaptive | |
|---|---|---|
| Runs on | Microcontrollers (deeply embedded ECUs) | High-performance processors (central and zonal computers) |
| OS | OSEK/AUTOSAR OS, static configuration | POSIX-based (e.g. Linux), dynamic deployment |
| Communication | Signal-based: CAN, LIN, FlexRay, Ethernet | Service-oriented: SOME/IP over Ethernet |
| EV examples | BMS, inverter, VCU, OBC | Central vehicle computer, ADAS, OTA management |
The typical AUTOSAR Classic workflow
- System descriptionDefine SWCs, their ports and the network signals; DBC or ARXML describes the communication.
- ECU extract and configurationConfigure BSW modules (CAN stack, COM, NvM, Dcm/Dem, OS tasks) in tools such as Vector DaVinci, EB tresos or ETAS ISOLAR.
- RTE generationThe tool generates the RTE that connects SWC ports to BSW services.
- Application codeWrite or generate (from Simulink) the SWC runnables; build, flash, test on HIL.
Tools, and a CAN lab you can build at home
Closed bench learning loop
| Tool | Type | Use |
|---|---|---|
| Vector CANoe / CANalyzer | Industry standard (paid) | Logging, simulation, testing, DBC-based analysis |
| PEAK PCAN-View, Kvaser CanKing | Free with their adapters | Viewing and sending frames |
| BusMaster, SavvyCAN | Open source | Logging, DBC decoding, reverse-engineering practice |
| Linux SocketCAN + can-utils | Open source | candump, cansend, scripting on a Raspberry Pi or PC |
| Python: python-can, cantools | Open source | Automated tests, DBC decoding and encoding in scripts |
A starter CAN lab
- Two microcontroller boards with CAN (for example STM32 boards with built-in CAN) plus two CAN transceiver modules
- A short twisted-pair bus with a 120 ฮฉ resistor at each end
- A USB-CAN adapter for your PC, with SavvyCAN or python-can
- Project 1: board A sends a "BMS" message every 100 ms; board B decodes it and lights an LED if voltage is low
- Project 2: write a DBC for your messages and decode the log with cantools
- Project 3: add an alive counter and checksum, and detect a missing or corrupted message
Want to practise on real EVs, not just a bench?DIYguru's COE labs include an embedded lab (Arduino, STM32 and ESP32 with the DIYguru Embedded Kit, including CAN messaging) and an on-board diagnostics lab where you read live CAN traffic and decode fault codes on production EVs. Labs run in Delhi NCR, Pune, Bangalore and Bhubaneswar. See the hands-on EV labs โ
Careers in EV embedded systems and AUTOSAR
Embedded engineering evidence
Embedded software engineer
Writes drivers, communication and application code for BMS, VCU and controller ECUs.
AUTOSAR BSW / MCAL engineer
Configures and integrates the CAN stack, diagnostics, memory and OS modules.
Application SWC developer
Builds VCU and BMS functions as AUTOSAR components, often from Simulink models.
Network / CAN integration engineer
Owns DBC/ARXML files, message timing, gateways and bus load.
Diagnostics (UDS) engineer
Defines DTCs, diagnostic services and flashing for ECUs and service tools.
Validation / HIL engineer
Tests ECUs with CANoe, HIL rigs and automated test scripts.
Who is hiring for these roles?DIYguru's hiring partners recruit for roles such as Embedded Systems Engineer, Automotive Firmware Engineer and Cluster Flashing Engineer. At the Recruitathon Pune 2026, employers such as Electra EV hired Embedded C Engineers and BMS Software Testing Engineers. See placements and hiring partners โ
Learning roadmap
- Embedded C and a microcontrollerPointers, bit manipulation, interrupts, timers, ADC and PWM on an STM32 or similar.
- CAN in practiceConfigure a CAN peripheral, send and receive frames, use filters, measure the bus.
- DBC and toolsWrite DBC files, decode logs, simulate nodes in CANoe or with python-can.
- EV domain knowledgeBMS, motor control and charging: what the signals mean and why their timing matters.
- AUTOSAR fundamentalsLayers, RTE, COM stack and the configuration workflow.
- Diagnostics and safetyUDS, ISO 26262 basics, MISRA C.
- PortfolioA small multi-node CAN project with a DBC, documented on GitHub.
Get this roadmap personalised to your branch, experience and goals. Choose "Embedded Systems" or "ADAS & Autonomous" as your interest.
Try the free EV Career Path Advisor โCAN bus in EVs: interactive battery-to-network learning lab
Use these conceptual models to connect battery measurements with the information a BMS may publish to the vehicle network. Battery physics and CAN communication are different layers: a healthy bus does not guarantee a healthy battery. They are learning aids, not pack-building instructions or approved repair procedures. Real protection thresholds and test methods depend on the manufacturer, chemistry, temperature and hardware.
11. CAN bus in EVs: series/parallel simulator
Series count determines nominal voltage. Parallel count determines capacity when identical cells share current appropriately. Nominal energy is voltage ร ampere-hours; usable energy is lower and varies with operating limits. This model does not calculate safe current, wiring, thermal design or charger compatibility.
Try doubling parallel count while keeping series count fixed. Capacity and energy double; nominal voltage stays the same. Change chemistry and observe why the same series count need not mean the same pack voltage.
12. BMS fault scenarios and evidence
This fictional 16-group NMC model demonstrates how protection can respond to different evidence. The example limits are not universal service limits. Actual systems may derate, latch a fault, require a reset or implement independent charge and discharge paths.
What the evidence says
Appropriate next step
Never use simulated values as permission to continue driving or charging a damaged battery. A missing reading is missing evidence, not a zero-volt measurement.
13. Guided diagnostic walkthroughs
Record the complaint, conditions, original codes, diagnostic evidence, repair and verification outcome. Do not clear fault history before saving it. A part replacement without a supporting test can hide an intermittent fault and add unnecessary cost.
14. Searchable CAN bus in EVs glossary
24 terms
BMS
Battery management system: monitors battery conditions and requests protection according to its configuration.
SOC
State of charge: an estimate of remaining charge, not a direct capacity measurement.
SOH
State of health: a model-dependent estimate of battery condition.
Series
Connecting cell groups in series adds voltage.
Parallel
Connecting matched cells in parallel adds charge capacity.
Voltage sag
A reduction in terminal voltage under load; resistance, temperature and SOC influence it.
Cell imbalance
A difference between cell-group readings; compare at matching conditions.
Contactor
An electrically controlled switch used to connect or disconnect a power circuit.
Precharge
A controlled process that limits inrush into capacitors before the main connection closes.
Interlock
A safety input that prevents operation in an unsafe or unready state.
DTC
Diagnostic trouble code: a manufacturer-defined clue requiring supporting evidence.
CAN
A communication network used by vehicle controllers.
Isolation
Separation from energy sources using the approved procedure, followed by required verification.
Insulation resistance
Resistance between circuits and accessible structures; a DMM continuity check does not certify it.
Ah
Ampere-hour: charge capacity.
Wh
Watt-hour: energy; nominal voltage multiplied by ampere-hours gives a nominal estimate.
Arbitration
Bitwise access resolution. Among simultaneously starting standard data frames, the lower identifier wins.
DBC
A database describing message signals, bit positions, scaling and units. It does not make unknown frames self-describing.
Endianness
How signal bits and bytes are ordered. A Motorola DBC start-bit convention needs more care than reversing bytes.
Bus-off
A CAN controller fault-confinement state following excessive transmit errors; recovery depends on configuration and system requirements.
RTE
AUTOSAR runtime environment connecting application software components and basic software services.
Watchdog
A supervision mechanism that detects missing or incorrect execution and triggers a configured response.
Timeout
A receiver rule that marks a signal stale when updates have not arrived in time.
CAN FD
A CAN variant supporting larger payloads and optional faster data-phase signalling than Classical CAN.
Further learning and primary references
Explore DIYguru training programs and training locations. Read the HSE electric and hybrid vehicle repair guidance for general workshop hazards (UK guidance, not Indian regulation), and Texas Instruments BQ76952 documentation for an example of configurable battery monitoring and protection. Always use the actual vehicleโs service documentation for repair limits.
15. CAN bus in EVs: arbitration simulator
Compare two standard 11-bit Classical CAN data-frame identifiers that start at the same time. Each transmitter observes the bus. At the first differing identifier bit, dominant zero wins over recessive one and the losing node stops transmitting. This model excludes extended identifiers, remote frames, timing, stuffing and error handling.
A safe first CAN lab
- Use an isolated low-voltage bench setup, two compatible CAN interfaces and correctly placed termination. Keep it disconnected from a road vehicle.
- Configure both nodes for the same bit rate. Start with known example frames and keep a timestamped log.
- Change one payload value, observe the received bytes and decode them against the same signal definition.
- Introduce a controlled software timeout in the simulated receiver. Check that stale data is identified instead of silently reused.
- Record assumptions, expected results and observed results. Restore the baseline after each exercise.
Do not inject experimental messages onto a live vehicle. A valid identifier and correct byte order alone do not establish that a command is safe or meaningful.
























































