Refine this doc
Ask about this doc
Project Specification
Project Overview
  • Project: ECU Read Write Interface
  • Status: Draft
  • Purpose: USB-connected ECU read/write interface prototype for authorized diagnostics/programming of owned or permitted ECUs.
  • Core interfaces: Classic CAN, K-Line, OBD-II, and bench harness connection.
Intended Use
  • Connect to passenger cars, trucks, and heavy vehicles using 12 V or 24 V electrical systems.
  • Support OBD-II in-vehicle access and bench/desktop ECU connection.
  • Intended for legal/authorized ECU service, diagnostics, firmware backup, and firmware restore workflows.
What the Device Should Do
  • Communicate with ECUs over classic CAN.
  • Communicate with older ECUs over K-Line / ISO9141 / KWP2000 style physical layer.
  • Connect to a PC over USB.
  • Accept vehicle-side supply from 12 V and 24 V systems.
  • Provide protected bench wiring access for ECU power, ground, CAN, and K-Line.
Main Features
  • USB-C PC connection.
  • MCU-based protocol bridge.
  • Classic CAN transceiver.
  • K-Line transceiver/interface.
  • OBD-II 16-pin connector.
  • Bench connector/header for ECU harness wiring.
  • Automotive input protection for 9–32 V nominal operation.
  • Reverse polarity, surge/load-dump, fuse, and ESD protection.
  • Status LEDs and test points.
System Architecture

Diagram


PC USB USB-C Device Port STM32 MCU 12/24 V Vehicle or Bench Supply Automotive Protection Wide VIN Buck Regulator 3.3 V Rail Classic CAN Transceiver OBD-II Connector Bench Connector K-Line Interface
Hardware Subsystems
Power Input and Protection
  • Nominal vehicle support: 12 V and 24 V systems.
  • Design target input range: 9–32 V continuous, with transient protection sized for automotive surges.
  • Protection blocks: fuse/PTC, reverse-polarity protection, 36 V-class input TVS surge clamp, input filtering.
MCU / USB Bridge
  • Selected MCU family: STM32G431, using a square LQFP SMD package where available.
  • MCU needs USB device support, FDCAN/classic CAN controller support, UART for K-Line transceiver control, SWD debug, BOOT/NRST access, and enough GPIO for status/test features.
  • USB-C used as PC interface and optional 5 V auxiliary input if needed.
CAN Interface
  • Classic CAN physical layer, 3.3 V or 5 V logic-compatible transceiver.
  • OBD-II CAN pins and bench CAN pins exposed.
  • Switchable/optional 120 ohm termination planned for bench use.
K-Line Interface
  • ISO9141/KWP2000 compatible K-Line physical layer.
  • OBD-II K-Line pin and bench K-Line pin exposed.
  • Protected against vehicle electrical transients.
Connectors
  • OBD-II 16-pin connector.
  • SMD bench connector with at least VBAT, GND, CANH, CANL, K-Line, and optional ignition/wake line.
Interfaces and Connections

Table


InterfaceDirectionNotes
USB-CPC/deviceFirmware update, data exchange, command/control
OBD-II CANBidirectionalClassic CAN on standard OBD pins
OBD-II K-LineBidirectionalOlder ECU access
Bench CANBidirectionalDirect ECU bench harness
Bench K-LineBidirectionalDirect ECU bench harness
Vehicle VBATInput12/24 V nominal, 9–32 V design target
3.3 V railInternalMCU and logic rail
Power and Runtime Expectations
  • Primary power: vehicle/bench VBAT input.
  • USB may provide data and optionally power for logic-only operation if needed in a later revision.
  • No battery runtime requirement.
Power Tree and Power Budget
Initial estimate before final part selection:

Table


RailLoadTypicalPeak
3.3 VSTM32 MCU50 mA120 mA
3.3 VCAN transceiver logic10 mA30 mA
3.3 VK-Line interface logic5 mA20 mA
3.3 VLEDs/test support10 mA30 mA
3.3 V totalInternal electronics75 mA200 mA
Assumption: 3.3 V buck efficiency 85% at light/medium load.
  • Peak output power: 3.3 V × 0.2 A = 0.66 W.
  • Input current at 9 V worst case: 0.66 W / (9 V × 0.85) ≈ 86 mA.
  • Protection and regulator should be sized with margin; target input path current rating at least 0.5 A.
Manufacturing and Assembly Expectations
  • Prototype-intent PCB.
  • All components should be SMD where a suitable library/current-production option exists.
  • Prefer the largest practical SMD packages for manual rework: LQFP/TQFP for MCU, SOIC/PowerSOIC/HTSSOP for ICs, and 0805/1206-style passives where electrical performance allows.
  • Avoid BGA, QFN/DFN, 0402/0201, and very tiny packages unless no practical alternative exists.
  • Use active-production, currently available parts with distributor availability where possible.
  • Avoid EOL, obsolete, and NRND components.
  • Automotive connector and protection placement should prioritize robustness.
Firmware-Relevant Hardware Requirements
  • USB device stack.
  • CAN driver and ISO-TP/UDS-capable firmware architecture.
  • UART/timer support for K-Line wakeup/communication.
  • Boot/debug access via SWD.
  • Status LEDs for power, USB, CAN activity, K-Line activity.
Physical Design Expectations
  • OBD-II and bench connector accessible at board edge.
  • Keep vehicle-side transient protection near connectors.
  • Keep CAN pair short and routed as a pair.
  • Provide test points for VBAT, 3.3 V, GND, CANH, CANL, K-Line, reset/SWD.
Important Design Decisions
  • Use classic CAN, not CAN-FD, unless later requested.
  • Include bench connection in addition to OBD-II.
  • Design power input for both 12 V and 24 V vehicle systems.
  • Use automotive-grade protection strategy rather than simple hobby-level input protection.
  • Select currently available, non-obsolete parts.
  • MCU changed from STM32H753ZIT6 to STM32G431 family, with square LQFP package preferred.
  • Use SMD parts throughout, but choose hand-rework-friendly large SMD packages whenever possible.
Assumptions
  • User wants a legitimate interface for owned/authorized ECU service.
  • Initial scope excludes BDM/JTAG/boot-mode ECU programming adapters unless requested later.
  • Classic CAN is sufficient for first revision.
  • 9–32 V continuous input target is acceptable for 12/24 V vehicles; transient protection will be added separately.
Change Notes
  • Initial requirement: ECU read/write interface.
  • Added: classic CAN, K-Line, bench connection.
  • Added: 12/24 V vehicle support for cars, trucks, and heavy vehicles.
  • Added: active/currently available part selection requirement.
  • Added: all-SMD but manual-rework-friendly package strategy.
  • Changed MCU decision to STM32G431 LQFP-family device.
  • Changed input TVS from 24 V class to 36 V class for 9–32 V continuous 12/24 V vehicle compatibility.
  • Project Overview

  • Intended Use

  • What the Device Should Do

  • Main Features

  • System Architecture

  • Hardware Subsystems

  • Power Input and Protection

  • MCU / USB Bridge

  • CAN Interface

  • K-Line Interface

  • Connectors

  • Interfaces and Connections

  • Power and Runtime Expectations

  • Power Tree and Power Budget

  • Manufacturing and Assembly Expectations

  • Firmware-Relevant Hardware Requirements

  • Physical Design Expectations

  • Important Design Decisions

  • Assumptions

  • Change Notes