Timer unit - interrupts for CAS, airflow, injector/coil schedules
#1
Evolved Member
Thread Starter
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).
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).
Last edited by jcsbanks; Dec 9, 2008 at 02:38 PM.
#4
Evolved Member
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
MB
#6
Evolved Member
Thread Starter
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
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
#7
Evolved Member
Join Date: Mar 2008
Location: Lattitude 48.38°, Longitude 17.58°, Altitude 146m = Slovakia, for common dude
Posts: 730
Likes: 0
Received 2 Likes
on
2 Posts
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
Count me in, I will try to help if you ever need it
Trending Topics
#8
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
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
#9
Evolved Member
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.
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.
#10
Evolved Member
Thread Starter
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.
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.
#11
Evolved Member
Join Date: Apr 2008
Location: Sydney, Australia
Posts: 604
Likes: 0
Received 0 Likes
on
0 Posts
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.
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.
#13
Evolved Member
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.
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.
#14
Evolved Member
Join Date: Apr 2008
Location: Sydney, Australia
Posts: 604
Likes: 0
Received 0 Likes
on
0 Posts
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.
As far as I can remember reading about it, Mitsubishi tends to run fixed EOI (end of injection) timing.
Thread
Thread Starter
Forum
Replies
Last Post
Nniikkooss
General Engine Management / Tuning Forum
0
Mar 23, 2017 01:34 AM