Notices
ECU Flash

Timer unit - interrupts for CAS, airflow, injector/coil schedules

Thread Tools
 
Search this Thread
 
Old Dec 9, 2008, 01:41 AM
  #1  
Evolved Member
Thread Starter
 
jcsbanks's Avatar
 
Join Date: May 2006
Location: UK
Posts: 2,399
Likes: 0
Received 5 Likes on 4 Posts
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).

Last edited by jcsbanks; Dec 9, 2008 at 02:38 PM.
Old Dec 9, 2008, 02:06 PM
  #2  
Account Disabled
iTrader: (3)
 
dan l's Avatar
 
Join Date: Apr 2006
Location: USA
Posts: 1,029
Likes: 0
Received 0 Likes on 0 Posts
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.
Old Dec 9, 2008, 02:12 PM
  #3  
Evolved Member
Thread Starter
 
jcsbanks's Avatar
 
Join Date: May 2006
Location: UK
Posts: 2,399
Likes: 0
Received 5 Likes on 4 Posts
That is exactly the sort of thing I expect to find Whether it is easily adjustable is another matter.
Old Dec 9, 2008, 02:24 PM
  #4  
Evolved Member
 
burgers22's Avatar
 
Join Date: Jan 2006
Location: Oxfordshire
Posts: 953
Received 2 Likes on 2 Posts
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
Old Dec 9, 2008, 03:03 PM
  #5  
Evolved Member
iTrader: (2)
 
logic's Avatar
 
Join Date: Apr 2003
Location: Berkeley, CA
Posts: 1,022
Likes: 0
Received 5 Likes on 4 Posts
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.
Old Dec 9, 2008, 03:17 PM
  #6  
Evolved Member
Thread Starter
 
jcsbanks's Avatar
 
Join Date: May 2006
Location: UK
Posts: 2,399
Likes: 0
Received 5 Likes on 4 Posts
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
Old Dec 9, 2008, 10:09 PM
  #7  
Evolved Member
 
acamus's Avatar
 
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
Old Dec 10, 2008, 02:29 AM
  #8  
Newbie
 
AndyF_RSX's Avatar
 
Join Date: Aug 2001
Location: Geekmapped
Posts: 56
Likes: 0
Received 1 Like on 1 Post
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
Old Dec 11, 2008, 10:46 PM
  #9  
Evolved Member
 
merlin.oz's Avatar
 
Join Date: Jun 2008
Location: Sydney
Posts: 824
Likes: 0
Received 23 Likes on 19 Posts
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.
Old Dec 12, 2008, 12:11 AM
  #10  
Evolved Member
Thread Starter
 
jcsbanks's Avatar
 
Join Date: May 2006
Location: UK
Posts: 2,399
Likes: 0
Received 5 Likes on 4 Posts
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.
Old Dec 12, 2008, 04:02 AM
  #11  
Evolved Member
 
Mattjin's Avatar
 
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.
Old Dec 12, 2008, 07:00 PM
  #12  
Newbie
 
COL Knock's Avatar
 
Join Date: Oct 2008
Location: usa
Posts: 73
Likes: 0
Received 0 Likes on 0 Posts
You're the man, Banks
Old Feb 8, 2009, 07:44 PM
  #13  
Evolved Member
 
merlin.oz's Avatar
 
Join Date: Jun 2008
Location: Sydney
Posts: 824
Likes: 0
Received 23 Likes on 19 Posts
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.
Old Feb 9, 2009, 02:30 AM
  #14  
Evolved Member
 
Mattjin's Avatar
 
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.
Old Feb 9, 2009, 02:40 AM
  #15  
Evolved Member
iTrader: (9)
 
Slo_crx1's Avatar
 
Join Date: Sep 2007
Location: Simpson, PA
Posts: 821
Likes: 0
Received 1 Like on 1 Post
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.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
mrb00st
E85 / Ethanol
186
Jul 26, 2022 12:42 PM
3VOLUTIONIST
ECU Flash
6
Dec 19, 2020 02:23 AM
Raceghost
ECU Flash
24
Aug 10, 2018 10:39 PM
Nniikkooss
General Engine Management / Tuning Forum
0
Mar 23, 2017 01:34 AM
mrfred
ECU Flash
242
Oct 2, 2015 12:41 AM



Quick Reply: Timer unit - interrupts for CAS, airflow, injector/coil schedules



All times are GMT -7. The time now is 11:30 AM.