From 7556ff5a2c8063af6e8a6b3b75dbda06354a9ccd Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Fri, 20 Mar 2015 15:12:47 +1100 Subject: [PATCH] Correct EEPROM mapping of final 2 bytes in a page Note that this commit may cause strange behaviour the first time it is loaded within Tuner Studio. You need to ensure you reload the values from Tuner Studio --- reference/Speeduino base tune v0.3.msq | 293 +++++++++++++++++++++++++ storage.h | 28 +-- storage.ino | 2 +- 3 files changed, 308 insertions(+), 15 deletions(-) create mode 100644 reference/Speeduino base tune v0.3.msq diff --git a/reference/Speeduino base tune v0.3.msq b/reference/Speeduino base tune v0.3.msq new file mode 100644 index 00000000..a5320b6c --- /dev/null +++ b/reference/Speeduino base tune v0.3.msq @@ -0,0 +1,293 @@ + + + + + +"0" + + -1.5 + -1.1 + -0.8 + -0.6 + -0.5 + -0.4 + -0.3 + -0.2 + -0.1 + 0.0 + + + 162.0 + 152.0 + 143.0 + 135.0 + 126.0 + 120.0 + 119.0 + 116.0 + 112.0 + 100.0 + + + -40.0 + -29.0 + -18.0 + -7.0 + 4.0 + 16.0 + 27.0 + 38.0 + 54.0 + 71.0 + + + + + 27.0 27.0 27.0 27.0 27.0 27.0 27.0 27.0 + 29.0 32.0 33.0 35.0 36.0 36.0 36.0 36.0 + 35.0 42.0 43.0 45.0 45.0 46.0 46.0 46.0 + 46.0 53.0 55.0 56.0 56.0 56.0 55.0 55.0 + 59.0 64.0 65.0 65.0 65.0 65.0 65.0 65.0 + 71.0 74.0 75.0 75.0 75.0 75.0 75.0 74.0 + 90.0 91.0 92.0 92.0 92.0 92.0 92.0 91.0 + 102.0 102.0 103.0 103.0 103.0 103.0 103.0 103.0 + + + 700.0 + 1200.0 + 2000.0 + 3000.0 + 4000.0 + 4900.0 + 5500.0 + 6500.0 + + + 20.0 + 30.0 + 40.0 + 50.0 + 60.0 + 70.0 + 88.0 + 100.0 + +6.5 +3.5 +15.0 +13.0 + + 162.0 + 152.0 + 143.0 + 135.0 + 126.0 + 120.0 + 119.0 + 116.0 + 112.0 + 100.0 + +25.0 +"Speeduino v0.3" +0.0 +0.0 +0.0 +90.0 +200.0 +80.0 +"Generic 128x32" +"RPM" +"CPU" +"TPS" +"Mem" +"RPM" +"RPM" +"RPM" +0.0 +6.2 +1.0 +"Alternating" +1.0 +0.0 +0.0 +0.0 +0.0 +3000.0 +"250 kPa" +"Four-stroke" +"Port" +"4" +"GM" +"GM" +"4" +"Even fire" +"Narrow band" +"Alpha-N" +"Off" +1.5 +0.0 +59.94 +0.0 +0.0 +0.0 +252.0 + + + + 10.0 20.0 25.0 27.0 32.0 38.0 38.0 40.0 + 10.0 21.0 23.0 27.0 32.0 35.0 38.0 40.0 + 12.0 23.0 23.0 27.0 32.0 35.0 38.0 40.0 + 12.0 15.0 23.0 28.0 27.0 28.0 31.0 33.0 + 10.0 15.0 19.0 24.0 24.0 25.0 27.0 29.0 + 10.0 15.0 13.0 18.0 18.0 19.0 21.0 23.0 + 10.0 15.0 12.0 17.0 17.0 18.0 20.0 22.0 + 10.0 15.0 15.0 17.0 17.0 18.0 20.0 23.0 + + + 500.0 + 1200.0 + 2000.0 + 3000.0 + 3500.0 + 4200.0 + 5000.0 + 6000.0 + + + 10.0 + 20.0 + 35.0 + 50.0 + 65.0 + 75.0 + 86.0 + 100.0 + +244.0 +0.0 +13.024 +11.6 +10.0 +"+45" +"Time Based" +"No" +"Yes" +-1.9008 +65.0 +3200.0 +-20.535 +38.0 +1.0 +"Dwell control" +4.5 +3.0 +36.0 +1.0 +300.0 +92.0 +7000.0 +15.0 +2.0 +7500.0 + + 80.0 + 200.0 + 520.0 + 890.0 + + + 18.0 + 24.0 + 33.0 + 42.0 + + + 0.0 + 11.0 + 22.0 + 33.0 + 44.0 + 56.0 + 67.0 + 78.0 + 94.0 + 111.0 + +8.0 + + 248.0 + 189.0 + 132.0 + 100.0 + 90.0 + 87.0 + + + + + 14.7 14.7 15.0 15.1 14.9 14.7 14.7 14.7 + 14.7 14.7 15.0 15.1 14.9 14.7 14.7 14.7 + 14.7 14.7 14.8 15.0 14.8 14.6 14.4 14.0 + 14.3 14.3 14.7 14.7 14.6 14.1 13.8 13.4 + 14.1 14.2 14.5 14.3 14.0 13.5 13.1 12.9 + 14.1 14.2 13.7 13.6 13.4 13.1 13.0 12.8 + 13.5 13.5 12.8 12.9 12.8 12.7 12.7 12.7 + 12.8 12.8 12.8 12.7 12.5 12.5 12.5 12.5 + + + 500.0 + 1200.0 + 2000.0 + 3000.0 + 3500.0 + 4200.0 + 5000.0 + 6000.0 + + + 10.0 + 20.0 + 35.0 + 50.0 + 65.0 + 75.0 + 86.0 + 100.0 + +"PID" +"Wide Band" +100.0 +20.0 +0.0 +69.93 +16.0 +1.0 +15.0 +9.0 +19.0 +15.0 +1200.0 +70.0 +90.0 +20.0 + + 6.0 + 8.0 + 10.0 + 13.0 + 15.0 + 19.0 + + + + + + + + + + + + + diff --git a/storage.h b/storage.h index 499d46fc..aab8793e 100644 --- a/storage.h +++ b/storage.h @@ -22,12 +22,12 @@ Current layout of EEPROM data (Version 2) is as follows (All sizes are in bytes) | 133 |64 | Ignition Map (8x8) | | 197 |8 | Ign Table RPM bins | | 205 |8 | Ign Table MAP/TPS bins | -| 213 |46 | Remaining Page 2 settings | -| 259 |2 | X and Y sizes for AFR table | -| 261 |64 | AFR Target Map (8x8) | -| 325 |8 | AFR Table RPM bins | -| 333 |8 | AFR Table MAP/TPS bins | -| 341 |46 | Remaining Page 3 settings | +| 213 |48 | Remaining Page 2 settings | +| 261 |2 | X and Y sizes for AFR table | +| 263 |64 | AFR Target Map (8x8) | +| 327 |8 | AFR Table RPM bins | +| 335 |8 | AFR Table MAP/TPS bins | +| 343 |48 | Remaining Page 3 settings | | 2559 |512 | Calibration data (O2) | | 3071 |512 | Calibration data (IAT) | | 3583 |512 | Calibration data (CLT) | @@ -47,14 +47,14 @@ Current layout of EEPROM data (Version 2) is as follows (All sizes are in bytes) #define EEPROM_CONFIG2_XBINS 197 #define EEPROM_CONFIG2_YBINS 205 #define EEPROM_CONFIG2_SETTINGS 213 -#define EEPROM_CONFIG2_END 259 -#define EEPROM_CONFIG3_XSIZE 259 -#define EEPROM_CONFIG3_YSIZE 260 -#define EEPROM_CONFIG3_MAP 261 -#define EEPROM_CONFIG3_XBINS 325 -#define EEPROM_CONFIG3_YBINS 333 -#define EEPROM_CONFIG3_SETTINGS 341 -#define EEPROM_CONFIG3_END 387 +#define EEPROM_CONFIG2_END 261 +#define EEPROM_CONFIG3_XSIZE 261 +#define EEPROM_CONFIG3_YSIZE 262 +#define EEPROM_CONFIG3_MAP 263 +#define EEPROM_CONFIG3_XBINS 327 +#define EEPROM_CONFIG3_YBINS 335 +#define EEPROM_CONFIG3_SETTINGS 343 +#define EEPROM_CONFIG3_END 391 //Calibration data is stored at the end of the EEPROM (This is in case any further calibration tables are needed as they are large blocks) #define EEPROM_CALIBRATION_O2 2559 diff --git a/storage.ino b/storage.ino index 39df0c2f..353d664e 100644 --- a/storage.ino +++ b/storage.ino @@ -171,7 +171,7 @@ void loadConfig() offset = x - EEPROM_CONFIG2_YBINS; ignitionTable.axisY[offset] = EEPROM.read(x); } - //The next 45 bytes can simply be pulled straight from the configTable + //The next 48 bytes can simply be pulled straight from the configTable for(int x=EEPROM_CONFIG2_SETTINGS; x