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>&gt;Um, you may find that, except in the ECM init code, that=20
anything<BR>&gt;below 26 sets the result to 0.&nbsp; (The init code in a =
lot of=20
ECMs<BR>&gt;forgets to check for the underflow.)<BR></DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV>&gt;;One bar MAP sensor to KPa conversion<BR>&gt;;KPa =3D (n - 26) =
* 151/128=20
* 5/16 + 20</DIV>
<DIV>&nbsp;</DIV>
<DIV>This formula doesn't seem to work out the same as what I </DIV>
<DIV>have.&nbsp; My kPaMAP isn't used for much except a couple of </DIV>
<DIV>calculations.&nbsp; The other MAP value ((((n-26)*.59)+.25)*2) is =
</DIV>
<DIV>used for all the table lookups.&nbsp; I call that one =
&quot;TableMAP&quot;.=20
8-)</DIV>
<DIV>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=3DCourier size=3D2>7F23&nbsp;&nbsp;&nbsp; F6 01 =
E7&nbsp;&nbsp;&nbsp;=20
LDAB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
$01E7&nbsp;&nbsp;&nbsp;&nbsp; ;=20
FilteredRoundedMAPCounts <BR>7F26&nbsp;&nbsp;&nbsp;=20
4F&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
CLRA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
; D can be #$0000 to #$00FF<BR>7F27&nbsp;&nbsp;&nbsp; CE 02 =
B6&nbsp;&nbsp;&nbsp;=20
LDX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
#$02B6&nbsp;&nbsp;&nbsp; ;=20
2.71&nbsp; (#$015C for 1.36)<BR>7F2A&nbsp;&nbsp;&nbsp;=20
03&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
FDIV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
; X =3D MAP/2.71<BR>7F2B&nbsp;&nbsp;&nbsp;=20
8F&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
XGDX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
; D &lt;-&gt; X<BR>7F2C&nbsp;&nbsp;&nbsp; C3 0A 59&nbsp;&nbsp;&nbsp;=20
ADDD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #$0A59&nbsp;&nbsp;&nbsp; =
;=20
10.35<BR>7F2F&nbsp;&nbsp;&nbsp; FD 02 78&nbsp;&nbsp;&nbsp;=20
STD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$0278&nbsp;&nbsp;&nbsp;&nbsp; ; kPaMAP</FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT>&nbsp;</DIV>
<DIV>&gt;[Heh, heh - I'm now waiting for you to find the MAP to vacuum=20
conversion<BR>&gt;code.&nbsp; It will really throw you for a =
loop.]</DIV>
<DIV>&nbsp;</DIV>
<DIV>I think I've found it.&nbsp; Does this look like it?</DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT =
face=3DCourier></FONT></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT =
face=3DCourier>A527&nbsp;&nbsp;&nbsp; C6=20
97&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
LDAB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
#$97&nbsp;&nbsp;&nbsp;&nbsp; ;=20
0.59<BR>A529&nbsp;&nbsp;&nbsp; B6 03 13&nbsp;&nbsp;&nbsp;=20
LDAA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $0313&nbsp;&nbsp;&nbsp; ; =

FilteredBARCounts<BR>A52C&nbsp;&nbsp;&nbsp; B0 01 E7&nbsp;&nbsp;&nbsp;=20
SUBA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $01E7&nbsp;&nbsp;&nbsp; ; =

FilteredRoundedMAPCounts<BR>A52F&nbsp;&nbsp;&nbsp; 22=20
02&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
BHI&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
$A533&nbsp;&nbsp;&nbsp; ; if=20
(FilteredBARCounts &gt; FilteredMAPCounts) =
branch<BR>A531&nbsp;&nbsp;&nbsp; 86=20
01&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
LDAA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
#$01&nbsp;&nbsp;&nbsp;&nbsp; ;=20
else A =3D 1<BR>A533&nbsp;&nbsp;&nbsp;=20
3D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
MUL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
<BR>A534&nbsp;&nbsp;&nbsp;=20
C3 00 40&nbsp;&nbsp;&nbsp; =
ADDD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
#$0040<BR>A537&nbsp;&nbsp;&nbsp;=20
05&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
ASLD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
<BR>A538&nbsp;&nbsp;&nbsp; 24=20
03&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
BHS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$A53D<BR>A53A&nbsp;&nbsp;&nbsp; CC FF FF&nbsp;&nbsp;&nbsp;=20
LDD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
#$FFFF<BR>A53D&nbsp;&nbsp;&nbsp;=20
40&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
NEGA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
<BR>A53E&nbsp;&nbsp;&nbsp; B7 01=20
EA&nbsp;&nbsp;&nbsp; STAA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$01EA&nbsp;&nbsp;&nbsp; ; Store Vacuum</FONT></FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT=20
face=3DCourier><BR></FONT></FONT>&nbsp;</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>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_001C_01BDE93E.738852C0--




More information about the Diy_efi mailing list