Click on our menu buttons immediately below to find MegaSquirt® information quickly:


Tuning Software for MS-II™ v2.9

The Windows 9x/ME/XP/Vista/7 software application you use to tune and configure your MegaSquirt® or MegaSquirt-II is either Tuner Studio by Phil Tobin or MegaTune by Eric Fahlgren. (Version 2.25 or higher is needed to work with MegaSquirt-II™). You also need Windows 9x/Me/XP/Vista/7 on a computer (a laptop or notebook computer if you want to tune in the car) and a conventional serial port to communicate with MegaSquirt-II™. A USB/serial converter may work, and many people have reported that they have been successful using a USB-serial adapter. Just about any computer that is capable of booting Windows 95 (or better) will be fast enough, but get the fastest laptop computer you think is reasonably priced, obviously. This document covers the use of the 2.9 versions of embedded software (aka. "code") on MegaSquirt-II™.

Note that for 2.9 Code, the first thing you must do after loading code is set the ECU Type (under 'Fuel Set-Up/General') to match your hardware (MS-II™ or MicroSquirt® controller), MegaTune will not let you change anything else until you do this. Do not change settings, expect the stimulator to work, load an MSQ, etc., until you have set the ECU Type (MS-II™ = 1, MicroSquirt® = 2, the MS-II Sequencer™ will be 3). This setting applies to MS-II™ derivatives with code 2.8 or higher code only.

ECU Type setting was inserted to head off the potential MicroSquirt® problems due to the coils being turned on with the old default configuration. As of the 2.8+ code, if ECU Type is not set, the code will put the ignition outputs in a safe state (cycling the tach display from 0 to 8000 rpm, and also flashing the fuel pump LED) and wait until a known ECU type is put in by the user.

MegaTune Help Index

Introduction to TunerStudioMS Installation File Fuel Set-Up
Ignition Set-Up Basic Tables
'Basic Tables' are displayed as 12x12 'spreadsheets' to allow easy viewing of the numbers in the tables. This is best for setting up the tables. For tuning the tables in the vehicle or on a dyno, see the 'Tuning' menu item.
These can be indexed to MAP or MAP/Baro.
Basic Tables
These can be indexed to MAP or MAP/Baro.
Basic Tables
This can be indexed to MAP or MAP/Baro.
Other Tables Tuning
Tuning offers a 3-D view of the table a a number of gauges simultaneously, so is a good place to be when actually tuning.
X-Tau Tuning Other Tuning
Communications Tools Help

Introduction to MegaTune

MegaTune2.25+ is MegaSquirt® configuration editor software for Windows 95 (and later). It is written by Eric Fahlgren, and it used for the MegaSquirt® and MegaSquirt-II EFI controller. It allows all of the tuning and set-up parameters to be modified and has a real-time VE table editor, which allow a vehicle passenger to tune the engine while driving.

General Advice and Operation Some general principles to follow when setting the configuration parameters are:

Some Warnings

Note that it is possible to damage your engine by choosing inappropriate tuning or set-up parameters in MegaTune. Be sure to read this document, and all associated tuning documents that apply to your engine, vehicle, and tuning circumstances. In particular, read the safety precautions.

How to Tune Using MegaTune/TunerStudio

Information on tuning using tuning software with MegaSquirt® or MegaSquirt-II is listed separately from this section, and depends on the processor you have.

Installing MegaTune

Note: for installing TunerStudio, please see the TunerStudio web site: www.efianalytics.com/TunerStudio/

MegaTune has an 'automated' install package, similar to most other modern Windows software. You download the set-up file (see below), click on it, and the package virtually installs itself.

You may have to select some options, or you may chose to select all the defaults. In particular, you may need to set the install directory, especially if you have used different paths to install MegaTune at any time. This is because the MegaTune installer remembers the last install directory, and will attempt to re-install there. If that folder is not the one where your current projects reside, the result is that MegaTune won't find your project folders, and will open without asking for one, as well as likely give a "0x14 (from the INI)" error. To fix this, remove the latest installation, and re-install in the correct folder (the default is shown below).

Files Get the latest version of MegaTune from http://www.megamanual.com/files/software/.

