The MegaTune Tuning Software

The Windows 9x/Me/XP software application you use to tune and configure your MegaSquirt® or MegaSquirt-II™ is called MegaTune by Eric Fahlgren. (Version 2.25 or higher is needed to work with MegaSquirt-II, all versions work with MegaSquirt®). You also need Windows 9x/Me/XP 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. USB will 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.

MegaTune Help Index

Introduction to MegaTune Installation File Settings
Table VE Table 1
  • AFR Table 1
  • VE Table 2
  • AFR Table 2
  • Ignition Table
  • Cold Advance
  • MAT Based Timing Retard
    • Tuning Communications Tools Help

      Introduction to MegaTune

      MegaTune2.25+ is the Windows 95 (and later) configuration editor by Eric Fahlgren 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

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

      Installing MegaTune

      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 installs itself. You may have to select some options, or you may chose to select all the defaults. Files Get the latest version of MegaTune from Generally, you need MT2.25 for MegaSquirt-II. All versions will work with MregaSquirt, later versions often have more features. Install Process To get the latest version of MegaTune:

      1. Click this link to go to the release site,
      2. Select MegaTune225p3_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'.
      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 to your MegaSquirt® EFI Controller, then you must install the corresponding INI file in the place expected by MegaTune.

      The error you are seeing 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: but change CODE_VARIANT and the INI file to match the 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 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. 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, it is there for your purposes, so give it a descriptive name that works 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 file (megasquirt-I.ini, megasquirt-II.ini, etc.) in the MegaTune folder, you can edit the gauges to show ranges and warning appropriate to your combination. To do this, open the file using Notepad or another text editor.

      Each gauge has a number of properties, these are:


      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:

         egoLEDs         =  0.0, 1.0,  0.5 ; Voltage settings.
      #elif LAMBDA
         egoLEDs         =  1.5, 0.5,  1.0 ; Lambda settings.
         egoLEDs         = 19.7, 9.7, 14.7 ; Afr settings.

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

      #if   NARROW_BAND_EGO
         egoLEDs         =  0.0, 1.0,  0.5 ; Voltage settings.
      #elif LAMBDA
         egoLEDs         =  1.5, 0.5,  1.0 ; Lambda settings.
         egoLEDs         = 19.7, 9.7, 14.7 ; Afr settings.
         ; 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
         gauge4 = afr1Gauge
         gauge5 = mapGauge
      #if IAC_GAUGE
         gauge6 = IACgauge
      #elif PWM_GAUGE
         gauge6 = PWMIdlegauge
      #else ; FIDLE_GAUGE
         gauge6 = matGauge
         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.

      MegaTune allows you to compute values from MegaSquirt'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:

            ; Make up some variable names... 
            highLoad = { rpm >= 3500 && throttle >= 50 } 
            enable   = { rpm >= 2000 } 
            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. 

      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 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 standard MegaSquirt® and MegaSquirt-II hardware and code configurations. For other configurations, please see the developer's site. Below is a list of all the menu items in MegaTune 2.25. Click on any of them to navigate to specific information on that topic.

      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 it's 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's 12V supply. These are cheap (~$5) and widely available. They typically have three wires: one from a switched 12V 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 it's 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's power, you must 'burn' the to flash. You do this using the 'burn to ECU' button on the dialogs.

      In general, MegaTune only burns the values on the current dialog when you click on the Burn to ECU button. 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).