Open Import Fuel Tuner


O.I.F.T. Communication Specification v0.1

General Message Format: <ControlWord>[<DataWord1>[<DataWord2>[...]]]<EOTWord>
  • <EOTWord> = 0xffff
  • Data and Control Words are not allowed to be == 0xffff

    Desired Host2OIFT Messages:
  1. Add/remove Engine State Update item
  2. Request software version
  3. Read translation table (Karman, MAP, or RPM)
  4. Add/remove translation table point
  5. Retrieve statistical knock data
  6. Set/read Engine State serial refresh rate
  7. Set/read Engine Update rate
  8. Set/read knock calculation mode (off/statistical/tuned)
  9. Set/read MAP/Knock/Spark Timing/IAT/TPS parameters
  10. Save parameters to Flash ROM
  11. Adjustment Confirmation Reply

    Desired OIFT2Host Messages:
  1. Engine State Update
    • RPM, MAP/Karman, TPS, IAT, O2, Knock, Spark Timing, SerialTooFast, CPUTaxed
  2. Report software version
  3. Report translation table
  4. Report statistical knock data
  5. Report Engine State serial refresh rate
  6. Report Engine Update rate
  7. Report knock calculation mode (off/statistical/tuned)
  8. Report MAP/Knock/Spark Timing/IAT/TPS parameters
  9. Adjustment Confirmation Request
  10. Adjustment Success

The Open Import Fuel Tuner Communication Protocol is a loosely structured, message-oriented, word-based protocol. Each message begins with a <ControlWord>, followed by zero or more <DataWords>, and ends with an <EOTWord>. The end-of-transmission word is defined as 0xffff, and consequently the Control Words and Data Words are not allowed to be equal to 0xffff. There are no provisions built-in for extending the symbol space (such as escape words) to accommodate the loss of this value. This simple mechanism preserves message synchronization from data errors yet retains extreme simplicity for fast processing and minimal overhead. Each word is two bytes, and is transmitted big-endian (Motorola) style. The MSB is transmitted first, followed by the LSB.

Some O.I.F.T. command messages are so critical to proper operation (such as saving parameters in Flash ROM, or modifying tuning parameters) that a handshaking protocol is used to protect data integrity. When the O.I.F.T. controller receives a critical command, it will send an Adjustment Confirmation Request message to the host. This message contains a (random) confirmation number and a copy of the received command, excluding the received <EOTWord>. The host will then verify that the command was received correctly and send an Adjustment Confirmation Reply back to the controller. Upon reception of the Confirmation Reply, the O.I.F.T. controller will perform the desired command. To complete the handshake, the O.I.F.T. controller will send an Adjustment Success message back to the host.


O.I.F.T. Communication Data Definitions

[SignalType] (4 bits):
  0 = None
  1 = RPM
  2 = MAP
  3 = Karman
  4 = TPS
  5 = IAT
  6 = O2
  7 = Knock
  8 = Spark Timing
  9-15 = Reserved

[SignalBitfield] (12 bits):
                     +---------+----+----+----+----+----+----+----+----+
                     |  11-08  | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
                     +---------+----+----+----+----+----+----+----+----+
Reserved (0) -------------/       |    |    |    |    |    |    |    |
Spark Timing ---------------------/    |    |    |    |    |    |    |
       Knock --------------------------/    |    |    |    |    |    |
          O2 -------------------------------/    |    |    |    |    |
         IAT ------------------------------------/    |    |    |    |
         TPS -----------------------------------------/    |    |    |
      Karman ----------------------------------------------/    |    |
         MAP ---------------------------------------------------/    |
         RPM --------------------------------------------------------/

[KnockMode] (4 bits):
  0 = Off
  1 = Statistical Data Collection
  2 = Runtime DSP Analysis
  3-15 = Reserved

[CarType] (4 bits):
  0 = Honda/Acura
  1 = DSM
  2-15 = Reserved

Engine State Update Data Formats:
The O.I.F.T. code for the MC68HC16 will make extensive use of fixed-point arithmetic for simplicity and accuracy. Using this tool it is possible to easily compute calculations with "fractional" accuracy and convert to any fixed-point base by simply shifting bits. For example the result of a multiplication between an 8.8 fixed-point number and a 12.4 fixed-point number results in a 20.12 result. By shifting this to the right 12 bits, the result becomes an integer.

