Special Objects

The following objects are optional – GW can run OK without any of these defined in the GIN, unless the ECU relies on the behaviour manifest by their existence (for example COMOK). For many of these, this is just an indication of what rather than why, since this is getting beyond the scope of this documentation. None of these objects influence the behaviour of Ginmake at all and are described here purely for reference purposes.

Special ECU “Registers”

There are a number of reserved variable names that define special ECU registers. These definitions do not require structured comments to describe them:

Variable Name Definition
STAT1 Status register – typically used to determine if the engine is running. The Engine Running bit is 0x20
PCTL Program Control (typically used for programming the checksum)
PACK Program ACKnowledge
SCMD1 Special command register 1 (used in the 14bit addressing protocol)
SCMD2 Special command register 2 (used in the 14bit addressing protocol)
LOGTBL Defines the location of the log table. This is used to implement fast parameter updates. Note that the length of the table is defined by using an array initializer. The base size is generally a 16bit.
Chkloc Defines the end of a region and the additive checksum for that region (located in ROM).
Crcloc Defines the end of a region and the CRC checksum for that region (located in ROM). If the size of the base object is 16bit, then it will be CRC16 checksum.
Chksm Runtime checksum (located in RAM).
Calname Identifies a location in the ECU that contains the ‘calibration name’ string. Note that the length of the string is defined by using an array initializer.
Author Identifies a location in the ECU that contains an ‘author’ string.
SERIAL Identifies a location in the ECU that contains a ‘serial’ string. Should be an array of 4 bytes.
Gemsec{x} For security – see Section 6.4.Security
PROD_ID Product ID, should be a word. See GEMS document #102700.
FTR_STAT Feature status. Should be an array of bytes (or 1 byte). See GEMS document #102700.
FTR_CTRL Feature control register. Should be an array of 8 bytes. See GEMS document #102700.

For General Operation

“COMOK” Parameter

Defining COMOK as a parameter causes GW to poll this value until it is clear after receiving a write failure from the ECU.

This is also done before critical procedures such as ISP.

“ISPEN” Option

The ISPEN (ISP Enable) Option is intended to prevent situations where an invalid character received by the ECU could cause it to enter its ISP loop. If available, GW will typically write this to zero after connecting (GW v3.18r05+), and non-zero when performing an ISP.

“Auto EE” Option

Enables automatic E2 checksum updates in the ECU. AutoEE is disabled before performing an upload.

Security

The variables “GEMSEC1” through “GEMSEC6” must be defined if you wish to make the ECU securable.

Each of these security characters is usually defined as a byte (although this is not strictly necessary for use with more recent versions of GW).

In order to unlock security, the password is written into these characters.

To erase the calibration and the password, 0xff characters are written into these locations.

Once unlocked, writing a new password should set the ECU password.

Operations are triggered by writing the last gemsec character (gemsec6).

Fuel Map

“Fuel” Map

The Fuel map (named “Fuel”) is bequeathed with extra features in GW.

Chiefly, these are:

View [Raw / Pulse Width / Duty Cycle] display options.

Rescale Fuel Map

Optimize Fuel Map

Change Injectors / Pressure

Note that maps other than “Fuel” can be given the attribute “fuel” so that the tuning software can identify it as such and display appropriate menu options. See the attributes section.

“Fuel Throttle” Map

As for Fuel Map, this is typically an alias for the Fuel map (uses the same area of memory in the calibration).

“MSPB” Option

Microseconds per bit – required for Fuel map extensions

“LD0MPC” Option

Required for Fuel map extensions such as optimizing of the map.

LDOMPC is a scaling factor used on the load axis of the map.

Optimizing the fuel map adjusts MSPB, LD0MPC and the fuel map.

The optimize procedure finds the average slope of the map and removes it by adjusting LD0MPC. This is based on the general trend of fuel maps increasing in value as load increases. The map is also scaled to give maximum fuelling resolution.

Generally, optimize is not necessary on engines tuned for Rally.

For Pulse-width display of fuel map (in milliseconds):

The value is based upon the Microsec/Bit (or MSPB) option and the LD0MPC option. The scaling is as follows:

load_scaling = (load_site / load_site_max) +

1 ((load_site_max - load_site) / load_site_max) \* ld0mpc / 256);
2value = (mspb / 1000) \* load_scaling;

Try setting the fuel map to 255 in raw mode and then switching to pulse-width mode and adjusting the LD0MPC option to get an idea of how ld0mpc affects the scaling of the map.

Duty Cycle View displays the map in terms of the duty cycle of the injector pulse train. Duty Cycle is the fraction of time that the injector is active as a percentage, so a duty cycle of 100 or greater indicates that the injector is permanently on.

Like pulse-width, the duty cycle view uses the LD0MPC option to scale the map based upon the load site. However, the scaling also takes into account the speed axis.

Try it out on a map where all the raw values are the same and adjust LD0MPC to see the effect.

When viewing in Duty Cycle, you will be asked what kind of engine you are running in order that duty cycle can be correctly calculated.

“Fuel Map Throttle” Option

“TPS Based Fuel Map” Option

Causes the fuel map to be interpreted as a TPS based fuel map as opposed to load based.

Throttle Setup Feature

“TPS Min” or “TPS Min Voltage” Option

