WB code

Dig turbodig at yahoo.com
Mon Aug 27 03:23:56 GMT 2001


> > Box is a '749, code is the $58 BBZB SyTy.
> 
> Your code patch will not work as you have written it
> here.  I would
> guess that you have working code, but you must have
> written this after
> the fact, just for the list.  I am not tearing it
> apart, just looking at
> what you have written.

Yeah, my excellent documentation skills shine through.
That's what I get for posting while waiting for the 
track to dry.

> 
> > hose that I have in my garage.
> 
> Need help?

Well, okay, but you gotta bring your own hose.

> > Right here you JSR to the routine "Additional_AD".

> The end of that
> routine has a JMP back into the code.  Needs an RTS
> at the end.

Actually, I've done both, that's why my documentation
got screwed up. Early versions did a JMP to FD00,
then JMP back. I was a little skittish about using
JSR due to the stack ops going on, but I got over it
and went to the JSR/RTS instead. No fear.

>  
> > Change AFR desired addresses in data stream:
> > Data displayed will be raw hex / 10.
> > 
> > 7C0 = 01 a0
> 
> This line is not needed for most folks, see below. 
> It is not displayed
> on DIACOM, but is usefull for other data loggers. 
> This 

As you say. I use it for other things (testing,
mostly),
and I neglected to take it out of the documentation.

> 
> > 7DC = 01 a0
> 
> Puts new filtered value in ALDL.

Yep.

> 
>  
> > 07c0  00 F5 00 a3 00 a5 00 a7 00 bc 00 bd 00 56 30
> 6c
> 
> This does not agree with the above line of putting
> '01A0' in 7C0.  It
> has 00F5, which is not a stock value either.
> 
>  
> > 07d0  00 6d 00 a4 00 b0 01 7e 00 a6 00 73 00 F5 00
> af
> 
> 
> This line also does not agree with the above 7DC =
> 01A0.

Yeah, both of these are wrong. From older versions
of code. 


>  
> > Add filter coef  $C152 = $20.
> > 
> > New code with filter:
> > FD00:
> > 
> > JSR $F4B3   ; jump to A/D routine, finish the TPS
> read
> > PSH A       ; we used to hook this code in.
> > PSH B       ; save it on the stack
> > LDAA #$00   ;load A/D channel
> > JSR $F4B3   ;call A/D routine
> > STAA $01a0  ;store in unused RAM
> 
> This STAA defeats the filter.  The filtered loc
> loaded next is $01A0,
> and it is already loaded with the new raw value, as
> you just stored it! 
> I assume you mean $00F5 for this line?

Nope, this is as written. Maybe I don't really get
the mechanics of the lag routine, but it works quite
well this way. I can move the coef around and get 
varying levels of filtration, anyway.

I was under the impression that (in this code) $01a0
was the value to be filtered, and that $01a1 (which
gets loaded via the LDX) was the old value that the
target value was being filtered against? IE:

New val to be filtered -> 01a0

Filter it against old (01a1), store filtered back into
01a0.

Move a copy of this into old (01a1), and return from
the routine. This becomes the value to filter against
the next time the loop comes around. Repeat cycle.

Am I way off the mark there? If so, why is it working
now? It's been a while since I wrote this originally,
and it's kinda hard to remember what I was thinking
about at the time.


> > LDX $01a0   ;load unfiltered value
> > LDAB $C152  ;load the filter coef.... I use $20
> > JSR $F599   ;call the filter routine
> > STD $01a0   ;store filtered value
> > PUL A       ; always PUL what thou hast PSHd, lest
> > PUL B       ; thy stack runneth over
> > JMP $D4CB   ; JMP back to where we cut into the
> code
> 
> This last line has to be an RTS, not a JMP.  Or
> don't JSR to this
> routine.

Either. Both. See above. :)


Anyway, apologies to anyone this may have screwed up.
I ought to know better than to send off half-checked
documentation by now.

Just as a side note... this code was written with 
brevity in mind, as I didn't have the space to add
a lot of code unless I went to a 32k EPROM. Could
have used the space the shift light code uses, but
I have plans for a shift light down the road...


later,

Dig


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
----------------------------------------------------------------------------
To unsubscribe from gmecm, send "unsubscribe gmecm" (without the quotes)
in the body of a message (not the subject) to majordomo at lists.diy-efi.org




More information about the Gmecm mailing list