Open Import Fuel Tuner


Top-Level Hardware Design

We reasoned that it would be best to begin this project by looking at the signals which are useful to capture and/or modify for this application. Here's a table of the relevant signals:

Signal Name
Input Type
Output Type
TDC (Top Dead Center) Peak Detector?, Input Capture  
IGN Input (Ignition) Peak Detector?, Input Capture Output Compare, monostable?
Karman Sensor (Mass Air Flow, DSM only) Input Capture Output Compare, monostable?
MAP (Manifold Absolute Pressure, Honda only) A/D D/A
TPS (Throttle Position Sensor) A/D D/A
IAT (Intake Air Temp) A/D Relay or D/A
O2 (Oxygen Sensor) A/D  
Knock Sensor A/D  

From the above list, it looks like it can be seen that we need a microcontroller board with several A/Ds and D/As, preferably 10 or 12 bits in resolution, and a high-resolution timer for input capture and output compare, serial ports, and some digital I/O lines. We considered many different options and researched a number of microcontroller boards before settling on the SS16v2T from Intec Automation Inc. This board features a very small size (2"x3"), a low price ($129 for 16.78MHz, $169 for 25.1MHz), a "prototyping" area to add components, and plenty of features.
    The SS16v2T features:
  • 16-bit MC68HC16Z1 microprocessor
  • 128Kbyte SRAM
  • 128Kbyte Flash EPROM
  • 39 Digital I/O
  • 8 chan 10 bit A/D 100KHz
  • QSPI and SCI Serial I/O
  • 3/4 Channel Input Capture
  • 4/5 Channel Output Compare
  • PWM, Pulse Counter
  • Multiple internal & external IRQs
  • Multiple high-resolution timers
  • Keypad / LCD panel interface
The specifications and documentation for the MC68HC16Z1 CPU may be retrieved at the Motorola website.

Unfortunately this board is missing a D/A converter and a +5v power regulator. These components and circuit design will be covered in the Component Selection section.

Top-Level Schematic Here's the O.I.F.T. Top-Level Electrical Schemtaic.


Top-Level Software Design

In the interests of efficiency and speed the 68HC16 microcontroller code will be written in assembly language. The code will be efficient, well-commented, modular, thoroughly tested, and fast. As the code is written and tested, it will be placed on this website.
    Top-level Software Architecture:
  1. Initialization / startup code
  2. ISRs
    Each signal ISR will be triggered by the end of its input conversion operation. It will update the input engine status table, call the proper Engine Control Logic routine, and begin the output conversion. The main timer clock will activate the input sampling at a specific interval.
    1. Main timer clock
    2. A/D conversion
    3. D/A serial output
    4. Input Capture
    5. RS-232 serial input & output
  3. Engine Control Logic (output engine status generation)
    1. MAP re-mapping
    2. MAP adjustment by RPM
    3. IAT modification
    4. TPS modification
  4. Main Loop
    1. Update RS-232 output buffer according to state as needed
    2. Read serial input data, update state accordingly

Back

Hardware
FS Home Page