This is the code that does the trick. The MAP value is the key to how much fuel
is injected at any RPM. As the throttle is opened manifold air pressure goes
up in absolute terms.
Assembly language is very very simple. It mostly copies 8 bit bytes from one memory
location to another. Like PO boxes. They stay there untill they are erased or written
over by something else. Some of those memory locations are input output pins. That is
called memory mapped I/O.
It is very straight forward and the exact time it takes to do anything is known down
to the nano second. That cannot be said about "C".
NaBaroUse:
..... lda tmp11 ....... ; Use the saved MAP-derived barometer value
..... sta barocor
..... bra CltCalc......... ;branch to CltCalc routine in back gound prog
TurboMap:
.... lda....baro.............;load the value in the baro address
.... tax
.... lda....BAROFAC4250,x ;load the value from the sensor
.... sta....tmp11......... ;Store Barometer Correction Gamma
.... lda....map
.... tax
.... lda....KPAFACTOR4250,x
.... sta....kpa........ ;Store Manifold Air Pressure in Kilopascals
.... lda....config13............; Check if we use baro correction mode (bit=1) or
....................................not (bit=0)
.... bit....#$08................; Use BIT instead of brset because outside of
...................................zero-page
bne....TurboBaroUse..... ; Branch if the bit is set - we use the
...................................MAP-obtained barometer
.... lda....#$64
.... sta....barocor........... ; Store 100% barometer correction (correction not
...................................used)
bra CltCalc.......... ;branch to the CltCalc routine in back ground prog
TurboBaroUse:
..... lda tmp11 .........; Use the saved MAP-derived barometer value
..... sta barocor..........;store in meory location named barocor
This runs all the time until a signal comes in from the crank angle sensor.
When that happens it is called a hardware interrupt.
The computer stops doing this to fire the injectors and the plugs.
Then is goes back to doing this (among other things) over and over again.
The other things are listed in the attached flow chart jpg.
Here is the complete program listed in the attached pdf.
Also what the FreeScale Integrated Development Environment looks like running on the
PC. This makes it very easy to change the program to suit our purposes.
Last jpg is a flow chart of what is done and when it is done.
Paul Lamar
--
The Rotary Engine News Letter. Powered by Linux.
ACRE NL web site.
http://www.rotaryeng.net
You Tube key word PaulLamar2
Copyright 1998-2012 All world wide rights reserved.