Hi, i am testing the etpu2 library (direct injection), the etpu_inj.c file says:
Revision 0.2 2013/08/02 r54529
* fs_etpu_inj_update() removed, fs_etpu_inj_config() modified so that it can be used anytime to update the injection parameters. During the injection sequence activity the injection parameters cannot be updated and fs_etpu_inj_config() returns FS_ETPU_ERROR_TIMING.
In the "MPC5674F_EngineControlDemo" project in try ude the "injection_time" variable from etpu_fuel.c to unpdate the "USEC2TCR1" times on injection config (injection pattern) (on file etpu_gct.c), but it give me compiler error because it would be a constant value, not a variable.
How can i do it?
PD: "etpu_gct.c"-> Was it made with Graphical Configuration Tool?, The actual version of EtpuGTC software do not support api for etpu2 (i think).
Thank and regards
The eTPU Graphical Configuration Tool does not support the new API style introduced with the Engine Control eTPU Library. Instead, a C-code template of the eTPU configuration is provided in AN2864SW. This template should be followed to create a custom eTPU configuration.
Original:
uint32_t inj_injection_3_phase_config[3] =
{
/* duration, BANK 1 output, BANK 2 output, INJ output */
USEC2TCR1(20) + FS_ETPU_INJ_PHASE_OUT_HIGH_BANK_1 + FS_ETPU_INJ_PHASE_OUT_LOW + FS_ETPU_INJ_PHASE_OUT_HIGH_INJ,
USEC2TCR1(10) + FS_ETPU_INJ_PHASE_OUT_LOW + FS_ETPU_INJ_PHASE_OUT_LOW + FS_ETPU_INJ_PHASE_OUT_HIGH_INJ,
USEC2TCR1(10) + FS_ETPU_INJ_PHASE_OUT_LOW + FS_ETPU_INJ_PHASE_OUT_HIGH_BANK_2 + FS_ETPU_INJ_PHASE_OUT_HIGH_INJ,
};
Mod:
uint32_t inj_injection_3_phase_config[3] =
{
/* duration, BANK 1 output, BANK 2 output, INJ output */
USEC2TCR1(20) + FS_ETPU_INJ_PHASE_OUT_HIGH_BANK_1 + FS_ETPU_INJ_PHASE_OUT_LOW + FS_ETPU_INJ_PHASE_OUT_HIGH_INJ,
USEC2TCR1(10) + FS_ETPU_INJ_PHASE_OUT_LOW + FS_ETPU_INJ_PHASE_OUT_LOW + FS_ETPU_INJ_PHASE_OUT_HIGH_INJ,
USEC2TCR1(injection_time6) + FS_ETPU_INJ_PHASE_OUT_LOW + FS_ETPU_INJ_PHASE_OUT_HIGH_BANK_2 + FS_ETPU_INJ_PHASE_OUT_HIGH_INJ,
};
Should I have several patterns for each time? Sorry, I do not understand
You can have several patterns and select one each time you update INJ, or you can create a code to update the pattern dynamically in run-time.