Looks like it's working now. A little sleep and some thought and it all makes sense. I was forgetting to give a w command so it was just verifying (is that a sensible default action?), which would fail if I hadn't actually programmed a firmware. Manually programming the firmware via the ISPI didn't set the magic bits to tell the bootloader to try to run it. Either way, now it seems to boot and run and if I type Man I get Hello>.

I wish there was an RPM for megatunix... Doesn't matter, it doesn't seem to support genboard. Is the best on Linux going to be [dumb terminal]? Got the dock for my laptop which has a hardware serial port (usb-serial adapter I've been using loses recieved bytes for some reason). Got megatune up and running, time to work on more soldering, will start with sensors so correct functionality can be verified.


Got tired of wondering, so I built a dapa cable like [this] but just wires, no resistors. For the config I used the dapa section from the config available [here]. It's the same config as the one built into the config that comes with the avrdude rpm available [here], but without the vcc. Ran into problems because I hooked up to MOSI and MISO, but I was fixed up by [this guy's notes]. Anyway, the AVR chip is live at least, and it's communicating serially and worst case I have a torched max like [him], so I can follow those tests.

Tried to replace the bootloader like [here] and now it looks like I can get into the boot loader with proper responses to S, v, etc. I also am seeing gibberish if I hook up a serial cable with a terminal while uploading, (usb-serial adapter still doesn't work in the same way, but it does show gibberish when uploading an image). I tried uploading newer firmware (1.0.53), no go. now I just get a loop of gibberish. I reflashed to that older version and as I seem to get some sort of serial communication now though, so I tried uploading via RS232, but I get:

ihex file read and found OK
we say p
AVR in sync
we say S
we say v
we say V
error at page 0
157,7,192,253error at page 256
0,63,52,141error at page 512
128,196,135,14error at page 768
129,68,135,142error at page 1024
5,220,171,88error at page 1280
21,137,62,165too many errors, bailing out
Verified(0 1280)
TOTAL serious errors at verify: 6

Turns out that "gibberish" I saw was the bootloader operating the serial port at 19.2 instead of 9600. Loading the firmware via ISPI results in a non-responsive serial port (assumably overwrote or erased the bootblock), and it cannot be coaxed into bootloader mode by jumpering the two serial port pins. Doesn't work with a later version either.

The bootloader wouldn't load the vems code, so I hooked up the serial cable now and tried again...and it verified successfully!

To fix the flagword, it's simplest to write again with (w option).


Hooked up a fuse holder with a 500mA fuse for F1, the "wire" next to it, inductor, and power ground wires to EC36 (hooked into a PC power supply for now). Oops! mixed up the ends of the fuse and the "wire" so the portion of the circuit with the inductor had no power while the circuit on the far side of the "wire" had 12V. Seemed nothing had power going through the startup voltage checks. Hopefully this didn't mess up my board; I'm now seeing power everywhere, but nothing at the serial port, at least according MegaTune or by just typing gibberish at the terminal. Just in case it's my cheap USB-Serial adapter, I tried my desktop ( on Linux) and it doesn't seem to see anything either. Quadruple checked the serial pinout, it matches [the pinout here] directly wired to SV2. What else to check or try?


More of life conspiring to put this way in the back burner. Got a week off coming up, so working on re-figuring out how to set this up. Main questions are:

Also, in my OE setup, the Inj+ common isn't available to the PCM.

You must connect EC36pin23 in any case! (FlyBack is a must!) Choose a +12V than, that powers the injectors (likely through a fuse or a fuse and relay). At least the injectors shouldn't get +12V power when this line is 0V

Will you want injector-PWM-ing ? Many finds 6.8Ohm power resistors a good idea for low-Z injectors, or choosing high-Z whenever possible (easier config, less sensitive to injector-opening characteristics variations in the set of injectors).

Connect GND and all 4 GND5 at EC36, with max 20cm, strong wires. There must be a solid path to battery- , of course. Examine and measure the OEM harness carefully before deciding about not using a separate wire of your own.


Finally recovered from the quarter from hell. Goal is to get this thing up and running by the end of May in a more stable form so I can sell my other car.

Turbo has been in for almost a year now. Running only 4psi at the turbo, 2.5psi at the manifold. Fuel control is the stock setup with 25% larger injectors and a 2 bar MAP sensor supplied by 8.5V instead of 5V to bring open loop to stoch (passes emissions with better than it used to). Unfortunately the dumb knock sensing method used by the computer is triggered by loose bearings and piston slap so it's been disabled (replaced with a resistor of appropriate value). The trash engine in there that I wanted to use to get operational has maybe 5K, 10K miles at most left on it before it needs a complete rebuild. Replacement engine is already standing by...gotta get going!

So I can see how the Stilo code should work, although I'm somewhat disenheartened by the apparent failure of using the stock CAS. It should at least get it working better than using the builtin DIS timing.

Ordering parts this week...


The DIS module's output gives no indication of which cyllinders are at TDC. Basically this limits me to 1 bank batch until I ditch the DIS and deal with the VR sensor directly or add in the cam sync generator (heard on IRC that the current code doesn't apprecate sync signals in the advance window).


