DIY-WB Output Voltage Scaling
Scot Sealander
Sealand at clarityconnect.com
Sun Aug 26 16:40:50 GMT 2001
daklein at netzero.net wrote:
> Here's an Idea!! hook it up to an extra PCM input, and have the pcm
> table lookup the AFR(like it does volts to whatever for MAP, temps, etc),
> put it in the aldl datastream and have your palm
> pilot display it for ya.
If you use this list for commercial purposes, please delete this right
now!
This code may not be used for any commercial purpose, and is offered in
the
spirit of the DIY_WB.
Here is some assembly code to do just that...... It is a subroutine
that can be called to read, linearize, and filter the WB AFR. I haven't
actually tried it, I just sat down and wrote it.... And I don't program
for a living, so be careful.
How you get it out of the ECM is up to you. But it would be neat to put
the WbAfrAldl value in the ALDL stream for DesiredAfr. You would then
get the WB AFR in a direct reading output in DIACOM.
===============================================================================
*
* Absolutely not for commercial purposes.
*
*
* Code to linearize the DIY_WB
*
* Copyright (C)
* Scot Sealander (for the DIY_WB) August 26, 2001
*
*
DoWideBand LDAA #$xx ; xx will be the A/D channel you
use
JSR DoSensorAtoD ; Go do conversion
STAA RawWbVolts ; Store new value (only if you
want to see it)
SUBA #$47 ; Min table value
BCC WideBand000 ;
*
CLRA ; No less than zero
BSET WbStatus;BitZero; Set WB under min limit
*
WideBand000 CMPA #$4D ; Max value
BCS WideBand010 ; Skip if under max
*
LDAA #$4C ; Load max value
BSET WbStatus;BitOne ; Set WB over limit
*
WideBand010 LDX #WideBandTable ; Address of table
TAB ; Move to B
ABX ; Add table offset
LDAA $00,X ; Get new value
STAA RawWbAFR ; Before filter
CLRB ;
LDX WideBand ;
BEQ WideBand020 ; Go init if first pass
*
LDAB TpsIndex ; Low TPS, lots of filter, high
TPS->low filter
JSR DoLpFilter ;
*
WideBand020 STD WideBand ; Filtered value
ADDD #$0080 ; Round off
STAA WbAfrAldl ; For ALDL purposes
RTS ; Return
*
*
* ACC B = RawWideBand - '47'
*
*
WideBandTable FCB $65,$65,$65,$66,$67,$67,$68,$69 ; 08
FCB $69,$6A,$6A,$6B,$6C,$6D,$6D,$6E ; 10
FCB $6E,$70,$71,$71,$72,$74,$74,$75 ; 18
FCB $76,$77,$78,$78,$79,$7A,$7A,$7B ; 20
FCB $7C,$7D,$7E,$7F,$80,$80,$82,$83 ; 28
FCB $84,$84,$85,$86,$88,$89,$8A,$8A ; 30
FCB $8C,$8D,$8E,$8F,$90,$91,$92,$93 ; 38
FCB $96,$99,$9B,$9C,$9E,$A2,$A5,$A6 ; 40
FCB $A7,$AC,$B0,$B3,$B6,$B9,$BC,$C0 ; 48
FCB $C5,$C8,$CB,$CF ; 4C
*
*
*
====================================================================================
----------------------------------------------------------------------------
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