Update Item  | Data Format              | Units                  |
Spark Timing - (unsigned 8.8 bits)        Degrees before TDC
       Knock - (unsigned 16 bits)         Knock intensity
          O2 - (unsigned 10 bits)         ADC value (1023 = 5v)
         IAT - (unsigned 16 bits)         Temperature, Degrees F
         TPS - (unsigned 10 bits)         ADC value (1023 = 5v)
      Karman - (unsigned 12.4 bits)       Frequency, Hz
         MAP - (unsigned 10 bits)         ADC value (1023 = 5v)
         RPM - (unsigned 16 bits)         RPM


OIFT2Host Messages

For messages from the O.I.F.T. to the Host PC, there are two distinct classes. The highest bit (15) of the Control Word selects the message class.

Engine State Update Message:
Class ‘0' is for engine update messages, which are used for datalogging and will require a high percentage of serial bandwidth. The lower 12 bits of the Control Word for these messages is a [SignalBitfield] parameter, and designates which engine status items are being sent with the message. There is one Data Word sent for each engine status item being updated, and the data begins with the item corresponding with the lowest (closest to 0) bit, and proceeds to the item corresponding with the highest (closest to 12) bit. Class ‘1' messages (Generic OIFT Messages) are for generic command and control purposes.

Message Format: <ControlWord><SignalDataWord1>[<SignalDataWord2>[...]]<EOTWord>
  - Number of data words = Population count (number of bits set) in [SignalBitfield]

                    +----+----+----+----+--------+
<ControlWord>:      | 15 | 14 | 13 | 12 | 11-00  |
                    +----+----+----+----+--------+
               0 ------/    |    |    |     |
    Reserved (0) -----------/    |    |     |
   SerialTooFast ----------------/    |     |
        CPUTaxed ---------------------/     |
[SignalBitfield] ---------------------------/

Generic OIFT Message:
Class ‘1' Messages contain three bit-fields: [SignalType], [DataLen], and [OIFTMsgType]. The [SignalType] parameter specifies the ECU Signal to which the message pertains. [DataLen] specifies the length of the data portion of the message, in words. [DataLen] is a 5-bit field, so for messages with more than 31 words of data, [DataLen] is set to 0 and the total data length (in words) is in <DataWord1>. This allows for messages with up to 65,536 words of data. Consequently messages with 0 words of data are not allowed. Finally, the [OIFTMsgType] parameter specifies the exact nature of the message being sent.

Message Format: <ControlWord><DataWord1>[<DataWord2>[...]]<EOTWord>
  - Number of data words = [DataLen] (5 bits)
    - If ([DataLen] == 0) then Number of data words = <DataWord1>

                    +----+---------+--------+--------+
<ControlWord>:      | 15 |  14-11  | 10-06  | 05-00  |
                    +----+---------+--------+--------+
               1 ------/      |        |        |
    [SignalType] -------------/        |        |
       [DataLen] ----------------------/        |
   [OIFTMsgType] -------------------------------/
