fupsrl

06 – Injection and Ignition Outputs

1 min read Updated 16 July 2026

RT-STACK separates output scheduling from engine configuration. The source provides spark.c and injection.c modules plus the hardware maps in engine_config.h. Read all three before commanding a physical output.

Output resources

  • 12 ignition channels are mapped directly to GPIO outputs through ign_hw[].
  • 12 injector channels are mapped through inj_hw[] to comparator, DAC threshold, selection and boost-control resources.
  • Injector channels are paired by the hardware selection resources. Verify the physical pair and polarity in the KiCad design before wiring a load.

Software interface

The source comments show the intended scheduling interface: spark_update() accepts a cylinder, advance and dwell request; injection_update() accepts a cylinder, start angle and duration. The matching spark_off() and injection_off() calls are the explicit shutdown interface. An engine strategy must call these APIs with fully validated inputs; the reference project is not a finished fuel/spark strategy.

Limits are not calibration data

The included dwell clamp, injector boost duration and comparator DAC thresholds are source defaults for the reference project. They are not universal values. Set them only from the actual coil, injector, driver, supply and thermal validation for the target build.

Prove outputs safely

  1. Keep coils and injectors disconnected at first.
  2. Verify inactive output polarity and boot/reset behaviour.
  3. Use appropriate passive loads or a dedicated driver fixture.
  4. Measure pulse width, timing and repeatability over the intended RPM range.
  5. Prove the all-off/fault behaviour before an engine is connected.

Suggested screenshot: oscilloscope traces of a passive-load ignition or injector test, with annotated command and measured duration.