rusefi/firmware/config/engines/gm_sbc.cpp

109 lines
4.2 KiB
C++
Raw Normal View History

2023-03-26 08:35:32 -07:00
#include "pch.h"
#include "gm_sbc.h"
#include "defaults.h"
#if HW_HELLEN
#include "hellen_meta.h"
#endif // HW_HELLEN
2023-04-29 16:28:11 -07:00
#include "proteus_meta.h"
void setStepperHw() {
engineConfiguration->useStepperIdle = true;
engineConfiguration->useHbridgesToDriveIdleStepper = true;
engineConfiguration->stepper_dc_use_two_wires = false;
engineConfiguration->stepperDcInvertedPins = false; // or true?
2023-05-11 19:29:14 -07:00
// for instance IWP069
engineConfiguration->injector.flow = 482.5;
#if HW_HELLEN
setPPSInputs(EFI_ADC_NONE, EFI_ADC_NONE);
2023-06-23 23:01:49 -07:00
// using 8chan pinout for DC1: A26 (OUT_DC1+ AH pin "D") and A27 (OUT_DC1- AL pin "C")
engineConfiguration->stepperDcIo[0].controlPin = H144_GP4; // DC1_PWM
engineConfiguration->stepperDcIo[0].directionPin1 = Gpio::H144_GP3; // DC1_DIR
engineConfiguration->stepperDcIo[0].directionPin2 = Gpio::Unassigned;
engineConfiguration->stepperDcIo[0].disablePin = H144_GP5; // ETB_DIS
2023-06-23 23:01:49 -07:00
// using 8chan pinout for DC2: A28 (OUT_DC2+ BL pin "A") and A29 (OUT_DC2- BH pin "B")
engineConfiguration->stepperDcIo[1].controlPin = H144_UART1_TX; // DC2_PWM
engineConfiguration->stepperDcIo[1].directionPin1 = H_SPI3_CS; // DC2_DIR
engineConfiguration->stepperDcIo[1].directionPin2 = Gpio::Unassigned;
2023-03-27 07:15:48 -07:00
// open question if we need custom logic to handle shared disable pin? engineConfiguration->stepperDcIo[1].disablePin = H144_GP5; // ETB_DIS
#endif // HW_HELLEN
2023-05-11 19:35:14 -07:00
#if HW_PROTEUS
2023-06-23 23:01:49 -07:00
// coil #1 - proteus pin 7 to AH pin "D"
2023-05-11 19:40:20 -07:00
// PWM pin
engineConfiguration->stepperDcIo[0].controlPin = Gpio::D12;
// DIR pin
engineConfiguration->stepperDcIo[0].directionPin1 = Gpio::D10;
// Disable pin
engineConfiguration->stepperDcIo[0].disablePin = Gpio::D11;
// Unused
engineConfiguration->stepperDcIo[0].directionPin2 = Gpio::Unassigned;
2023-06-23 23:01:49 -07:00
// coil #2 = proteus pin 15 to BL pin "A"
2023-05-11 19:40:20 -07:00
// PWM pin
engineConfiguration->stepperDcIo[1].controlPin = Gpio::D13;
// DIR pin
engineConfiguration->stepperDcIo[1].directionPin1 = Gpio::D9;
// Disable pin
engineConfiguration->stepperDcIo[1].disablePin = Gpio::D8;
// Unused
engineConfiguration->stepperDcIo[1].directionPin2 = Gpio::Unassigned;
2023-05-11 19:35:14 -07:00
#endif // HW_PROTEUS
}
2023-12-08 23:20:29 -08:00
void setGmSbc() {
2023-04-28 18:01:08 -07:00
engineConfiguration->cylindersCount = 8;
engineConfiguration->firingOrder = FO_1_8_4_3_6_5_7_2;
engineConfiguration->displacement = 5.2;
2023-03-26 08:26:38 -07:00
2023-06-24 20:37:23 -07:00
// see engine sniffer at https://github.com/rusefi/rusefi/issues/5353
// if injectors are wired in groups of four best to use channels 1 and 4
2023-06-24 19:07:19 -07:00
engineConfiguration->crankingInjectionMode = IM_BATCH;
engineConfiguration->injectionMode = IM_BATCH;
2023-04-29 21:42:28 -07:00
engineConfiguration->etbFunctions[0] = DC_None;
engineConfiguration->etbFunctions[1] = DC_None;
2023-03-27 07:33:49 -07:00
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_GM);
strcpy(engineConfiguration->engineCode, "SBC");
2023-08-09 12:08:19 -07:00
// white wire "HEI E" plug pin D
engineConfiguration->ignitionMode = IM_ONE_COIL;
2023-08-09 14:22:37 -07:00
engineConfiguration->globalTriggerAngleOffset = 24;
2023-03-27 07:33:49 -07:00
2023-06-24 19:07:19 -07:00
gppwm_channel *ignOverride = &engineConfiguration->gppwm[0];
ignOverride->pwmFrequency = 0;
2023-04-29 21:42:28 -07:00
strcpy(engineConfiguration->gpPwmNote[0], "ign ovrrd B");
2023-06-24 19:07:19 -07:00
setTable(ignOverride->table, 100);
2023-04-29 21:42:28 -07:00
#if HW_PROTEUS
2023-08-09 12:08:19 -07:00
// tan wire with a black trace - "HEI B", plug pin B
ignOverride->pin = Gpio::PROTEUS_IGN_12;
2023-06-25 14:13:10 -07:00
engineConfiguration->fanPin = Gpio::Unassigned;
// reminder about D101
engineConfiguration->injectionPins[0] = Gpio::PROTEUS_LS_14; // #1
2023-06-25 14:13:10 -07:00
// reminder about D104
engineConfiguration->injectionPins[3] = Gpio::PROTEUS_LS_15; // #4
2023-08-09 12:08:19 -07:00
2023-12-10 20:18:45 -08:00
// wow high side relay control on MEFI1 ELECTRONIC-FUEL-INJECTION-MEFI-1-2-5.7L-350CID-8.2L-502CID.pdf page 46
engineConfiguration->fuelPumpPin = Gpio::PROTEUS_HS_1;
2023-12-10 20:18:45 -08:00
// low side on MEFI3 ELECTRONIC-FUEL-INJECTION-MEFI-3-5.7L-350CID-8.2L-502CID.pdf page 487
2023-08-09 23:59:50 -07:00
setGmCltSensor(&engineConfiguration->clt, PROTEUS_DEFAULT_AT_PULLUP);
2023-04-29 21:42:28 -07:00
#endif // HW_PROTEUS
2023-08-09 12:08:19 -07:00
engineConfiguration->mainRelayPin = Gpio::Unassigned; // vehicle controls main relay
2023-04-29 21:42:28 -07:00
setStepperHw();
2023-03-26 08:26:38 -07:00
// 8 cylinders one coil HEI trigger
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL;
2023-04-29 16:28:11 -07:00
engineConfiguration->trigger.customTotalToothCount = 8;
engineConfiguration->trigger.customSkippedToothCount = 0;
2023-04-29 22:39:49 -07:00
engineConfiguration->skippedWheelOnCam = true;
2023-08-09 12:08:19 -07:00
// Proteus Digital 1 is Tach input "HEI R", plug pin C
2023-06-23 19:55:38 -07:00
engineConfiguration->map.sensor.type = MT_GM_1_BAR;
}