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


MegaShift™ V4.1 Settings

V4.1xx MegaShift™ code is the latest release code for controlling automatic transmissions using the GPIO board form Bowling and Grippo. This code has:

Jump to the: Set-Up and Tuning Parameters.

The Windows 9x/ME/XP/Vista software applications you use to tune and configure your MegaShift™ hardware are called TunerStudio by Phil Tobin. You also need a laptop or notebook computer and a conventional serial port (or USB-serial adapter) to communicate with MegaShift™.

CANbus Pass-Through

To set up TunerStudio to use MShift™ with CANbus from MS-II™:

  1. First set the MS-II™ up normally under Project Properties (if you haven't already set up a controller for your engine controller):

    1. Give your project a name and description,
    2. Select the INI to match the firmware on your primary controller (MS-II™, MicroSquirt®, Sequencer™, etc.). You can either:
      • use a 'pre-defined' firmware from the drop-down list, or
      • click 'Other' and browse to a specific INI file.
    3. Click "OK".

  2. This code INI has several Project Property Settings. You set/change them in TunerStudio under 'Project → Project Properties → Settings'. This is the first thing you should do after creating a new project. The settings are:

    Note: The way the code and INI handle metric conversions has changed from older (4.122 and earlier) codes. You MUST set your units before loading an old MSQ. When upgrading from older code, be sure to save the old user parameters in a MSQ, load the new code and set up the new INI, change your units (Project -> Project Properties -> Settings: CELSIUS and SI_LENGTHS) to what you used when creating the older MSQ before finally loading the old MSQ file. The defaults are for both settings to be deactivated (i.e. Imperial units). Otherwise the values will be converted again (i.e. twice, so they will be incorrect) when you change the units settings. Once the units are set, you don't have to worry about this anymore.

  3. Then set up the MShift™ GPIO controller under 'CAN devices' of the engine controller project:

    For example, if you have a Project that has an MS-II™ as the main controller you will connect the laptop to, and a GPIO board with MShift™ as a CANbus device with the CANbus ID set to 1 (the default), only GPIO board goes in CAN Devices list and the CAN ID should be set to 1.

    1. Device Identifier (short): Give your CANbus controller a short name. This will preface the menu entries as they drop down in TunerStudio so you always know which controller you are working with when you change parameters in the menus.

    2. Device description: This is a longer description to remind you of the configuration you are setting.

    3. Device CANbus ID: The CANbus ID for the MShift™ code has a default value of 1. You can change the CANbus ID in the menus to a value up to 13 to avoid conflicts with other CANbus devices - if you do change the MShift™ CAN ID you must also change it to the same new value under 'File/Project Properties/CAN Devices'.

      However, to prevent people accidentally screwing up their comms, it is un-editable in the INI file until you make a small change. Use a text editor and find a line in the INI like:

      [pre]field = "!MS-II CANbus ID", ms2canID, { 0 } ; change to { 1 } to make editable[/pre]

      and change it to:

      [pre]field = "!MS-II CANbus ID", ms2canID, { 1} ; change to { 1 } to make editable[/pre]

    4. Device Configuration File: You will have to set the 'Device Configuration File' to point the GPIO.ini file for your MShift™ controller (you can download the file from the link for V4.100 code). Note that you can select another file at any time to update the INI (re-start TunerStudioMS to see the new INI), you don't have to remove the CANbus Device and then re-create it. If You are updating both the code and the INI, then you also have to reload the code on the MShift™ GPIO board using its serial connection, of course.

    5. Configuration Settings: Be sure to 'Activate' CAN_COMMANDS in the 'Configuration Setting' section of the CAN Devices dialog. This activates the use of CANbus pass-through mode for TunerStudio.

Here is a video on setting up CANbus in TunerStudioMS: CANbus set-up video (22 MBytes)

There is more on the CANbus pass-through here: www.msgpio.com/manuals/mshift/cpt.html, including assembly and wiring instructions, etc.

Set-Up and Tuning Parameters

The following is a list of of all the tuning parameters in the MShift™ V4.1xx software, and each has a description of how that parameter is used. Pressing F1 at any menu in the tuning software while connected to the internet will take you directly to the corresponding spot in this file.

Note: DO NOT power off the MShift™/GPIO board while the 'Flash Burn' indicator is active. Doing so *will* corrupt your settings. Wait a second or two for the burn to complete before powering down the board.

  • Shift Input Patterns

    Note: DO NOT power off the MShift™/GPIO board while the 'Flash Burn' indicator is active. Doing so *will* corrupt your settings. Wait a second or two for the burn to complete before powering down the board.

  • Shift Output Patterns

    Note: DO NOT power off the MShift™/GPIO board while the 'Flash Burn' indicator is active. Doing so *will* corrupt your settings. Wait a second or two for the burn to complete before powering down the board.

  • TCC Settings

    TCC lock-up start values: The following values set the PWM% that the TCC will start at, it will then move to the 'PWM% when TCC Locked' over the 'PWM Taper Time' you specify. This allows you to have smooth engagement of the TCC Lock-up.

  • Tables

    Note: DO NOT power off the MShift™/GPIO board while the 'Flash Burn' indicator is active. Doing so *will* corrupt your settings. Wait a second or two for the burn to complete before powering down the board.

  • Bins

  • LED Patterns

    Note: DO NOT power off the MShift™/GPIO board while the 'Flash Burn' indicator is active. Doing so *will* corrupt your settings. Wait a second or two for the burn to complete before powering down the board.

    Here you can set the LED patterns in each gear. The default is:

    However, using these menu items, you can change the pattern in each gear. Select the gear you wish the change the pattern for from the menu, then change the pattern in the dialogue to have each LED "off" or "ON" for that gear.

    For example, you can have only one LED light in each gear. You can also set two patterns for reverse: the LEDs will cycle through the set patterns once per second - allowing you to have the display flash in reverse as a warning.

    Or if you wish to use a 7-segment LED to display the current gear numerically, you can use these pattern to adjust the 4 LED outputs to be suitable for a 7-segment LED driver (such as the 4511 7-segment decoder/display driver IC).

    Note that when driving LEDs, "ON" means current is allowed to flow, and "off" means current is not allowed to flow. If you are using a pull-up circuit with a 7-segment LED driver IC, "ON" will mean the pull-up voltage is held low (< 0.7 Volts), while "off" will mean the pull up voltage is high. So it might be backwards to what you expect (unless you are using the processor pins directly, in which case "ON" means 5V is being supplied).

    There is much more on using the 7 segment LED/LCD driver here: 7segment.html

  • Tuning

  • Spare Ports

    Note: DO NOT power off the MShift™/GPIO board while the 'Flash Burn' indicator is active. Doing so *will* corrupt your settings. Wait a second or two for the burn to complete before powering down the board.

    Spare Port Function: The function of each three 'spare ports' can be selected under: Spare Ports→Spare Ports Function→Spare Port X Usage (there are 5 modes, corresponding to 5 values of the parameter spX_mode):

    1. User Spare Ports/Speedo Output*:

      • Spare Port 0 Use: For spare port 0 (but not spare port 1 or spare port 2), the user can select to enable this output to send a signal to an electronic speedometer. The output will then put out a pulse/mile signal (based on the VSS input) of the user's choice. To set this up, set the function to 'Speedo Output' under 'Spare Ports→Spare Port Function' and then set the desired pulse/mile under 'Spare Port→Speedo Output on Spare Port 0':

        • Output pulse/mile: This is the output pulses/ mile (or pulses/kilometer if you have set Metric units) for the speedometer output. The output is triggered in the VSS tooth interrupt (not the main loop), and has to be at least 2 of these long (one tooth to turn on, next tooth to turn off, etc.). As long as the ratio of speedometer output to VSS input is reasonable (say 1:5 or 'higher') it will work fine. Typically, the VSS gives about 96000 pulses per mile and the speedometer will require 2000 to 4000 pulse/mile. This is a VSS/speedo pulse ratio of 24:1 to 48:1; well within the range needed to work effectively with your MShift™/GPIO controller. This output is used to drive an electronic speedometer (such as those found on many newer vehicles) - it is adjusted automatically when you change the VSS settings (such as tire diameter, rear axle ratio, etc.). The output is a 0-12V square wave.

          The speedometer output signal will adjust automatically after a reset when you change the tire size, final drive ratio, or number of VSS teeth. If not used as a speedo output, this is a PWM enabled port with a 16x9 lookup table.

          You can use the calculator above to determine the ratio of the VSS input frequency (pulse/mile) to the speedo desired output.

        • Speedo Output Duty Cycle: You can use this parameter to set the pulse width modulation percentage for the speedometer output signal. It can be set from 1% to 99%, where the percentage is the time 'high' when the signal from the processor is used to control a PNP transistor with a pull-up circuit (i.e. the standard build). This can help in making the speedo output signal compatible with some speedometers. The default is 50%.
      • Spare Port 1 Use: For Spare port 1 and spare port 2 (but not spare port 0), the user can select settings to control the behavior based on speed, rpm, load. ON and OFF PWM percentages are based on the 12 element table (ON) and PWM OFF value (OFF). The PWM is updated continuously based on the index value. The AND'ed conditions, thresholds, and hysteresis values are set under: Spare Ports→User Spare Port X.

        There are two 'user spare ports' (SP1/SP2) that are an ANDed combination of speed, rpm, load, and current gear (with hysteresis). Assuming they are not used for another function (like a 4th shift solenoid), these can be used to control external devices like fans (ex. shut off above a specified speed), or ancillary trans functions.

        These are the 4 conditions on 4 variables (vehicle speed, engine rpm, load, and current gear) that can be used to set the state of the spare port output on Ampseal pin 11. The conditions are:

        • 'no condition': this is ignored, so if you don't want to use 4 conditions, you don't have to. Just leave the unwanted variables as 'no condition'.
        • 'greater than or equal to'
        • 'less than or equal to'
        Note that the port is not directly aligned with the circuit on the 25x2 header. To use spare port 1, you must jumper from PT7 to VB1 (they are near opposite corners of the 25x2 header).

        For example, if you set:

        • condition to 'greater than or equal to',
        • speed to 50, and
        • hysteresis to 5
        and have 'no condition' on the remaining variables, then Output1 will go high when the speed reaches 50 (either mph or kph depending on what you have your units set to), and won't go low until the speed drops below 45.

      • Spare Port 2 Use:

        You can set up to 4 of the following conditions. There are 4 conditions on 4 variables (vehicle speed, engine rpm, load, and current gear) that can be used to set the state of the spare port output on Ampseal pin 12. ALL must be 'true' for the output to switch. The conditions are:

        • 'no condition': this is ignored, so if you don't want to use 4 conditions, you don't have to. Just leave the unwanted variables as 'no condition'.
        • 'greater than or equal to'
        • 'less than or equal to'
        Note that the port is directly aligned with the circuit on the 25x2 header. To use spare port 2, you just jumper from PA0 to VB2.

        For example, if you set:

        • condition to 'less than or equal to',
        • speed to 50, and
        • hysteresis to 5
        and have 'no condition' on the remaining variables, then Output2 will go high until the speed reaches 50 (either mph or kph depending on what you have your units set to), and will stay low until the speed drops below 45.

    2. PWM mode: For spare port 0: Use the only PWM 144 (16x9) element table and OFF value to set the state. This setting relies on the 'PWM active' parameter (below) to determine when the PWM state is ON or OFF. The PWM can be set to a range of values from 0% to 100% in 144 bins (and the user can select if the interpolated PWM percent varies with load, temperature, speed, or engine rpm. The user can also set a single separate OFF value for the PWM. If the user doesn't want varying PWM, and wants and ON/OFF output instead, they can simply set all the table values to 100% and the OFF value to 0% (or vice-versa).

      For spare port 1 and spare port 2: Use the only PWM 12 element table and OFF value to set the state. This setting relies on the 'PWM active' parameter (below) to determine when the PWM state is ON or OFF. The PWM can be set to a range of values from 0% to 100% in 12 bins (and the user can select if the interpolated PWM percent varies with load, temperature, speed, or engine rpm. The user can also set a single separate OFF value for the PWM. If the user doesn't want varying PWM, and wants and ON/OFF output instead, they can simply set all the table values to 100% and the OFF value to 0% (or vice-versa).

      Spare Ports→Spare Port X PWM Setup→PWM Active (spX_active):

      • PWM Active: In PWM mode, the user has 3 choices as to when the PWM table is used:
        1. always ON: PWM percent is always based on the 12 element table, whether shifting or not. The OFF value is not used.
        2. ON except while shifting: PWM percent is based on 12 element table, except during shifting when it is set to the user specified OFF value.
        3. ON only during shift*: PWM percent is based on 12 element table during shifting, but when not shifting the PWM percent is set to the user specified OFF value. (This is the inverse of the previous mode.)
        * = default value; X = 0,1,2

      • PWM Index: The pulse width modulation uses a table lookup for the ON state and has an OFF value as well as index options. For spare port 1 and 2, the user can select the index value to use ('Spare Ports→Spare Port X PWM Setup→PWM Index') to interpolate the 12 element PWM% table based on the bins in the 'Spare Ports→Spare Port X PWM Index' table. For spare port 0, the user can select the index values to use ('Spare Ports→Spare Port X PWM Setup→PWM Index') to interpolate the 144 element PWM% 2-D table based on the bins in the 'Spare Ports→Spare Port X PWM Index' table. The possible index values are:
        1. Load*,
        2. Speed,
        3. RPM,
        4. Temperature (only positive temperatures are allowed).
        * = default value; X = 0,1,2

      • PWM Period: This is the period of the pulse width modulation. The period = 1/frequency. The PWM clock operates in 0.128 millisecond 'ticks'. The period can be from 30.6 Hertz (cycles per second) to 1953 Hertz. You can enter any value you like, but the tuning software will round this to a multiple of 0.128 milliseconds.

      • PWM% when inactive: This is the desired PWM percentage when the spare port is in the OFF state. It can be set to 0 (actually off), or any other value up to 100% (it will be rounded as necessary).

      For spare port 1 and 2 there are two 12x1 tables for each spare port's PWM. One (Spare Port X PWM Percent) sets the percentage of 'ON-time' for each bin of the index table. The index table is used to compare the current 'PWM Index' value (which can be the current load, speed, temperature or rpm, depending on what you have selected in the PWM setup) to the index bin values. The code finds the closest bin values in the index table, and then computes the interpolated PWM% from the 'PWM percent' table. Dealing with two separate table is awkward, though. Instead, it may be easier to use the 'Tuning→Spare Port X (index)' graphical presentation. This gives a graph of the index versus PWM%, along with the associate tables, all in one place.

      For spare port 0 there are two index table (a 9 element bin table for the y axis, and a 16 element bin table for the x axis). These are used to interpolate the PWM percentage from a 144 element table. The bin values and PWM table can be edited under 'Tables→Spare Port 0 Table' once the spare port 0 is set to a PWM enabled usage under 'Spare Ports→Spare Port Function→Spare Port 0 Use' (i.e. if it is not set to be a speedo output).

      Note that the PWM reported in TunerStudio is the actual PWM percentage. As the frequency increases, the 'granularity' of the possible PWM% increases, and the PWM% may be off from the target by up to several percent. Lowering the PWM frequency (increasing the period) will result in better accuracy.

    3. TCC mode: Output is ON (PWM% from 12x1 table for sp1/2, from the 16x9 table for sp0) while TCC is engaged, OFF otherwise. None of the spare port TCC settings affect the main TCC output on PT3 (which has its own PWM frequency, PWM algorithm, etc.)

    4. Use as Shift Solenoid: Output state is changed at some shifts based on user's output pattern. PWM% from 12x1 table in ON state. Note that if you want to have a constant PWM% for the shift solenoid, you should enter that value in all 12 bins (sp1 & sp2) or 144 (sp0) of the spare output's PWM % table.

    5. Selective Clutch: This parameter is to select using as ports active only during shifts (i.e. 'clutch' outputs), which are active only during the shifts specified under 'Shift Output Patterns→Clutch Pattern (Output 4/7)'. The ON state PWM percent is set by the 12x1 table for spare port 1 and spare port 2. The ON state PWM percent is set by the 16x9 table for spare port 0.

  • Communications

    Note: DO NOT power off the MShift™/GPIO board while the 'Flash Burn' indicator is active. Doing so *will* corrupt your settings. Wait a second or two for the burn to complete before powering down the board.

  • Tools

    Note: DO NOT power off the MShift™/GPIO board while the 'Flash Burn' indicator is active. Doing so *will* corrupt your settings. Wait a second or two for the burn to complete before powering down the board.

  • Help


    1 'Bit banging' means the port is turned off and on by specific instructions in the code that occur within normal program flow. In MShift™ the chance to turn these outputs off and on occurs every 1/8th of a millisecond. The alternative is to use timer channels. These are built in processor hardware devices that allows the user to set the PWM frequency and duty cycle, and the hardware handles the PWM switching independently of the program code. This not only reduces computational overhead, but can be switched an much higher (or lower speeds) and is also is much more accurate.

    MegaSquirt® and MicroSquirt® controllers are experimental devices intended for educational purposes.
    MegaSquirt® and MicroSquirt® controllers are not for sale or use on pollution controlled vehicles. Check the laws that apply in your locality to determine if using a MegaSquirt® or MicroSquirt® controller is legal for your application.
    © 2011, 2014 Bruce Bowling and Al Grippo. All rights reserved.