[OIFTMsgType] (6 bits):
  0 = Report Software Version ([SignalType] = none, [DataLen] = 1)
                          +-------+---------+--------+--------+
      <DataWord1>:        | 15-12 |  11-08  | 07-04  | 03-00  |
                          +-------+---------+--------+--------+
          Reserved (0) -------/        |        |        |
             [CarType] ----------------/        |        |
         Major Ver Num -------------------------/        |
         Minor Ver Num ----------------------------------/
  1 = Report Signal Parameters ([SignalType] = Knock, Spark Timing, MAP, IAT, or TPS)
      - Refer to Signal Parameter Data Table for message data structure
  2 = Report Translation Table ([SignalType] = RPM, MAP, or Karman, [DataLen]=0)
      - <DataWord1> = Total data length
      - <DataWord2> = Number of translation points
      - <DataWord3-n> = Translation Table Values, n = <DataWord1>
        - Translation Value: <Word1>= Input Value
                             <Word2>= Output Value
        - If ([SignalType] == MAP)
          - Input Value = MAP Value from engine (10-bit unsigned ADC value)
          - Output Value = MAP Value to ECU (10-bit unsigned DAC value)
        - If ([SignalType] == Karman)
          - Input Value = Karman Value (Hz) from engine (12.4 fixed-point)
          - Output Value = Karman Value (Hz) to ECU (12.4 fixed-point)
        - If ([SignalType] == RPM)
          - Input Value = RPM Value (RPM) from engine (16.0 bits)
          - Output Value = Fuel Correction Factor (signed 8.8 fixed-point)
  3 = Report Knock Calculation Mode ([SignalType] = Knock, [DataLen]=1)
      - <DataWord1> = [KnockMode]
  4 = Report Statistical Knock Data ([SignalType] = Knock, [DataLen]=0)
      - <DataWord1> = Total data length
      - <DataWord2> = RPM Start (16.0 bits RPM)
      - <DataWord3> = RPM End (16.0 bits RPM)
      - <DataWord4> = RPM Points
      - <DataWord5> = Frequency Start (16.0 bits Hz)
      - <DataWord6> = Frequency End (16.0 bits Hz)
      - <DataWord7> = Frequency Points
      - <DataWord8-n> = Knock Value Matrix (RPM x Frequency), n = <DataWord1>
        - Knock Value: <Word1>= Min Value (16.0 bits)
                       <Word2>= Max Value (16.0 bits)
                       <Word3>= Standard Deviation (16.0 bits)
                       <Word4>= Point count
        - There are (RPM Points) * (Frequency Points) * 4 data words in the matrix
  5 = Report Engine Update rate ([SignalType] = none, [DataLen]=1)
      - <DataWord1> = Engine update rate (12.4 fixed point)
  6 = Report Engine State serial refresh rate ([SignalType] = none, [DataLen]=1)
      - <DataWord1> = Serial Refresh rate (12.4 fixed point)
  7 = Adjustment Confirmation Request ([DataLen]=0)
      - [SignalType] = None (ROM Write), Knock, Timing, MAP, IAT, or TPS
      - <DataWord1> = Total data length
      - <DataWord2> = Confirmation Number (16-bits)
      - <DataWord3-n> = Copy of received command from Host excluding <EOTWord>
  8 = Adjustment Success ([DataLen]=1)
      - [SignalType] = None (ROM Write), Knock, Timing, MAP, IAT, or TPS
      - <DataWord1> = Confirmation Number (16-bits)
  9-63 = Reserved

Signal Parameter Data Table:
[SignalType] = Knock ([DataLen]=10)
  - <DataWord1> = Test Frequency 1 (16.0 bits, Hz) <DataWord2> = TF1 Weight (1.15)
  - <DataWord3> = Test Frequency 2 (16.0 bits, Hz) <DataWord4> = TF2 Weight (1.15)
  - <DataWord5> = Test Frequency 3 (16.0 bits, Hz) <DataWord6> = TF3 Weight (1.15)
  - <DataWord7> = Test Frequency 4 (16.0 bits, Hz) <DataWord8> = TF4 Weight (1.15)
  - <DataWord9> = Base Knock Threshold (signed 16.0 bits, Counts @ 0 RPM)
  - <DataWord10> = Threshold RPM Offset (2.14 bits, Counts / RPM)
[SignalType] = Spark Timing ([DataLen]=2)
  - <DataWord1> = Boost Retard Start (10-bit unsigned Input ADC value)
  - <DataWord2> = Boost Retard Factor (unsigned 0.16 fixed-point, degrees/ADC value)
[SignalType] = MAP ([DataLen]=2)
  - <DataWord1> = Minimum MAP Value (10-bit unsigned Output DAC value)
  - <DataWord2> = Maximum MAP Value (10-bit unsigned Output DAC value)
[SignalType] = IAT ([DataLen]=2)
  - <DataWord1> = Activation MAP Value (10-bit unsigned Input ADC value, 0=off)
  - <DataWord2> = De-activation MAP Value (10-bit unsigned Input ADC value, 0=off)
[SignalType] = TPS ([DataLen]=3)
  - <DataWord1> = Wide-Open-Trottle TPS Value (10-bit unsigned Output DAC value)
  - <DataWord2> = Activation MAP Value (10-bit unsigned Input ADC value, 0=off)
  - <DataWord3> = De-activation MAP Value (10-bit unsigned Input ADC value, 0=off)


