Getting started in ECU mods?

Technical information, definitions, advice, and support for factory ECU remapping, aftermarket systems, and much more.
Post Reply
discostu
New Member
Posts: 7
Joined: 07 Jan 2019, 16:07
State: New South Wales
Model: Pajero NL
Engine: 3.5-Litre 6G74 V6 24V SOHC
Transmission: 5 Speed Manual

Getting started in ECU mods?

Post by discostu » 10 Jan 2019, 22:05

Hey guys. I somehow got myself into thinking about the world of ECU tuning etc and would like some advice in where to start learning what I need to know.

I've recently bought an unregistered NL pajero which I'll be getting fixed up soon. Getting thinking about monitoring data from the ECU led to hearing about remapping the ECU etc. Stumagoo on the pajero forums (who is also a member here it seems) has helped me out a lot in trying to understand things and given me some info to look at through ECUflash and get a feel for things.

I've now gotten the longer term goal of implementing a second ignition advance map for the ECU to use while running on LPG. I did find the jaycar kit for modifying the advance, but I've got 3 coil ignition and could only find 2 of the single coil kits (I figure in this setup I would require 3, and all adjustments would be at RPM x 3). These kits are on clearance at a store for only $11, so if they are any good to you guys who still have distributors/single coils then let me know. I also found a guy who implemented a full diy solution and published the code and some hand drawn circuit diagrams, but to be honest that is all looking too hard right now. Happy to share if its any use to anyone though

For the ECU to use a second advance map I understand that I would need to write the map into the bin file and create the info for it in the definition file. I'm also well aware that this is all a fair way off for me, but trying to give you guys a reasonable idea of where I'm at knowledge wise.

So basically, I'm trying to find an ECU tuning 101, but having a bit of trouble. A lot of the info I'm finding seems to assume I'm already familiar with the programming side. Or something like that...I think! Basically I'm still lacking in knowledge enough to get a little dumbfounded by many terms. Stu talked about figuring out code from the HEX, but all the files I've loaded up in ECUflash just have the info all there nicely projected. I'm wondering how it goes from the bare file the first bright fellow pulled off his ECU and was unknown, to the point where we had the nice info shown in ECUflash.

I've always had a bit of an interest in programming PICs for various purposes, but I've always just put it into the "later on" basket. I figure this will be a project with a decent purpose that will help me learn this stuff and be useful in the future for many more things.

So, to give the short version of all that-is anyone able to point me towards something/s that will help me learn all this ECU tuning and modifcation stuff from the bottom up, a dummies guide if you will, that will then give me the background knowledge to know how things have gotten to this point and allow me to get to the stage of doing things myself?

Many thanks in advance

Stuart

WytWun
Valued Contributor
Posts: 536
Joined: 09 Apr 2011, 23:22
State: Australian Capital Territory
Model: Mitsubishi Magna TJ AWD
Engine: 3.5-Litre 6G74 V6 24V SOHC

Re: Getting started in ECU mods?

Post by WytWun » 11 Jan 2019, 00:40

discostu wrote:
10 Jan 2019, 22:05
Hey guys. I somehow got myself into thinking about the world of ECU tuning etc and would like some advice in where to start learning what I need to know.

I've recently bought an unregistered NL pajero which I'll be getting fixed up soon. Getting thinking about monitoring data from the ECU led to hearing about remapping the ECU etc. Stumagoo on the pajero forums (who is also a member here it seems) has helped me out a lot in trying to understand things and given me some info to look at through ECUflash and get a feel for things.

I've now gotten the longer term goal of implementing a second ignition advance map for the ECU to use while running on LPG.
Adding support for extra fuel and ignition maps is actually one of the easiest mods you can make with the 1995-2005 Mitsubishi ECU code, whether H8 (your NL) or SH2 (NM & NP 3.5l), however you do have to understand the processor code in order to find the right place to make the modification.

I've had little interest in the H8s, sticking with later SH2 ECUs used in my own car, but one member here with lots of H8 knowledge might see this and step in (if he's still around).

Nonetheless...

The first thing to locate for H8 ECUs is the H8/539F hardware manual - I think there might be PDF copies available from evoscan.com in the information section but you should be able to find it on the Renesis website too. The hardware manual describes not only the actual processor instructions, but all the peripheral functions built into the chip (timers, I/O ports, ADC inputs, PWM outputs etc).

The first piece of software you should become familiar with is a binary/hexadecimal file viewer/editor. If you used Windows, HxD is a good starting point.

