Embedded Code for Your MicroSquirt® Controller
Your MicroSquirt® controller comes with the embedded code already loaded onto its processor. You can still upgrade to newer versions of the code as they are released, of course, but you won't have to load the code initially to get your MicroSquirt® controller working.
The current 'release' code for the MicroSquirt® controller is V3.830.
The 'ready to load' .s19 file for uploading to your V3 MicroSquirt® controller is here:Monitor_v3.830.abs.s19
(Right click and 'Save As')
For the V3.830 code, you will also need the megasquirt-II_3830.ini file. Do NOT rely on the INI that comes with your tuning software, even if it has the correct version number it may be out of date and not have the latest updates and corrections.
To work properly, this code requires TunerStudioMS version 2.2.11x or later, which is presently a beta release.
Do not attempt to install this code on an MS-II, it will not load successfully (because MS-II and MicroSquirt controllers have different bootloader software). This code is intended for use with the extended hardware capabilities of the MicroSquirt controller, and has no benefits on an MS-II controller.
Note that for this 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™), the tuning software will not let you change anything else until you do this. Do not change settings, expect the stim 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.88 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.88 code, if ECU Type is not set, the code will put the ignition outputs in a safe state (the controller will also cycle the rpm from 0 to 8000 rpm on TunerStudio's tachometer, and as well as cycle the fuel pump (or flash the fuel pump LED on the stim) and wait until a known ECU type is put in by the user.
To load the .S19 file above to your MicroSquirt® controller over the serial port, you use Eric Fahlgren's downloader program (click the link to download). This application installs much like any other Windows application. 'Run' the download when prompted, and follow the instructions.
To use the downloader.exe application to load code to your MicroSquirt® controller:
If you have changed code versions, you should recreate your settings file (aka. 'MSQ') from scratch by entering the values by hand into TunerStudioMS.
- Save an MSQ setting file of your existing setup.
- Power down MegaSquirt® EFI Controller,
- Ground the bootloader wire (Ampseal pin #15).
- Power up your MicroSquirt® controller.
- Start the downloader program (make sure TunerStudioMS is not running), and select the appropriate COM port. Note that 'File/Update' does not work on the downloader to fetch the latest code and INI anymore. You can get the latest code and matching INI from this link: www.megamanual.com/ms2/code.htm
- Select the appropriate .S19 file using 'File/Open', and the downloader will read, write and verify the code to the processor in about 10 seconds or so. If you have a problem connecting to the controller, see the tips here: www.megamanual.com/connect.htm
- The process ends with a message like "Verification succeeded, 999 records total (4 skipped)."
- Shut down the downloader program.
- Remove power from your MicroSquirt® controller.
- Remove the bootloader wire from its ground connection.
- Start the tuning software (TunerStudioMS) and set the COM port and speed if necessary.
- You will need to download and activate the latest INI file. Under the 'File/Project/Project Properties' of TunerStudio, click on the Other check box.
- Click the 'Browse' button.
- Locate the INI file you downloaded for the link above (www.megamanual.com/ms2/code.htm).
- Click on the appropriate INI file you download from the code page (www.megamanual.com/ms2/code.htm) to activate it.
- Finally, reload the MSQ file (aka. 'tune') you saved above, paying particular attention to any warnings the tuning software gives you (these are generally for settings that have changed or been added to the newer code, so look them up in the help file and decide how they should be set).
V3.830 has the following improvements over earlier code:
- Auto Trigger Option. A major improvement in v3.x code is the Auto Trigger option. This option, while leaving the previous code logic intact, greatly simplifies the Dual Spark setup for the user. It automatically calculates trigger offset, Delay_Teeth, and Skip_Teeth. The user only needs to follow some simple instructions at: www.megamanual.com/seq/autotrig.htm.
This code also simplifies the Fuel Injection Timing logic by allowing the user to enter start of injection in crank degrees relative to TDC compression of cylinder 1. The same relative timing will automatically be applied to all other cylinders, taking account, with some limitations, of odd-fire offset.
Finally, this option also adds the capability of entering separate sampling angles, in crank degrees relative to TDCC1, for MAP and MAF. This sampling is now separate from injection start angle.
- Preliminary Model Based features, such as manifold filling and residual gas models were added.
- Extended Odd-Fire angle logic for 4, 6 and 8 cylinders, as well as 2 cylinders, in both wasted and fully sequential modes.
- Fuel and Spark Trims. These will work for 1-8 cylinders and are meant to be trims, but they have been tested to fairly large values like 100% and 40 degrees. The resolution is 0.1% and 0.1 deg. A ±5% fuel trim is implemented by adding/subtracting 5% to/from the normally calculated VE correction. (For pure MAF VE would be 100% plus or minus the trim) The spark trim is added to the normally calculated spark advance, so a negative trim number will retard spark. NOTE: trims are not used in any wasted spark mode, since you do not know which is the actual cylinder being fired. In a wasted to sequential mode, for example, a missing tooth crank wheel with cam synch, the trims will not take effect until the processor declares cam/synch/ sequential mode. (A wasted/sequential indicator has been added to the engine status bits and is displayed on the bottom of the tuning software.)
- Cam_Tooth: This is a user specified tooth number on the crank wheel with the significance that the cam synch must come after this tooth and before the first (real) tooth after the gap. Details for how to configure this for both MicroSquirt® and s may be found in the Auto Trigger documentation.
- Cranking Pulsewidth Option. There are 3 Cranking Pulsewidth options (nskipCPW) which appear under the 'Fuel Menu, Start→Afterstart' selection. These are described as follows:
- No cranking PW: This bypasses cranking and uses the normal calculated PW, with each cylinder firing once (or twice in wasted) per 720 deg engine cycle
- Sequential CPW: For the Sequencer™ controller, this option is the same as the preceding, but uses the existing CPW (2-point or table values as a function of coolant temperature) instead of calculating PW from the VE table. For MicroSquirt® controllers this option provides the same fueling as in pre-v3.x code, that is, there is simultaneous injection of both cylinder banks on every tach cycle.
- Simultaneous CPW: This is only used with Sequencer™ controller hardware and is the same as the second option, except all cylinders are injected simultaneously. In addition, a new input, nskpCPW, allows the user to specify the number of tach events between simultaneous injections.
This is illustrated in the figure below:
- 0 or 1 means simultaneous injections every tach event;
- 2 means every other event;
- 3 means inject every 3rd event, skipping 2;
Note that you must cycle power afterward if CPWOption is changed. Note also that there is no control of when injections begin during cranking when the simultaneous CPW option is used (because it makes no sense). Another thing to note is that fuel trim is not added into the cranking pulse width. Finally, when the mode changes from wasted to sequential during cranking, simultaneous CPW continues until past cranking rpm.
- The input tie1_2cyl: this is an option: (=1) to tie Ign1,2 outputs together either after the ignition drivers or through a diode gate combining the 2 Ampseal outputs; or(=0) leave them separate and ignore one. Only applies for MicroSquirt® controllers in dual spark/ toothed wheel mode to 1 cylinder engines and 2 cylinder engines with wasted spark. See MicroSquirt 1,2 cyl Dual Spark Configuration for detailed guidance.
- Improved range of MAF airflow calculation and corrected calculation of injector pulse width:
PW = Topen + MAP x VE x ReqFuel
New Equation (model-based):
PW(sec) = Topen + ((MAF(g/s) x (120 / Rpm) / No_cyl) / AFRTGT) / InjFlowRate(g/s)
This is important because now AFRTGT has a big effect on fueling and ReqFuel is used only with MAP.
- Expanded dual table options to: use VE1, AFRTGT1 tables only; use VE1,2 and AFRTGT1,2 for engine banks 1,2; use VE2, AFRTGT2 tables only. These options, in conjunction with an added FlexFuel pin option, allow the user to switch VE and AFRTGT tables based on an external switch wired to the FlexFuel Ampseal pin. In this mode,
- when the FlexFuel pin is High, the dual table usage is set to VE1, AFRTGT1,
- when the FlexFuel pin is pulled Low (grounded), the dual table usage is set to VE2, AFRTGT2.
- Two AFTStoich Values: Another addition to the Flex Fuel capability was to provide two user entries for AFRStoich value: one for the lowest FF sensor reading fuel (generally gasoline) and one for the highest reading (generally pure ethanol). The actual AFRStoich value is then interpolated based on the sensor % readback.
- Added fixed width and duty cycle input options for tachout pulses.
- A soft rev limit was added as a third option. This starts randomly cutting fuel to the cylinders starting at Rpm1, with complete fuel cut by Rpm2.
- Restored capability to compensate Χ-Τau parameters for coolant temperature during the warmup period. The coolant compensation should NOT be made more than about 2 or 3 times (200-300%) for Τau, and Χ, after coolant compensation, should generally not exceed 60-70%. This in no way replaces the normal warmup enrichment, which compensates for poor fuel mixing and poor combustion - which are separate effects from wall wetting.
- Added Signature in Table Descriptors.
- Fixed bug in sync search for wheel gap.
- Added nested interrupts to allow operation with Android phones.
- Fixed overflow problem in warmup.
See the 3.8xx code help file for more information: mt38.htm
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.
©2013 Bruce Bowling and Al Grippo and Lance Gardiner. All rights reserved. MegaSquirt® and MicroSquirt® are registered trademarks. This document is solely for the support of MegaSquirt® boards from Bowling and Grippo.