“TPS Max” or “TPS Max Voltage” Option

“TPS Raw” or “TPS Volts” Parameter

Ignition Setup Feature

“Ignition sync” Option

“Ignition Teeth” / “Spark Teeth” Option

“Ignition Timing” Parameter

“Ignition Fixed” Option

Injector Setup

(Requires Fuel Map)

“Secondary” Option

“Staged Flow Ratio” Option

“Crank fuel” or “Crank Injector Time” Table

Sets the amount of fuel used during Cranking for different Throttle positions.

“Crank pulse” or “Initial Crank Pulse” Table

Internal Logging

“Log Load” Option

“Log Throttle” Option

“Log Speed” Option

“Log VSS” Option

“Log Code 1”…“Log Code 15” Options

“Log Switch Input” Option

“Log Always” Option

“Log Running” Option

“Log Wrap” Option

“Log Switch” Option

“Log PBW” Option

“Log Rate” Option

In GW, “Log Rate” this is typically checked for existence to determine if internal logging is supported.

“Log Reset” Parameter

The tuning software writes this parameter to “ON” in order to reset the ECU’s internal log. The reason it is a writeable parameter is that once it has been written, the ECU resets the value to OFF once the log has been reset. Options are not continually read from the ECU and so you end up with your calibration being out of sync with the ECU.

i.e. Log reset is a volatile value. Options, maps etc should not be volatile.

Telemetry Setup

CAN TX (CTele)

CTele ID option format:

IDs are parsed along the lines of: CTele? ID[m]??([x] [b??-??]) Or, as a posix regular expression: ^ctele[0-9] id(m)?([0-9]{2})(x)?( b([0-9]{1,2})-([0-9]{1,2}))?$

For example:

1CTele1 ID01 b02-00 // channel1, message 01, bits 2 down to 0
2CTele1 ID01 b10-03 // channel1, message 01, bits 10 down to 3

Extended IDs have an ‘x’ after the message number: CTele1 ID01x b15-00 // Extended channel1, message 01, bits 15 down to 0

Mask IDs have an ’m’ after ID:

1CTele1 IDm01 b02-00 // MASK, channel1, message 01, bits 2 down to 0
2CTele1 IDm01x b15-00 // MASK, Extended channel1, message 01, bits 15 down to 0

CTele message option format: ^ctele%1 m([0-9]{2})([wb])([0-9]+)

e.g.

1CTele1 M01W1 // Channel 1, Message 1, byte 1 (word 1)
2CTele1 M01B2 // Channel 1, Message 1, byte 2
3CTele1 M01W2 // Channel 1, Message 1, byte 3 (word 2)
4CTele1 M01B4 // Channel 1, Message 1, byte 4
5CTele1 M01W3 // Channel 1, Message 1, byte 5 (word 3)
6CTele1 M01B6 // Channel 1, Message 1, byte 6
7CTele1 M01W4 // Channel 1, Message 1, byte 7 (word 4)
8CTele1 M01B8 // Channel 1, Message 1, byte 8

Note the padding of the message number.

CTele message specific options format:

1CTele1 rate1 // Channel 1, Message 1 rate (rarely used)
2CTele1 m01 bytes // Number of bytes to transmit for this message.
3CTele1 id1 ext // Channel 1, Message 1 Use extended ID switch.
4CTele1 Extended01 // Channel 1, Message 1 Extended ID switch (not actually parsed).

There appears to be an issue here - some ECUs define CTele1 Extended01. However, the option that is actually used for this is ‘CTele1 id1 ext’ In GWv4 4.01.05 and later, this option will be parsed correctly and is equivalent to ‘CTele1 id1 ext’.

CTele channel specific options format:

1CTele1 speed // Channel 1 bus speed
2CTele1 bit rate // Channel 1 bus speed alias (typically the RAW value).
3CTele1 rate // Message periodic rate.
4CTele1 enable // Turns channel on/off.

CAN RX

There are the options to describe the arbitration ID for reach message and parameters to describe where the received CAN data is placed.

CAN RX parameter format: CAN1 RX1 W1 CAN1 RX1 W2 CAN1 RX1 W3 CAN1 RX1 W4

The first number is the CAN channel, the second is the message number (which message CANID it corresponds to).  The W number is the index of the word in the message buffer. Upon reading CAN data it is the ECU’s responsibility to push the data into these parameters as appropriate.

CAN RX ID option format: The IDs are formatted in a similar manner to CAN TX and can be split across multiple options. They can be bytes or words:

1CAN1 RXID01 b02-00 // channel1, message 01, bits 2 down to 0
2CAN1 RXID01 b10-03 // channel1, message 01, bits 10 down to 3

Extended IDs have an ‘x’ after the message number: CAN1 RXID01x b15-00 // Extended channel1, message 01, bits 15 down to 0 .. etc …

CAN RX extended enable option format: You can specify a switch channel that causes the extended CAN ID to be used to receive data into the CAN RX parameters by using single bit ON/OFF options:

CAN1 RXID Extended01 1st number being channel, of course and the second being the message number.  For some reason in this case the message number must be left-padded with zero to be two characters long.

Mask may be specified as: CAN1 RXIDM Extended01 Though in reality I’m not even sure it can be made to work as there is no mask ID parsed for CAN RX channels (but it IS for CAN TX).