Host2OIFT Messages

Generic Host Message:
The Host2OIFT Generic message is similar to the OIFT2Host Class ‘1' message, with two major differences. The [R!/W] bit replaces the message class bit (15), and the [DataLen] parameter is processed differently. For Host2OIFT Generic messages, the [DataLen] parameter is allowed to authentically be 0, and zero-data messages are allowed. Consequently messages are not allowed to have more than 31 words of data.

The [R!/W] bit is used to indicate whether the message's primary intent is to read data from the O.I.F.T. controller, or write data to it. A ‘0' signifies a Read operation, while a ‘1' signifies a Write operation. The [HostMsgType] parameter specifies the exact nature of the message being sent.

Message Format: <ControlWord>[<DataWord1>[<DataWord2>[...]]]<EOTWord>
  - Number of data words = [DataLen] (5 bits)

                    +----+---------+--------+--------+
<ControlWord>:      | 15 |  14-11  | 10-06  | 05-00  |
                    +----+---------+--------+--------+
          [R!/W] ------/      |        |        |
    [SignalType] -------------/        |        |
       [DataLen] ----------------------/        |
   [HostMsgType] -------------------------------/

[HostMsgType] (6 bits):
  0 = Request Software Version ([SignalType]=none, [R!/W] = 0, [DataLen]=0)
  1 = Add Engine State Update item ([SignalType]=any, [R!/W] = 1, [DataLen]=0)
  2 = Remove Engine State Update item ([SignalType]=any, [R!/W] = 1, [DataLen]=0)
  3 = Read Translation Table ([SignalType]=RPM,MAP,or Karman, [R!/W] = 0, [DataLen]=0)
  4 = Add Translation Point ([SignalType]=RPM,MAP,or Karman, [R!/W] = 1, [DataLen]=2)
      - <DataWord1> = New Input Value
      - <DataWord2> = New Output Value
  5 = Remove Translation Point ([SignalType]=RPM,MAP,or Karman, [R!/W]= 1, [DataLen]=1)
      - <DataWord1> = Input Value of point to remove
  6 = Change Translation Point ([SignalType]=RPM,MAP,or Karman, [R!/W]= 1, [DataLen]=3)
      - <DataWord1> = Input Value of point to modify
      - <DataWord2> = New Input Value
      - <DataWord3> = New Output Value
  7 = Request Statistical Knock Data ([SignalType]=Knock, [R!/W] = 0, [DataLen]=0)
  8 = Set/Read Engine State serial refresh rate ([SignalType]=none)
      - if ([R!/W] == 0) then Read serial rate, [DataLen]=0
      - if ([R!/W] == 1) then Set serial rate, [DataLen]=1
        - <DataWord1> = Serial Refresh rate (12.4 fixed point)
  9 = Set/Read Engine Update rate ([SignalType]=none)
      - if ([R!/W] == 0) then Read Engine Update rate, [DataLen]=0
      - if ([R!/W] == 1) then Set Engine Update rate, [DataLen]=1
        - <DataWord1> = Engine update rate (12.4 fixed point)
  10= Set/Read Knock Calculation Mode ([SignalType]=Knock)
      - if ([R!/W] == 0) then Read Knock Calculation mode, [DataLen]=0
      - if ([R!/W] == 1) then Set Knock Calculation mode, [DataLen]=1
        - <DataWord1> = [KnockMode]
  11= Set/Read Signal Parameters ([SignalType]=Knock,Spark Timing,MAP,IAT,or TPS)
      - if ([R!/W] == 0) then Read Signal Parameters, [DataLen]=0
      - if ([R!/W] == 1) then Set Signal Parameters, [DataLen] depends on [SignalType]
        - Refer to Signal Parameter Data Table for message data structure
  12= Save Parameters to Flash ROM ([SignalType] = none, [R!/W] = 1, [DataLen]=0)
  13= Adjustment Confirmation Reply ([R!/W] = 1, [DataLen]=1)
      - [SignalType]= None (ROM Write), Knock, Timing, MAP, IAT, or TPS
      - <DataWord1> = Confirmation Number (16-bits)
  14-63 = Reserved


Back

Hardware
FS Home Page