EvolutionM - Mitsubishi Lancer and Lancer Evolution Community

EvolutionM - Mitsubishi Lancer and Lancer Evolution Community (https://www.evolutionm.net/forums/)
-   ECU Flash (https://www.evolutionm.net/forums/ecu-flash-179/)
-   -   Timer unit - interrupts for CAS, airflow, injector/coil schedules (https://www.evolutionm.net/forums/ecu-flash/386460-timer-unit-interrupts-cas-airflow-injector-coil-schedules.html)

jcsbanks Dec 9, 2008 01:41 AM

Timer unit - interrupts for CAS, airflow, injector/coil schedules
 
I'm disassembling the ATU-II code in the ECU at present.

Findings so far, will update with more as I find them.

The main loop which is interrupted by everything else processes: MUT/OBD baud, ADC, coolant enrichment, sensor/fault checks, fuel, MAF, coolant trim, knock reaction, calc of AFR*MAF, injector scaling, asynchronous acceleration enrichment, ignition and knock, secondary air system, immobiliser and CEL.

Compare match timer 0 runs at 802Hz and calls the routine longsub_inj which as its name suggests is a very long subroutine that processes loads of stuff including counters, knock, ISC, asynchronous acceleration enrichment.

Compare match timer 1 is basically unused.

Timer 1 and 11 have code but are basically unused.

Timer 0 has an input capture pin that triggers a latch of timer 2A and Timer 0(high 16 of 32 bits), a few flags bits are checked and then output compare timer 2G is set to the present value of timer 2B -1 or +D.

Timer 2 appears to be CAS related and processes knock control, and probably lots of injection/coil stuff.

Timer 8 has 16 downcounters which need disassembly.

Timer 4 need disassembly.

I expect to find airflow pulse interrupt, CAS interrupt, coil and injector scheduling code in the above. A 500 KHz timer (32MHz CPU, divide by 2 to give 16MHz peripheral clock, divide by 32 prescaler).

dan l Dec 9, 2008 02:06 PM

If you come across anything that is related to injector timing and/or phasing that could be useful to get large injector cars to idle better on gasoline.

jcsbanks Dec 9, 2008 02:12 PM

That is exactly the sort of thing I expect to find :) Whether it is easily adjustable is another matter.

burgers22 Dec 9, 2008 02:24 PM

Usually after 3 or 4 reads I get what jcs is on about, but I have no idea what ATU and CAS are, and Google isn't turning up much on compare match timer other than this looks familiar ;)

MB

logic Dec 9, 2008 03:03 PM

See the SH7052 documentation regarding the ATU; Section 10 is probably what you're looking for.

By CAS, I assume jcs is talking about the cam angle sensor.

jcsbanks Dec 9, 2008 03:17 PM

The crank angle sensor (CAS) is high for the 75 to 5 degrees BTDC for each cylinder and is the main sync used for timing things. Exhaust cam sensor is used for identifying which cylinder we're working with. Intake cam sensor is used for MIVEC control. Superficially I cannot see a difference in the timer interrupts used between the MIVEC and non-MIVEC cars which is curious as I would expect a duty cycle output for MIVEC control, plus an interrupt/input capture register to read the intake cam sensor.

The reason for this work is that the flags and timers used to measure CAS and MAF and schedule the fuel and timing are useful to our overall understanding of the ECU so we can track the logic used from sensor all the way through to actuator. This should start to unlock more mysteries soon :) It is complex code, but I like a challenge :D

acamus Dec 9, 2008 10:09 PM

I am glad you have started with this, it seems to be most undiscovered area of the ROM's.
Count me in, I will try to help if you ever need it :)

AndyF_RSX Dec 10, 2008 02:29 AM

John,
If you want, I can send you my paritally commented disassembly of my early Evo ECU that I've done to hopefully give you some pointers / ideas on how they *may* work (depending upon how much Mitsi have changed them between models)

Drop me a PM with your email address and I'll send some stuff over tonight for you to have a look at.

Andy

merlin.oz Dec 11, 2008 10:46 PM

jcs, I have been tinkering with the decel fuel cut values, which I understand to be units of time.
I thought you had posted somewhere that the time units were something like 8mS.
Is this correct?
Noting the 802Hz - 1.24mS timer mentioned above, was wondering if the decel time could be translated into seconds or milli-seconds.

jcsbanks Dec 12, 2008 12:11 AM

There are many different timers, the 802Hz is one of the master ones.

These routines are massive! Still working on them just breaking down the logic, need to go back through and start to label variables to start to piece it all together. I have endless pages of diagrams from these routines.

Mattjin Dec 12, 2008 04:02 AM

Merlin.oz, the decel fuel cut maps are definitely time related. Changing the map values changes the delay before fuel is cut, so the number have to correspond to something. If you want to get a closer idea of what the calulation is, try using very large numbers for the delay and log it.

The maps for startup delay for closed loop fuel control is also on a timer, and I found a calculation that is very close. It ended up being the value of 128 was 60 seconds, so I used:

<scaling name="DelayTime" units="sec" toexpr="x/128*60" frexpr="x/60*128" format="%.1f" min="0" max="120" inc="1" storagetype="uint8" endian="big"/>

This is different from the delay timer used for decel though.

COL Knock Dec 12, 2008 07:00 PM

You're the man, Banks

merlin.oz Feb 8, 2009 07:44 PM

Mattjin, must have missed your response to this back in Dec, sorry.
Your scaling formula is suspiciously seductive, and looks typicaly Mitsi.
But what paramater are you appling this to? Starting Enrichment Delay?

I am still trying to work the Decel FuelCut Delay time into real time units.

Mattjin Feb 9, 2009 02:30 AM

It is for a map that controls the startup delay of closed loop fuel control vs engine temp. The delay is to allow for the heater element to bring the sensor up to temperature. This timer was pretty easy to find and yes it was typical of them to use this scale base.

As far as I can remember reading about it, Mitsubishi tends to run fixed EOI (end of injection) timing.

Slo_crx1 Feb 9, 2009 02:40 AM

I'm going to subscribe...certain findings regarding the CAS timing setup may come in handy down the road with figuring out why the USDM Evo 8 roms don't like to play well with 2g DSM's, but the EDM roms seem to be just fine.


All times are GMT -7. The time now is 06:23 PM.


© 2024 MH Sub I, LLC dba Internet Brands