Ejemplo n.º 1
0
static void setDefaultAspireMaps(DECLARE_ENGINE_PARAMETER_SIGNATURE) {

	setFuelLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX);
	setFuelRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX);
	setTimingLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX);
	setTimingRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX);

	copyFuelTable(default_aspire_fuel_table, config->fuelTable);
	copyTimingTable(default_aspire_timing_table, config->ignitionTable);
}
Ejemplo n.º 2
0
static void setDefaultCustomMaps(DECLARE_CONFIG_PARAMETER_SIGNATURE) {

	setFuelLoadBin(0,100 PASS_CONFIG_PARAMETER_SUFFIX);
	setFuelRpmBin(0, 7000 PASS_CONFIG_PARAMETER_SUFFIX);
	setTimingLoadBin(0,100 PASS_CONFIG_PARAMETER_SUFFIX);
	setTimingRpmBin(0,7000 PASS_CONFIG_PARAMETER_SUFFIX);

	copyFuelTable(default_custom_fuel_table, config->fuelTable);
  copyFuelTable(default_custom_fuel_table, config->veTable);
	copyTimingTable(default_custom_timing_table, config->ignitionTable);
}
Ejemplo n.º 3
0
static void setDefaultMaps(engine_configuration_s *engineConfiguration) {

	setFuelLoadBin(engineConfiguration, 1.2, 4.4);
	setFuelRpmBin(engineConfiguration, 800, 7000);
	setTimingLoadBin(engineConfiguration, 1.2, 4.4);
	setTimingRpmBin(engineConfiguration, 800, 7000);

	for (int k = 0; k < FUEL_LOAD_COUNT; k++) {
		for (int r = 0; r < FUEL_RPM_COUNT; r++) {
			engineConfiguration->fuelTable[k][r] = default_fuel_table[k][r];
		}
	}

	for (int k = 0; k < AD_LOAD_COUNT; k++) {
		for (int r = 0; r < AD_RPM_COUNT; r++) {
			engineConfiguration->ignitionTable[k][r] = default_timing_table[k][r];
		}
	}
}
Ejemplo n.º 4
0
static void setDefaultAspireMaps(engine_configuration_s *engineConfiguration) {

	setFuelLoadBin(engineConfiguration, 1.2, 4.4);
	setFuelRpmBin(engineConfiguration, 800, 7000);
	setTimingLoadBin(engineConfiguration, 1.2, 4.4);
	setTimingRpmBin(engineConfiguration, 800, 7000);

	// todo: extract an array16x16 type? extract a method?
	for (int k = 0; k < FUEL_LOAD_COUNT; k++) {
		for (int r = 0; r < FUEL_RPM_COUNT; r++) {
			engineConfiguration->fuelTable[k][r] = default_aspire_fuel_table[k][r];
		}
	}

	// todo: extract an array16x16 type? extract a method?
	for (int k = 0; k < AD_LOAD_COUNT; k++) {
		for (int r = 0; r < AD_RPM_COUNT; r++) {
			engineConfiguration->ignitionTable[k][r] = default_aspire_timing_table[k][r];
		}
	}
}
Ejemplo n.º 5
0
static void commonMiataNa(DECLARE_ENGINE_PARAMETER_F) {
	engineConfiguration->trigger.type = TT_MAZDA_MIATA_NA;
	engineConfiguration->engineChartSize = 100;

	boardConfiguration->triggerInputPins[0] = GPIOC_6; // 2G YEL/BLU
	boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP

	engineConfiguration->ignitionMode = IM_WASTED_SPARK;
	setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
	setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);

	boardConfiguration->idle.solenoidFrequency = 160;

	engineConfiguration->globalTriggerAngleOffset = 294;

	// Frankenstein: high side #1 is PE8
	// Frankenstein: high side #2 is PE10
	// Frankenstein: high side #3 is PE12
	// Frankenstein: high side #4 is PE14
	// Frankenstein: high side #5 is PC9
	// Frankenstein: high side #6 is PC7

	boardConfiguration->ignitionPins[0] = GPIOE_12; // Frankenstein: high side #3
	boardConfiguration->ignitionPins[1] = GPIOE_14; // Frankenstein: high side #4
	boardConfiguration->ignitionPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPinMode = OM_DEFAULT;

	setDefaultCrankingFuel(engineConfiguration);

	boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;
	boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN;

	setCommonNTCSensor(&engineConfiguration->clt);
	engineConfiguration->clt.config.bias_resistor = 2700;
	setCommonNTCSensor(&engineConfiguration->iat);
	engineConfiguration->iat.config.bias_resistor = 2700;

}
Ejemplo n.º 6
0
void setCitroenBerlingoTU3JPConfiguration(DECLARE_ENGINE_PARAMETER_F) {
	engineConfiguration->engineType = CITROEN_TU3JP;

	/**
	 * Base engine setting
	 */
	setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
	engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
	engineConfiguration->globalTriggerAngleOffset = 114;
	engineConfiguration->specs.cylindersCount = 4;
	engineConfiguration->specs.displacement = 1.360;
	engineConfiguration->specs.firingOrder = FO_1_THEN_3_THEN_4_THEN2;
	engineConfiguration->ignitionMode = IM_WASTED_SPARK;
	engineConfiguration->injectionMode = IM_BATCH;
	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	engineConfiguration->rpmHardLimit = 5000;
	engineConfiguration->cranking.rpm = 600;

//	memcpy(config->ve2RpmBins, rpmSteps, sizeof(rpmSteps));

	/**
	* Cranking fuel setting
	* TODO: they recomend using something like -40C for low point and +80C for high point
	*/
	engineConfiguration->cranking.baseFuel = 15;

	/**
	 * Algorithm Alpha-N setting
	 */
	setAlgorithm(LM_ALPHA_N PASS_ENGINE_PARAMETER);
	setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER);
	setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
	setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER);

	/**
	 * Outputs
	 */

	// Frankenstein lo-side output #1: PC14 Igniter 1-4
	// Frankenstein lo-side output #2: PC15 Igniter 2-3
	// Frankenstein lo-side output #3: PE6  Injector 1-4
	// Frankenstein lo-side output #4: PC13 Injector 2-3
	// Frankenstein lo-side output #5: PE4
	// Frankenstein lo-side output #6: PE5
	// Frankenstein lo-side output #7: PE2
	// Frankenstein lo-side output #8: PE3
	// Frankenstein lo-side output #9: PE0	Fan
	// Frankenstein lo-side output #10: PE1	MIL
	// Frankenstein lo-side output #11: PB8	Main relay
	// Frankenstein lo-side output #12: PB9	Fuel pump

	boardConfiguration->ignitionPins[0] = GPIOC_14;
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIOC_15;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;

	engineConfiguration->injector.flow = 137; //SIEMENS DEKA VAZ20734
	boardConfiguration->injectionPins[0] = GPIOE_6;
	boardConfiguration->injectionPins[1] = GPIOC_13;
	boardConfiguration->injectionPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->injectionPins[3] = GPIO_UNASSIGNED;

	boardConfiguration->fanPin = GPIOE_0;
	boardConfiguration->fanPinMode = OM_DEFAULT;

	boardConfiguration->malfunctionIndicatorPin = GPIOE_1;
	boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;

	boardConfiguration->mainRelayPin = GPIOB_8;

	boardConfiguration->fuelPumpPin = GPIOB_9;
	boardConfiguration->fuelPumpPinMode = OM_DEFAULT;

	setLCD(boardConfiguration);


//	boardConfiguration->o2heaterPin = GPIOC_13;
//	boardConfiguration->logicAnalyzerPins[1] = GPIO_UNASSIGNED;

	/**
	 * Inputs
	 */

	// See https://docs.google.com/spreadsheet/ccc?key=0Arl1FeMZcfisdEdGdUlHdWh6cVBoSzFIbkxqa1QtZ3c
	// Frankenstein analog input #1: PA1		adc1	MAP
	// Frankenstein analog input #2: PA3		adc3	TPS
	// Frankenstein analog input #3: PC3		adc13	IAT
	// Frankenstein analog input #4: PC1		adc11	CLT
	// Frankenstein analog input #5: PA0		adc0	vBatt
	// Frankenstein analog input #6: PC2		adc12	WBO
	// Frankenstein analog input #7: PA4		adc4
	// Frankenstein analog input #8: PA2		adc2
	// Frankenstein analog input #9: PA6		adc6
	// Frankenstein analog input #10: PA7		adc7
	// Frankenstein analog input #11: PC4		adc14
	// Frankenstein analog input #12: PC5|PA8	adc15	Speed Sensor

	/**
	 * MAP <BOSCH 0 261 230 057>
	 */
	engineConfiguration->map.sensor.hwChannel = EFI_ADC_1;
	engineConfiguration->map.sensor.type = MT_CUSTOM;
	engineConfiguration->map.sensor.valueAt0 = 10;
	engineConfiguration->map.sensor.valueAt5 = 110;
	/**
	 * TPS <MAGNETI MARELLI>
	 */
	engineConfiguration->tpsAdcChannel = EFI_ADC_3;
	engineConfiguration->tpsMin = 108; // convert 12to10 bit (ADC/4)
	engineConfiguration->tpsMax = 812; // convert 12to10 bit (ADC/4)
	/**
	 * IAT <OEM ECU>
	 */
	engineConfiguration->iat.adcChannel = EFI_ADC_13;
	setThermistorConfiguration(&engineConfiguration->iat, -20.0, 15600.0, 23.0, 2250.0, 92.0, 240.0);
	engineConfiguration->iat.config.bias_resistor = 2660;
	/**
	* CLT <LADA Samara>
	*/
	engineConfiguration->clt.adcChannel = EFI_ADC_11;
	setThermistorConfiguration(&engineConfiguration->clt, -20.0, 28680.0, 25.0, 2796.0, 100.0, 177.0);
	engineConfiguration->iat.config.bias_resistor = 2660;
	/**
	 * vBatt
	 */
	engineConfiguration->vbattAdcChannel = EFI_ADC_0;
	engineConfiguration->vbattDividerCoeff = ((float) (2.6 + 10.1)) / 2.6 * 2;
	/**
	* WBO Innovate LC-1
	*/
	engineConfiguration->afr.hwChannel = EFI_ADC_12;
	/**
	* Speed Sensor
	*/
	boardConfiguration->vehicleSpeedSensorInputPin = GPIOA_8;
	engineConfiguration->hasVehicleSpeedSensor = true;
	/**
	* Other
	*/
//	engineConfiguration->mafAdcChannel = GPIO_UNASSIGNED;

	copyFuelTable(tps_fuel_table, config->fuelTable);
	copyTimingTable(tps_advance_table, config->ignitionTable);

}
Ejemplo n.º 7
0
void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
	board_configuration_s * boardConfiguration = &engineConfiguration->bc;
	engineConfiguration->trigger.type = TT_DODGE_NEON_2003;
	setFrankenso_01_LCD(boardConfiguration);
	setFrankenso0_1_joystick(engineConfiguration);

	// set_global_trigger_offset_angle 50
	engineConfiguration->globalTriggerAngleOffset = 50;
	// set_injection_offset 0
	engineConfiguration->injectionAngle = 0;

	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	engineConfiguration->injectionMode = IM_SEQUENTIAL;
	engineConfiguration->ignitionMode = IM_WASTED_SPARK;
	engineConfiguration->specs.displacement = 1.996;
	engineConfiguration->specs.cylindersCount = 4;

	/**
	 * that's NGC config
	 *
	 * set_cranking_fuel 5
	 */
	engineConfiguration->cranking.baseFuel = 5;

	/**
	 * 77C
	 * 1200 rpm
	 * fuel 3
	 *
	 * 88C
	 * fuel 2.8
	 *
	 * set_whole_fuel_map 12
	 */
	//setWholeFuelMap(12 PASS_ENGINE_PARAMETER);
	copyFuelTable(alphaNfuel, config->fuelTable);
	//setWholeTimingTable(12 PASS_ENGINE_PARAMETER);
	copyTimingTable(fromDyno, config->ignitionTable);

	// set_cranking_charge_angle 70
	engineConfiguration->crankingChargeAngle = 70;
	// set_cranking_timing_angle 710
	engineConfiguration->crankingTimingAngle = -710;


	/**
	 * bosch 4G1139
	 * http://forum.2gn.org/viewtopic.php?t=21657
	 */
	engineConfiguration->injector.flow = 199;

	// I want to start with a simple Alpha-N
	engineConfiguration->algorithm = LM_ALPHA_N;
//	engineConfiguration->algorithm = LM_SPEED_DENSITY;
	setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER);
	setTimingLoadBin(0, 100 PASS_ENGINE_PARAMETER);

	boardConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED;

	/**
	 * PA4 Wideband O2 Sensor
	 */
	engineConfiguration->afr.hwChannel = EFI_ADC_4;

	commonFrankensoAnalogInputs(engineConfiguration);
	engineConfiguration->vbattDividerCoeff = ((float) (8.2 + 33)) / 8.2 * 2;

	/**
	 * http://rusefi.com/wiki/index.php?title=Manual:Hardware_Frankenso_board
	 */
	// Frankenso low out #1: PE6 main relay
	// Frankenso low out #2: PE5 alternator field control
	// Frankenso low out #3: PD7 coolant fan relay
	// Frankenso low out #4: PC13 idle valve solenoid
	// Frankenso low out #5: PE3 fuel pump relay
	// Frankenso low out #6: PE4
	// Frankenso low out #7: PE1 (do not use with discovery!)
	// Frankenso low out #8: PE2 injector #3
	// Frankenso low out #9: PB9 injector #2
	// Frankenso low out #10: PE0 (do not use with discovery!)
	// Frankenso low out #11: PB8 injector #1
	// Frankenso low out #12: PB7 injector #4

	boardConfiguration->fanPin = GPIOD_7;

	boardConfiguration->injectionPins[0] = GPIOB_8;
	boardConfiguration->injectionPins[1] = GPIOB_9;
	boardConfiguration->injectionPins[2] = GPIOE_2;
	boardConfiguration->injectionPins[3] = GPIOB_7;

	boardConfiguration->ignitionPins[0] = GPIOC_9;
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIOE_8;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;

	boardConfiguration->mainRelayPin = GPIOE_6;

	boardConfiguration->idle.solenoidPin = GPIOC_13;
	boardConfiguration->idle.solenoidFrequency = 300;

	boardConfiguration->fuelPumpPin = GPIOE_3;
	boardConfiguration->fuelPumpPinMode = OM_DEFAULT;

	boardConfiguration->triggerInputPins[0] = GPIOA_5;
	boardConfiguration->triggerInputPins[1] = GPIOC_6;

	/**
	 * Frankenso analog #1 PC2 ADC12 CLT
	 * Frankenso analog #2 PC1 ADC11 IAT
	 * Frankenso analog #3 PA0 ADC0
	 * Frankenso analog #4 PC3 ADC13
	 * Frankenso analog #5 PA2 ADC2
	 * Frankenso analog #6 PA1 ADC1
	 * Frankenso analog #7 PA4 ADC4 WBO AFR
	 * Frankenso analog #8 PA3 ADC3
	 * Frankenso analog #9 PA7 ADC7
	 * Frankenso analog #10 PA6 ADC6 MAP
	 * Frankenso analog #11 PC5 ADC15 TPS
	 * Frankenso analog #12 PC4 ADC14 VBatt
	 */


	setThermistorConfiguration(&engineConfiguration->clt, 0, 32500, 30, 7550, 100, 700);
	engineConfiguration->clt.bias_resistor = 10000;

	setThermistorConfiguration(&engineConfiguration->iat, 0, 32500, 30, 7550, 100, 700);
	engineConfiguration->iat.bias_resistor = 10000;

	/**
	 * MAP PA6
	 */
	engineConfiguration->map.sensor.hwChannel = EFI_ADC_6;

	boardConfiguration->adcHwChannelEnabled[0] = ADC_SLOW; // ADC0 - PA0
	boardConfiguration->adcHwChannelEnabled[1] = ADC_SLOW; // just for test
	boardConfiguration->adcHwChannelEnabled[2] = ADC_SLOW; // just for test
	boardConfiguration->adcHwChannelEnabled[3] = ADC_SLOW; // just for test

	boardConfiguration->adcHwChannelEnabled[4] = ADC_SLOW;
	boardConfiguration->adcHwChannelEnabled[5] = ADC_OFF;
	boardConfiguration->adcHwChannelEnabled[6] = ADC_FAST;
	boardConfiguration->adcHwChannelEnabled[7] = ADC_SLOW; // just for test

	boardConfiguration->adcHwChannelEnabled[8] = ADC_OFF;
	boardConfiguration->adcHwChannelEnabled[9] = ADC_OFF;
	boardConfiguration->adcHwChannelEnabled[10] = ADC_OFF;
	boardConfiguration->adcHwChannelEnabled[11] = ADC_SLOW; // IAT

	boardConfiguration->adcHwChannelEnabled[12] = ADC_SLOW; // CLT
	boardConfiguration->adcHwChannelEnabled[13] = ADC_SLOW; // AFR
	boardConfiguration->adcHwChannelEnabled[14] = ADC_SLOW; // VBatt
	boardConfiguration->adcHwChannelEnabled[15] = ADC_FAST; // TPS


	/**
	 * TPS
	 */
	engineConfiguration->tpsAdcChannel = EFI_ADC_15;
	engineConfiguration->tpsMin = 125; // convert 12to10 bit (ADC/4)
	engineConfiguration->tpsMax = 625; // convert 12to10 bit (ADC/4)

	/**
	 * IAT D15/W7
	 */
	engineConfiguration->iatAdcChannel = EFI_ADC_11;

	/**
	 * CLT D13/W9
	 */
	engineConfiguration->cltAdcChannel = EFI_ADC_12;


	boardConfiguration->analogChartMode = AC_MAP;
	boardConfiguration->isFastAdcEnabled = true;
	engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003;

