2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file mazda_miata_nb.cpp
|
|
|
|
*
|
2016-02-24 15:01:35 -08:00
|
|
|
*
|
2016-11-03 14:03:11 -07:00
|
|
|
* MAZDA_MIATA_NB1 = 9
|
2017-01-06 07:04:41 -08:00
|
|
|
* set engine_type 9
|
2015-07-10 06:01:56 -07:00
|
|
|
*
|
2016-02-24 15:01:35 -08:00
|
|
|
* http://rusefi.com/forum/viewtopic.php?t=467
|
|
|
|
* http://rusefi.com/forum/viewtopic.php?t=987
|
|
|
|
*
|
2015-07-10 06:01:56 -07:00
|
|
|
* @date Feb 18, 2014
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "mazda_miata_nb.h"
|
|
|
|
#include "thermistors.h"
|
|
|
|
|
2019-05-03 15:41:43 -07:00
|
|
|
EXTERN_CONFIG;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-05-03 15:41:43 -07:00
|
|
|
void setMazdaMiataNb1EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
2019-11-03 14:25:34 -08:00
|
|
|
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
// set_rpm_hard_limit 3000
|
|
|
|
engineConfiguration->rpmHardLimit = 3000; // yes, 3k. let's play it safe for now
|
|
|
|
|
2016-11-03 14:03:11 -07:00
|
|
|
engineConfiguration->trigger.type = TT_MAZDA_MIATA_NB1;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-01-06 06:03:33 -08:00
|
|
|
// set cranking_injection_mode 0
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
2017-01-06 06:03:33 -08:00
|
|
|
// set injection_mode 1
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
2017-01-06 06:03:33 -08:00
|
|
|
// set ignition_mode 2
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
|
|
|
// set_firing_order 2
|
2016-07-20 16:04:27 -07:00
|
|
|
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-10-02 18:00:10 -07:00
|
|
|
engineConfiguration->clt.config = {0, 30, 100, 32500, 7550, 700, 2700};
|
|
|
|
engineConfiguration->iat.config = {-10, 60, 120.00, 160310, 7700, 1180, 2700};
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-06-30 11:28:47 -07:00
|
|
|
engineConfiguration->tps1_1AdcChannel = EFI_ADC_3; // 15 is the old value
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->vbattAdcChannel = EFI_ADC_0; // 1 is the old value
|
|
|
|
// engineConfiguration->map.channel = 1;
|
|
|
|
engineConfiguration->mafAdcChannel = EFI_ADC_1;
|
|
|
|
engineConfiguration->clt.adcChannel = EFI_ADC_11;
|
|
|
|
engineConfiguration->iat.adcChannel = EFI_ADC_13;
|
2018-11-29 21:37:32 -08:00
|
|
|
engineConfiguration->afr.hwChannel = EFI_ADC_2; // PA2
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->idle.solenoidPin = GPIOE_0;
|
|
|
|
engineConfiguration->idle.solenoidPinMode = OM_DEFAULT;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->fuelPumpPin = GPIOC_14; // Frankenstein: low side - out #4
|
|
|
|
engineConfiguration->fuelPumpPinMode = OM_DEFAULT;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - out #12
|
|
|
|
engineConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - out #11
|
|
|
|
engineConfiguration->injectionPins[2] = GPIOE_3; // Frankenstein: low side - out #8
|
|
|
|
engineConfiguration->injectionPins[3] = GPIOE_5; // Frankenstein: low side - out #6
|
|
|
|
engineConfiguration->injectionPins[4] = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->injectionPins[5] = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->injectionPinMode = OM_DEFAULT;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->ignitionPins[0] = GPIOE_10; // Frankenstein: high side #1
|
|
|
|
engineConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->ignitionPins[2] = GPIOC_9; // // Frankenstein: high side #2
|
|
|
|
engineConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->ignitionPinMode = OM_INVERTED;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->malfunctionIndicatorPin = GPIOE_1;
|
|
|
|
engineConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->fanPin = GPIOE_6;
|
|
|
|
engineConfiguration->fanPinMode = OM_DEFAULT;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->clutchDownPin = GPIO_UNASSIGNED;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
// set_whole_fuel_map 3
|
2019-01-10 14:07:29 -08:00
|
|
|
setWholeFuelMap(3 PASS_CONFIG_PARAMETER_SUFFIX);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
// 10 deg before TDC is default timing
|
2016-02-17 19:02:24 -08:00
|
|
|
|
|
|
|
// VICS solenoid
|
|
|
|
/**
|
|
|
|
* to test
|
2017-03-12 11:47:21 -07:00
|
|
|
* set_fsio_setting 1 5000
|
2016-02-17 19:02:24 -08:00
|
|
|
*/
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->fsio_setting[0] = 5000;
|
2016-03-02 20:01:50 -08:00
|
|
|
// (self and (rpm > 4800)) OR (rpm > 5000)
|
2017-03-08 21:05:52 -08:00
|
|
|
// set_rpn_expression 1 "self rpm 4800 > & rpm 5000 > OR"
|
2019-05-03 15:41:43 -07:00
|
|
|
// setFsioExt(0, GPIOE_3, "self rpm 4800 > & rpm 5000 > OR", 150 PASS_CONFIG_PARAMETER_SUFFIX);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|