This car has a GM DIS, see for a crank picture or for more general info.

It's an extra pulse instead of missing and it's just plain weird compared to the rest.

From discussions on IRC, it doesn't sound like anyone's worked on this sort of set up.

Good that you bring it up on wiki, because you must be very lucky to get full-picture answers on IRC. The code written for MembersPage/FiatStilo, which considers the small gap (the shortest gap between two consequtive trigger pulses) as "missing tooth" (should be called indextooth), should be able to drive this wheel too. Config changes:

However, it should be tested on the table. This wheel is better than MembersPage/FiatStilo's since it allows wasted spark without camsync. I see a small problem: RPM is calculated from the time between tooth 0 and tooth 3 (another_trigger_tooth), which is uneven for this wheel. This results in some perceived RPM fluctuation, which should be fixed (small firmware mod).

Possible/probable roadblocks requiring extra code are:

sync pulse comes 70 ATDC # 4cyl

With 4cyl, 70 degree ATDC = 110degree BTDC. I don't see why this would be a problem, it's outside the ignadv window, even if ALS is used.


So, finally time to get going on this, shopping list/plan is as follows (comments appreciated):


6 fets

1 dpak fet

idle stepper driver


WBO2, harnesss, connector

cam sync generator

egt thermocouple/connectors

COP plugs

4 igbt drivers for COP

Genboard 3.3

no case/connectors

stock computer case and connectors (attempt at plug and play)

Use jumper wires and a stub board to connect from genboard to connectors removed from stock computer



4 injector drivers (driving 36lb low impedance injectors from a thunderbird)

batch fire 2+2 for now, hopefully sequential later

1 wbo2 heater

1 power steering orifice (pwm to control properly? need to scope, probably add later)

1 boost controller (using an egr solenoid probably low current, use extrafet spot?)

idle stepper driver - for the idle stepper...


egr control (stock solenoid)

canister purge solenoid (stock)

fuel pump (via relay)

fan (via relay)

air conditioning (probably relay, but might need to move to extrafet)

3 - stock check engine, coolant temp, and shift lights

DIS bypass signal (external circuit/igbt channel ?)

bypass an igbt channel and directly drive the est signal to the DIS


stock coolant temp sensor (standard GM type)

stock air temp sensor (same)

stock knock sensor (ditto)

2 bar GM map sensor

crank position signal from DIS module (square wave, hallish? even though sensor is inductive)

cam position signal from cam sync generator

stock throttle position sensor

stock nb O2, upgrade to wbo2 once running


Getting the speedometer to work as it's driven by the PCM which takes the speed sensor signal and does the math to accomodate different size tires and then sends it to the speedo. This may be doable with an external part, will worry about this later...

Need a digital input for AC request line.

Reading the crank signal from the DIS should be easy because it's just a square wave. Controlling may be more difficult as it needs high or low so the igbt won't work. Since the ixdn404si can pull high or low, jumpering the igbt pads would do the trick or just connect directly to chip (maybe configure as input?). Cam sync signal is also in the same format, but won't be useful until sequential injection comes into play.


Wire up injectors, idle stepper, and sensors, get idling with DIS controlling ignition, then get DIS working, then all the other niceys/emissions as time/money allow.