#if EFI_HIP_9011 || defined(__DOXYGEN__)
	setHip9011FrankensoPinout();
#endif
	engineConfiguration->cylinderBore = 87.5;

//	boardConfiguration->clutchDownPin = GPIOC_12;
	boardConfiguration->clutchDownPinMode = PI_PULLUP;
	boardConfiguration->clutchUpPin = GPIOD_3;
	boardConfiguration->clutchUpPinMode = PI_PULLUP;

	// alt GPIOC_12
	
	/**
	 * set_fsio_setting 0 0.11
	 */
	engineConfiguration->bc.fsio_setting[0] = 0.2;
#if EFI_FSIO || defined(__DOXYGEN__)
	boardConfiguration->fsio_setting[0] = 0.55;
	setFsioExt(0, GPIOE_5, "0 fsio_setting", 400 PASS_ENGINE_PARAMETER);
#endif

	boardConfiguration->vehicleSpeedSensorInputPin = GPIOA_8;
	engineConfiguration->hasVehicleSpeedSensor = true;

	engineConfiguration->fanOnTemperature = 85;
	engineConfiguration->fanOffTemperature = 80;

//	boardConfiguration->tunerStudioSerialSpeed = 9600;
	boardConfiguration->tunerStudioSerialSpeed = 38400;
	engineConfiguration->algorithm = LM_SPEED_DENSITY;

	boardConfiguration->alternatorControlPin = GPIOD_5;
	engineConfiguration->alternatorControlPFactor = 22;

//	engineConfiguration->isCanEnabled = true;
	boardConfiguration->canTxPin = GPIOB_6;
	boardConfiguration->canRxPin = GPIOB_12;
	engineConfiguration->canWriteEnabled = true;
	engineConfiguration->canReadEnabled = false;
	engineConfiguration->canNbcType = CAN_BUS_NBC_BMW;
//	engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;


	boardConfiguration->idle.stepperDirectionPin = GPIOE_10;
	boardConfiguration->idle.stepperStepPin = GPIOE_12;

	engineConfiguration->mapAccelLength = 12;
}
Ejemplo n.º 8
0
/**
 * pin 1I/W9 - extra +5v
 * set_engine_type 14
 */
void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
	engineConfiguration->trigger.type = TT_MAZDA_DOHC_1_4;

	common079721_2351(engineConfiguration, boardConfiguration);

	setFrankenso_01_LCD(boardConfiguration);
	setFrankenso0_1_joystick(engineConfiguration);

	setDensoTODO(config);

	engineConfiguration->globalFuelCorrection = 0.75;
	engineConfiguration->specs.displacement = 1.839;
//	engineConfiguration->algorithm = LM_PLAIN_MAF;
	setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
//	engineConfiguration->algorithm = LM_REAL_MAF;

	setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
	setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);

	config->veRpmBins[0] = 800;
	config->veRpmBins[1] = 1200;
	config->veRpmBins[2] = 1600;
	config->veRpmBins[3] = 2000;
	config->veRpmBins[4] = 2400;
	config->veRpmBins[5] = 2800;
	config->veRpmBins[6] = 3200;
	config->veRpmBins[7] = 3600;
	config->veRpmBins[8] = 4100;
	config->veRpmBins[9] = 4500;
	config->veRpmBins[10] = 4900;
	config->veRpmBins[11] = 5300;
	config->veRpmBins[12] = 5700;
	config->veRpmBins[13] = 6100;
	config->veRpmBins[14] = 6500;
	config->veRpmBins[15] = 7000;

	copyFuelTable(racingFestivaVeTable, config->veTable);

//	boardConfiguration->triggerInputPins[0] = GPIOC_6; // 2G YEL/BLU
//	boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP

	// in case of SOHC distributor we only have one signal
//	boardConfiguration->triggerInputPins[0] = GPIOA_5; // 2E White CKP
//	boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;

	// in case of DOHC distributor we have two signals
	boardConfiguration->triggerInputPins[0] = GPIOC_6;
	boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP

	// Denso 195500-2180
	engineConfiguration->injector.flow = 265;

	engineConfiguration->hasBaroSensor = false;

	engineConfiguration->hasMapSensor = true;
	boardConfiguration->isFastAdcEnabled = true;
	engineConfiguration->map.sensor.type = MT_DENSO183;
	engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;

	setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER);
	engineConfiguration->afr.hwChannel = EFI_ADC_2; // Frankenso analog #5

	// set_idle_position 10
	boardConfiguration->manIdlePosition = 10;

	setWholeIatCorrTimingTable(0 PASS_ENGINE_PARAMETER);


	// set_global_trigger_offset_angle -37
	engineConfiguration->globalTriggerAngleOffset = -37;
	// set_ignition_offset 0
	engineConfiguration->ignitionOffset = 0;
	// set_injection_offset 0
	engineConfiguration->injectionOffset = 0;

	// todo: change to 15?
	// set_cranking_timing_angle 3
	engineConfiguration->crankingTimingAngle = 3;
	engineConfiguration->crankingChargeAngle = 70;
	// set_cranking_fuel 9
	engineConfiguration->cranking.baseFuel = 9;

	setTableBin2(config->ignitionLoadBins, IGN_LOAD_COUNT, 20, 105, 5);
	setWholeTimingTable(10 PASS_ENGINE_PARAMETER);
	// set_whole_fuel_map 5
	setWholeFuelMap(5 PASS_ENGINE_PARAMETER);
	setMap(config->afrTable, 13.5);

	setSingleCoilDwell(engineConfiguration);
	engineConfiguration->ignitionMode = IM_ONE_COIL;

	boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;
	boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN;

	boardConfiguration->ignitionPins[0] = GPIOE_14; // Frankenso high side - pin 1G
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPinMode = OM_DEFAULT;

	// individual coils
	// W6  PC9
	// W8  PC7
	// W12 PE8
	// W13 PE12



	/**
	 * Outputs
	 */
	// Frankenso low out #1: PE6
	// Frankenso low out #2: PE5 MIL
	// Frankenso low out #3:
	// Frankenso low out #4:
	// Frankenso low out #5: PE3 VICS solenoid
	// Frankenso low out #6: PE4
	// Frankenso low out #7: PE0<>PD5
	// Frankenso low out #8: PE2 INJ
	// Frankenso low out #9: PB9 IDLE
	// Frankenso low out #10: PE1<>PD3 INJ 1&3
	// Frankenso low out #11: PB8
	// Frankenso low out #12: PB7

	boardConfiguration->injectionPins[0] = GPIOD_3;
	boardConfiguration->injectionPins[1] = GPIOE_2;


	//setDefaultCrankingFuel(engineConfiguration);
	engineConfiguration->cranking.baseFuel = 5;

	// 40% idle is good default
	boardConfiguration->idle.solenoidFrequency = 300;
	boardConfiguration->idle.solenoidPin = GPIOB_9;

	boardConfiguration->malfunctionIndicatorPin = GPIOE_5;
	boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;

	boardConfiguration->tunerStudioSerialSpeed = 19200;

	commonFrankensoAnalogInputs(engineConfiguration);
	setCommonNTCSensor(&engineConfiguration->clt);
	engineConfiguration->clt.config.bias_resistor = 2700;
	setCommonNTCSensor(&engineConfiguration->iat);
	engineConfiguration->iat.config.bias_resistor = 2700;

	// we have a 1999 Auto Miata TB mounted on this car
	engineConfiguration->hasTpsSensor = true;
	engineConfiguration->tpsMin = 115; // convert 12to10 bit (ADC/4)
	engineConfiguration->tpsMax = 630; // convert 12to10 bit (ADC/4)

	engineConfiguration->tpsAdcChannel = EFI_ADC_3;
