Introduction to ECU Chipping
by David Blundell
Please feel free to link to this article, but "mirroring" is highly discouraged, as you will not automatically receive updates.
How it all works
With the move from carburetors to fuel injection, computers have assumed an important role in the proper functioning of an engine. The level of precise control possible with a ECU (Engine Control Unit - computer for running an engine) can not only allow for greatly improved fuel economy, but can also allow for fine tuning of an engine to a degree that is arguably impossible with the best carburetors. Many ECUs, including those made by Honda, do data interpolation, allowing them to intelligently compensate for engine conditions that fall "between" known states, allowing for an almost continuously variable response to varying engine conditions. Additionally, the ECU can make small corrections to fuel/timing based on the state of various engine sensors. It is probably fairly fair to say that from the factory, most manufacturers tune for fuel economy, emissions and poor quality gasoline as opposed to power and race gas.
Honda is no exception to these rules about tuning. Basis for this can be seen very clearly by comparing European/US fuel and timing maps to Japanese timing maps for the same engine. Japanese have gasoline that is on average a minimum of about 10 octane points greater than gas sold in the US. Comparing JDM and USDM/EDM timing curves generally show the JDM maps having several degrees more spark advance, reflecting the manufacturer's expectation of better quality gasoline. You have to wonder about how much 205 HP out a 1.8L (ITR) can be improved on within the constraints of pump gas. It wouldn't surprise anyone if another 5-10 peak HP and a considerable amount of low-midrange torque could be squeezed out of an ITR by HOURS on a dyno, and some changes to the ECU program. This goes to show that even on Honda's "performance" motors, very conservative assumptions are made about the quality of gasoline used. If you are willing to run high octane gasoline consistently, significant performance improvements can usually be found by tuning the car for the better quality gas.
This does bring us to an important point. Tuning is best something done on a dyno that can simulate loads (such as a Dynapack or Mustang dyno). Dynojets are only useful for tuning a much narrow range of operating conditions, namely acceleration at wide open throttle through the rev reange. When a Dyno is not available, something to give an objective measure of how the car is responding is a good second choice. Wideband O2 meters and EGT probes can give you some idea of what is going on. Widebands generally provide more direct information about Air Fuel Ratio, but they are generally ineffective for timing adjustment. EGT probes tell how how the exhaust leaving a motor is, which can be used to infer a lot of information. If Air Fuel Ratio is left relatively constant, most changes in EGTs can be attributed to timing adjustment. Air Fuel Ratios will cause changes in EGTs so make sure you have your AFRs nailed reasonably close to your target before trying to use an EGT to tune your timing. This article in intended as a brief introduction, so enough of that.
Don't despair if you don't have access to a dyno, however. Accelerometers (like the G-Spot) measure acceleration forces with fairly good (<1%) precison. If you can record this information as part of your Data Logging procedure, you can do some math knowing the weight of the vehicle and its gearing to come up with horsepower and torque output figures for the car. Again, this method has fairly good precison but relatively poor accuracy. The numbers themselves don't mean a lot, but if you can produce significant and consistent improvements, you have tuned the car better.
A final note about tuning tools - the "butt dyno" is a totally inappropriate way to determine how the car is performing - most of the changes you will make to a computer program will be subtle enough that you probably will not be able to "feel" them accurately. The butt dyno has almost zero precision - I've had many kids report "very different" results from no real changes to a chip. Also, the butt dyno is much better for detecting rapid increases in torque than consistently more torque. Consistent torque is what makes a car fast, not how quickly torque increases. What this means concretely is that a car may "feel" faster on the butt dyno because it has sharp spikes of torque, but in reality it is slower than a car with a smoother powerband with gradual increases in torque.
Beware of most aftermarket "chips": more often than not these programs just dump more fuel and increase timing greatly while doing things like raising revlimiters far beyond safe levels. There are very limited gains to be had from most "performance chips." Tuning not "chipping" generally produces usable, real world gains. That being said, changing the program of a ECU is generally not that tricky. First, it would probably be wise to focus on some basics of how ECUs work so that it is more apparent where we could makes changes to have a positive effect on performance.
Most ECUs seem to operate in two modes. In one mode, the ECU is monitoring as many engine sensors as possible, trying to get the best fuel economy. This mode is normally referred to as "closed loop" because it is a closed feedback system. In the other mode, the ECU runs a much simpler routine that is most often engaged at wide open throttle. This mode is normally called "open loop" because it does not continuously monitor sensors and compute fuel correction. Open loop conditions are generally stored in the form of a table where the ECU "looks up" fuel and timing values using a relatively simple algorithm. Modifying fuel and timing tables is the most basic way to retune a car, however it bears remembering that the ECU will be making adjustments to whatever information it has. In most cases, open loop table values serve as base values for closed loop fuel correction routines to adjust, but it is difficult to change the exact behavior of adjustment routines. Problematic closed loop correction routines require an understanding and possibly a re-write of the code running the ECU to be fixed properly.
You can completely change the operating characteristics of an engine by changing the fuel and timing tables around. As an example, a PM6 (88-91 Civic/CRX Si) ECU is normally used to run a D16A6, ~100HP. By little more than changing the fuel, ignition tables and the revlimiter, a PM6 can run a DOHC ZC, ~135HP, like it came out of the factory. Additionally, little more than even more fuel/ignition map changes and revlimiter changes are all that is needed to make it run a B18A/B18B or a B20B! Virutally the same ECU hardware runs a D16Z6 SOHC vtec and a B16A2/A3 DOHC vtec motor - swapping chips will let one motor's ECU run the other motor, and vise versa. In another more extreme example, a friend of mine recently had success running a 2G accord engine with a GM computer!
As I hope you have gathered, there is a certain amount of art and a lot of skill/experience involved in tuning a car well. An adequate explanation of how to tune a car perfectly is far beyond both the scope of this article and my expertise. Please, be careful changing your engine's fuel/timing tables - understand that timing changes can completely change the operating characteristics of the engine! Please be very careful, especially when doing baseline tunes - you can destroy your engine in seconds with a bad program. Use proper tools (wideband, EGT, accelerometer, dyno) whenever possible. We are now going to assume that you now know what fuel and timing adjustments you need to make, regardless of whether this is actually the case. With that hefty disclaimer out of the way, the tools and methods from this point forwards are going to become a lot more specific:
- Hexediting and Raw ROM editing
- ROM Editors
- Chipping an ECU: hardware
Hexediting and Raw ROM editing
Hex is base a 16 numbering system. Instead of digits from 0 to 9, hex uses digits from 0 to F. So A = 10, B = 11, ... F = 15. Typically we distinguish hex numbers from other numbers by either putting 0x at the front of the number or putting an 'h' at the end. i.e. 0xFE and FEh are both the hex number FE.
Fuel and timing tables are stored in the middle of the code running the ECU. Distinguishing them from code is generally not THAT hard because they "look" different than the pseudorandom data that runs the computer. A hex editor will let you manipulate the raw data in the ECU. WinHex is a quality, shareware hexeditor available from www.download.com. You might want to grab some checksum utilities from www.keil.com as they're generally useful.
So, you've found the fuel and timing tables in your ECU's program, edit away. How do you interpret all this? Well, first you mut know about the addresses. Each byte has its own address referenced by the left most column (the "offset" column) and the top row. As an example, look to the bottom right corner of the above picture. Notice the byte that has 6f as its value. Follow the row to the corresponding row in the offset column and you will see a 3ef0. Then follow 6f's column all the way up to the F on the top row. Put those values together and you have the address of the 6f byte: 0x3eff.
Now what? This data is the binary representation of the actual machine code that runs in the ecu's processor and ROM data that the ECU uses. To figure out what it does you must use a disassembler to convert the binary code/data into the machine code instructions which are more human readable.
Most ECUs have a Check Sum routine - the checksum gods must be appeased after any changes to the ROM are made or the car will not run properly. It would take a long time to tune a car if everyone only had hexeditors at their disposal. In many cases, ROM editors are available to assist in the tuning process.
Remember, anything you can do with a ROM editor can be done by hand with a hexeditor too.
Although most ROM Editors? are specific to one or more ECUs, most are fairly similar visually - Understanding Maps has a lot of pictures and more hands-on explanation of editor-based fuel and timing table adjustment. Most of the concepts will apply to any and all editors.
Ghettodyne (available at http://www.ghettodyne.com) is a free ROM editor that was the first to support the PM6 (88-91 CRX/Civic Si) ECU. It is no longer being actively developed. To give you an idea of what ghettodyne looks like:
TurboEdit has since largely replaced Ghettodyne as the most actively developed OBD0 ROM editor. It supports ROMs based off the PM6 and PM7 codebase at this point. Close communication between Team OBD0 and Jason Parker, TE's author, ensure that it supports the latest features quickly. As you can see, the interface is very similar to earlier editors: