Click on our menu buttons immediately below to find MegaSquirt® information quickly:


General Motors HEI Ignition Control with MegaSquirt-II

There were a number of different kinds of General Motors HEI modules:

When using the HEI-7 or HEI-8 pin modules, you need to set MegaSquirt-II to:

Parameter
Value
Ignition Input CaptureRising Edge
Signal through optoisolator (U4)

Falling Edge for MicroSquirt® only if using the VR input circuit

Cranking triggerTrigger Rise
Coil Charging SchemeStandard Coil Charge
Spark OutputGoing High (Inverted)
for production MS-II

Going High (Inverted) for MicroSquirt

Using MegaTune 2.25+ (Settings/Ignition Settings).

The 7 Pin HEI Module

With a GM HEI 7-pin (and 8-pin modules), the ignition module wires you need to know about are:

The 4-pin HEI uses a negative-to-positive transition, while the 7/8-pin uses a positive-to-negative transition (though this *might* have changed in some applications). Thus polarity of the reluctor signal is critical to proper function.

In the GM 7/8-pin HEI, the module converts the AC signal from the variable reluctor pick-up {on pins P & N} in the distributor to a 'square wave' tach signal {on pin R} suitable for MegaSquirt-II. The falling edge of this square wave is used as the trigger event (which becomes the rising edge when the optoisolator inverts the signal).

HEI does not use the reluctor for dwell control, this is accomplished in the module. Dwell needs to be independent of RPM. Variable reluctor output is RPM dependent with regard to both its width and amplitude of its output. The only thing constant with a variable reluctor output is the location of the zero crossing point with respect to the passing tooth.

Be sure to get the variable reluctor pick-up wires connected properly. Reversing the variable reluctor sensor wires and thus the polarity of the sensor causes the leading voltage to go negative first and the electronics ignores the positive going transition. Thus trigger signal, if ever recognized, is the falling edge of the voltage as the end of the tooth passes.

The only way to get proper triggering at the center of the tooth is to have the positive ½ cycle first (tooth approaching) and the negative ½ cycle last.

The 'trigger offset' in MegaTune is the number of degrees before TDC at which the VR sensor output goes from positive to negative, and the falling edge of the square wave is sent from the 7/8-pin module to MegaSquirt-II. This tells MegaSquirt-II where the crankshaft is positioned so that timing advance can be calculated appropriately. (Note that since the optoisolator (U4) inverts the trigger signal, you specify 'Rising edge' for the 'Input Capture' in MegaTune, which refers to the signal at the processor.) Positive trigger offsets are used to specify the number of degrees before top dead center (BTDC), negative numbers are used for triggers that occur after top dead center (ATDC).

The 7/8-pin HEI uses a "next cylinder" advance calculation method. That is, you get the square wave out of the module at (say) 10° BTDC which is used for cranking and limp home mode. To advance the timing MegaSquirt-II waits until the NEXT cylinder to fire to provided an altered signal to the coil.

Reference (tach) pulses come into MegaSquirt-II from pin R at 10° BTDC (this offset can be calibrated using MegaTuneII so that the spark table values match the actual advance). At each reference pulse, the period between it and the previous reference pulse is calculated. The difference is used (with a time interpolation technique) to set up the timing pulse for the next ignition event. Specifically, the reference period is added to the time of the current pulse, a calculated amount subtracted for the advance, another amount subtracted for the dwell to determine the rise time.

To install the HEI with MegaSquirt-II, you connect:

V2.2 main board:

V3.0 main board:

Note that some users have reported difficulties obtaining a clean trigger from HEI modules (often aftermarket modules rather than OEM General Motors modules). If you find this is the case in your install, check out the alternative trigger circuits here: inputHEI.htm.

When the signal is 'high', current flows. When the signal is pulled low, current stops, the magnetic field in the coil collapses, and a spark is produced. Thus, the HEI module fires on the 'trailing edge' of the advance signal. The advance signal is generated by MegaSquirt-II from the tach signal by modifying its duty cycle (pulse width). Larger duty cycles mean less advance, as the spark is delayed by a larger amount.

The ignition signal going to MegaSquirt-II comes from pin R of the 7-pin HEI module and goes to the DB37 pin 24, as usual.

The timing of the trailing edge determines the amount of advance: a longer pulse width means a more delayed, 'retarded' spark, while a shorter pulse width means an earlier 'advanced' spark.