//	engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
	engineConfiguration->mafAdcChannel = EFI_ADC_0;
	engineConfiguration->clt.adcChannel = EFI_ADC_12;
	engineConfiguration->iat.adcChannel = EFI_ADC_11;

	// todo: 8.2 or 10k?
	engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2;

	// VICS solenoid
	/**
	 * to test
	 * set_fsio_setting 0 5000
	 */
	engineConfiguration->bc.fsio_setting[0] = 5000;
	// set_fsio_expression 1 "rpm 0 fsio_setting >"
	setFsioExt(0, GPIOE_3, "rpm 0 fsio_setting >", 150 PASS_ENGINE_PARAMETER);


	// warning light
	/**
	 * to test
	 * set_fsio_setting 1 1800
	 * set_fsio_setting 2 95
	 * set_fsio_setting 3 14
	 *
	 * set_fsio_expression 1 "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
	 * eval "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
	 */
	engineConfiguration->bc.fsio_setting[1] = 6200; // RPM threshold
	engineConfiguration->bc.fsio_setting[2] = 90; // CLT threshold
	engineConfiguration->bc.fsio_setting[3] = 13.5; // voltage threshold

	setFsio(1, GPIOC_13, "rpm 1 fsio_setting > coolant 2 fsio_setting > | vbatt 3 fsio_setting < |" PASS_ENGINE_PARAMETER);


	config->ignitionRpmBins[0] = 800;
	config->ignitionRpmBins[1] = 1200;
	config->ignitionRpmBins[2] = 1600;
	config->ignitionRpmBins[3] = 2000;
	config->ignitionRpmBins[4] = 2400;
	config->ignitionRpmBins[5] = 2800;
	config->ignitionRpmBins[6] = 3200;
	config->ignitionRpmBins[7] = 3600;
	config->ignitionRpmBins[8] = 4100;
	config->ignitionRpmBins[9] = 4500;
	config->ignitionRpmBins[10] = 4900;
	config->ignitionRpmBins[11] = 5300;
	config->ignitionRpmBins[12] = 5700;
	config->ignitionRpmBins[13] = 6100;
	config->ignitionRpmBins[14] = 6500;
	config->ignitionRpmBins[15] = 7000;
	copyTimingTable(racingFestivaIgnitionTable, config->ignitionTable);

	//	boardConfiguration->useWarmupPidAfr = true;
		engineConfiguration->warmupAfrPid.pFactor = -0.2;
		engineConfiguration->warmupAfrPid.iFactor = -0.0005;
	//	engineConfiguration->warmupAfrPid.dFactor = -0.02;
		engineConfiguration->debugMode = WARMUP_ENRICH;

	// end of Ford Escort GT config
}
Ejemplo n.º 9
0
/**
 * @brief	Global default engine configuration
 * This method sets the global engine configuration defaults. These default values are then
 * overridden by engine-specific defaults and the settings are saved in flash memory.
 *
 * This method is invoked only when new configuration is needed:
 *  * recently re-flashed chip
 *  * flash version of configuration failed CRC check or appears to be older then FLASH_DATA_VERSION
 *  * 'rewriteconfig' command
 *  * 'set_engine_type X' command
 */
void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
#if (! EFI_UNIT_TEST) || defined(__DOXYGEN__)
	memset(&persistentState.persistentConfiguration, 0, sizeof(persistentState.persistentConfiguration));
#endif
	prepareVoidConfiguration(engineConfiguration);

	boardConfiguration->mafSensorType = Bosch0280218037;
	setBosch0280218037(config);

	engineConfiguration->injector.lag = 1.0;

	engineConfiguration->acCutoffLowRpm = 700;
	engineConfiguration->acCutoffHighRpm = 5000;

	initTemperatureCurve(IAT_CURVE_SIZE, config->iatFuelCorrBins, config->iatFuelCorr);
	initTemperatureCurve(CLT_CURVE_SIZE, config->cltFuelCorrBins, config->cltFuelCorr);

	initTemperatureCurve(CLT_CURVE_SIZE, config->cltIdleCorrBins, config->cltIdleCorr);

	engineConfiguration->tachPulseDuractionMs = 4;
	engineConfiguration->tachPulseTriggerIndex = 4;

	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, -40, 1.5);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, -30, 1.5);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, -20, 1.42);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, -10, 1.36);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 0, 1.28);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 10, 1.19);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 20, 1.12);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 30, 1.10);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 40, 1.06);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 50, 1.06);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 60, 1.03);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 70, 1.01);


	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, -40, 1.5);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, -30, 1.5);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, -20, 1.42);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, -10, 1.36);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 0, 1.28);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 10, 1.19);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 20, 1.12);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 30, 1.10);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 40, 1.06);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 50, 1.06);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 60, 1.03);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 70, 1.01);

	for (int i = 0; i < VBAT_INJECTOR_CURVE_SIZE; i++) {
		engineConfiguration->injector.battLagCorrBins[i] = 12 - VBAT_INJECTOR_CURVE_SIZE / 2 + i;
		engineConfiguration->injector.battLagCorr[i] = 0; // zero extra time by default
	}

	setConstantDwell(4 PASS_ENGINE_PARAMETER); // 4ms is global default dwell
	engineConfiguration->useConstantDwellDuringCranking = false;

	setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
	setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
	setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
	setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER);

	setTableBin2(engineConfiguration->map.samplingAngleBins, MAP_ANGLE_SIZE, 800, 7000, 1);
	setTableBin2(engineConfiguration->map.samplingAngle, MAP_ANGLE_SIZE, 100, 130, 1);
	setTableBin2(engineConfiguration->map.samplingWindowBins, MAP_ANGLE_SIZE, 800, 7000, 1);
	setTableBin2(engineConfiguration->map.samplingWindow, MAP_ANGLE_SIZE, 50, 50, 1);

	// set_whole_timing_map 3
	setWholeFuelMap(3 PASS_ENGINE_PARAMETER);
	setMap(config->afrTable, 14.7);

	setDefaultVETable(PASS_ENGINE_PARAMETER_F);

	setMap(config->injectionPhase, -180);
	setRpmTableBin(config->injPhaseRpmBins, FUEL_RPM_COUNT);
	setFuelTablesLoadBin(10, 160 PASS_ENGINE_PARAMETER);
	setDefaultIatTimingCorrection(PASS_ENGINE_PARAMETER_F);

	setThermistorConfiguration(&engineConfiguration->clt, 0, 9500, 23.8889, 2100, 48.8889, 1000);
	engineConfiguration->clt.config.bias_resistor = 1500;

	setThermistorConfiguration(&engineConfiguration->iat, 32, 9500, 75, 2100, 120, 1000);