Install Process To get the latest version of MegaTune:

  1. Click this link to go to the release site,
  2. Select MegaTune225pX_setup.exe, and click on it.
  3. Choose 'Run' or 'Run program from current location' when prompted.
  4. Choose all the defaults when installing the program, and it will create a folder called 'C:\Program files\MegaSquirt\MegaTune225' and subfolders 'mtCfg' and 'carMtCfg'.

    You may have to select some options, or you may chose to select all the defaults. In particular, you may need to set the install directory, especially if you have used different paths to install MegaTune at any time. This is because the MegaTune installer remembers the last install directory, and will attempt to re-install there. If that folder is not the one where your current projects reside, the result is that MegaTune won't find your project folders, and will open without asking for one, as well as likely give a "0x14 (from the INI)" error. To fix this, remove the latest installation, and re-install in the correct folder (the default is shown below).

  5. The install program will also create a folder in 'C:\Program files\MegaSquirt\' called 'Car1', this is where all your vehicle specific information will go.
  6. You need to tell MegaTune which version of MegaSquirt® you have, as well as the EGO type, etc. To do this, use the mtCfg program, which opens automatically during the installation process (it can be opened directly from the MegaTune folder at any later time). Look for the CODE_VARIANT variable, it will be in 'Car1/settings.ini/Settings/CODE_VARIANT' in the directory tree on the left side of the mtCfg window. Click on CODE_VARIANT. You can then use the drop box in the upper right section of the window to select your code variant.

While you are in the setting.ini files, you can verify or change the EGO sensor option under LAMBDA_SENSOR if necessary.

You can use mtCfg to change the color depth, temperature units (°F/C) and a large number of other parameters for MegaTune. See the documentation in the files displayed in mtCfg.

Be sure to 'Save' the file. You should now be able to launch MegaTune. Double-click the MegaTune icon (created above) on the desktop.

Return to help index

Communications/Settings dialog on the MegaTune menu.

You should always uninstall MegaTune before installing newer versions.

Signature Errors

There are two parts for any firmware release:

  1. the .s19 file that contains the firmware for the MegaSquirt, and
  2. the INI file that describes the firmware to MegaTune.

If you download a different .s19 file (i.e., a different embedded code version) to your MegaSquirt® EFI Controller, then you must install the corresponding INI file in the place expected by MegaTune.

If the INI file does not correspond to the code you have load, MegaTune will generate an error message when starting. The error you see is telling you that the signature in the INI doesn't match what MegaTune is receiving from MegaSquirt. This can be for a number of reasons, the most common are:

The best thing to do is follow the MegaTune installation instructions here: www.megamanual.com/ms2/configure.htm but change CODE_VARIANT and the INI file to match the v2.9 code you have loaded on your processor. (The instructions are explicitly for MegaSquirt-II. The default install for MegaTune is for MS-I.)

Also, be SURE to set the CODE_VARIANT (MS-II) as well as activating the appropriate INI file, both actions are necessary.

Creating and Selecting New Projects

MegaTune allows you to manage data for multiple MegaSquirt® installations on the same computer. First you must use the installer to build yourself a default setup. Once you have a basic MegaTune setup, use mtCfg.exe to create a new project. Open mtCfg, then click on 'Project/New', type in the project's name, then click on okay.

