PJSC(Pump Jet Solenoid Controller)はArduinoを使用したバイク用燃料噴射コントローラです。このプロジェクトは、オープンソースECUプロジェクト『Speeduino』をベースにしています。
[PJSC v1.01c] Preparing for MUX output test mode.
| @@ -414,25 +414,28 @@ | ||
| 414 | 414 | #if table4_spark ;[PJSC v1.01c] |
| 415 | 415 | muxout1selection = bits, U08, 117, [0:3], "Disable", "IDLE control", "Thermo Fan control", "Launch control", "Fuel pump control", "Boost control", "VVT control", "Tach output", "INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" |
| 416 | 416 | muxout2selection = bits, U08, 117, [4:7], "Disable", "IDLE control", "Thermo Fan control", "Launch control", "Fuel pump control", "Boost control", "VVT control", "Tach output", "INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" |
| 417 | + muxout3selection = bits, U08, 118, [0:3], "Disable", "IDLE control", "Thermo Fan control", "Launch control", "Fuel pump control", "Boost control", "VVT control", "Tach output", "INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" | |
| 418 | + muxout4selection = bits, U08, 118, [4:7], "Disable", "IDLE control", "Thermo Fan control", "Launch control", "Fuel pump control", "Boost control", "VVT control", "Tach output", "INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" | |
| 417 | 419 | #endif ;[PJSC v1.01c] |
| 418 | 420 | #if table4_fuel ;[PJSC v1.01c] |
| 419 | 421 | muxout1selection = bits, U08, 117, [0:3], "Disable", "IDLE control", "Thermo Fan control", "INVALID", "Fuel pump control", "Boost control", "VVT control", "Tach output", "INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" ;[PJSC v1.01c] |
| 420 | 422 | muxout2selection = bits, U08, 117, [4:7], "Disable", "IDLE control", "Thermo Fan control", "INVALID", "Fuel pump control", "Boost control", "VVT control", "Tach output", "INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" ;[PJSC v1.01c] |
| 423 | + muxout3selection = bits, U08, 118, [0:3], "Disable", "IDLE control", "Thermo Fan control", "INVALID", "Fuel pump control", "Boost control", "VVT control", "Tach output", "INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" ;[PJSC v1.01c] | |
| 424 | + muxout4selection = bits, U08, 118, [4:7], "Disable", "IDLE control", "Thermo Fan control", "INVALID", "Fuel pump control", "Boost control", "VVT control", "Tach output", "INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" ;[PJSC v1.01c] | |
| 421 | 425 | #endif ;[PJSC v1.01c] |
| 422 | 426 | //[PJSC v1.01c] baroDenBins = array, U08, 102, [9], "kPa", 1.0, 0.0, 0.0, 255.0, 0 ;[PJSC v1.10] Bins for the Barometric density correction curve |
| 423 | 427 | //[PJSC v1.01c] baroDenRates = array, U08, 111, [9], "%", 1.0, 0.0, 0.0, 255.0, 0 ;[PJSC v1.10] Values for the \Barometric density correction curve |
| 424 | - algorithm2 = bits, U08, 118, [0:2], $loadSourceNames ;[PJSC v1.10] For Dual Fuel Load | |
| 425 | - algorithm3 = bits, U08, 118, [3:5], $loadSourceNames ;[PJSC v1.10] | |
| 426 | - unused2_120 = bits, U08, 118, [6:7] ;[PJSC v1.10] | |
| 427 | - table4Usage = bits, U08, 119, [0:0], "Fuel", "Spark" ;[PJSC v1.10] | |
| 428 | - unused2_121 = bits, U08, 119, [1:7] ;[PJSC v1.10] | |
| 429 | - inj1SquirtStartEnd = bits, U08, 120, [0:0], "End angle", "Start angle" ;[PJSC v1.01c] | |
| 430 | - inj2SquirtStartEnd = bits, U08, 120, [1:1], "End angle", "Start angle" ;[PJSC v1.01c] | |
| 431 | - inj3SquirtStartEnd = bits, U08, 120, [2:2], "End angle", "Start angle" ;[PJSC v1.01c] | |
| 432 | - inj4SquirtStartEnd = bits, U08, 120, [3:3], "End angle", "Start angle" ;[PJSC v1.01c] | |
| 433 | - unused2_122 = bits, U08, 120, [4:7] ;[PJSC v1.01c] | |
| 434 | -;[PJSC v1.01c] unused2_122 = array, U08, 122, [6], "%", 1.0, 0.0, 0.0, 255, 0 ;[PJSC v1.10] | |
| 435 | - unused2_123 = array, U08, 121, [7], "%", 1.0, 0.0, 0.0, 255, 0 ;[PJSC v1.01c] | |
| 428 | + algorithm2 = bits, U08, 119, [0:2], $loadSourceNames ;[PJSC v1.10] For Dual Fuel Load | |
| 429 | + algorithm3 = bits, U08, 119, [3:5], $loadSourceNames ;[PJSC v1.10] | |
| 430 | + unused2_119 = bits, U08, 119, [6:7] ;[PJSC v1.10] | |
| 431 | + table4Usage = bits, U08, 120, [0:0], "Fuel", "Spark" ;[PJSC v1.10] | |
| 432 | + unused2_120 = bits, U08, 120, [1:7] ;[PJSC v1.10] | |
| 433 | + inj1SquirtStartEnd = bits, U08, 121, [0:0], "End angle", "Start angle" ;[PJSC v1.01c] | |
| 434 | + inj2SquirtStartEnd = bits, U08, 121, [1:1], "End angle", "Start angle" ;[PJSC v1.01c] | |
| 435 | + inj3SquirtStartEnd = bits, U08, 121, [2:2], "End angle", "Start angle" ;[PJSC v1.01c] | |
| 436 | + inj4SquirtStartEnd = bits, U08, 121, [3:3], "End angle", "Start angle" ;[PJSC v1.01c] | |
| 437 | + unused2_121 = bits, U08, 121, [4:7] ;[PJSC v1.01c] | |
| 438 | + unused2_122 = array, U08, 122, [6], "%", 1.0, 0.0, 0.0, 255, 0 ;[PJSC v1.10] | |
| 436 | 439 | |
| 437 | 440 | |
| 438 | 441 | ;Page 2 is the fuel map and axis bins only |
| @@ -1216,6 +1219,8 @@ | ||
| 1216 | 1219 | requiresPowerCycle = dutyPulseCaptureEnabled2 ;[PJSC] |
| 1217 | 1220 | requiresPowerCycle = muxout1selection ;[PJSC v1.10] |
| 1218 | 1221 | requiresPowerCycle = muxout2selection ;[PJSC v1.10] |
| 1222 | + requiresPowerCycle = muxout3selection ;[PJSC v1.01c] | |
| 1223 | + requiresPowerCycle = muxout4selection ;[PJSC v1.01c] | |
| 1219 | 1224 | requiresPowerCycle = algorithm2 ;[PJSC v1.10] |
| 1220 | 1225 | requiresPowerCycle = algorithm3 ;[PJSC v1.10] |
| 1221 | 1226 | requiresPowerCycle = secondaryFuelUsage ;[PJSC v1.10] |
| @@ -1357,6 +1362,8 @@ | ||
| 1357 | 1362 | defaultValue = testinjcnt, 0 ; | |
| 1358 | 1363 | defaultValue = muxout1selection, 0 ; V |
| 1359 | 1364 | defaultValue = muxout2selection, 0 ;[PJSC v1.10] |
| 1365 | + defaultValue = muxout3selection, 0 ;[PJSC v1.01c] | |
| 1366 | + defaultValue = muxout4selection, 0 ;[PJSC v1.01c] | |
| 1360 | 1367 | #if table4_fuel ;[PJSC v1.10] For switching table4 |
| 1361 | 1368 | defaultValue = table4Usage, 0 ;[PJSC v1.10] |
| 1362 | 1369 | #endif ;[PJSC v1.10] For switching table4 |
| @@ -1872,26 +1879,28 @@ | ||
| 1872 | 1879 | panel = engine_constants_west, West |
| 1873 | 1880 | panel = engine_constants_east, East |
| 1874 | 1881 | |
| 1875 | - dialog = muxWarningMessage, "" ;[PJSC v1.10] | |
| 1876 | - field = "Don't select the same function for MUX out1 and MUX out2!" ; | | |
| 1877 | - ; | | |
| 1878 | - dialog = muxoutSetting, "MUX Output Port Setting" ; | | |
| 1879 | - field = "MUX out1", muxout1selection ; | | |
| 1880 | - field = "MUX out2", muxout2selection ; V | |
| 1881 | - panel = muxWarningMessage, ;[PJSC v1.10] | |
| 1882 | + dialog = muxWarningMessage, "" ;[PJSC v1.10] | |
| 1883 | + field = "Don't select the same function for MUX out1 and MUX out2!" ; | | |
| 1884 | + ; | | |
| 1885 | + dialog = muxoutSetting, "MUX Output Port Setting" ; | | |
| 1886 | + field = "MUX out1", muxout1selection ; V | |
| 1887 | + field = "MUX out2", muxout2selection ;[PJSC v1.10] | |
| 1888 | + field = "MUX out3", muxout3selection, { pinLayout == 64 } ;[PJSC v1.01c] | |
| 1889 | + field = "MUX out4", muxout4selection, { pinLayout == 64 } ;[PJSC v1.01c] | |
| 1890 | + panel = muxWarningMessage, ;[PJSC v1.10] | |
| 1882 | 1891 | |
| 1883 | - dialog = captExValveSetting, "Capture Exhaust Valve Position Control" ;[PJSC] | |
| 1884 | - field = "Exhaust valve calibration mode", exValveCalibrationMode ; | | |
| 1885 | - field = "Closed exhaust valve ADC count", exValvePosMin ; | | |
| 1886 | - field = "Open exhaust valve ADC count", exValvePosMax ; | | |
| 1887 | - ; | | |
| 1888 | - dialog = captSparkSetting, "Capture External Spark Control" ; | | |
| 1889 | - field = "Spark capture trigger edge", externalTrigEdge ; | | |
| 1890 | - field = "Spark capture hysteresis", exTrigHysteresis ; | | |
| 1891 | - ; | | |
| 1892 | - dialog = captDutyPulseSetting, "Capture Duty Pulse Control" ; | | |
| 1893 | - field = "Duty pulse ON Level ch1", dutyPulseOnLevel ; V | |
| 1894 | - field = "Duty pulse ON Level ch2", dutyPulseOnLevel2 ;[PJSC] | |
| 1892 | + dialog = captExValveSetting, "Capture Exhaust Valve Position Control" ;[PJSC] | |
| 1893 | + field = "Exhaust valve calibration mode", exValveCalibrationMode ; | | |
| 1894 | + field = "Closed exhaust valve ADC count", exValvePosMin ; | | |
| 1895 | + field = "Open exhaust valve ADC count", exValvePosMax ; | | |
| 1896 | + ; | | |
| 1897 | + dialog = captSparkSetting, "Capture External Spark Control" ; | | |
| 1898 | + field = "Spark capture trigger edge", externalTrigEdge ; | | |
| 1899 | + field = "Spark capture hysteresis", exTrigHysteresis ; | | |
| 1900 | + ; | | |
| 1901 | + dialog = captDutyPulseSetting, "Capture Duty Pulse Control" ; | | |
| 1902 | + field = "Duty pulse ON Level ch1", dutyPulseOnLevel ; V | |
| 1903 | + field = "Duty pulse ON Level ch2", dutyPulseOnLevel2 ;[PJSC] | |
| 1895 | 1904 | |
| 1896 | 1905 | dialog = analogInputPort1select, "" ;[PJSC v1.10] |
| 1897 | 1906 | field = "", exValveCaptureEnabled ; | |
| @@ -123,6 +123,24 @@ | ||
| 123 | 123 | #define VVT_TIMER_COMPARE OCR1B |
| 124 | 124 | #define VVT_TIMER_COUNTER TCNT1 |
| 125 | 125 | |
| 126 | + #define MUX1_TIMER_ENABLE() TIMSK1 |= (1 << OCIE1A) //[PJSC v1.01c] | |
| 127 | + #define MUX1_TIMER_DISABLE() TIMSK1 &= ~(1 << OCIE1A) // | | |
| 128 | + #define MUX2_TIMER_ENABLE() TIMSK1 |= (1 << OCIE1B) // | | |
| 129 | + #define MUX2_TIMER_DISABLE() TIMSK1 &= ~(1 << OCIE1B) // | | |
| 130 | + #define MUX3_TIMER_ENABLE() TIMSK1 |= (1 << OCIE1A) // | | |
| 131 | + #define MUX3_TIMER_DISABLE() TIMSK1 &= ~(1 << OCIE1A) // | | |
| 132 | + #define MUX4_TIMER_ENABLE() TIMSK1 |= (1 << OCIE1B) // | | |
| 133 | + #define MUX4_TIMER_DISABLE() TIMSK1 &= ~(1 << OCIE1B) // | | |
| 134 | + // | | |
| 135 | + #define MUX1_COMPARE OCR1A // | | |
| 136 | + #define MUX1_COUNTER TCNT1 // | | |
| 137 | + #define MUX2_COMPARE OCR1B // | | |
| 138 | + #define MUX2_COUNTER TCNT1 // | | |
| 139 | + #define MUX3_COMPARE OCR1A // | | |
| 140 | + #define MUX3_COUNTER TCNT1 // | | |
| 141 | + #define MUX4_COMPARE OCR1B // V | |
| 142 | + #define MUX4_COUNTER TCNT1 //[PJSC v1.01c] | |
| 143 | + | |
| 126 | 144 | /* |
| 127 | 145 | *********************************************************************************************************** |
| 128 | 146 | * Idle |
| @@ -353,6 +353,15 @@ | ||
| 353 | 353 | volatile byte tempVEvalue[4]; //[PJSC v1.10] Multi VE Map support |
| 354 | 354 | volatile unsigned int dualFuelLoadVE; //[PJSC v1.10] Dual Fuel Load support |
| 355 | 355 | |
| 356 | +volatile PORT_TYPE *mux1_pin_port; //[PJSC v1.01c] | |
| 357 | +volatile byte mux1_pin_mask; // | | |
| 358 | +volatile PORT_TYPE *mux2_pin_port; // | | |
| 359 | +volatile byte mux2_pin_mask; // | | |
| 360 | +volatile PORT_TYPE *mux3_pin_port; // | | |
| 361 | +volatile byte mux3_pin_mask; // | | |
| 362 | +volatile PORT_TYPE *mux4_pin_port; // V | |
| 363 | +volatile byte mux4_pin_mask; //[PJSC v1.01c] | |
| 364 | + | |
| 356 | 365 | //These need to be here as they are used in both speeduino.ino and scheduler.ino |
| 357 | 366 | bool channel1InjEnabled = true; |
| 358 | 367 | bool channel2InjEnabled = false; |
| @@ -688,6 +697,8 @@ | ||
| 688 | 697 | uint16_t testinjcnt; // | |
| 689 | 698 | byte muxout1Selection: 4; // | MUX output1 selection |
| 690 | 699 | byte muxout2Selection: 4; // | MUX output2 selection |
| 700 | + byte muxout3Selection: 4; // |[PJSC v1.01c] MUX output3 selection | |
| 701 | + byte muxout4Selection: 4; // |[PJSC v1.01c] MUX output4 selection | |
| 691 | 702 | //[PJSC v1.01c] byte baroDenBins[9]; // | For Barometric extend correnction |
| 692 | 703 | //[PJSC v1.01c] byte baroDenRates[9]; // | For Barometric extend correnction |
| 693 | 704 | byte fuelAlgorithm2: 3; //[PJSC v1.10] For Secondary Fuel Algorithm |
| @@ -700,8 +711,8 @@ | ||
| 700 | 711 | byte inj2SquirtStartEnd: 1; // | |
| 701 | 712 | byte inj3SquirtStartEnd: 1; // | |
| 702 | 713 | byte inj4SquirtStartEnd: 1; // | |
| 703 | - byte unused2_120: 4; // V | |
| 704 | - byte unused2_121[7]; //[PJSC v1.01c] | |
| 714 | + byte unused2_121: 4; // V | |
| 715 | + byte unused2_122[6]; //[PJSC v1.01c] | |
| 705 | 716 | |
| 706 | 717 | #if defined(CORE_AVR) |
| 707 | 718 | }; |
| @@ -1112,6 +1123,8 @@ | ||
| 1112 | 1123 | byte pinCaptureDuty2; //[PJSC] For capturing duty pulse |
| 1113 | 1124 | byte pinMuxout1; //[PJSC v1.10] For MUX output setting |
| 1114 | 1125 | byte pinMuxout2; //[PJSC v1.10] For MUX output setting |
| 1126 | +byte pinMuxout3; //[PJSC v1.01c] For MUX output setting | |
| 1127 | +byte pinMuxout4; //[PJSC v1.01c] For MUX output setting | |
| 1115 | 1128 | |
| 1116 | 1129 | // global variables // from speeduino.ino |
| 1117 | 1130 | extern struct statuses currentStatus; // from speeduino.ino |
| @@ -76,6 +76,16 @@ | ||
| 76 | 76 | #define coil4Low() (*ign4_pin_port &= ~(ign4_pin_mask)) |
| 77 | 77 | #define coil4High() (*ign4_pin_port |= (ign4_pin_mask)) |
| 78 | 78 | |
| 79 | +//[PJSC v1.01c] For MUX output test mode | |
| 80 | +#define openMux1() *mux1_pin_port |= (mux1_pin_mask); | |
| 81 | +#define closeMux1() *mux1_pin_port &= ~(mux1_pin_mask); | |
| 82 | +#define openMux2() *mux2_pin_port |= (mux2_pin_mask); | |
| 83 | +#define closeMux2() *mux2_pin_port &= ~(mux2_pin_mask); | |
| 84 | +#define openMux3() *mux3_pin_port |= (mux3_pin_mask); | |
| 85 | +#define closeMux3() *mux3_pin_port &= ~(mux3_pin_mask); | |
| 86 | +#define openMux4() *mux4_pin_port |= (mux4_pin_mask); | |
| 87 | +#define closeMux4() *mux4_pin_port &= ~(mux4_pin_mask); | |
| 88 | + | |
| 79 | 89 | void nullCallback(); |
| 80 | 90 | |
| 81 | 91 | static byte coilHIGH = HIGH; |
| @@ -230,6 +230,18 @@ | ||
| 230 | 230 | long pjsc2_pwm_target_value; |
| 231 | 231 | long pjsc3_pwm_target_value; |
| 232 | 232 | long pjsc4_pwm_target_value; |
| 233 | +volatile bool mux1_pwm_state; //[PJSC v1.01c] | |
| 234 | +volatile bool mux2_pwm_state; // | | |
| 235 | +volatile bool mux3_pwm_state; // | | |
| 236 | +volatile bool mux4_pwm_state; // | | |
| 237 | +volatile unsigned int mux1_pwm_cur_value; // | | |
| 238 | +volatile unsigned int mux2_pwm_cur_value; // | | |
| 239 | +volatile unsigned int mux3_pwm_cur_value; // | | |
| 240 | +volatile unsigned int mux4_pwm_cur_value; // | | |
| 241 | +long mux1_pwm_target_value; // | | |
| 242 | +long mux2_pwm_target_value; // | | |
| 243 | +long mux3_pwm_target_value; // V | |
| 244 | +long mux4_pwm_target_value; //[PJSC v1.01c] | |
| 233 | 245 | //[PJSC] For PJSC |
| 234 | 246 | |
| 235 | 247 | //[PJSC v1.10] |
| @@ -237,15 +249,27 @@ | ||
| 237 | 249 | void pjsc2Toggle(); |
| 238 | 250 | void pjsc3Toggle(); |
| 239 | 251 | void pjsc4Toggle(); |
| 252 | +void mux1Toggle(); //[PJSC v1.01c] | |
| 253 | +void mux2Toggle(); // | | |
| 254 | +void mux3Toggle(); // V | |
| 255 | +void mux4Toggle(); //[PJSC v1.01c] | |
| 240 | 256 | void setPjsc1Duty(); |
| 241 | 257 | void setPjsc2Duty(); |
| 242 | 258 | void setPjsc3Duty(); |
| 243 | 259 | void setPjsc4Duty(); |
| 260 | +void setCoil1Duty(); //[PJSC v1.01c] | |
| 261 | +void setCoil2Duty(); // | | |
| 262 | +void setCoil3Duty(); // | | |
| 263 | +void setCoil4Duty(); // | | |
| 264 | +void setMux1Duty(); // | | |
| 265 | +void setMux2Duty(); // | | |
| 266 | +void setMux3Duty(); // V | |
| 267 | +void setMux4Duty(); //[PJSC v1.01c] | |
| 244 | 268 | void injTstPulseToggle1(); |
| 245 | 269 | void injTstPulseToggle2(); |
| 246 | 270 | void injTstPulseToggle3(); |
| 247 | 271 | void injTstPulseToggle4(); |
| 248 | -void injTstControlPWM(byte injCh); | |
| 272 | +void hardWareTstControlPWM(byte injCh); | |
| 249 | 273 | void injTstControlPulse(byte injCh); |
| 250 | 274 | |
| 251 | 275 | #define DISABLE_TIMER_FUEL1TO4() FUEL1_TIMER_DISABLE(); FUEL2_TIMER_DISABLE(); FUEL3_TIMER_DISABLE(); FUEL4_TIMER_DISABLE() |