Tach Input
Background: Crank Angle Sensor (CAS) Wheel in the 1G DSM

This article was originally based on the 1st
gen DSM with the 4G63 engine, but also works for the 2G models. On a 1G, there are two 'sets' or 'rings'
of holes in the optical CAS. The outer ring of holes is read by an optical
sensor and then sent across a wire to the ECU and referred to as the CKP signal.
Likewise the inner ring with two holes is also read by an optical sensor,
sent across a wire to the ECU and is referred to as the CMP signal.

Outer Ring -
Crank Angle Sensor (RPM) - CKP

Inner Ring -
Top Dead Center Sensor - CMP

The later 2G motors use a Hall effect CAS that behaves in the same way as a
2G from an electronics standpoint, even though the hardware is different,
relocating the CKP signal to the crank while the CMP sensor is on the cam. Some
Lancer EVOs also used the same sort of signal, and this CAS showed up on a few
other Mitsubishi motors. Even a few non-Mitsubishi products used a version of
this CAS, such as the
Mazda Miata.

MegaSquirt-I

Getting the Tach Input Signal:

Run MS1/Extra and the
"2nd Trigger" Wheel Decoder option (where the
missing tooth on the wheel decoder comes from a second sensor, usually cam
position). The 1G CAS on a DSM (which bolts up to ALL years of 4G63 7- and
6-bolt engines) has a CMP and CKP signal, so you take the outputs of each and
run them into the MegaSquirt. Take the CKP signal (4 holes in the Optical sensor wheel,
the "outer" ring of the mitsu CAS), and run it to the primary tach input on the MS
with a 12v pullup resistor - then you take the inner ring of the CAS (1 hole
in the sensor wheel) and run it to the secondary tach input on MS (it's pin 11
on the MS-I cpu) with a 5v pullup resistor.

If you follow my documentation for the mods below you'll externally wire
the tach inputs like this:

The Primary tach input (CKP) is connected to pin 24 on the
MegaSquirt's DB37

The Secondary tach input (CMP) is connected to pin 25 on the
MegaSquirt's DB37

If you're using a relay board: Pin 24 goes through to position
15, Tach/Ignition for the CKP/Primary Tach Input. Pin 25 goes through to
position 7, S1 for the CMP/Secondary Tach Input. You'll need to make sure
your relay cable has this wire in place, if so then this will work fine.
All of my MS-II ready relay cables have this wire in place.
(black loom covered cables are MS-II ready, old MS-I grey cables do not have
this wire)

-How to mod a MegaSquirt-I PCB2.2 ECU-

Parts Needed for Input Mod: (1) 1k 1/4w Resistor
and (2) 470 ohm 1/4w Resistors
(Grab a
mk-pullup with your order to get the resistors you need for next to nothing!)