If you're serious about working with the H8 ECU, then you'll also need a copy of IDA to disassemble the ROMs to assembly source code. The H8/500 series is supported in the Starter edition but the SH2 requires the Pro edition (twice the price!). This software is unfortunately very expensive but its the only option I know of for the H8 (there is an open source alternative for the SH2, which is what I use). There are some tricks to using IDA to make disassembly easier - the info here is one of the major bits. Sadly a lot of good info for H8 ECU work disappeared when the GeekMapped website disappeared :(

While it is possible to manually disassemble code without a disassembler, based on the info in the hardware manual, it can be very slow going - automated disassembly speeds things up enormously.

After you've worked out what you need to change, you then need to rebuild the ROM image with the changes. For simple modifications, the usual approach is to manually "patch" the existing code with different instructions and add extra code in other unused parts of the ROM using the binary file editor. The more sophisticated approach is to fully automate the rebuild by assembling the ROM source code (from the disassembly) and linking it. There are some freely available H8 tools here - they don't explicitly support the H8/500 series but I think they've been used to do so.

Then you need to modify the ECUFlash definition file so that you can edit the new maps and any other data that you've installed to control the modified code.

I've actually installed a modified Magna SH2 ROM in 2 LPG cars with some success (some basic LPG ignition maps for these have been posted elsewhere on this forum). Apart from the necessary data structures for the added maps, only half a dozen CPU instructions needed to be patched for the LPG map switching functionality (the actual modified ROM supports more than that though). This is because Mitsubishi's code included a lot of easily re-purposed functionality, such as an unused ADC input which is routinely sampled and the value stored in memory (even though it isn't used by anything) and a mechanism that allows selecting maps (up to 8) based on the "Spec Number" set in the ROM. The code patch just calculates the spec number from the stored ADC input value with bit shifts, instead of using the stored value.

The ECUFlash sub-forum of the EvolutionM forums has some H8 info - look for references to the Evo 5 & 6 (the Evo 7 and later all use SH2 ECUs). Some of the programming practices noted for SH2 ECU code also apply to the H8 ECUs as the original C language source code was migrated from the H8 to the SH2 as development continued. There might be some other sites with H8 related info, particularly for the Evo 5/6 and Galant/Legnum.

discostu
New Member
Posts: 7
Joined: 07 Jan 2019, 16:07
State: New South Wales
Model: Pajero NL
Engine: 3.5-Litre 6G74 V6 24V SOHC
Transmission: 5 Speed Manual

Re: Getting started in ECU mods?

Post by discostu » 11 Jan 2019, 08:20

That is very helpful, thank you. Broken things down really clearly. I'll start working my way through all of that and see if I can get things unjumbled in my mind.

I was reading about the extra ignition maps you had added, which got me quite interested. I'm surprised you say its fairly straightforward, as I thought it was probably about the most you would make changes to existing things (rather than adjusting existing maps). Good to hear of the unused input, as that was something I was going to look into also to monitor what fuel it is running on

I'll give the VAG COM data monitoring cable a go that is in the end of this ECU section. Unless someone knows they don't work with the NL?

Really appreciate the reply. Impressed with some of the stuff you guys have achieved on here

WytWun
Valued Contributor
Posts: 536
Joined: 09 Apr 2011, 23:22
State: Australian Capital Territory
Model: Mitsubishi Magna TJ AWD
Engine: 3.5-Litre 6G74 V6 24V SOHC

Re: Getting started in ECU mods?

Post by WytWun » 11 Jan 2019, 21:06

discostu wrote:
11 Jan 2019, 08:20
I'll give the VAG COM data monitoring cable a go that is in the end of this ECU section. Unless someone knows they don't work with the NL?
To reflash an H8 ECU you will avoid lots of frustration by buying a genuine OpenPort 2.0 cable. I've heard nothing good about any of the clones available from Asia :roll: :( The OpenPort 1.3U isn't satisfactory for flashing H8 ECUs but works fine for flashing SH2 ECUs.

While the original VAG COM cables with genuine FTDI chips work for logging some Mitsubishi ECUs - notably Evo 5-9 - they don't work for others including Magnas and Pajeros (at least not AU market models anyway) without modification. The VAG COM cables widely available now use a variety of other chips (including FTDI clones which don't work well) and are essentially useless so I'd recommended avoiding them :(

discostu
New Member
Posts: 7
Joined: 07 Jan 2019, 16:07
State: New South Wales
Model: Pajero NL
Engine: 3.5-Litre 6G74 V6 24V SOHC
Transmission: 5 Speed Manual

Re: Getting started in ECU mods?

Post by discostu » 11 Jan 2019, 23:04

Thanks. Saved me a bit of frustration with the VAG COM cable then. Not really willing to pay $80 odd for one just to log when I can pay a bit more to log and flash. Pity the cheaper ones won't do the job, not that I mind modifying etc

That opens up another question. I'm getting a bit of conflicting info about logging the NL pajero with openport 2.0. From what I can gather the 1.3 (one of them at least) will certainly log fine, but not flash. It seems unsure about the 2.0 logging data, which I will want to do. I contacted EvoScan asking which one will log but haven't heard back, and that was a few weeks ago (although it has been christmas holidays). At least I know that its the H8 ECU, which is a lot more than I knew yesterday!

discostu
New Member
Posts: 7
Joined: 07 Jan 2019, 16:07
State: New South Wales
Model: Pajero NL
Engine: 3.5-Litre 6G74 V6 24V SOHC
Transmission: 5 Speed Manual

Re: Getting started in ECU mods?

Post by discostu » 11 Jan 2019, 23:09

Uuum-do you think I should read the full 900 pages of the H8 hardware manual?? :lol:

WytWun
Valued Contributor
Posts: 536
Joined: 09 Apr 2011, 23:22
State: Australian Capital Territory
Model: Mitsubishi Magna TJ AWD
Engine: 3.5-Litre 6G74 V6 24V SOHC

Re: Getting started in ECU mods?

Post by WytWun » 18 Jan 2019, 21:13

discostu wrote:
11 Jan 2019, 23:04
I'm getting a bit of conflicting info about logging the NL pajero with openport 2.0. From what I can gather the 1.3 (one of them at least) will certainly log fine, but not flash. It seems unsure about the 2.0 logging data, which I will want to do. I contacted EvoScan asking which one will log but haven't heard back, and that was a few weeks ago (although it has been christmas holidays). At least I know that its the H8 ECU, which is a lot more than I knew yesterday!
Evoscan supports the OpenPort 2.0 for logging, including H8 ECUs. The OP2 can also log any MUT-II compatible Mitsubishi (H8 or SH2) directly to a MicroSD card without external software but it takes some care and experimentation to get this setup as it isn't well documented (I bought an Evoscan licence so I've never tried it but others have).

