Hi all.
Couldn't find anything on this site (or others) about putting a megasquirt on these motors. I'm about to start the whole project, will be a while to get to a running engine as I have to transplant it into a Sierra first. And I have plenty of things I have to do to the Sierra before that happens (body work, sound deadening, reassemble the interior...)

But I will either update this post, Or the thread, which ever is suitable, throughout the process. And I'm hoping, that by the end of it, with a few revisions, that it will be an easy to follow, almost step by step guide to installing a MS2 on a G13BB engine.
I'm not any authority on megasquirt, Suzuki's, or tuning. Just want to relay what I learn, and hope that it helps someone else.
Why am I doing this to a plain old Suzuki? Because I can. I like tinkering with stuff, I like electronics, I love learning new things. I've never done anything like this, closest I have done is rejetting carb's on my bike. So it's been an interesting learning curve.
I will be using a Megasquirt 2, v3 board, running MS/Extra firmware. Learn more at
http://www.megasquirt.info/ Basically, the MS2 is an Engine management system (EMS) or an Engine control unit (ECU) that you assemble, install, and tune yourself. It has an 'auto tune' feature which is nice. It can also handle damn near any engine. MS systems are installed in a few record setting land speed record cars, also a lot of drag cars, jet boats, track cars.. It will run 99% of internal combustion engines. V10's, V12's, W16's.. Just the level of build/addons/extra's changes. Forced induction, launch control.. It has all the functions of the 'big' name brand ECU's, but at half the cost..
If you have an android device, you can also have a 'dash' or complete readout on the device, and can even make tuning changes from it. No wires needed. All done by Bluetooth

(I have no affiliation, with MS or anyone else. Just like their systems)
Anywho. For the sake of anyone else's sanity, ill give up the info that has taken me dozens of hours trawling the Internet to find.
Ok, the motor. (this is from the 99 Jimny, there are a few versions of the G13BB, I wont go into them all here) 1.3ltr, SOHC, 4 cyl, twin coil running 2 spark plugs each in a wasted spark setup (both sets of spark plugs fire (1&3, 2&4), but only 1 plug is igniting the fuel, the other plug sparks on the exhaust stroke). 4 injectors. There is only 1 trigger wheel, at the back end of the camshaft (on other versions of this engine, there is also a crank sensor)
Now, the bit I had a lot of trouble with. The trigger wheel. For Injection and spark timing, the ECU needs to be able to tell where the engine is in the rotation, where the cylinders are in the stroke pattern. This is done with a trigger wheel and sensor, the wheel has teeth, or holes, that a sensor pics up, that indicate the different positions the engine is in, TDC, BDC, 15* past TDC etc.. These wheels can either be on the crankshaft, or on the cam, or sometimes both.
This simulates the 'points' system on older engines. More modern engines that still use a distributer will have 'electronic points' which act like the OLD points, but with modern sensors. Anyway..
On this engine this timing/triggering is done by a VR sensor (
http://en.wikipedia.org/wiki/Variable_reluctance_sensor) and a toothed wheel attached to the end of the cam shaft, where the distributor is on the older engines.
The Suzuki trigger wheel is a strange config, total of 11 teeth. 3 pairs of 2 teeth close together, and 5 teeth spaced between them. This had me stumped. And I couldn't find any references to this type of trigger/tooth setup.
After hours and hours going through dozens and dozens of pages over about 3 or 4 days, I finally found this
http://www.msextra.com/doc/ms2extra/MS2 ... Vitara.htm This is exactly what is on the G13BB, and apparently, the Vitara 2ltr, don't know the engine code for the Vitara. But that's not the point. The point is, Someone has already done the hard work in figuring out the tooth arrangement, and the wheel is natively recognized inside the
megasquirt code.
What this means is that it's essentially plug and play. Wire it all up, make the required changes to the ecu, select the right settings in the software and hey presto... IF it wasn't supported in this way. Then you would need to stuff around fitting other trigger wheels and sensors. Which can be a royal pain.
There are a few things that need to be done to the Megasquirt during the build to run this setup..
The G13bb uses High impedance (or High-Z) injectors. This is a good thing, LowZ injectors require extra circuits, and will generate a lot of electrical 'noise' that will mess with a lot of things. You don't need to make any modifications for this. Its just something you need to know

Depending on the source, These injectors flow between 170 and 190 cc/min. I THINK I have the 188cc/min injectors, so thats what im going with at the moment. May change this later on.
You will need to set the megasquirt up to control the idle control valve, or ICV, or IAC. The idle control valve on the g13bb is a or PWM valve.
Unfortunately, the IAC is a '3 wire', which isn't DIRECTLY supported by MS. BUT there is a simple circuit that you can build that will enable it to work.
Basically, 1 wire gets +12V, Another wire goes to ground VIA a resistor, the 3rd wire goes back to the MS to one of the IAC output pins. This page
http://www.msextra.com/doc/ms2extra/MS2 ... .htm#FidleExplains what needs to be done, and how it works. Read the bit about "bosch 3 wire". The Jimny uses a Denso valve, but it works the same. Again, certain things are required to be done to the ecu during the build to run this PWM valve, and I won't go into it here.
You need to set it up as a VR sensor. NOT a Hall sensor setup. This is discussed in the build instructions so I won't go into it here.
With the ignition system running twin coils and a wasted spark, you need to do yet more modifications to the Megasquirt. The coils are what they call a "logic level", pretty much, they have a type of relay inside them, which only needs a small current/voltage to activate. "Normal" coils need a much greater current/voltage. With these 'logic level' coils, a very simple circuit needs to be built. The circuit required to run this setup is here
http://www.msextra.com/doc/ms2extra/MS2 ... htm#5Vpull This will allow you to drive the 2 coils directly the same way the stock ECU does, firing one, then the other.
The engine has a MAP sensor (Manifold Absolute Pressure) which basically tells the ECU what load the engine is under, combined with other sensors, this is what tells the ECU how much fuel the engine needs. NOW there IS a way to use this sensor with the MS2. BUT the MS2 comes with a MAP sensor that you install into the ECU box. Im going to be using the MS2 sensor, until I get the car up and running well, THEN I will look into utilizing the stock sensor. Its pretty easy to wire in, but it needs to be calibrated, and if you get it wrong, it can cause all sorts of issues. So making the first start/run as simple as possible, Im leaving it until later.
Ok, So this is where I am up to at the moment. I have ordered the MS kit today. So I will begin the assembly once it gets here, and I will post the results

If I have missed anything, let me know, and ill do my best to get the info and post it up.