// todo: this value is way off! I am pretty sure temp coeffs are off also
	engineConfiguration->iat.config.bias_resistor = 2700;


	engineConfiguration->step1rpm = 3000;
 	engineConfiguration->step1timing = 10;
	engineConfiguration->step1RpmWindow = 500;
	engineConfiguration->step1fuelCutEnable = false;
	engineConfiguration->step1SparkCutEnable = false;
	engineConfiguration->step1RpmWindow = 500;

	engineConfiguration->rpmHardLimit = 7000;
	engineConfiguration->cranking.rpm = 550;
	engineConfiguration->cutFuelOnHardLimit = true;
	engineConfiguration->cutSparkOnHardLimit = true;

	engineConfiguration->noAccelAfterHardLimitPeriodSecs = 3;

	setTableBin2(engineConfiguration->crankingTpsCoef, CRANKING_CURVE_SIZE, 1, 1, 1);
	setTableBin2(engineConfiguration->crankingTpsBins, CRANKING_CURVE_SIZE, 0, 100, 1);

	config->crankingFuelCoef[0] = 5; // base cranking fuel adjustment coefficient
	config->crankingFuelBins[0] = -20; // temperature in C
	config->crankingFuelCoef[1] = 3.7;
	config->crankingFuelBins[1] = -10;
	config->crankingFuelCoef[2] = 2.6;
	config->crankingFuelBins[2] = 5;
	config->crankingFuelCoef[3] = 2.4;
	config->crankingFuelBins[3] = 20;
	config->crankingFuelCoef[4] = 2.1;
	config->crankingFuelBins[4] = 35;
	config->crankingFuelCoef[5] = 1.8;
	config->crankingFuelBins[5] = 50;
	config->crankingFuelCoef[6] = 1.5;
	config->crankingFuelBins[6] = 65;
	config->crankingFuelCoef[7] = 1;
	config->crankingFuelBins[7] = 90;

	config->crankingCycleCoef[0] = 2;
	config->crankingCycleBins[0] = 10;
	config->crankingCycleCoef[1] = 1;
	config->crankingCycleBins[1] = 31;
	config->crankingCycleCoef[2] = 1;
	config->crankingCycleBins[2] = 52;
	config->crankingCycleCoef[3] = 0.5;
	config->crankingCycleBins[3] = 73;
	config->crankingCycleCoef[4] = 0.5;
	config->crankingCycleBins[4] = 74;
	config->crankingCycleCoef[5] = 0.5;
	config->crankingCycleBins[5] = 75;
	config->crankingCycleCoef[6] = 0.5;
	config->crankingCycleBins[6] = 76;
	config->crankingCycleCoef[7] = 0.5;
	config->crankingCycleBins[7] = 77;

	engineConfiguration->cranking.baseFuel = 5;

	engineConfiguration->analogInputDividerCoefficient = 2;

	engineConfiguration->crankingChargeAngle = 70;
	engineConfiguration->timingMode = TM_DYNAMIC;
	engineConfiguration->fixedModeTiming = 50;

	// performance optimization
	boardConfiguration->sensorChartMode = SC_OFF;

	engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
	engineConfiguration->baroSensor.hwChannel = EFI_ADC_NONE;

	engineConfiguration->pedalPositionChannel = EFI_ADC_NONE;

	engineConfiguration->specs.firingOrder = FO_1_THEN_3_THEN_4_THEN2;
	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	engineConfiguration->injectionMode = IM_SEQUENTIAL;

	engineConfiguration->ignitionMode = IM_ONE_COIL;
	engineConfiguration->globalTriggerAngleOffset = 0;
	engineConfiguration->injectionOffset = 0;
	engineConfiguration->ignitionOffset = 0;
	engineConfiguration->overrideCrankingIgnition = true;
	engineConfiguration->sensorChartFrequency = 20;

	engineConfiguration->algorithm = LM_PLAIN_MAF;

	engineConfiguration->vbattDividerCoeff = ((float) (15 + 65)) / 15;

	engineConfiguration->fanOnTemperature = 75;
	engineConfiguration->fanOffTemperature = 70;

	engineConfiguration->tpsMin = convertVoltageTo10bitADC(1.250);
	engineConfiguration->tpsMax = convertVoltageTo10bitADC(4.538);
	engineConfiguration->tpsErrorLowValue = convertVoltageTo10bitADC(0.2);
	engineConfiguration->tpsErrorHighValue = convertVoltageTo10bitADC(6);

	engineConfiguration->canNbcType = CAN_BUS_NBC_BMW;
	engineConfiguration->canSleepPeriod = 50;
	engineConfiguration->canReadEnabled = true;
	engineConfiguration->canWriteEnabled = false;

	setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
	engineConfiguration->specs.cylindersCount = 4;
	engineConfiguration->specs.displacement = 2;
	/**
	 * By the way http://users.erols.com/srweiss/tableifc.htm has a LOT of data
	 */
	engineConfiguration->injector.flow = 200;

	engineConfiguration->displayMode = DM_HD44780;

	engineConfiguration->logFormat = LF_NATIVE;
	engineConfiguration->directSelfStimulation = false;

	engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;

	engineConfiguration->HD44780width = 20;
	engineConfiguration->HD44780height = 4;

	engineConfiguration->vRefAdcChannel = EFI_ADC_NONE;
	engineConfiguration->vbattAdcChannel = EFI_ADC_NONE;
	engineConfiguration->clt.adcChannel = EFI_ADC_6;
	engineConfiguration->iat.adcChannel = EFI_ADC_7;
	engineConfiguration->mafAdcChannel = EFI_ADC_NONE;
	engineConfiguration->afr.hwChannel = EFI_ADC_14;

	engineConfiguration->cylinderBore = 87.5;

	setEgoSensor(ES_14Point7_Free PASS_ENGINE_PARAMETER);

	engineConfiguration->globalFuelCorrection = 1;

	engineConfiguration->map.sensor.type = MT_MPX4250;

	engineConfiguration->baroSensor.type = MT_CUSTOM;
	engineConfiguration->baroSensor.valueAt0 = 0;
	engineConfiguration->baroSensor.valueAt5 = 500;

	engineConfiguration->hasMapSensor = true;
	engineConfiguration->hasMafSensor = true;
	engineConfiguration->hasTpsSensor = true;
	engineConfiguration->hasAfrSensor = true;
	engineConfiguration->hasIatSensor = true;
	engineConfiguration->hasCltSensor = true;
	engineConfiguration->hasBaroSensor = false;
	engineConfiguration->isEngineChartEnabled = true;

	engineConfiguration->useOnlyFrontForTrigger = false;

	boardConfiguration->idle.solenoidFrequency = 200;
	// set_idle_position 50
	boardConfiguration->idlePosition = 50;
	engineConfiguration->targetIdleRpm = 1200;
//	engineConfiguration->idleMode = IM_AUTO;
	engineConfiguration->idleMode = IM_MANUAL;

	engineConfiguration->acSwitchAdc = EFI_ADC_NONE;

	engineConfiguration->externalKnockSenseAdc = EFI_ADC_NONE;

	boardConfiguration->useSerialPort = true;
	boardConfiguration->useStepperIdle = false;

	boardConfiguration->idle.stepperDirectionPin = GPIOE_10;
	boardConfiguration->idle.stepperStepPin = GPIOE_12;
	engineConfiguration->stepperEnablePin = GPIOE_14;
	engineConfiguration->idleStepperReactionTime = 10;
	engineConfiguration->idleStepperTotalSteps = 150;

#if EFI_PROD_CODE || defined(__DOXYGEN__)
	engineConfiguration->engineChartSize = 300;
#else
	// need more events for automated test
	engineConfiguration->engineChartSize = 400;