All of the OpenPort 1.3 variants will log fine with Evoscan, but none of them are useful for flashing H8 ECUs :(

As I recall the NLs have the same wiring issue as the TF Magnas with respect to flashing which requires a harness mod to work around - it has been posted on here somewhere, either by stumagoo or rush.

WytWun
Valued Contributor
Posts: 536
Joined: 09 Apr 2011, 23:22
State: Australian Capital Territory
Model: Mitsubishi Magna TJ AWD
Engine: 3.5-Litre 6G74 V6 24V SOHC

Re: Getting started in ECU mods?

Post by WytWun » 18 Jan 2019, 21:17

discostu wrote:
11 Jan 2019, 23:09
Uuum-do you think I should read the full 900 pages of the H8 hardware manual?? :lol:
Only the early chapters regarding the CPU register layout, instruction execution, interrupt handling and memory access arrangements are really necessary, at least in the beginning. The chapters relating to the various peripheral functions can be left to a time when you need to look at these in detail.

discostu
New Member
Posts: 7
Joined: 07 Jan 2019, 16:07
State: New South Wales
Model: Pajero NL
Engine: 3.5-Litre 6G74 V6 24V SOHC
Transmission: 5 Speed Manual

Re: Getting started in ECU mods?

Post by discostu » 18 Jan 2019, 23:41

Thanks for that. I did hear back from EvoScan, with the detailed reply just saying that they don't do Pajero's :D I resisted giving them further details of what I needed to do because it seemed obvious that they didn't really want to go looking into it for me. The info you've given here has been very helpful

I did get through some of that manual, but to be honest the stuff I need to understand was all way over my head. Hardware part was fine though!! I've found a few more very basic guides that will hopefully get me to the stage of understanding that stuff at least a bit.

I haven't looked at any of this for a few days though. Been trying to get stuck into the work I need to do on this car, and I stupidly did a compression test and now trying to figure out if I need an engine, in which case I will be going down the magna engine path

Appreciate all the help with this

stumagoo
Member
Posts: 52
Joined: 01 Jul 2014, 23:27
State: Western Australia
Model: Mitsubishi pajero
Engine: 3.5-Litre 6G74 V6 24V SOHC
Transmission: 5 Speed Manual

Re: Getting started in ECU mods?

Post by stumagoo » 26 Mar 2019, 21:53

Good to see you here Discostu..... Wytwun has helped me imensely with his info in the past - I am looking forward to seeing how you progress

and dont bother with Vagcom - been there - tried it..... before I really started to get into it. - the genuine Vag com cables only worked with early versions of ECU flash and the newer ones, as stated most dont use the right chipset

discostu
New Member
Posts: 7
Joined: 07 Jan 2019, 16:07
State: New South Wales
Model: Pajero NL
Engine: 3.5-Litre 6G74 V6 24V SOHC
Transmission: 5 Speed Manual

Re: Getting started in ECU mods?

Post by discostu » 27 Mar 2019, 12:38

Thanks Stu. I happened to read a bit more about the vag-com cables, and realised what you said-you need particular chipset in it and it will only work with things before and after what I need.

I have pondered if I would be saving a lot of time and effort buying an ignition advance processor that they sell for LPG cars overseas, compared to learning all this to be able to add a second ignition map, and work out getting a signal into the computer. I have seen chinese versions of the spark advance units that are under $30 US that I'm pondering trying out. Another use was for the immobiliser to save buying expensive keys, but the thought occurred to me that I could just hook up my RFID type key into the ignition area, and then use cheapo keys for it.

ONe big thing putting me off is the purchase cost of the tactrix cable for flashing for what I imagine wont be a lot of use. Been busy lately, but when I get a bit more time I'll put a bit more effort into getting my head around this all

Post Reply