#unset INI_VERSION_2 ; this is set by TunerStudio, but needs to be unset for Megatune to work #unset SERIAL ; This is to use the serial port [MegaTune] MTversion = 2.25 ; MegaTune itself; needs to match exec version. [TunerStudio] iniSpecVersion = 3.24 #if SERIAL versionInfo = "S" ; Put this in the title bar. queryCommand = "Q" ; Verify against signature. #else versionInfo = "r\x01\x0e\x00\x00\x00\x3c" ; Put this in the title bar. queryCommand = "r\x01\x0f\x00\x00\x00\x14" ; Verify against signature. #endif signature = "MS Ext_CANEGT 0.1.4" ; I/O Extender sends a null at 20th byte. ; 123456789.123456789. ;------------------------------------------------------------------------------- [Constants] ;---------------------------------------------------------------------------- ; Constants Definition ; -------------------- ; ; Scalar Values ; ------------- ; The scaling and translation values are used as follows: ; msValue = userValue / scale - translate ; userValue = (msValue + translate) * scale ; ; I've got no good way to handle a few of these things yet. ; ; Temperatures are fine, check out the Fielding IAC example (fastIdleTemp). ; ; The TPS stuff is a problem, because we have to modify the ini file for ; each TPS installation and again whenever we move the TPS... I figured ; out a moderately palatable solution to presenting the frequency ; divider in the boost control values, turn it into a bit field and then ; enumerate the resulting frequencies. ; ; Array Values ; ------------ ; Arrays are specified just like scalars, except that they have a "shape" ; entry in the fourth parameter. The shape allows you to define lists or ; tables, for example [8] defines a list with eight values and [2x4] defines ; a table with eight values (two rows and four columns). Tables may be ; stored in either "X-" or "Y-order." X-order means that memory is layed ; out like. ; ; [x1,y1] [x2,y1]...[xn,y1] [x1,y2]... ; ; Y-order would be ; ; [x1,y1] [x1,y2]...[x1,yn] [x2,y1]... ; ; To use the TableEditor, you must define two lists and a table, and ; the lengths of the lists must correspond to the shape of the table. ; ; Bit Fields ; ---------- ; Bits are numbered 0-7, the rightmost being bit zero. The basic ; data word that stores bit fields must be unsigned. ; ; You need NOT supply the correct number of labels matching the ; number of bits you've specified (one bit requires 2 values, two ; bits requires 4 values and so on). If you neglect to supply enough ; labels, they will be synthesized using the sequence "1", "2" and so ; on based upon their position in the sequence (the cltType and matType ; will end up with identical lists). ; ;---------------------------------------------------------------------------- pageActivationDelay = 100 ; Milliseconds delay after burn command. blockReadTimeout = 400 ; Milliseconds total timeout for reading page. tsWriteBlocks = on interWriteDelay = 1 endianness = big nPages = 1 pageSize = 30 pageIdentifier = "\x01\x04" burnCommand = "b\x01\x04" pageReadCommand = "r\x01\x04%2o%2c" pageValueWrite = "w\x01\x04%2o%2c%v" ; pageChunkWrite = "w\x07\x04%2o%2c%v" - disable chunk write to attempt to force single byte writes only crc32CheckCommand = "k\x01\x04\x00\x00\x00\x04" ; new serial messageEnvelopeFormat = msEnvelope_1.0 page = 1 ; name = class, type, offset, shape, units, scale, translate, lo, hi, digits adcparam = bits, U08, 0, [0:1], "8 bits", "12 bits", "10 bits", "INVALID" ; * ad1active = bits, U08, 1, [0:0], "Disabled", "Active" ; * ad2active = bits, U08, 1, [1:1], "Disabled", "Active" ; * ad3active = bits, U08, 1, [2:2], "Disabled", "Active" ; * ad4active = bits, U08, 1, [3:3], "Disabled", "Active" ; * ad5active = bits, U08, 1, [4:4], "Disabled", "Active" ; * ad6active = bits, U08, 1, [5:5], "Disabled", "Active" ; * ad7active = bits, U08, 1, [6:6], "Disabled", "Active" ; * ad8active = bits, U08, 1, [7:7], "Disabled", "Active" ; * ; Logger+ config ; name = class, type, offset, shape, units, scale, translate, lo, hi, digits serial1_baud = bits, U08, 2, [0:2], "9600", "19200", "38400", "57600", "115200", "INVALID", "INVALID", "INVALID" serial2_baud = bits, U08, 2, [3:5], "9600", "19200", "38400", "57600", "115200", "INVALID", "INVALID", "INVALID" ; Lag factors ; name = class, type, offset, shape, units, scale, translate, lo, hi, digits ad1lag = scalar, U08, 3, "", 0.78125, 0,10,100, 0 ; * ad2lag = scalar, U08, 4, "", 0.78125, 0,10,100, 0 ; * ad3lag = scalar, U08, 5, "", 0.78125, 0,10,100, 0 ; * ad4lag = scalar, U08, 6, "", 0.78125, 0,10,100, 0 ; * ad5lag = scalar, U08, 7, "", 0.78125, 0,10,100, 0 ; * ad6lag = scalar, U08, 8, "", 0.78125, 0,10,100, 0 ; * ad7lag = scalar, U08, 9, "", 0.78125, 0,10,100, 0 ; * ad8lag = scalar, U08, 10, "", 0.78125, 0,10,100, 0 ; * auxconfig = bits, U08, 11, [0:1], "Disabled", "Enable LC-1 reading from serial port 2", "INVALID", "INVALID"; * afrdefault = scalar, U16, 12, "", 0.0147, 500, 7.35, 22.39, 2 ; * can_mode = bits, U08, 14, [0:2], "Polled Mode", "Push Mode", "Automatic", "Automatic+offset", "Broadcast standard CAN", "INVALID", "INVALID", "INVALID" ; * canid_egt = bits, U08, 15, [0:3], "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "INVALID" ; * table_egt = bits, U08, 16, [0:3], "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" ; * offset_egt = scalar, U16, 17, "", 1, 0, 0, 2047, 0 ; * adcnum = scalar, U08, 19, "", 1, 0, 0, 23, 0 ; * canid_afr = bits, U08, 20, [0:3], "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "INVALID" ; * table_afr = bits, U08, 21, [0:3], "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" ; * offset_afr = scalar, U16, 22, "", 1, 0, 0, 2047, 0 ; * auxnum = scalar, U08, 24, "", 1, 0, 0, 23, 0 ; * nb_egt = bits, U08, 25, [0:3], "0", "1", "2", "3", "4", "5", "6", "7", "8", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"; * nb_afr = bits, U08, 25, [4:7], "0", "1", "2", "3", "4", "5", "6", "7", "8", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"; * std_idbase = scalar, U16, 26, "", 1, 0, 0, 2047, 0 ; * ms_can = bits, U08, 28, [0:0], "Enabled", "Disabled" ; * CAN_speed = bits, U08, 28, [1:2], "500k", "250k", "1M", "INVALID" ; * broadcast_rate = bits, U08, 29, [0:2], "1Hz", "2Hz", "5Hz", "10Hz", "25Hz", "50Hz", "INVALID", "INVALID" ; * [SettingContextHelp] ; constantName = "Help Text" ; tool tips tooltips ;Ensure all settings are defined as some MS2/BG words shipped with TS are not applicable. std_idbase = "EGT 1-4 are on base. EGT 5-8 are on base+1. AFR 1-4 are on base+2. AFR 5-8 are on base+3." ms_can = "Only disable the MS CAN protocol when connecting to other incompatible devices and when the USB port is available." CAN_speed = "Sets the CAN baud rate. 500k is the standard baud rate, changing this will prevent communications with Megasquirt-compatible devices. Alternatives for 3rd party devices are 250k and 1M." ; [Menu] ;---------------------------------------------------------------------------- ; There are five pre-defined values that may be used to define your menus. ; The first four allow access to the "standard" dialog boxes, the last one ; merely draws a separator (horizontal line) in the menu. ; ; std_constants ; std_enrichments ; std_realtime ; std_warmup ; std_accel ; ; std_separator ; ; Additionally, to support MegaSquirt-II firmware, there are two standard ; dialogs to generate its three embedded tables. The first of these acts ; like Roger Enns' EasyTherm, but only works for MS-II. The second one ; generates the internal AFR table required for proper closed loop operation ; in MS-II. Use these without page numbers, as they will just be ignored ; in any case. ; ; std_ms2gentherm ; std_ms2geno2 ; ; If you use any of the std_constants, std_enrichments or std_warmup ; editors, they may be optionally suffixed with a page number (only ; useful for multi-page code variants), which causes them to edit the ; specified page. If you leave off the page specifier, they edit logical ; page one as specified in the Constants section. ; ; There are four special menu names, which when used append to the standard ; menus of the same name instead of creating a new one. The menu names ; are "File", "Communications", "Tools" and "Help". ; ;---------------------------------------------------------------------------- menuDialog = main menu = "CAN EGT setup" subMenu = adc_settings, "ADC settings" subMenu = serial_settings,"Serial ports settings" subMenu = can_comm, "CAN transfer settings" menu = "Data" subMenu = std_realtime, "Realtime Display" ;------------------------------------------------------------------------------- [UserDefined] dialog = adc_resolution, "", xAxis field = "ADC resolution", adcparam dialog = adc_18, "", yAxis field = "Activate" field = "EGT 1", ad1active field = "EGT 2", ad2active field = "EGT 3", ad3active field = "EGT 4", ad4active field = "EGT 5", ad5active field = "EGT 6", ad6active field = "EGT 7", ad7active field = "EGT 8", ad8active dialog = adclag_18, "", yAxis field = "Lag Factor" field = "", ad1lag field = "", ad2lag field = "", ad3lag field = "", ad4lag field = "", ad5lag field = "", ad6lag field = "", ad7lag field = "", ad8lag dialog = adc_channels, "Channels 1-8", xAxis panel = adc_18 panel = adclag_18 dialog = adc_settings, "ADC Settings", border panel = adc_resolution, North panel = adc_channels, South dialog = serial_settings, "Serial ports settings" field = "Serial port 1 (USB) Baud rate", serial1_baud field = "Serial port 2 (LC-1) Baud rate", serial2_baud field = "Auxiliary data configuration", auxconfig field = "Default AFR value in case of error", afrdefault, { (auxconfig == 1) || (auxconfig == 2) } dialog = can_comm, "CAN transfer settings" field = "Transfer mode", can_mode field = "" field = "EGT" field = "CAN ID", canid_egt, { can_mode == 1 } field = "Table number", table_egt, { can_mode == 1 } field = "Offset", offset_egt, { can_mode == 1} field = "CANADC #", adcnum, { can_mode == 3 } field = "Number of EGT values to transfer", nb_egt, { can_mode } field = "" field = "AFR" field = "CAN ID", canid_afr, { (can_mode == 1) && auxconfig } field = "Table number", table_afr, { (can_mode == 1) && auxconfig } field = "Offset", offset_afr, { (can_mode == 1) && auxconfig} field = "CANEGO #", auxnum, { (can_mode == 3) && auxconfig } field = "Number of AFR values to transfer", nb_afr, { can_mode && auxconfig } field = "" field = "CAN Broadcasting 11-bit CAN ID" field = "Base CAN id", std_idbase, { can_mode == 4 } field = "" field = "CAN baud rate", CAN_speed field = "MegaSquirt CAN protocol", ms_can, { can_mode == 4 } field = "" field = "CAN broadcast rate", broadcast_rate, { can_mode >= 1 } ;;------------------------------------------------------------------------------- [CurveEditor] ;------------------------------------------------------------------------------- [GaugeConfigurations] ;------------------------------------------------------------------------------- ; Notes on some of the gauges. ; ; The accelEnrichGauge is now a composite of both acceleration enrichment ; and deceleration enleanment numbers. See the definition of the variable ; accDecEnrich in the OutputChannels section. ; ; David Hooke contributed the lambda gauge and associated transfer ; function files. ; ; The lambda gauge is the best way (my opinion) to report data from a ; wide band EGO gauge, it standardizes the output irrespective of fuel ; or mix of fuels, so you needn't do any brainwork to know if your 75% ; gasoline and 25% methanol is rich at 10:1 or not. ; ; Use the file WBlambda100AVR.inc, if using a standard ADC (e.g., AVR cpu). ; Use the file WBlambda100MOT.inc, if using a biased ADC (e.g., MOT cpu). ;------------------------------------------------------------------------------- ; Define a gauge's characteristics here, then go to a specific layout ; block (Tuning or FrontPage) and use the name you've defined here to ; display that gauge in a particular position. ; ; Name = Case-sensitive, user-defined name for this gauge configuration. ; Var = Case-sensitive name of variable to be displayed, see the ; OutputChannels block in this file for possible values. ; Title = Title displayed at the top of the gauge. ; Units = Units displayed below value on gauge. ; Lo = Lower scale limit of gauge. ; Hi = Upper scale limit of gauge. ; LoD = Lower limit at which danger color is used for gauge background. ; LoW = Lower limit at which warning color is used. ; HiW = Upper limit at which warning color is used. ; HiD = Upper limit at which danger color is used. ; vd = Decimal places in displayed value ; ld = Label decimal places for display of Lo and Hi, above. ;Name Var Title Units Lo Hi LoD LoW HiW HiD vd ld clockGauge = seconds, "Clock", "Seconds", 0, 255, 10, 10, 245, 245, 0, 0 ;Name Var Title Units Lo Hi LoD LoW HiW HiD vd ld ad1Gauge = ad1, "AD1", "raw", 0, 4095, -1, -1, 4097, 4097, 0, 0 ad2Gauge = ad2, "AD2", "raw", 0, 4095, -1, -1, 4097, 4097, 0, 0 ad3Gauge = ad3, "AD3", "raw", 0, 4095, -1, -1, 4097, 4097, 0, 0 ad4Gauge = ad4, "AD4", "raw", 0, 4095, -1, -1, 4097, 4097, 0, 0 ad5Gauge = ad5, "AD5", "raw", 0, 4095, -1, -1, 4097, 4097, 0, 0 ad6Gauge = ad6, "AD6", "raw", 0, 4095, -1, -1, 4097, 4097, 0, 0 ad7Gauge = ad7, "AD7", "raw", 0, 4095, -1, -1, 4097, 4097, 0, 0 ad8Gauge = ad8, "AD8", "raw", 0, 4095, -1, -1, 4097, 4097, 0, 0 #if CELSIUS egt1Gauge = egt1, "EGT 1", "°C", 0, 1250, -1, -1, 1000, 1100, 0, 0 egt2Gauge = egt2, "EGT 2", "°C", 0, 1250, -1, -1, 1000, 1100, 0, 0 egt3Gauge = egt3, "EGT 3", "°C", 0, 1250, -1, -1, 1000, 1100, 0, 0 egt4Gauge = egt4, "EGT 4", "°C", 0, 1250, -1, -1, 1000, 1100, 0, 0 egt5Gauge = egt5, "EGT 5", "°C", 0, 1250, -1, -1, 1000, 1100, 0, 0 egt6Gauge = egt6, "EGT 6", "°C", 0, 1250, -1, -1, 1000, 1100, 0, 0 egt7Gauge = egt7, "EGT 7", "°C", 0, 1250, -1, -1, 1000, 1100, 0, 0 egt8Gauge = egt8, "EGT 8", "°C", 0, 1250, -1, -1, 1000, 1100, 0, 0 #else egt1Gauge = egt1, "EGT 1", "°F", 0, 2300, -1, -1, 1800, 2000, 0, 0 egt2Gauge = egt2, "EGT 2", "°F", 0, 2300, -1, -1, 1800, 2000, 0, 0 egt3Gauge = egt3, "EGT 3", "°F", 0, 2300, -1, -1, 1800, 2000, 0, 0 egt4Gauge = egt4, "EGT 4", "°F", 0, 2300, -1, -1, 1800, 2000, 0, 0 egt5Gauge = egt5, "EGT 5", "°F", 0, 2300, -1, -1, 1800, 2000, 0, 0 egt6Gauge = egt6, "EGT 6", "°F", 0, 2300, -1, -1, 1800, 2000, 0, 0 egt7Gauge = egt7, "EGT 7", "°F", 0, 2300, -1, -1, 1800, 2000, 0, 0 egt8Gauge = egt8, "EGT 8", "°F", 0, 2300, -1, -1, 1800, 2000, 0, 0 #endif maxcountGauge = max_count, "Count", "raw", 0, 4095, -1, -1, 4097, 4097, 0, 0 aux1Gauge = aux_data1, "Auxiliary data 1", "raw", 0, 1023, -1, -1, 1024, 1024, 0, 0 aux2Gauge = aux_data2, "Auxiliary data 2", "raw", 0, 1023, -1, -1, 1024, 1024, 0, 0 aux3Gauge = aux_data3, "Auxiliary data 3", "raw", 0, 1023, -1, -1, 1024, 1024, 0, 0 aux4Gauge = aux_data4, "Auxiliary data 4", "raw", 0, 1023, -1, -1, 1024, 1024, 0, 0 aux5Gauge = aux_data5, "Auxiliary data 5", "raw", 0, 1023, -1, -1, 1024, 1024, 0, 0 aux6Gauge = aux_data6, "Auxiliary data 6", "raw", 0, 1023, -1, -1, 1024, 1024, 0, 0 aux7Gauge = aux_data7, "Auxiliary data 7", "raw", 0, 1023, -1, -1, 1024, 1024, 0, 0 aux8Gauge = aux_data8, "Auxiliary data 8", "raw", 0, 1023, -1, -1, 1024, 1024, 0, 0 AFR1Gauge = afr1, "AFR 1", "", 7.0, 22.5, 10, 11, 17, 18, 2, 1 AFR2Gauge = afr2, "AFR 2", "", 7.0, 22.5, 10, 11, 17, 18, 2, 1 AFR3Gauge = afr3, "AFR 3", "", 7.0, 22.5, 10, 11, 17, 18, 2, 1 AFR4Gauge = afr4, "AFR 4", "", 7.0, 22.5, 10, 11, 17, 18, 2, 1 AFR5Gauge = afr5, "AFR 5", "", 7.0, 22.5, 10, 11, 17, 18, 2, 1 AFR6Gauge = afr6, "AFR 6", "", 7.0, 22.5, 10, 11, 17, 18, 2, 1 AFR7Gauge = afr7, "AFR 7", "", 7.0, 22.5, 10, 11, 17, 18, 2, 1 AFR8Gauge = afr8, "AFR 8", "", 7.0, 22.5, 10, 11, 17, 18, 2, 1 ;------------------------------------------------------------------------------ [FrontPage] ; Gauges are numbered left to right, top to bottom. ; ; 1 2 3 4 ; 5 6 7 8 gauge1 = egt1Gauge gauge2 = egt2Gauge gauge3 = egt3Gauge gauge4 = egt4Gauge gauge5 = egt5Gauge gauge6 = egt6Gauge gauge7 = egt7Gauge gauge8 = egt8Gauge ;---------------------------------------------------------------------------- ; Indicators ; expr off-label on-label, off-bg, off-fg, on-bg, on-fg ; ; Look in the new colors24b.ini for the basic ones, add more or tell me what to add. ; indicator = { cpu == 0 }, "-", "CPU UNSET", white, black, red, black ;------------------------------------------------------------------------------- [OutputChannels] deadValue = { 0 } ; Convenient unchanging value. ochGetCommand = "r\x01\x07%2o%2c" ochBlockSize = 34 seconds = scalar, U16, 0, "s", 1.000, 0.0 secl = { seconds % 256 }, "s" ; For runtime screen. ad1 = scalar, U16, 2, "", 1,0 ad2 = scalar, U16, 4, "", 1,0 ad3 = scalar, U16, 6, "", 1,0 ad4 = scalar, U16, 8, "", 1,0 ad5 = scalar, U16, 10, "", 1,0 ad6 = scalar, U16, 12, "", 1,0 ad7 = scalar, U16, 14, "", 1,0 ad8 = scalar, U16, 16, "", 1,0 aux_data1 = scalar, U16, 18, "", 1,0 aux_data2 = scalar, U16, 20, "", 1,0 aux_data3 = scalar, U16, 22, "", 1,0 aux_data4 = scalar, U16, 24, "", 1,0 aux_data5 = scalar, U16, 26, "", 1,0 aux_data6 = scalar, U16, 28, "", 1,0 aux_data7 = scalar, U16, 30, "", 1,0 aux_data8 = scalar, U16, 32, "", 1,0 time = { timeNow } max_count = { adcparam ? (4096 / (1 + (3 * (adcparam - 1)))) - 1 : 255 } #if CELSIUS egt1 = { ad1 * (1250 / max_count) } egt2 = { ad2 * (1250 / max_count) } egt3 = { ad3 * (1250 / max_count) } egt4 = { ad4 * (1250 / max_count) } egt5 = { ad5 * (1250 / max_count) } egt6 = { ad6 * (1250 / max_count) } egt7 = { ad7 * (1250 / max_count) } egt8 = { ad8 * (1250 / max_count) } #else egt1 = { (ad1 * (2250 / max_count)) + 32 } egt2 = { (ad2 * (2250 / max_count)) + 32 } egt3 = { (ad3 * (2250 / max_count)) + 32 } egt4 = { (ad4 * (2250 / max_count)) + 32 } egt5 = { (ad5 * (2250 / max_count)) + 32 } egt6 = { (ad6 * (2250 / max_count)) + 32 } egt7 = { (ad7 * (2250 / max_count)) + 32 } egt8 = { (ad8 * (2250 / max_count)) + 32 } #endif afr1 = { (aux_data1 + 500) * 0.0147 } afr2 = { (aux_data2 + 500) * 0.0147 } afr3 = { (aux_data3 + 500) * 0.0147 } afr4 = { (aux_data4 + 500) * 0.0147 } afr5 = { (aux_data5 + 500) * 0.0147 } afr6 = { (aux_data6 + 500) * 0.0147 } afr7 = { (aux_data7 + 500) * 0.0147 } afr8 = { (aux_data8 + 500) * 0.0147 } ;------------------------------------------------------------------------------- ;-- The entries are saved in the datalog file in the order in which they -- ;-- appear in the list below. -- ;-- -- ;-- Channel - Case sensitive name of output channel to be logged. -- ;-- Label - String written to header line of log. Be careful -- ;-- about changing these, as programs like MSLVV and -- ;-- MSTweak key off specific column names. -- ;-- Type - Data type of output, converted before writing. -- ;-- Format - C-style output format of data. -- [Datalog] ; Channel Label Type Format ; -------------- ---------- ----- ------ entry = time, "Time", float, "%.3f" entry = seconds, "SecL", int, "%d" entry = egt1, "EGT 1", int, "%d" entry = egt2, "EGT 2", int, "%d" entry = egt3, "EGT 3", int, "%d" entry = egt4, "EGT 4", int, "%d" entry = egt5, "EGT 5", int, "%d" entry = egt6, "EGT 6", int, "%d" entry = egt7, "EGT 7", int, "%d" entry = egt8, "EGT 8", int, "%d" entry = afr1, "AFR 1", int, "%d" entry = afr2, "AFR 2", int, "%d" entry = afr3, "AFR 3", int, "%d" entry = afr4, "AFR 4", int, "%d" entry = afr5, "AFR 5", int, "%d" entry = afr6, "AFR 6", int, "%d" entry = afr7, "AFR 7", int, "%d" entry = afr8, "AFR 8", int, "%d" ;-------------------------------------------------------------------------------