MAP conversion
Mike Pitts
mpitts at mail.emi.net
Sat Sep 26 15:12:40 GMT 1998
This is a multi-part message in MIME format.
------=_NextPart_000_001C_01BDE93E.738852C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
>Um, you may find that, except in the ECM init code, that anything
>below 26 sets the result to 0. (The init code in a lot of ECMs
>forgets to check for the underflow.)
You're right, that was from the init code, and further in the ECM=20
it does the same conversion but with an underflow check.
>;One bar MAP sensor to KPa conversion
>;KPa =3D (n - 26) * 151/128 * 5/16 + 20
This formula doesn't seem to work out the same as what I=20
have. My kPaMAP isn't used for much except a couple of=20
calculations. The other MAP value ((((n-26)*.59)+.25)*2) is=20
used for all the table lookups. I call that one "TableMAP". 8-)
I've found the MAP A/D value to kPa formula in my ECM is=20
kPa =3D (MAP / 2.71) + 10.35 as follows:
; ** Convert MAP A/D counts to kPa value in fixed form
; ** 1-Bar MAP: kPa =3D (Counts / 2.71) + 10.35
7F23 F6 01 E7 LDAB $01E7 ; FilteredRoundedMAPCounts=20
7F26 4F CLRA ; D can be #$0000 to #$00FF
7F27 CE 02 B6 LDX #$02B6 ; 2.71 (#$015C for 1.36)
7F2A 03 FDIV ; X =3D MAP/2.71
7F2B 8F XGDX ; D <-> X
7F2C C3 0A 59 ADDD #$0A59 ; 10.35
7F2F FD 02 78 STD $0278 ; kPaMAP
>[Heh, heh - I'm now waiting for you to find the MAP to vacuum =
conversion
>code. It will really throw you for a loop.]
I think I've found it. Does this look like it?
; ** Calculate Vacuum reading from difference of MAP and BAR
; ** Vacuum =3D - ((((FilteredBARCounts - FilteredRoundedMAPCounts) * =
0.59) + 0.25) * 2)
=20
A527 C6 97 LDAB #$97 ; 0.59
A529 B6 03 13 LDAA $0313 ; FilteredBARCounts
A52C B0 01 E7 SUBA $01E7 ; FilteredRoundedMAPCounts
A52F 22 02 BHI $A533 ; if (FilteredBARCounts > =
FilteredMAPCounts) branch
A531 86 01 LDAA #$01 ; else A =3D 1
A533 3D MUL =20
A534 C3 00 40 ADDD #$0040
A537 05 ASLD =20
A538 24 03 BHS $A53D
A53A CC FF FF LDD #$FFFF
A53D 40 NEGA =20
A53E B7 01 EA STAA $01EA ; Store Vacuum
-Mike
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Mike Pitts
Delray Beach, FL
mpitts at emi.net
http://www.emi.net/~mpitts/mike.htm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
------=_NextPart_000_001C_01BDE93E.738852C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 =
HTML//EN">
<META content=3D'"MSHTML 4.72.2922.0"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>>Um, you may find that, except in the ECM init code, that=20
anything<BR>>below 26 sets the result to 0. (The init code in a =
lot of=20
ECMs<BR>>forgets to check for the underflow.)<BR></DIV>
<DIV> </DIV>
<DIV>You're right, that was from the init code, and further in the ECM =
</DIV>
<DIV>it does the same conversion but with an underflow check.</DIV>
<DIV> </DIV>
<DIV>>;One bar MAP sensor to KPa conversion<BR>>;KPa =3D (n - 26) =
* 151/128=20
* 5/16 + 20</DIV>
<DIV> </DIV>
<DIV>This formula doesn't seem to work out the same as what I </DIV>
<DIV>have. My kPaMAP isn't used for much except a couple of </DIV>
<DIV>calculations. The other MAP value ((((n-26)*.59)+.25)*2) is =
</DIV>
<DIV>used for all the table lookups. I call that one =
"TableMAP".=20
8-)</DIV>
<DIV> </DIV>
<DIV>I've found the MAP A/D value to kPa formula in my ECM is </DIV>
<DIV>kPa =3D (MAP / 2.71) + 10.35 as follows:</DIV>
<DIV> </DIV>
<DIV><FONT face=3DCourier size=3D2>; ** Convert MAP A/D counts to kPa =
value in fixed=20
form<BR>; ** 1-Bar MAP: kPa =3D (Counts / 2.71) + 10.35</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2><BR></FONT> </DIV>
<DIV><FONT face=3DCourier size=3D2>7F23 F6 01 =
E7 =20
LDAB =
$01E7 ;=20
FilteredRoundedMAPCounts <BR>7F26 =20
4F =20
CLRA &nb=
sp; =20
; D can be #$0000 to #$00FF<BR>7F27 CE 02 =
B6 =20
LDX =
#$02B6 ;=20
2.71 (#$015C for 1.36)<BR>7F2A =20
03 =20
FDIV &nb=
sp; =20
; X =3D MAP/2.71<BR>7F2B =20
8F =20
XGDX &nb=
sp; =20
; D <-> X<BR>7F2C C3 0A 59 =20
ADDD #$0A59 =
;=20
10.35<BR>7F2F FD 02 78 =20
STD =20
$0278 ; kPaMAP</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT> </DIV>
<DIV>>[Heh, heh - I'm now waiting for you to find the MAP to vacuum=20
conversion<BR>>code. It will really throw you for a =
loop.]</DIV>
<DIV> </DIV>
<DIV>I think I've found it. Does this look like it?</DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT =
face=3DCourier></FONT></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT face=3DCourier>; ** Calculate =
Vacuum reading=20
from difference of MAP and BAR<BR>; ** Vacuum =3D - =
((((FilteredBARCounts -=20
FilteredRoundedMAPCounts) * 0.59) + 0.25) * 2)</FONT></FONT><FONT=20
face=3DCourier></FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT =
face=3DCourier></FONT></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT =
face=3DCourier>A527 C6=20
97 =20
LDAB =
#$97 ;=20
0.59<BR>A529 B6 03 13 =20
LDAA $0313 ; =
FilteredBARCounts<BR>A52C B0 01 E7 =20
SUBA $01E7 ; =
FilteredRoundedMAPCounts<BR>A52F 22=20
02 =20
BHI =
$A533 ; if=20
(FilteredBARCounts > FilteredMAPCounts) =
branch<BR>A531 86=20
01 =20
LDAA =
#$01 ;=20
else A =3D 1<BR>A533 =20
3D =20
MUL =
<BR>A534 =20
C3 00 40 =
ADDD =20
#$0040<BR>A537 =20
05 =20
ASLD =
<BR>A538 24=20
03 =20
BHS =20
$A53D<BR>A53A CC FF FF =20
LDD =20
#$FFFF<BR>A53D =20
40 =20
NEGA =
<BR>A53E B7 01=20
EA STAA =20
$01EA ; Store Vacuum</FONT></FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT=20
face=3DCourier><BR></FONT></FONT> </DIV>
<DIV>-Mike<BR>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR>Mik=
e Pitts<BR>Delray=20
Beach, FL<BR><A href=3D"mailto:mpitts at emi.net">mpitts at emi.net</A><BR><A=20
href=3D"http://www.emi.net/~mpitts/mike.htm">http://www.emi.net/~mpitts/m=
ike.htm</A><BR>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</DIV>
<DIV> </DIV></BODY></HTML>
------=_NextPart_000_001C_01BDE93E.738852C0--
More information about the Diy_efi
mailing list