#endif

	engineConfiguration->engineCycle = 720;

	engineConfiguration->primingSquirtDurationMs = 5;

	engineConfiguration->isInjectionEnabled = true;
	engineConfiguration->isIgnitionEnabled = true;
	engineConfiguration->isCylinderCleanupEnabled = true;
	engineConfiguration->secondTriggerChannelEnabled = true;

	engineConfiguration->isMapAveragingEnabled = true;
	engineConfiguration->isMilEnabled = true;
	engineConfiguration->isFuelPumpEnabled = true;
	engineConfiguration->isTunerStudioEnabled = true;
	engineConfiguration->isWaveAnalyzerEnabled = true;
	engineConfiguration->isIdleThreadEnabled = true;

	engineConfiguration->acIdleRpmBump = 200;
	engineConfiguration->knockDetectionWindowStart = 35;
	engineConfiguration->knockDetectionWindowEnd = 135;

	engineConfiguration->fuelLevelSensor = EFI_ADC_NONE;
	boardConfiguration->fuelLevelEmptyTankVoltage = 0;
	boardConfiguration->fuelLevelFullTankVoltage = 5;

	engineConfiguration->hipOutputChannel = EFI_ADC_NONE;

	/**
	 * this is RPM. 10000 rpm is only 166Hz, 800 rpm is 13Hz
	 */
	boardConfiguration->triggerSimulatorFrequency = 1200;

	boardConfiguration->triggerErrorPin = GPIO_UNASSIGNED;

	boardConfiguration->max31855spiDevice = SPI_NONE;
	for (int i = 0; i < EGT_CHANNEL_COUNT; i++) {
		boardConfiguration->max31855_cs[i] = GPIO_UNASSIGNED;
	}
	for (int i = 0; i < LE_COMMAND_COUNT; i++) {
		boardConfiguration->fsioPins[i] = GPIO_UNASSIGNED;
		config->le_formulas[i][0] = 0;
		boardConfiguration->fsioDigitalInputs[i] = GPIO_UNASSIGNED;
		engineConfiguration->fsioInputModes[i] = PI_DEFAULT;
	}

	boardConfiguration->triggerSimulatorPins[0] = GPIOD_1;
	boardConfiguration->triggerSimulatorPins[1] = GPIOD_2;
	boardConfiguration->triggerSimulatorPins[2] = GPIO_UNASSIGNED;

	boardConfiguration->triggerSimulatorPinModes[0] = OM_DEFAULT;
	boardConfiguration->triggerSimulatorPinModes[1] = OM_DEFAULT;
	boardConfiguration->triggerSimulatorPinModes[2] = OM_DEFAULT;

	setFrankenstein_01_LCD(boardConfiguration);

	strcpy(config->timingMultiplier, "1");
	strcpy(config->timingAdditive, "0");

	engineConfiguration->hip9011SpiDevice = SPI_DEVICE_2;

	engineConfiguration->isAlternatorControlEnabled = true;

	engineConfiguration->isGpsEnabled = false;
	boardConfiguration->gps_rx_pin = GPIOB_7;
	boardConfiguration->gps_tx_pin = GPIOB_6;

	boardConfiguration->triggerInputPins[0] = GPIOC_6;
	boardConfiguration->triggerInputPins[1] = GPIOA_5;
	boardConfiguration->logicAnalyzerPins[0] = GPIO_UNASSIGNED;
	boardConfiguration->logicAnalyzerPins[1] = GPIO_UNASSIGNED; // GPIOE_5 is a popular option (if available)
	boardConfiguration->logicAnalyzerPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->logicAnalyzerPins[3] = GPIO_UNASSIGNED;
	boardConfiguration->vehicleSpeedSensorInputPin = GPIO_UNASSIGNED;
	engineConfiguration->vehicleSpeedCoef = 1.0f;

	boardConfiguration->logicAnalyzerMode[0] = false;
	boardConfiguration->logicAnalyzerMode[1] = false;

	engineConfiguration->mapErrorLowValue = 5;
	engineConfiguration->mapErrorHighValue = 250;

	boardConfiguration->idleThreadPeriod = 100;
	boardConfiguration->consoleLoopPeriod = 200;
	boardConfiguration->lcdThreadPeriod = 300;
	boardConfiguration->generalPeriodicThreadPeriod = 50;
	boardConfiguration->useLcdScreen = true;

	boardConfiguration->boardTestModeJumperPin = GPIOB_0;

	boardConfiguration->canDeviceMode = CD_USE_CAN2;
	boardConfiguration->canTxPin = GPIOB_6;
	boardConfiguration->canRxPin = GPIOB_12;

	// set this to SPI_DEVICE_3 to enable stimulation
	boardConfiguration->digitalPotentiometerSpiDevice = SPI_NONE;
	boardConfiguration->digitalPotentiometerChipSelect[0] = GPIOD_7;
	boardConfiguration->digitalPotentiometerChipSelect[1] = GPIO_UNASSIGNED;
	boardConfiguration->digitalPotentiometerChipSelect[2] = GPIOD_5;
	boardConfiguration->digitalPotentiometerChipSelect[3] = GPIO_UNASSIGNED;

	boardConfiguration->is_enabled_spi_1 = false;
	boardConfiguration->is_enabled_spi_2 = false;
	boardConfiguration->is_enabled_spi_3 = true;

	boardConfiguration->spi1mosiPin = GPIOB_5;
	boardConfiguration->spi1misoPin = GPIOB_4;
	boardConfiguration->spi1sckPin = GPIOB_3; // please note that this pin is also SWO/SWD - Single Wire debug Output

	boardConfiguration->spi2mosiPin = GPIOB_15;
	boardConfiguration->spi2misoPin = GPIOB_14;
	boardConfiguration->spi2sckPin = GPIOB_13;

	boardConfiguration->spi3mosiPin = GPIOB_5;
	boardConfiguration->spi3misoPin = GPIOB_4;
	boardConfiguration->spi3sckPin = GPIOB_3;

	boardConfiguration->hip9011Gain = 1;

	boardConfiguration->sdCardCsPin = GPIOD_4;
	boardConfiguration->isSdCardEnabled = true;
	boardConfiguration->isFastAdcEnabled = true;
	boardConfiguration->isEngineControlEnabled = true;

	boardConfiguration->isVerboseAlternator = false;

	boardConfiguration->tunerStudioSerialSpeed = TS_DEFAULT_SPEED;

	engineConfiguration->mapAccelLength = 6;
	engineConfiguration->mapAccelEnrichmentThreshold = 5; // kPa
	engineConfiguration->mapAccelEnrichmentMultiplier = 2;

	engineConfiguration->tpsAccelLength = 12;
	engineConfiguration->tpsAccelEnrichmentThreshold = 40; // TPS % change, per engine cycle
	engineConfiguration->tpsAccelEnrichmentMultiplier = 0.05;
}
Ejemplo n.º 10
0
static void setHondaAccordConfigurationCommon(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
	engineConfiguration->map.sensor.type = MT_DENSO183;
	boardConfiguration->isFastAdcEnabled = true;

	// set ignition_mode 0
	engineConfiguration->ignitionMode = IM_ONE_COIL;
	// set injection_mode
	engineConfiguration->injectionMode = IM_BATCH;

	engineConfiguration->idleMode = IM_MANUAL;

	engineConfiguration->HD44780height = 4;

	engineConfiguration->specs.cylindersCount = 4;
	engineConfiguration->specs.displacement = 2.156;

	// Keihin 06164-P0A-A00
	engineConfiguration->injector.flow = 248;

	setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX);
	setFuelLoadBin(0, 100 PASS_CONFIG_PARAMETER_SUFFIX);

	buildTimingMap(35 PASS_CONFIG_PARAMETER_SUFFIX);

	/**
	 * 18K Ohm @ -20C
	 * 2.1K Ohm @ 24C
	 * 100 Ohm @ 120C
	 */
	setCommonNTCSensor(&engineConfiguration->clt);
	engineConfiguration->clt.config.bias_resistor = 1500; // same as OEM ECU

	setCommonNTCSensor(&engineConfiguration->iat);
	engineConfiguration->iat.config.bias_resistor = 1500; // same as OEM ECU

	// set cranking_charge_angle 35
	engineConfiguration->crankingChargeAngle = 70;
	// set cranking_timing_angle 0
	engineConfiguration->crankingTimingAngle = -45;

	// set global_trigger_offset_angle 34
	engineConfiguration->globalTriggerAngleOffset = 34;

	// set_rpm_hard_limit 4000
	engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
	// set_cranking_rpm 2000
	engineConfiguration->cranking.rpm = 500;


	// set ignition_offset 350
//	engineConfiguration->ignitionOffset = 350;
	 // set injection_offset 510