Instead of "carN", use a real name, for example "Corvette" and "Audi" (the actual names are of no significance to MegaTune, they are there entirely for your convenience, so give them descriptive names that work for you.

Then use mtCfg to configure the new projects code variant, ego sensor, etc.

When you have only a single car directory, MegaTune assumes that you want to use that one, so starts there automatically. When you have more than one, MegaTune will present you with a list of choices at startup, so you can work on the correct one. By typing the initial letters of the project name, you can jump down the select list to the desired one quite quickly. Once you have the desired project highlighted, just hit the enter key or use the mouse to click "Ok."

Gauge Configurations

In the processor specific configuration file (megasquirt-II.ini) in the MegaTune folder, you can edit the gauges to show ranges and warning appropriate to your combination. (Note that you must 'activate' the appropriate file before editing it!) To do this, open the file using Notepad or another text editor.

Each gauge has a number of properties, these are:

Examples:

Note that many of the variables are represented on the runtime, tuning, and front pages, and you may need to set additional parameters to get them all to look the way you want. For example, the EGO display on the front page is set in this section:

[FrontPage]
#if NARROW_BAND_EGO
   egoLEDs         =  0.0, 1.0,  0.5 ; Voltage settings.
#elif LAMBDA
   egoLEDs         =  1.5, 0.5,  1.0 ; Lambda settings.
#else
   egoLEDs         = 19.7, 9.7, 14.7 ; Afr settings.
#endif

To change the gauges on the front page, find a section of your code's INI file similar to:

[FrontPage]
#if   NARROW_BAND_EGO
   egoLEDs         =  0.0, 1.0,  0.5 ; Voltage settings.
#elif LAMBDA
   egoLEDs         =  1.5, 0.5,  1.0 ; Lambda settings.
#else
   egoLEDs         = 19.7, 9.7, 14.7 ; Afr settings.
#endif

   ; Gauges are numbered left to right, top to bottom.
   ;
   ;    1  2  3  4
   ;    5  6  7  8

   gauge1 = tachometer
   gauge2 = throttleGauge
   gauge3 = pulseWidth1Gauge
#if   NARROW_BAND_EGO
   gauge4 = egoGauge
#elif LAMBDA
   gauge4 = lambda1Gauge
#else
   gauge4 = afr1Gauge
#endif
   gauge5 = mapGauge
#if IAC_GAUGE
   gauge6 = IACgauge
#elif PWM_GAUGE
   gauge6 = PWMIdlegauge
#else ; FIDLE_GAUGE
   gauge6 = matGauge
#endif
   gauge6 = xTauGauge
   gauge7 = advdegGauge
   gauge8 = dwellGauge

Change the gauge assignments to those you prefer. Note that the value after the 'gaugeX =' label MUST appear in the [GaugeConfigurations] section of the INI file.

So while the type of sensor is set in the vehicle specific folder, the limits are set here. In most cases the defaults work well, but you can change them to suit your purposes. The format is name, upper limit, lower limit, switch point.

Expressions

MegaTune allows you to compute values from MegaSquirt-II's output channel data or from constants and settings in the database. These can then be used in datalogs or gauges.

Data types:

Operators in order of descending precedence:

Built-in math functions and constants:

MegaSquirt-specific functions:

For example, to create boost and vacuum gauges in MegaTune, you would add to:

Automark and Datalogs

You can configure MegaTune to have datalogging start when conditions you specify are met. You still have to start the datalog manually ( Alt+L, <enter>), but it will only record lines when the conditions are met. So you can start the datalog 20 minutes in advance or more of when you want to datalog, knowing the lines are not being added until you want.

To enable automark logging, look for a section of the custom.ini file like this:

#unset AUTOMARK_LOGGING_FEATURES 
#if    AUTOMARK_LOGGING_FEATURES 
   [OutputChannels] 
      ; Make up some variable names... 
      highLoad = { rpm >= 3500 && throttle >= 50 } 
      enable   = { rpm >= 2000 } 

   [Datalog] 
      enableWrite = enable    ; Log entries are only written when the variable 
                              ; "enable" is true, see it's definition above. 

      markOnTrue  = highLoad  ; A datalog marker is written when "highLoad" 
                              ; transitions from false to true.  The marker 
                              ; looks like "MARK 001 highLoad" to distinguish 
                              ; it from the manual markers. 

#endif  

Change the #unset AUTOMARK_LOGGING_FEATURES to # set AUTOMARK_LOGGING_FEATURES (note we have changed unset to set), and edit the enable conditions (tps/rpm/map/etc.) to your liking.

Datalogging will start when the conditions are met. You still have to start the datalog - Alt+L, <enter>, but MegaTune will only record lines when the conditions are met. So you can start the datalog 20 minutes in advance, knowing the lines are not being added until you want.

As noted in the code snippet above, you can also have MegaTune 'mark' the datalog on specific events by defining other variables (for example 'highload' in the snippet above).

Return to help index

Uninstalling MegaTune

You should always uninstall MegaTune before installing a newer version.

You can uninstall MegaTune in three ways:

  1. Use the Windows 'Start/Control Panel/Add or Remove Programs', select MegaTune, and 'Change/Remove' it.
  2. Use the 'Start' menu/All Programs/MegaSquirt/Uninstall' to remove MegaTune,
  3. Go to the MegaTune install directory (usually 'C:\Program Files\MegaSquirt\MegaTune2.25') and click on the file called 'unins000.exe'. Follow the directions and MegaTune will be removed.

Using MegaTune2.25+

MegaTune 2.25 has a menu structure that depends on the hardware and software you have loaded. This document covers only the MegaSquirt-II hardware and v2.9 code configurations. For other configurations, please see the developer's site. At the top of this page is a list of all the menu items in MegaTune 2.25 for MS-II/v2.9. Click on any of them to navigate to specific information on that topic.

Note that for 2.88 Code, the first thing you must do is set the ECU Type (under 'Fuel Set-Up/General') to match your hardware (MS-II or MicroSquirt), MegaTune will not let you change anything else until you do this. ECU Type setting was inserted to head off the potential MicroSquirt® problems due to the coils being turned on with the old default configuration. As of the 2.88 code, if ECU Type is not set, the code will put the ignition outputs in a safe state (cycling the rpm from 0 to 8000 rpm, and also flashing the fuel pump LED) and wait until a known ECU type is put in by the user.

When MegaSquirt® is loaded and communicating with MegaSquirt® EFI Controller, the first thing you will see is the front page, which shows eight of the more useful gauges. A number of the sensor readings are displayed, as well as some outputs. For example, the injector pulse width is the measure in milliseconds of how long the injector is opened for each pulse, regardless of how many times it is opened in a cycle. Duty cycle gives the percentage of time the injector is open irrespective of individual pulse duration.

There is a bar gauge across the bottom of the window shows the oxygen sensor reading. The scale is determined by egoGauge value in the Tuning section of the MegaTune2.25+.ini file. This same setting controls the analog and bar gauges on the tuning page. The first value of this setting controls the lowest voltage displayed on the gauges, the second number controls the highest and the optional third value specifies the "alert" value, above which the LEDs are red. The bottom of the front page contains a status bar. The current file name (used for Save operations) is displayed in the left part of the status bar, followed by €œsaved€ status. When the memory image (i.e., the settings you have chosen) has been modified since the last Open or Save operation, this entry shows SAVED in bold face.

The front page also indicates how many times MegaSquirt® has reset since MegaTune was started. These resets can be due to the user manually turning off the power to MegaSquirt® (cycling the ignition switch) OR they could be due to problem with MegaSquirt® or its power supply.

When MegaSquirt® resets, MegaTune displays RESET X in the lower right corner (where X is the cumulative number of resets, including restarts) - MegaTune will also beep. Resets can cause a number of problems that cause the engine to run badly, including messing up the baro correction and enabling after start enrichment. So you should try to cure any reset issues before putting a lot of effort into tuning.

Resets generally indicate that the power to the processor was interrupted. This could mean that the input power actually was cut, but it can also mean that there was a power surge into the back plane (ground), so that there was no longer a 5v differential between the inputs and the grounds...

Resets are often caused by noisy power supplies (usually the alternator), or poor grounds. So you might recheck that the grounds are good, and add a car stereo power filter to MegaSquirt-II's 12V supply. These are cheap (~$5) and widely available. They typically have three wires: one from a switched 12 Volt source (the original source for MegaSquirt), one to go to MegaSquirt® (with clean power), and a ground wire.

Ignition noise, solenoids turning on or off, and that sort of thing can also cause resets. Check your harness routing to see if any ground or signal wires are near noise sources such as spark plug wires or the coil.

Solve reset issues as they come up, as they will confound your tuning efforts if you proceed without fixing them.

As well as the RESET indicator, MegaSquirt® has a number of other indicators that can be set manually. This is set by editing the variables and values in the indicators sub-section of the [FrontPage] section of the INI file you have activated:

   ;----------------------------------------------------------------------------
   ; Indicators
   ;               expr         off-label          on-label, off-bg, off-fg, on-bg, on-fg
   ;   indicator = { tpsaen }, "Not Accelerating", "AE",     cyan,   white,  red,   black
   ;
   ; Look in the new colorScheme.ini for the basic ones, add more or tell me what to add.

   indicator = { ready              }, "Not Ready",    "Ready",       white, black, green, black
   indicator = { crank              }, "Not Cranking", "Cranking",    white, black, black, white
   indicator = { startw             }, "ASE off",      "ASE ON",         white, black, cyan,   black
   indicator = { warmup             }, "WUE off",      "WUE ON",         white, black, blue, white
   indicator = { tpsaen             }, "Accel Enrich",   "Accel Enrich",   white, black, green, black
   indicator = { tpsden             }, "Decel Cut",      "Decel Cut", white, black, green, black
   indicator = { tps > floodClear && crank }, "Flood clear off", "FLOOD CLEAR ON", white, black, red,   black
   indicator = { batteryVoltage < 10.5 }, "Battery OK",  "Battery LOW", green, black, red,   black
   indicator = { port0              },  "Port 0 Off",  "Port 0 On",   white, black, red,   black
   

The front page is limited to eight gauges, which may not be enough, especially when you are learning to use MegaTune. If you go to the 'Tuning/Realtime Display', you can see many more variables at once. This is a good page to monitor while experimenting with the stimulator and MegaSquirt. MegaTune2.25+ allows you to save and restore configurations as disk files (they have an .msq extension). Use the Open, Save and Save As menu items to do this.

MegaSquirt has two types of memory RAM, which requires that the power be on for values to be retained, and flash, which retains its values even when the power is shut off. In MegaTune, values that are edited are change in RAM (and thus affect engine operation) as soon as you move to another field (with the tab key or the cursor). To retain the values when shutting off MegaSquirt-II's power, you must 'burn' the to flash. You do this using the 'burn to ECU' button on the dialogs. TunerStudioMS has users options to tailor this behavior and defaults.

To burn all the values you might have edited, the best method is to save them as a MSQ (which saves the values in RAM) then load and burn it (to flash).

Return to help index

  • Ignition Set-Up

    Return to help index

  • Basic Tables

    Return to help index

  • Other Tables