Esempio 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);
}
Esempio 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);
}
Esempio n. 3
0
/**
 * Tom tomiata, Frankenstein board
 */
void setMiata1996(DECLARE_ENGINE_PARAMETER_F) {
	commonMiataNa(PASS_ENGINE_PARAMETER_F);
	engineConfiguration->specs.displacement = 1.839;

	copyFuelTable(miata_maf_fuel_table, config->fuelTable);
	copyTimingTable(miata_maf_advance_table, config->ignitionTable);

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

	boardConfiguration->fuelPumpPin = GPIOE_4;
	boardConfiguration->idle.solenoidPin = GPIOE_5;

	engineConfiguration->mafAdcChannel = EFI_ADC_1;
	engineConfiguration->clt.adcChannel = EFI_ADC_11;
	engineConfiguration->tpsAdcChannel = EFI_ADC_13;

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

	// harness is sequential but we have a limited board
	engineConfiguration->crankingInjectionMode = IM_BATCH;
	engineConfiguration->injectionMode = IM_BATCH;

	boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - out #12
	boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - out #11
	boardConfiguration->injectionPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->injectionPins[3] = GPIO_UNASSIGNED;
	boardConfiguration->injectionPins[4] = GPIO_UNASSIGNED;
	boardConfiguration->injectionPins[5] = GPIO_UNASSIGNED;
	boardConfiguration->injectionPinMode = OM_DEFAULT;
}
Esempio n. 4
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);

}
Esempio n. 5
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;
}
Esempio n. 6
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
}
Esempio n. 7
0
static void setMiata1994_common(DECLARE_ENGINE_PARAMETER_F) {
	commonMiataNa(PASS_ENGINE_PARAMETER_F);
	engineConfiguration->specs.displacement = 1.839;

	// set_cranking_timing_angle 0
	engineConfiguration->crankingTimingAngle = 0;

	engineConfiguration->crankingChargeAngle = 70;

	copyFuelTable(miata_maf_fuel_table, config->fuelTable);

	copyTimingTable(miata_maf_advance_table, config->ignitionTable);

//	boardConfiguration->triggerSimulatorPins[0] = GPIOD_2; // 2G - YEL/BLU
//	boardConfiguration->triggerSimulatorPins[1] = GPIOB_3; // 2E - WHT - four times
//	boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;
//	boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN;
//
//	boardConfiguration->triggerInputPins[0] = GPIO_UNASSIGNED;
//	boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;
//
//	boardConfiguration->is_enabled_spi_1 = false;
//	boardConfiguration->is_enabled_spi_2 = false;
//	boardConfiguration->is_enabled_spi_3 = false;

	/**
	 * Outputs
	 */
	// Frankenso low out #: PE6
	// Frankenso low out #: PE5
	// 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 #8:
	// 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->fanPin = GPIOE_6;

	boardConfiguration->o2heaterPin = GPIO_UNASSIGNED;

	boardConfiguration->fuelPumpPin = GPIOE_4;

	boardConfiguration->injectionPins[4] = GPIO_UNASSIGNED;
	boardConfiguration->injectionPins[5] = GPIO_UNASSIGNED;
	boardConfiguration->injectionPinMode = OM_DEFAULT;

	boardConfiguration->idle.solenoidPin = GPIOB_9;

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

	setFrankenso_01_LCD(boardConfiguration);

	commonFrankensoAnalogInputs(engineConfiguration);

	engineConfiguration->tpsAdcChannel = EFI_ADC_2;
	engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
	engineConfiguration->mafAdcChannel = EFI_ADC_0;
	engineConfiguration->clt.adcChannel = EFI_ADC_12;
	engineConfiguration->iat.adcChannel = EFI_ADC_11;
// end of 1994 commond
}