//	engineConfiguration->extraInjectionOffset = 510;


	/**
	 * ADC inputs:
	 *
	 * Inp1/ADC12 PC2: CLT
	 * Inp2/ADC11 PC1: AIT/IAT
	 * Inp3/ADC0 PA0: MAP
	 * Inp4/ADC13 PC3: AFR green wire
	 * Inp6/ADC1 PA1: TPS
	 * Inp12/ADC14 PC4: VBatt
	 */

	/**
	 * wideband O2 Sensor
	 */
	engineConfiguration->afr.hwChannel = EFI_ADC_13;

	/**
	 * VBatt
	 */
	engineConfiguration->vbattAdcChannel = EFI_ADC_14;
	engineConfiguration->vbattDividerCoeff = ((float) (10 + 39)) / 10 * 2;

	//	todo engineConfiguration->afr.hwChannel = 14;


	/**
	 * MAP D17/W5 blue wire
	 */
	engineConfiguration->map.sensor.hwChannel = EFI_ADC_0;
	/**
	 * IAT D15/W7 green wire
	 */
	engineConfiguration->iat.adcChannel = EFI_ADC_11;
	/**
	 * CLT D13/W9 yellow wire
	 */
	engineConfiguration->clt.adcChannel = EFI_ADC_12;
	/**
	 * TPS D11/W11 blue wire
	 */
	engineConfiguration->tpsAdcChannel = EFI_ADC_1;


	/**
	 * Outputs
	 */
	// Frankenso low out #1: PE6
	// Frankenso low out #2: PE5
	// Frankenso low out #3: PD7
	// Frankenso low out #4: PC13
	// Frankenso low out #5: PE3 Fuel Relay
	// Frankenso low out #6: PE4 radiator fan - blue wire
	// Frankenso low out #7: PD3 idle air valve solenoid - green wire
	// Frankenso low out #8: PE2 MIL - white wire
	// Frankenso low out #9: PB9 Injector #2
	// Frankenso low out #10: PD5 Injector #3
	// Frankenso low out #11: PB8 injector #1
	// Frankenso low out #12: PB7 injector #4
	boardConfiguration->fuelPumpPin = GPIOE_3;
	boardConfiguration->fuelPumpPinMode = OM_DEFAULT;
	boardConfiguration->malfunctionIndicatorPin = GPIOE_2;
	boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;
	boardConfiguration->fanPin = GPIOE_4; // blue wire

	boardConfiguration->idle.solenoidPin = GPIOD_3; // green wire

	boardConfiguration->injectionPins[0] = GPIOB_8;
	boardConfiguration->injectionPins[1] = GPIOB_9;
	boardConfiguration->injectionPins[2] = GPIOD_5;
	boardConfiguration->injectionPins[3] = GPIOB_7;

	boardConfiguration->ignitionPins[0] = GPIOE_12; // white wire
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;


	setFrankenso_01_LCD(boardConfiguration);
	setFrankenso0_1_joystick(engineConfiguration);

	boardConfiguration->idle.solenoidFrequency = 500;
}
Ejemplo n.º 11
0
void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfiguration,
		board_configuration_s *boardConfiguration) {
	engineConfiguration->triggerConfig.triggerType = TT_DODGE_NEON_2003;
	setFrankenso_01_LCD(boardConfiguration);

	// set_global_trigger_offset_angle 46
	engineConfiguration->globalTriggerAngleOffset = 46;
	engineConfiguration->needSecondTriggerInput = false;

	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	engineConfiguration->injectionMode = IM_SEQUENTIAL;
	engineConfiguration->ignitionMode = IM_WASTED_SPARK;
	engineConfiguration->displacement = 1.996;
	engineConfiguration->cylindersCount = 4;

	/**
	 * that's NGC config
	 *
	 * set_cranking_fuel 5
	 */
	engineConfiguration->crankingSettings.baseCrankingFuel = 5;

	/**
	 * 77C
	 * 1200 rpm
	 * fuel 3
	 *
	 * 88C
	 * fuel 2.8
	 *
	 * set_whole_fuel_map 12
	 */
	setWholeFuelMap(engineConfiguration, 12);
	setWholeTimingTable(engineConfiguration, 12);

	// set_cranking_charge_angle 70
	engineConfiguration->crankingChargeAngle = 70;
	// set_cranking_timing_angle 710
	engineConfiguration->crankingTimingAngle = 710;


	/**
	 * bosch 4G1139
	 * http://forum.2gn.org/viewtopic.php?t=21657
	 */
	engineConfiguration->injectorFlow = 199;

	// I want to start with a simple Alpha-N
	engineConfiguration->algorithm = LM_ALPHA_N;
	setFuelLoadBin(engineConfiguration, 0, 100);
	setTimingLoadBin(engineConfiguration, 0, 100);

	boardConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED;

	/**
	 * PA4 Wideband O2 Sensor
	 */
	engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_4;

	commonFrankensoAnalogInputs(engineConfiguration);
	engineConfiguration->vbattDividerCoeff = ((float) (8.2 + 33)) / 8.2 * 2;

	// Frankenso low out #1: PE6
	// Frankenso low out #2: PE5
	// Frankenso low out #3: PD7 coolant fan relay
	// Frankenso low out #4: PC13 idle valve solenoid
	// Frankenso low out #5: PE3 fuel pump relay
	// Frankenso low out #6: PE4
	// Frankenso low out #7: PE1 (do not use with discovery!)
	// Frankenso low out #8: PE2 injector #3
	// Frankenso low out #9: PB9 injector #2
	// Frankenso low out #10: PE0 (do not use with discovery!)
	// Frankenso low out #11: PB8 injector #1
	// Frankenso low out #12: PB7 injector #4

	boardConfiguration->fanPin = GPIOD_7;

	boardConfiguration->injectionPins[0] = GPIOB_8;
	boardConfiguration->injectionPins[1] = GPIOB_9;
	boardConfiguration->injectionPins[2] = GPIOE_2;
	boardConfiguration->injectionPins[3] = GPIOB_7;

	boardConfiguration->ignitionPins[0] = GPIOC_9;
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIOE_8;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;

	boardConfiguration->idleValvePin = GPIOC_13;
	boardConfiguration->idleSolenoidFrequency = 300;

	boardConfiguration->fuelPumpPin = GPIOE_3;
	boardConfiguration->fuelPumpPinMode = OM_DEFAULT;

	boardConfiguration->gps_rx_pin = GPIO_UNASSIGNED;
	boardConfiguration->gps_tx_pin = GPIO_UNASSIGNED;

	boardConfiguration->triggerInputPins[0] = GPIOA_5;
	boardConfiguration->triggerInputPins[1] = GPIOC_6;

	setThermistorConfiguration(&engineConfiguration->cltThermistorConf, 0, 32500, 30, 7550, 100, 700);
	engineConfiguration->cltThermistorConf.bias_resistor = 10000;

	setThermistorConfiguration(&engineConfiguration->iatThermistorConf, 0, 32500, 30, 7550, 100, 700);
	engineConfiguration->iatThermistorConf.bias_resistor = 10000;

	/**
	 * MAP PA6
	 */
	engineConfiguration->map.sensor.hwChannel = EFI_ADC_6;

	boardConfiguration->adcHwChannelEnabled[0] = ADC_FAST; // ADC0 - PA0 - MAP
	boardConfiguration->adcHwChannelEnabled[1] = ADC_SLOW;
	boardConfiguration->adcHwChannelEnabled[4] = ADC_SLOW;
	boardConfiguration->adcHwChannelEnabled[11] = ADC_SLOW; // IAT
	boardConfiguration->adcHwChannelEnabled[12] = ADC_SLOW; // CLT
	boardConfiguration->adcHwChannelEnabled[13] = ADC_SLOW; // AFR
	boardConfiguration->adcHwChannelEnabled[14] = ADC_SLOW; // VBatt
	boardConfiguration->adcHwChannelEnabled[15] = ADC_SLOW; // TPS



	/**
	 * TPS
	 */
	engineConfiguration->tpsAdcChannel = EFI_ADC_15;
	engineConfiguration->tpsMin = 125; // convert 12to10 bit (ADC/4)
	engineConfiguration->tpsMax = 625; // convert 12to10 bit (ADC/4)

	/**
	 * IAT D15/W7
	 */
	engineConfiguration->iatAdcChannel = EFI_ADC_11;

	/**
	 * CLT D13/W9
	 */
	engineConfiguration->cltAdcChannel = EFI_ADC_12;
}
Ejemplo n.º 12
0
/**
 * pin 1I/W9 - extra +5v
 * set_engine_type 14
 */
void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
	engineConfiguration->trigger.type = TT_MAZDA_DOHC_1_4;

	common079721_2351(engineConfiguration, boardConfiguration);

	setFrankenso_01_LCD(boardConfiguration);
	setFrankenso0_1_joystick(engineConfiguration);

	setDensoTODO(config);

	engineConfiguration->globalFuelCorrection = 0.75;
	engineConfiguration->specs.displacement = 1.839;
//	engineConfiguration->algorithm = LM_PLAIN_MAF;
	engineConfiguration->algorithm = LM_SPEED_DENSITY;
//	engineConfiguration->algorithm = LM_REAL_MAF;
	boardConfiguration->tunerStudioSerialSpeed = 9600;

	setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
	setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);

//	boardConfiguration->triggerInputPins[0] = GPIOC_6; // 2G YEL/BLU
//	boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP

	// in case of SOHC distributor we only have one signal
//	boardConfiguration->triggerInputPins[0] = GPIOA_5; // 2E White CKP
//	boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;

	// in case of SOHC distributor we only have one signal
	boardConfiguration->triggerInputPins[0] = GPIOC_6;
	boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP

	// Denso 195500-2180
	engineConfiguration->injector.flow = 265;

	engineConfiguration->hasBaroSensor = false;

	engineConfiguration->hasMapSensor = true;
	boardConfiguration->isFastAdcEnabled = true;
	engineConfiguration->map.sensor.type = MT_DENSO183;
	engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;

	setEgoSensor(ES_BPSX_D1 PASS_ENGINE_PARAMETER);
	engineConfiguration->afr.hwChannel = EFI_ADC_2;


	// set_global_trigger_offset_angle -40
	engineConfiguration->globalTriggerAngleOffset = -40;
	// set_ignition_offset 0
	engineConfiguration->ignitionOffset = 0;
	// set_injection_offset 0
	engineConfiguration->injectionOffset = 0;

	// todo: change to 15?
	// set_cranking_timing_angle 3
	engineConfiguration->crankingTimingAngle = 3;
	engineConfiguration->crankingChargeAngle = 70;

	setWholeTimingTable(10 PASS_ENGINE_PARAMETER);
	// set_whole_fuel_map 5
	setWholeFuelMap(5 PASS_ENGINE_PARAMETER);

	setSingleCoilDwell(engineConfiguration);
	engineConfiguration->ignitionMode = IM_ONE_COIL;

	boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;
	boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN;

	boardConfiguration->ignitionPins[0] = GPIOE_14; // Frankenso high side - pin 1G
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPinMode = OM_DEFAULT;

	/**
	 * Outputs
	 */
	// Frankenso low out #1: PE6
	// Frankenso low out #2: PE5 MIL
	// Frankenso low out #3:
	// Frankenso low out #4:
	// Frankenso low out #5: PE3
	// Frankenso low out #6: PE4
	// Frankenso low out #7: PE0<>PD5
	// Frankenso low out #8: PE2 INJ
	// Frankenso low out #9: PB9 IDLE
	// Frankenso low out #10: PE1<>PD3 INJ 1&3
	// Frankenso low out #11: PB8
	// Frankenso low out #12: PB7

	boardConfiguration->injectionPins[0] = GPIOD_3;
	boardConfiguration->injectionPins[1] = GPIOE_2;


	//setDefaultCrankingFuel(engineConfiguration);
	engineConfiguration->cranking.baseFuel = 5;

	// 40% idle is good default
	boardConfiguration->idle.solenoidFrequency = 300;
	boardConfiguration->idle.solenoidPin = GPIOB_9;

	boardConfiguration->malfunctionIndicatorPin = GPIOE_5;
	boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;

	boardConfiguration->tunerStudioSerialSpeed = 9600;

	commonFrankensoAnalogInputs(engineConfiguration);
	setCommonNTCSensor(&engineConfiguration->clt);
	engineConfiguration->clt.config.bias_resistor = 2700;
	setCommonNTCSensor(&engineConfiguration->iat);
	engineConfiguration->iat.config.bias_resistor = 2700;

	engineConfiguration->hasTpsSensor = false;
	engineConfiguration->tpsAdcChannel = EFI_ADC_NONE;
//	engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
	engineConfiguration->mafAdcChannel = EFI_ADC_0;
	engineConfiguration->clt.adcChannel = EFI_ADC_12;
	engineConfiguration->iat.adcChannel = EFI_ADC_11;

	// todo: 8.2 or 10k?
	engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2;

	// end of Ford Escort GT config
}
Ejemplo n.º 13
0
static void setHondaAccordConfigurationCommon(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
	engineConfiguration->map.sensor.sensorType = MT_DENSO183;

	engineConfiguration->ignitionMode = IM_ONE_COIL;
	engineConfiguration->injectionMode = IM_BATCH;

	engineConfiguration->idleMode = IM_MANUAL;

	engineConfiguration->HD44780height = 4;

	engineConfiguration->cylindersCount = 4;
	engineConfiguration->displacement = 2.156;

	// Keihin 06164-P0A-A00
	engineConfiguration->injectorFlow = 248;

//	engineConfiguration->algorithm = LM_SPEED_DENSITY;
	// I want to start with a simple Alpha-N
	engineConfiguration->algorithm = LM_TPS;
	setFuelLoadBin(engineConfiguration, 0, 100);
	setTimingLoadBin(engineConfiguration, 0, 100);

	engineConfiguration->crankingSettings.coolantTempMaxC = 65; // 8ms at 65C
	engineConfiguration->crankingSettings.fuelAtMaxTempMs = 8;

	engineConfiguration->crankingSettings.coolantTempMinC = 0; // 20ms at 0C
	engineConfiguration->crankingSettings.fuelAtMinTempMs = 15;

	/**
	 * 18K Ohm @ -20C
	 * 2.1K Ohm @ 24C
	 * 100 Ohm @ 120C
	 */
	setThermistorConfiguration(&engineConfiguration->cltThermistorConf, -20.0, 18000.0, 23.8889, 2100.0, 120.0, 100.0);
	engineConfiguration->cltThermistorConf.bias_resistor = 1500; // same as OEM ECU

	setThermistorConfiguration(&engineConfiguration->iatThermistorConf, -20.0, 18000.0, 23.8889, 2100.0, 120.0, 100.0);
	engineConfiguration->iatThermistorConf.bias_resistor = 1500; // same as OEM ECU

	// set_cranking_charge_angle 35
	engineConfiguration->crankingChargeAngle = 70;
	// set_cranking_timing_angle 0
	engineConfiguration->crankingTimingAngle = 45;

	// set_global_trigger_offset_angle 34
	engineConfiguration->globalTriggerAngleOffset = 34;

	// set_rpm_hard_limit 4000
	engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
	// set_cranking_rpm 2000
	engineConfiguration->crankingSettings.crankingRpm = 500;


	// set_ignition_offset 350
//	engineConfiguration->ignitionOffset = 350;
	 // set_injection_offset 510
//	engineConfiguration->injectionOffset = 510;


	/**
	 * ADC inputs:
	 *
	 * Inp1/ADC12 PC2: CLT
	 * Inp2/ADC11 PC1: AIT/IAT
	 * Inp3/ADC0 PA0: MAP
	 * Inp4/ADC13 PC3: AFR
	 * Inp6/ADC1 PA1: TPS
	 * Inp12/ADC14 PC4: VBatt
	 */
	memset(boardConfiguration->adcHwChannelEnabled, 0, sizeof(boardConfiguration->adcHwChannelEnabled));
	boardConfiguration->adcHwChannelEnabled[0] = ADC_FAST; // ADC0 - PA0 - MAP
	boardConfiguration->adcHwChannelEnabled[1] = ADC_SLOW; // TPS
	boardConfiguration->adcHwChannelEnabled[2] = ADC_SLOW;
	boardConfiguration->adcHwChannelEnabled[3] = ADC_SLOW;
	boardConfiguration->adcHwChannelEnabled[4] = ADC_SLOW;

	boardConfiguration->adcHwChannelEnabled[6] = ADC_SLOW;
	boardConfiguration->adcHwChannelEnabled[11] = ADC_SLOW; // IAT
	boardConfiguration->adcHwChannelEnabled[12] = ADC_SLOW; // CLT
	boardConfiguration->adcHwChannelEnabled[13] = ADC_SLOW; // AFR
	boardConfiguration->adcHwChannelEnabled[14] = ADC_SLOW; // VBatt

	/**
	 * D14/W10 O2 Sensor
	 */
	engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_13;

	/**
	 * VBatt
	 */
	engineConfiguration->vbattAdcChannel = EFI_ADC_14;
	engineConfiguration->vbattDividerCoeff = ((float) (8.2 + 33)) / 8.2 * 2;

	//	todo engineConfiguration->afrSensor.afrAdcChannel = 14;


	/**
	 * MAP D17/W5
	 */
	engineConfiguration->map.sensor.hwChannel = EFI_ADC_0;


	/**
	 * TPS D11/W11
	 */
	engineConfiguration->tpsAdcChannel = EFI_ADC_1;

	/**
	 * IAT D15/W7
	 */
	engineConfiguration->iatAdcChannel = EFI_ADC_11;

	/**
	 * CLT D13/W9
	 */
	engineConfiguration->cltAdcChannel = EFI_ADC_12;


	/**
	 * Outputs
	 */
	// Frankenso low out #:
	// Frankenso low out #:
	// Frankenso low out #:
	// Frankenso low out #:
	// Frankenso low out #5: PE3
	// Frankenso low out #6: PE4
	// Frankenso low out #7: PE1 (do not use with discovery!)
	// Frankenso low out #:
	// Frankenso low out #9: PB9
	// Frankenso low out #10: PE0 (do not use with discovery!)
	// Frankenso low out #11: PB8
	// Frankenso low out #12: PB7

	boardConfiguration->idleValvePin = GPIOE_5;
	boardConfiguration->o2heaterPin = GPIOC_13;

	boardConfiguration->injectionPins[0] = GPIOB_8;
	boardConfiguration->injectionPins[1] = GPIOB_9;
	boardConfiguration->injectionPins[2] = GPIOE_1;
	boardConfiguration->injectionPins[3] = GPIOB_7;

	boardConfiguration->ignitionPins[0] = GPIOE_4;
	boardConfiguration->ignitionPins[1] = GPIO_NONE;
	boardConfiguration->ignitionPins[2] = GPIO_NONE;
	boardConfiguration->ignitionPins[3] = GPIO_NONE;

	boardConfiguration->fuelPumpPin = GPIOE_3;
	boardConfiguration->fuelPumpPinMode = OM_DEFAULT;

	boardConfiguration->gps_rx_pin = GPIO_NONE;
	boardConfiguration->gps_tx_pin = GPIO_NONE;

	setFrankenso_01_LCD(boardConfiguration);

	boardConfiguration->logicAnalyzerPins[1] = GPIO_NONE;


	boardConfiguration->idleSolenoidFrequency = 500;
}