Home / Wiki / Software / Nissan Leaf EV-CAN
Software · canonical reference

Nissan Leaf EV-CAN

The EV-CAN network is the main CAN bus used by the donor Nissan Leaf components. In the Aphid it is CAN1, the OEM powertrain bus that the DIY VCM uses to talk to the traction inverter and the Mitsubishi OBC/DC-DC. The DIY ECUs use a second bus, CAN2.

Vehicle buses

The VCM provides two independent CAN interfaces:

  • CAN1 - OEM powertrain: connects the VCM, Nissan Leaf inverter, and Mitsubishi OBC/DC-DC. The secondary safety processor monitors this bus, including outgoing torque requests.
  • CAN2 - DIY vehicle systems: connects the VCM to the front and rear BMS controllers. Future DIY nodes, such as a driver display, may also use this bus.

Both buses use twisted pairs. CAN1 runs VCM to OBC/DC-DC to inverter and is terminated with 120 ohm resistors at the VCM and inverter; the OBC/DC-DC is an unterminated intermediate node. CAN2 runs front BMS to rear BMS to VCM and is terminated at the front BMS and VCM. Bus bit rates remain to be documented.

Wiring

CAN bus Front Battery CAN H bms_signals:4 CAN L bms_signals:5 Rear Battery CAN H bms_signals:4 CAN L bms_signals:5 VCM CAN2 H can2:1 CAN2 L can2:2 CAN1 H can1:1 CAN1 L can1:2 OBC/DC-DC CAN H sig:6 CAN L sig:13 Inverter CAN H control:14 CAN L control:15 WH/BU WH/BU WH/RD WH/RD WH/BU WH/BU WH/RD WH/RD 120 Ω termination 120 Ω termination 120 Ω termination
CAN buses

The harness drawing of the CAN cables is on the Rear loom page.

Electrical

As any CAN bus, the EV-CAN network uses a twisted pair for differential signalling to improve noise immunity.

Signalling

In the Leaf, EV-CAN uses ISO 11898-1 with 11-bit identifiers and a 500 kbit/s baud rate.

Topology

A well-functioning CAN bus should have a linear topology with short stubs sticking out and a 120 Ω termination at each end. The order and terminations of CAN1 and CAN2 in the Aphid are listed under vehicle-buses.

Data integrity

Some critical frames are protected with both sequence counters and a CRC checksum (in addition to the CRC built into the CAN frames themselves).

Sequence counter

The sequence counter just counts up from 0 → 3 continuously.

CRC checksum

There is a specific Nissan CRC calculation of the first 7 bytes of the CAN frame stored in the 8th byte. It is a standard CRC8 calculation with the initial value 0x00 and the polynomial 0x85.

fn nissan_crc(data: &[u8]) -> u8 {
    const POLYNOMIAL: u8 = 0x85;
    let mut crc = 0u8;

    for &byte in data {
        crc ^= byte;
        for _ in 0..8 {
            crc = if crc & 0x80 != 0 {
                (crc << 1) ^ POLYNOMIAL
            } else {
                crc << 1
            };
        }
    }

    crc
}

Over 6E 6E 00 04 03 06 E0 it gives 0x69. That frame and its CRC come from dalathegreat’s Battery-Emulator, which talks to real Leaf hardware. The implementation is in crates/ev-can, tested against that frame and four others.

Messages

Here are the messages seen on the EV-CAN network. For more ECU-specific information see the traction inverter page.

crates/ev-can encodes these messages. It also defines 0x11A and 0x50B, two keep-alives from the VCM, and 0x55A, the inverter and motor temperatures, taken from the first VCM prototype. None of the three has been checked against a real inverter. Bytes marked ??? below are encoded as the prototype had them and are unverified too.

0x1D4 — Torque request

Sender: VCM Receiver: Traction inverter Frequency: 100 Hz DLC: 8 bytes

Data:

Byte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
??????Torque MSBTorque LSBSeq. counter??????CRC

Torque: signed i16. Positive → accelerate, negative → regen. Scale TBD Nm/bit.

Sequence counter: loops 0 → 3, in bits 7-6 of byte 4.

CRC: see above.

0x1DA — Inverter status

Sender: Traction inverter Receiver: VCM Frequency: TBD Hz DLC: 8 bytes

Data:

Byte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
DC voltage MSBDC voltage LSB??????????????????

DC voltage: unsigned u16, scale 0.5 V/bit.

References

Linked from the build log 9 posts reference this page