In a GM vehicle, the override signal is zero volts during cranking (less than 400 rpm or 5 to 15 seconds), then there is 5 volts on this wire after the engine starts to signal the 7-pin module that it should use the signal on the white wire to control timing. You need to apply a 5 volt signal here in order to control the timing while running. A wire can be run from the 5 Vref for the TPS (Pin 26 on the DB37) to the HEI pin B through a relay that is switch from a source that is hot in RUN but not CRANK (see the diagram below). Most cars have a source like this, check your service manual.

Alternatively, you can use the spare port settings to send a 5 Volt signal. The FIdle ports grounds the FIdle, so you'll need a pull up resistor to a 5V source (such as from the proto area).

To do this, you need to:

Then set up the port conditions (rpm < 300) and settings (check these carefully), and you have the pin B signal on db37 pin #30.

So you are just applying 5V to one end of D8 through a resistor (and then setting the spare port settings of course!).

If you have the relay board, you can use the pull up on the relay board instead of in MegaSquirt. The FIdle relay might be set up to supply a ground or 12V depending on how it's jumpered. You want it to supply 5 Volts, and the way to do that is to remove the jumper and connect the center hole to Vref. (Check the relay board schematics.)

The FIdle is particularly useful, since most GM set-ups use a stepper, not the FIdle port. However you may already be using the FIdle output for a TCC (in which case you'll have to use one of the other ports like knock enable and add a transistor).

(Note that the 7-pin HEI module also has two pins for the variable reluctor pick-up ([pin P] and [pin N]) as well as one each for the coil [pin C] and +12 volts [pin +] from the battery. Together with the spark timing signal [pin E], Ref (tach) [pin R], and crank override [pin B], there are 7 pins in total ).


(Shown is the large 7-pin HEI module. The small 7-pin HEI module (used in Vauxhalls in the UK and is listed for the 1.6i Cavalier) is wired to the same pins, but the pins are grouped differently. P, N, E, R are on the right, +, C, and B are on the left)

For using the HEI with a relay board:

Virtually any engine equipped with a variable reluctor distributor and a single coil can use the 7-pin HEI module to interface with MegaSquirt-II. These have the advantage of being cheap, widely available (in North America), and reliable. These are available as:

HEI 8-Pin Module

In addition to the module shown above, you can use the HEI 8-pin module from the "small cap" HEI distributor. This was used on 1987 through 1992 Camaro/Firebird Tuned Port Injection V8 engines, as well as 1987 to 1993 full size cars and 1987 to 1995 pick-up trucks, and V6 MPFI cars (such as the Fiero). It uses a remotely mounted coil (i.e., not in the cap), which is typically is bolted to the intake manifold. The distributors are used primarily on roller cam equipped engines. Note that the GM 8-pin HEI module is basically the same as the 7-pin, except there is one extra pin: the extra pin is 'G' and is used for a ground. The 8-pin module has two 'mushroom' style connectors. One has 2 pins, it is used for the coil. The other has 4 pins, and is used for the electronic timing control. The timing control wires are usually the same colors as described above for the 7-pin module.

You can buy the 8-pin module as:

Or as GM part numbers: 1987465, 1987466, 1989747, 5744006, 10469931, 10482827, 10482829, 10482831, 10482834, 10496048, 10496269, 10496541, 16129419, 16139369, 16139379. 16139389, 16139409, 16139879, 16140039.

The 4-wire connector to MegaSquirt-II can be bought as:

The two lead connector for the small cap module is the same as the recommended CLT sensor connector:

The VR pins can use 1/8" spade connectors.

There are four pins on the external coil used with the 8-pin HEI module. These are tied together in pairs (so you'll see zero resistance between them). One set of two is on the +12 V positive side (electrically), the other is on the negative side.

In OEM applications, if you look at the coil connections with the high tension terminal up and the two connectors on the bottom (with the iron core horizontal), that:

So the two top pins are 12 Volts, the two bottom ones are the coil negative terminal.

You should find about 0.4 Ohms between these two sets of pins (the coil's primary resistance).

Using Other VR Sensors with GM HEI Modules

To hook up another VR sensor distributor to MegaSquirt-II, you need to know which VR sensor wire to hook to the positive (P) pin and which to hook to the negative (N) pin of the 7 pin module. Here is a guide:

Positive (+)Negative (-)
Ford, MSDorange wireviolet wire
Chryslerorange wireblack wire
GM HEIwhite wiregreen wire
If you do not know which is positive and which is negative, you can check it with a timing light. Rotate the motor over until it is at some fixed figure, say 5° BTDC. Loosen the clamp and rotate the distributor until the armature vane is lined up with the center pole of the magnetic pickup. Set both the Base Timing and Initial Advance on MegaSquirt-II to 5°. Fire up the motor and check the timing with the timing light, it should be pretty close to 5°. If it is not close to 5°, then reverse the pickup leads and check it again.

Timing Advance Calculations for GM HEI Modules

In order to fire the coil, the coil must have a dwell period that ends when the advance timing for a spark is correct. The dwell itself must fall within certain limits, or the coil will overheat if dwell is too long, and produce a weak spark if the dwell is too short. So the spark is controlled by the start and stopping of current to the coil. In the MegaSquirtII code:

adv_deg = ign_table(rpm, kpa) + adv_offset + cold_adv_deg

Note that the adv_deg is relative to the trigger, not to TDC. However, MegaTune's ignition table corrects for this, and you fill the table with values relative to TDC. Futhermore, the advance reported by MegaTune is with respect to TDC.

In any ignition system, all of the required events must take place within the time available:

time available = latency time + dwell time + advance

In the MegaSquirtII code, this is calculated as:

dtpred = charge_time + coil_dur + adv_us

It is important to note that we need to estimate dtpred in order to have the correct amount of igntiuon timing advance. The better we estimate dtpred, the more accurately our actual timing will reflect the table and other parameters.

The process of determining the timing events (coil charging and coil spark) is performed as follows:

The coil is supplied with 12 volts when the charge_time has passed after the TDC signal from the distributor/crank sensor. It begins to charge. When a further time equal to coil_dur has passed, the current to the coil is shut off, and a spark is produced. Both charge_time and coil_dur vary based on engine rpm (dtpred), desired spark advance (adv_us + adv_offset), and dwell parameters.

Note that MegaSquirtII has an input for a knock sensor, and this value can be datalogged. In the version 1.000 code, however, the knock sensor input is not used to retard ignition timing.

Setting the Trigger Offset

After installing the MegaSquirt-II and HEI, be sure to use a timing light to verify that your 'trigger offset' is calibrated. Changing the Trigger Offset in MegaTune will not change the displayed advance, instead, it changes the actual advance as seen with a timing light. Your goal is to make these two match.

To do this, get your engine warmed-up (otherwise the timing moves as the temperature increases) and idling, then use a timing light to verify to be certain your actual advance as shown by a timing light equals your the advance display on the advance gauge in MegaTune. (Note that positive numbers denote BTDC, and negative numbers denote after TDC.)

The trigger offset value can theoretically be set anywhere physically, however, since it may be used for cranking and 'fault mode' timing (depending on how you have wired the bypass pin), it is best to set it at a reasonable number for cranking and idle, usually about ~8° BTDC (or whatever is recommended by the module's manufacturer). Check this with a timing light. To get the trigger offset to this value, you may have to physically rotate your distributor.

If you aren't sure where your trigger is physically located, you can set the trigger offset on your vehicle (with the 7 or 8 pin HEI module):

  1. Bring the engine to top dead center on cylinder #1 by rotating it in it's normal direction (usually clockwise when viewed from the front, except for some Honda engines). I remove the spark plug from cylinder #1, and feel for compression, then you know the engine is at TDC on the compressions stroke. Rotate the engine a bit more until the timing indicator lines up with the TDC mark.
  2. Rotate the distributor to align the VR sensor teeth. In the HEI distributor, there are eight sets of teeth, all of which align with one other tooth simultaneously. Lock the distributor down.
  3. Whichever terminal the rotor is pointing at is now cylinder #1. The rotor should be much closer to one terminal than the others (it wil probably have gone by one of the cylinder's terminal by a bit, that's okay - it means it will line up with a bit of advance - you can rotate the engine through very nearly two complete revolutions to check - get it to about 25° to 30° BTDC and it should align with the terminal). If the rotor is pointing between cylinders (i.e., the phasing is off), then it's likely that the distributor is off by one or more teeth at the camshaft (in a V8 HEI install, at least). On a small block Chevrolet, for example, the distributor should be installed so that the rotor is pointing a little in front of the #1 cylinder when the engine is at TDC on the compression stroke for cylinder #1 - all other positions will create phasing problems.
  4. Install the remaining plug wires in firing order around the distributor, being very careful about both the direction and the order. On a small block Chevrolet, the rotor spins clockwise when viewed from above, for example.
  5. Start the engine with the B pin disconnected, and set the timing as seen on a timing light to the trigger offset you want to use by loosening the distributor and rotating it. Usually you will want a value between 0 and 10° BTDC. (I use 0.)
  6. Connect the B pin to 5V (letting MegaSquirt® control the timing), and start MegaTune, verify that a timing light and the trigger wizard give the same number. Change the trigger offset value in MegaTune a bit to make them match, if necessary.

There are many more parameters to set up and tune to use the GM HEI effectively, see the: