diff --git a/firmware/config/boards/microrusefi/board_configuration.cpp b/firmware/config/boards/microrusefi/board_configuration.cpp index fda717012f..0c4b3f7e62 100644 --- a/firmware/config/boards/microrusefi/board_configuration.cpp +++ b/firmware/config/boards/microrusefi/board_configuration.cpp @@ -133,6 +133,13 @@ static void setupDefaultSensorInputs() { engineConfiguration->tps1_1AdcChannel = EFI_ADC_13; engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE; + + // EFI_ADC_10: "27 - AN volt 1" + engineConfiguration->map.sensor.hwChannel = EFI_ADC_10; + + // EFI_ADC_2: "24 - AN temp 3" + engineConfiguration->afr.hwChannel = EFI_ADC_2; + // clt = "18 - AN temp 1" engineConfiguration->clt.adcChannel = EFI_ADC_0; engineConfiguration->clt.config.bias_resistor = 2700; diff --git a/firmware/config/engines/mazda_miata_1_6.cpp b/firmware/config/engines/mazda_miata_1_6.cpp index f2a0576c0a..ce61ccf75b 100644 --- a/firmware/config/engines/mazda_miata_1_6.cpp +++ b/firmware/config/engines/mazda_miata_1_6.cpp @@ -328,7 +328,7 @@ void setMiataNA6_VAF_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // 0.2#3 has wrong R139 // 56k high side/10k low side multiplied by above analogInputDividerCoefficient = 11 -// engineConfiguration->vbattDividerCoeff = (66f / 10f) * engineConfiguration->analogInputDividerCoefficient; +// engineConfiguration->vbattDividerCoeff = (66.0f / 10.0f) * engineConfiguration->analogInputDividerCoefficient; boardConfiguration->isHip9011Enabled = false; diff --git a/firmware/config/engines/mazda_miata_vvt.cpp b/firmware/config/engines/mazda_miata_vvt.cpp index 8e138a750f..583765d510 100644 --- a/firmware/config/engines/mazda_miata_vvt.cpp +++ b/firmware/config/engines/mazda_miata_vvt.cpp @@ -242,6 +242,32 @@ static void setMazdaMiataEngineNB2Defaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) { setOperationMode(engineConfiguration, FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR); engineConfiguration->specs.displacement = 1.8; + // 0.0825 + // 0.1375 + // 6.375 + // 10.625 + boardConfiguration->miataNb2VVTRatioFrom = 8.50 * 0.75; + boardConfiguration->miataNb2VVTRatioTo = 14; + engineConfiguration->nbVvtIndex = 0; + + engineConfiguration->auxPidFrequency[0] = 300; // VVT solenoid control + + // set idle_position 35 + boardConfiguration->manIdlePosition = 35; + + engineConfiguration->specs.cylindersCount = 4; + engineConfiguration->specs.firingOrder = FO_1_3_4_2; + + engineConfiguration->injectionMode = IM_SEQUENTIAL; + + engineConfiguration->ignitionMode = IM_WASTED_SPARK; + /** + * http://miataturbo.wikidot.com/fuel-injectors + * 01-05 (purple) - #195500-4060 + */ + engineConfiguration->injector.flow = 265; + + // enable altdebug engineConfiguration->targetVBatt = 13.8; engineConfiguration->alternatorControl.offset = 40; @@ -301,7 +327,6 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // boardConfiguration->is_enabled_spi_1 = true; - engineConfiguration->twoWireBatchInjection = true; // this is needed for #492 testing boardConfiguration->alternatorControlPin = GPIOE_10; @@ -309,14 +334,10 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // boardConfiguration->vehicleSpeedSensorInputPin = GPIOA_8; - // set idle_position 35 - boardConfiguration->manIdlePosition = 35; - boardConfiguration->vvtCamSensorUseRise = true; engineConfiguration->vvtDisplayInverted = true; - engineConfiguration->auxPidFrequency[0] = 300; engineConfiguration->auxPidPins[0] = GPIOE_3; // VVT solenoid control // /** // * set_fsio_setting 1 0.55 @@ -361,29 +382,10 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->tpsMax = 650; // convert 12to10 bit (ADC/4) -// 0.0825 -// 0.1375 -// 6.375 -// 10.625 - boardConfiguration->miataNb2VVTRatioFrom = 8.50 * 0.75; - boardConfiguration->miataNb2VVTRatioTo = 14; - engineConfiguration->nbVvtIndex = 0; - engineConfiguration->specs.cylindersCount = 4; - engineConfiguration->specs.firingOrder = FO_1_3_4_2; - - engineConfiguration->injectionMode = IM_SEQUENTIAL; - - engineConfiguration->ignitionMode = IM_WASTED_SPARK; - boardConfiguration->malfunctionIndicatorPin = GPIOE_6; // just for a test - /** - * http://miataturbo.wikidot.com/fuel-injectors - * 01-05 (purple) - #195500-4060 - */ - engineConfiguration->injector.flow = 265; // boardConfiguration->malfunctionIndicatorPin = GPIOD_9; // boardConfiguration->malfunctionIndicatorPinMode = OM_INVERTED; @@ -508,13 +510,26 @@ void setMazdaMiata2003EngineConfigurationBoardTest(DECLARE_CONFIG_PARAMETER_SIGN * set engine_type 13 */ void setMiataNB2_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { + setMazdaMiataEngineNB2Defaults(PASS_CONFIG_PARAMETER_SIGNATURE); + // MRE has a special main relay control low side pin - rusEfi firmware is totally not involved with main relay control // fuelPumpPin is inherited from boards/microrusefi/board_configuration.cpp // crank trigger input is inherited from boards/microrusefi/board_configuration.cpp + // map.sensor.hwChannel input is inherited from boards/microrusefi/board_configuration.cpp + // tps1_1AdcChannel input is inherited from boards/microrusefi/board_configuration.cpp + // afr.hwChannel input is inherited from boards/microrusefi/board_configuration.cpp + + boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED; + boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED; engineConfiguration->camInputs[0] = GPIOA_5; engineConfiguration->useOnlyRisingEdgeForTrigger = false; + // GPIOD_6: "13 - GP Out 6" - selected to +12v + boardConfiguration->alternatorControlPin = GPIOD_6; + // GPIOD_7: "14 - GP Out 5" - selected to +12v + engineConfiguration->dizzySparkOutputPin = GPIOD_7; // tachometer + engineConfiguration->etb.pFactor = 12; // a bit lower p-factor seems to work better on TLE9201? MRE? engineConfiguration->etb.iFactor = 0; @@ -537,4 +552,12 @@ void setMiataNB2_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { + + // set vbatt_divider 11 + // 0.3#4 has wrong R139 as well? + // 56k high side/10k low side multiplied by above analogInputDividerCoefficient = 11 + engineConfiguration->vbattDividerCoeff = (66.0f / 10.0f) * engineConfiguration->analogInputDividerCoefficient; + + + }