Calling all gurus
Mike Pitts
mpitts at mail.emi.net
Tue Sep 8 04:18:32 GMT 1998
This is a multi-part message in MIME format.
------=_NextPart_000_0033_01BDDABE.207C4B60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all,
I'm to a point where I could use a wee bit of help. First of all,=20
my mathmatical skills are weak, especially when it comes=20
to coefficients and lag filters. (I never took calc). Anyway,=20
I have a routine that I think is a lag filter, but it's different enough =
from the '7148 code that I'm not sure. At a minumum, it's doing=20
a bit more than the '7148 version.
If anyone would care to explain the theory of lag filters/coefficients=20
to me, as well as tell me what the following routine does, I'd be=20
MUCH obliged. BTW: I'll bet this same routine is in 90% of the=20
modern P4 ECUs.
You'll need a monospaced font for this
;**********************************************************
;*
;* Lag Filter Subroutine??
;*
;* Input example:
;* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
;* LDAA $00A0 - Sometimes an A/D value
;* LDAB #$80 - Coefficient?
;* LDX $0315 - The 16-bit storage of the filtered value?
;* LDY #$5925- ???
;*
;* Result:
;* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
;* 16-bit word in Accumulator D
;*
;**********************************************************
F047 3C PSHX ; Store X
F048 30 TSX ; X =3D (SP) + 1
F049 A3 00 SUBD $00,x ; D =3D D - X[0]
F04B 37 PSHB ; store B
F04C E6 00 25 LDAB $00,y ; B =3D Y[0]
F04F 25 03 BLO $F054 ; if D < 0 goto $F054
F051 3D MUL ; D =3D A * B
F052 20 04 BRA $F058 ; goto $F058
F054 3D MUL ; D =3D A * B
F055 A0 00 E3 SUBA $00,y ; A =3D A - Y[0]
F058 E3 00 ADDD $00,x ; D =3D D + X[0]
F05A ED 00 STD $00,x ; X[0] =3D D
F05C 32 PULA ; get A from stack (was B)
F05D E6 00 3D LDAB $00,y ; B =3D Y[0]
F060 3D MUL ; D =3D A * B
F061 A9 01 ADCA $01,x ; A =3D A + X[1] + carry
F063 16 TAB ; B =3D A
F064 A6 00 LDAA $00,x ; A =3D X[0]
F066 89 00 ADCA #$00 ; A =3D A + carry
F068 38 PULX ; restore X
F069 39 RTS ; return
Thanks!!
-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_0033_01BDDABE.207C4B60
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>
<META content=3D'"MSHTML 4.72.2922.0"' name=3DGENERATOR>
</HEAD>
<BODY>
<DIV> </DIV>
<DIV>Hi all,</DIV>
<DIV> </DIV>
<DIV>I'm to a point where I could use a wee bit of help. First of =
all,=20
</DIV>
<DIV>my mathmatical skills are weak, especially when it comes </DIV>
<DIV>to coefficients and lag filters. (I never took calc). =
Anyway,=20
</DIV>
<DIV>I have a routine that I think is a lag filter, but it's different =
enough=20
</DIV>
<DIV>from the '7148 code that I'm not sure. At a minumum, it's =
doing=20
</DIV>
<DIV>a bit more than the '7148 version.</DIV>
<DIV> </DIV>
<DIV>If anyone would care to explain the theory of lag =
filters/coefficients=20
</DIV>
<DIV>to me, as well as tell me what the following routine does, I'd be =
</DIV>
<DIV>MUCH obliged. BTW: I'll bet this same routine is in 90% of =
the </DIV>
<DIV>modern P4 ECUs.</DIV>
<DIV> </DIV>
<DIV>You'll need a monospaced font for this</DIV>
<DIV> </DIV>
<DIV><FONT=20
face=3DCourier>;*********************************************************=
*<BR>;*<BR>;*=20
Lag Filter Subroutine??<BR>;*<BR>;* Input example:<BR>;* =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR>;*=20
LDAA $00A0 - Sometimes an A/D value<BR>;* LDAB #$80 - =
Coefficient?<BR>;*=20
LDX $0315 - The 16-bit storage of the filtered value?<BR>;* =
LDY =20
#$5925- ???<BR>;*<BR>;* Result:<BR>;* =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR>;* 16-bit word in=20
Accumulator=20
D<BR>;*<BR>;**********************************************************</F=
ONT></DIV>
<DIV><FONT face=3DCourier></FONT> </DIV>
<DIV><FONT face=3DCourier>F047 =20
3C =20
PSHX &nb=
sp; =20
; Store X<BR>F048 =20
30 =20
TSX &nbs=
p; =20
; X =3D (SP) + 1<BR>F049 A3=20
00 =20
SUBD $00,x ; D =3D =
D -=20
X[0]<BR>F04B =20
37 =20
PSHB &nb=
sp; =20
; store B<BR>F04C E6 00 25 =20
LDAB $00,y ; B =3D =
Y[0]<BR>F04F 25 03 =
BLO $F054 ; =
if D=20
< 0 goto $F054</FONT></DIV>
<DIV><FONT face=3DCourier></FONT> </DIV>
<DIV><FONT face=3DCourier>F051 =20
3D =20
MUL &nbs=
p; =20
; D =3D A * B<BR>F052 20 =
04 =20
BRA $F058 ; =
goto=20
$F058</FONT></DIV>
<DIV><FONT face=3DCourier></FONT> </DIV>
<DIV><FONT face=3DCourier>F054 =20
3D =20
MUL &nbs=
p; =20
; D =3D A * B<BR>F055 A0 00 E3 =20
SUBA $00,y ; A =3D =
A -=20
Y[0]</FONT></DIV>
<DIV><FONT face=3DCourier></FONT> </DIV>
<DIV><FONT face=3DCourier>F058 E3=20
00 =20
ADDD $00,x ; D =3D =
D +=20
X[0]<BR>F05A ED 00 =
STD $00,x ; =
X[0] =3D=20
D<BR>F05C =20
32 =20
PULA &nb=
sp; =20
; get A from stack (was B)<BR>F05D E6 00 =
3D =20
LDAB $00,y ; B =3D =
Y[0]<BR>F060 =20
3D =20
MUL &nbs=
p; =20
; D =3D A * B<BR>F061 A9 =
01 =20
ADCA $01,x ; A =3D =
A + X[1]=20
+ carry<BR>F063 =20
16 =20
TAB &nbs=
p; =20
; B =3D A<BR>F064 A6 =
00 =20
LDAA $00,x ; A =3D =
X[0]<BR>F066 89 00 =
ADCA #$00 ; =
A =3D A +=20
carry<BR>F068 =20
38 =20
PULX &nb=
sp; =20
; restore X<BR>F069 =20
39 =20
RTS &nbs=
p; =20
; return</FONT></DIV>
<DIV> </DIV>
<DIV>Thanks!!</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_0033_01BDDABE.207C4B60--
More information about the Diy_efi
mailing list