"CMP Signal" -- Lay a 1k 1/4watt resistor across the bottom of the PCB with
one end at pin 11 of the processor (U1) and the other end at the X11 hole.
Bend the resistor leads to raise the resistor just a bit off of the PCB and
allow a lead on one end to drop through X11 and solder that end in place (while
making sure the other end is in place near pin 11 still, and with the resistor
still raised a bit off the board so the leads don't short against anything).
Then use needle-nose to hold the resistor lead to pin 11 and solder it to the
pin. Now to get the 5v pullup use a 470 ohm 1/4w resistor and solder one end
of it to the first resistor at X11 (just tie them together) and the other leg of
it to the small un-labeled hole just above and to the right of D9 (when looking
at the PCB from the top that is). Do not connect to the leg of D9 itself -
you will be using a small hole in between D9 and R13. Once again raise this just enough off of
the PCB to prevent it from shorting with any of the leads sticking out on the
board. (Heatshrink tubing over the whole wire/resistor assembly works nicely)

The new "cap mod" turns this into a low pass filter that helps avoid misfires
caused by a noisy CMP signal. Solder a length of wire to a 0.1 uF capacitor, and
connect this capacitor-on-a-wire between pin 11 on the processor and a ground
point. The second hole from the bottom on the JP1 header is a good ground point.

"CKP Signal" -- We just need a 12v pullup.
Install a 470ohm 1/4w resistor between the right side (non-band) end of D5 and the right
hole (banded) end of D9.

-How to mod a MegaSquirt-I PCB3.0 ECU-

First off when you build up the PCB3.0 board configure
the tach circuit for Hall/Opto/Points (step
52). When you get to optional components that say to only install them if
you are triggering from the negative side of the coil; you aren't -
so don't. Note that normally my pre-assembled MegaSquirt-I
ECUs (MS130-C) are assembled and loaded with the standard B&G fuel only
firmware, which means they are configured for a fuel only install to trigger
from the negative side of the coil. It's easy to reconfigure them,
click here for how.

Parts Needed for Input Mod: (1) 1k 1/4w Resistor and (2) 470 ohm
1/4w Resistors (Grab a
mk-pullup with your order to get the resistors you need for next to nothing!)

"CMP Signal" -- Lay a 1k 1/4watt resistor across the bottom of the PCB with
one end at pin 11 of the processor (U1) and the other end at the IAC1A hole.
Bend the resistor leads to raise the resistor just a bit off of the PCB and
allow a lead on one end to drop through IAC1A and solder that end in place
(while making sure the other end is in place near pin 11 still, and with the
resistor still raised a bit off the board so the leads don't short against
anything). Then use needle-nose pliers to hold the resistor lead to pin 11 and
solder it to the pin. Now to get the 5v pullup use a 470 ohm 1/4w resistor and
solder one end of it to the leg of the first resistor to IAC1A and the
other leg of it to the 5v+ hole just above the proto area. (This is a long
reach so you'll need to use a bit of wire to get across the board.) Once again
raise this just enough off of the PCB to prevent it from shorting with any of
the leads sticking out on the board. (Heatshrink tubing over the whole
wire/resistor assembly works nicely)

The new "cap mod" turns this into a low pass filter that helps avoid misfires
caused by a noisy CMP signal. Solder a length of wire to a 0.1 uF capacitor, and
connect this capacitor-on-a-wire between JS8 and SG or a ground hole in the
proto area.

"CKP Signal" -- We just need a 12v pullup.
Install a 470 ohm 1/4w resistor between the right side (non-band) end of D1 and the left
leg (banded end) of D9.

Click for a larger view (does not show cap
mod)

Fuel Only Installation

Skip the Spark output section below as well as the ignition and dwell
settings. You should be able to share the CMP and CKP CAS signals with
the stock ECU to get your TACH signal to trigger the MegaSquirt so you can
take control of the fuel injection on your 4G63 and leave ignition control
to the stock ECU for now. This is a great way to 'get your feet wet'.
Learn the basics of installing and tuning the MegaSquirt EMS system, and
then when you're ready it will be pretty easy to add in ignition control as
well by following the Spark Output section below. For fuel only
control though you just need to wire up the rest of the sensors (IAT, CLT,
O2, TPS) and make sure you are getting good readings from them and a good
TACH signal on the MegaSquirt. At this point you've still taken
control of nothing, you've just hooked all of the MegaSquirt INPUTS.
Now comes the fun parts... wire up the injectors! If you use new
injector connectors and new wiring from the MegaSquirt it will be easy to
swap from factory ECU control of the injectors to MegaSquirt control and
back if you need to while you work out your tuning. The PCBv3 wiring
diagram for all of the sensors and injectors is
here. The PCB2.2 wiring diagram is
here.

Taking Control of the Ignition --

Decision time-- use the stock ignitors or use dual BIP373 coil drivers.
I'm going to document both options for you here, but I'd recommend using the
stock ignitors as it's simpler, and they will properly trigger your tachometer.

Only use one method or the other for spark output,
don't try to combine the two!

Option 1: Spark Output to factory DSM ignitors:
(Recommended)

Next use two 1k ohm
resistors as pictured below, along with two bits of wire to bring the
signals out to the DB37. This will condition the board to use the
stock ignitors and coil packs. Take each resistor and cut off all but
about ¼ of an inch lead on each side, hook both ends and loop them
around the pins that were already soldered. The picture below shows
where they go. The resistor goes from the 5v side of each resistor to
the negative leg of the respective LED. This is then brought over to the
db37 with two lengths of wire (one for each). The top resistor goes to
IGN and the bottom resistor goes to IAC2B.

When wiring up your ECU later: Spark
Output A will come out on pin36, and Spark Output B
will come out on pin31.

Then take spark output A to the ignitor trigger wire (coming off the Factory
ECU) for cylinders 1 & 4, and attach spark output B to the ignitor trigger wire
for cylinders 2 & 3.

Things to be careful of:

IF USING THE STOCK IGNITORS:

When the MS is powered off, it's spark triggers are grounded. So you
MUST make sure the MS is powered on if the coilpacks/ignitors are also powered on! During installation, it's common to have the MS attached to the ignitors, and have the ignition key "on," but not have the MS powered up yet.
So I make sure I do power and grounds first to the MS, and attach the spark
outputs LAST before I am ready to start the car.

You'll know you're doing it right if the "power transistor" (a.k.a. the ignitor) is not too hot to the touch.

IF USING THE BIP373 IGNITORS:

In MegaTune's Ignition Settings, 'Spark Output Inverted' must be set to YES.
And you should enable Dwell Control. Skipping either of these will cook
your BIP373's, and possibly your coils. (more info on MegaTune setup
below).

What about everything else???

Most of my 'how to' articles focus on the ignition system control, that's
because the rest of the sensors and injectors are pretty much the same for every
car out there, with only minor differences that are well covered in the
MegaManual. The tricky part is taking control of the stock ignition system
so that's what we focus on covering for you here. For everything else
you'll find the
MS1/Extra
manual will cover you very well. Other things the stock ECU controls,
and what to do about them, include:

Idle air control valve: Not supported with MS1. You can add a PWM
idle control valve, or run without this.

Voltage regulator: Not an issue on a 1G, but the 2G had voltage
control built into the ECU. You can use an external voltage regulator
instead.

Air condontioning: Control the compressor using a relay.

TunerStudio / MegaTune Configuration

You need to use a timing light to calibrate the MS's timing to the DSM
timing. To do this, run "fixed angle" of 15 degrees and adjust the "trigger
angle" until the timing light flashes while the motor is on the X degree mark on
the crankshaft. This way, whatever timing megasquirt is commanding is actually
happening. Here are my (Dieselgeek's) usual spark settings:

Dwell settings:

A word about DSM ignitions: With new plugs and wires, these can spark
up to 35psi if you set the dwell to 3.8ms. Bad wires and
plugs can cause all kinds of running issues, namely spark blowout at low psi.

MegaSquirt-II

MS2/Extra has a dedicated wheel decoder mode for the 4G63, so you won't be
using the generic wheel decoder. There are
several ways to make this work - note that our way isn't the same as the
MS2/Extra manual. However, there are several ways to make this work, and if you
follow all the steps in one single write-up, you'll be good to go. The potential
trouble spot can happen if you mix and match write-ups.

This article uses a different pinout for the MS2 than the MS1. MS2s normally
have the IAC1A through IAC2B jumpers populated by a stepper IAC valve. In this
write-up, we'll leave those where they are in order to control the stock IAC
valve. Here's the pinout we will be using.

Board version

V3.0

V3.57

CKP signal

DB37 pin 24

DB37 pin 24

CMP signal

DB37 pin 5

DB15 pin 7

Spark A

DB37 pin 36

DB37 pin 36

Spark B

DB37 pin 6

DB15 pin 10

-How to mod a MegaSquirt-II PCB3.0 ECU-

Our version will have you use the VR input circuit for the CKP input and a
basic logic level input for CMP. Jumper TachSelect to VRIN and TSEL to VROUTINV.
Note that it will be easier to add the MAP sensor after adding
these mods, as it gets in the way of the SPR3 and SPR4 holes.

Parts Needed for Input Mod: (1) 1k 1/4w Resistor and (2) 470 ohm
1/4w Resistors (Grab a
mk-pullup with your order to get the resistors you need for next to nothing!)

"CMP Signal" -- Lay a 1k 1/4watt resistor across the bottom of the PCB with
one end at JS10 and the other end at the SPR3 hole.
Bend the resistor leads to raise the resistor just a bit off of the PCB and
allow a lead on one end to drop through SPR3 and solder that end in place
(while making sure the other end is in place near JS10 still, and with the
resistor still raised a bit off the board so the leads don't short against
anything). Bend the other end to JS10 and solder it in place. Now to get the 5v pullup use a 470 ohm 1/4w resistor and
solder one end of it to the leg of the first resistor to SPR3 and the
other leg of it to the 5v+ hole just above the proto area. (This is a long
reach so you'll need to use a bit of wire to get across the board.) Once again
raise this just enough off of the PCB to prevent it from shorting with any of
the leads sticking out on the board. (Heatshrink tubing over the whole
wire/resistor assembly works nicely)

The new "cap mod" turns this into a low pass filter that helps avoid misfires
caused by a noisy CMP signal. Solder a length of wire to a 0.1 uF capacitor, and
connect this capacitor-on-a-wire between JS10 and SG or a ground hole in the
proto area.

"CKP Signal" -- We just need a 5v pullup.
Install a 470 ohm 1/4w resistor between VRIN and the 5V source in the proto
area.

Our version will have you use the VR input circuit for the CKP input and a
basic logic level input for CMP. Put the JP1 jumper in the 1-2 position, and J1
in the 3-4 position.

Parts Needed for Input Mod: (1) 1k 1/4w Resistor and (2) 470 ohm
1/4w Resistors (Grab a
mk-pullup with your order to get the resistors you need for next to nothing!)

"CMP Signal" -- Lay a 1k 1/4watt resistor across the bottom of the PCB with
one end at JS10 and the other end at the PAD7 hole.
Bend the resistor leads to raise the resistor just a bit off of the PCB and
allow a lead on one end to drop through PAD7 and solder that end in place
(while making sure the other end is in place near JS10 still, and with the
resistor still raised a bit off the board so the leads don't short against
anything). Bend the other end to JS10 and solder it in place. Now to get the 5v pullup use a 470 ohm 1/4w resistor and
solder one end of it to the leg of the first resistor to PAD7 and the other leg
of it to the 5v+ hole just above the LED area. Once again
raise this just enough off of the PCB to prevent it from shorting with any of
the leads sticking out on the board. (Heatshrink tubing over the whole
wire/resistor assembly works nicely)

The new "cap mod" turns this into a low pass filter that helps avoid misfires
caused by a noisy CMP signal. Solder a length of wire to a 0.1 uF capacitor, and
connect this capacitor-on-a-wire between JS10 and SG or a ground hole above the
LED area.

"CKP Signal" -- We just need a 5v pullup.
Solder a 1K resistor in the R57 slot, above JP1.

Taking Control of the Ignition --

Decision time-- use the stock ignitors or use dual BIP373 coil drivers.
I'm going to document both options for you here, but I'd recommend using the
stock ignitors as it's simpler, and they will properly trigger your tachometer.

Only use one method or the other for spark output,
don't try to combine the two!

Option 1: Spark Output to factory Mitsubishi ignitors:
(Recommended)

The mods in this article
require the spark output to be set to going low. There are some other
output mods floating around out there that use the opposite setting.

Next use two
270 to 330 ohm
resistors as pictured below, along with two bits of wire to bring the
signals out to the DB37. This will condition the board to use the
stock ignitors and coil packs. Take each resistor and cut off all but
about ¼ of an inch lead on each side, hook both ends and loop them
around the pins that were already soldered. The picture below shows
where they go (Note: In this picture they are marked as 1K resistors). The resistor goes from the 5v side of each resistor to
the negative leg of the respective LED. This is then brought over to the
db37 with two lengths of wire (one for each). The top resistor goes to IGN and the bottom resistor goes to
SPR4.

When wiring up your ECU later: Spark
Output A will come out on pin 36, and Spark Output B
will come out on pin 5.

V3.57 mods:

This board already has a 1K pull up on the spark outputs. If you need a
higher pull up value (such as for running our IGN-1A coils), you can run
330 ohm resistors from a 5V source to PAD1 and PAD3.

For spark output A, wire PAD1 to the center hole of Q16.

For spark output B, wire PAD3 to PAD15.

When wiring up your ECU later: Spark
Output A will come out on pin 36 of the DB37, and Spark Output B
will come out on pin10 of the DB15.

Option 2: Spark Output to MS-internal BIP373 Coil Drivers:

Things to be careful of:

IF USING THE STOCK IGNITORS:

When the MS is powered off, it's spark triggers are grounded. So you
MUST make sure the MS is powered on if the coilpacks/ignitors are also powered on! During installation, it's common to have the MS attached to the ignitors, and have the ignition key "on," but not have the MS powered up yet.
So I make sure I do power and grounds first to the MS, and attach the spark
outputs LAST before I am ready to start the car.

You'll know you're doing it right if the "power transistor" (a.k.a. the ignitor) is not too hot to the touch.

Spark output must be set to going low with these mods.

IF USING THE BIP373 IGNITORS:

In TunerStudio's Ignition Settings, spark output must be set to going high.
And you should enable Dwell Control. Skipping either of these will cook
your BIP373's, and possibly your coils. (more info on TunerStudio setup
below).

What about everything else???

Most of my 'how to' articles focus on the ignition system control, that's
because the rest of the sensors and injectors are pretty much the same for every
car out there, with only minor differences that are well covered in the
MS2/Extra Manual. The tricky part is taking control of the stock ignition system
so that's what we focus on covering for you here. For everything else
you'll find the
MS2/Extra
Manual
will cover you very well.

Voltage regulator: Not an issue on a 1G, but the 2G had voltage
control built into the ECU. You can use an external voltage regulator
instead.

Air condontioning: Control the compressor using a relay. The latest
(3.3.1 and later) MS2/Extra codes allow using an idle up input to
increase idle speed.

TunerStudio Configuration

You need to use a timing light to calibrate the MS's timing to the motor's
timing. To do this, run "fixed angle" of 10-15 degrees and adjust the "trigger
angle" until the timing light flashes while the motor is on the same 10-15 degree mark on
the crankshaft, this needs to be spot-on. This way, whatever timing Megasquirt
is commanding is actually happening.