AndyF
11-02-2009, 09:55 PM
Probably one for Mr Banks but anyone else please feel free to join in...
I've 'found' the part in my code that is used when the ECU doesn't receive MAS interrupts i.e. MAF is knackered...
It looks like this
;************************************************* **********************************
; Compute airCntDef, default airCnt0 value when no mas interrupts are being recieved
;************************************************* **********************************
______ldy #0xFF28_____________; rpm factor table
______jsr rpm4piecelin___________; b = factor vs rpm4
______pshb____________________; push b onto stack
______ldx #0xF3E4______________; ect factor table
______jsr INTECT _______________; b = factor vs ECT
______addb tpsRaw_____________; b = tpsRaw + ectFactor
______bcc L9BD2_______________; overflow check
______ldab #0xFF_______________; Use max
L9BD2: ldx #0xE121
______jsr CLPOFS_______________; offset and clip b, b = max(min(tpsRaw+ectFactor,$E1)-$21,0)
______lsrb_____________________; b=b/2
______pula_____________________; a = factor vs rpm4 from above
______ldx #0xF3C1______________; 2D lookup table
______ldy #0x0500
______jsr LUP2D2 _______________; b = 2D lookup using rpm4 and b
______ldaa L8081_______________; mem location is always init to 0
______beq L9BEC_______________; branch to 9BEC
______jmp L85BC
L9BEC:stab airCntDef____________; Store final value
L9BEF:ldaa #0x48_______________; a=$48
______mul_____________________; d=$48*airCntDef
______std TEMP6_______________; [temp6:temp7] = $48*airCntDef
;************************************************* *******
; Factor in air temp, baro, etc... when no mas interrupts
;************************************************* *******
_____ldab iatCompFact
_____jsr M16_12________________; [temp6:temp7] = iatFact*[temp6:temp7]/128
_____ldab baroFact
_____jsr M16_12________________; [temp6:temp7] = baroFact*[temp6:temp7]/128
_____ldab coldTempEnrFact
_____jsr M16_12________________; [temp6:temp7] = coldtempEnr*[temp6:temp7]/128
_____ldab enrWarmup
_____clra______________________; d = enrWarmup
_____lsld______________________; d = 2*enrWarmup
_____addd #0x0080_____________; d = (2*enrWarmup)+$80
_____jsr MUL661________________; d and [temp6:tenp7] = ((2*enrWarmup)+$80)*[temp6:temp7]/128
_____jmp L9C9E________________; Jump to next section
Now what I was thinking was the 2D lookup table that I've highlighted could *possibly* be converted to be rpm vs MAP and used as an easy way of converting to SD???
Any thoughts??
Cheers
Andy
I've 'found' the part in my code that is used when the ECU doesn't receive MAS interrupts i.e. MAF is knackered...
It looks like this
;************************************************* **********************************
; Compute airCntDef, default airCnt0 value when no mas interrupts are being recieved
;************************************************* **********************************
______ldy #0xFF28_____________; rpm factor table
______jsr rpm4piecelin___________; b = factor vs rpm4
______pshb____________________; push b onto stack
______ldx #0xF3E4______________; ect factor table
______jsr INTECT _______________; b = factor vs ECT
______addb tpsRaw_____________; b = tpsRaw + ectFactor
______bcc L9BD2_______________; overflow check
______ldab #0xFF_______________; Use max
L9BD2: ldx #0xE121
______jsr CLPOFS_______________; offset and clip b, b = max(min(tpsRaw+ectFactor,$E1)-$21,0)
______lsrb_____________________; b=b/2
______pula_____________________; a = factor vs rpm4 from above
______ldx #0xF3C1______________; 2D lookup table
______ldy #0x0500
______jsr LUP2D2 _______________; b = 2D lookup using rpm4 and b
______ldaa L8081_______________; mem location is always init to 0
______beq L9BEC_______________; branch to 9BEC
______jmp L85BC
L9BEC:stab airCntDef____________; Store final value
L9BEF:ldaa #0x48_______________; a=$48
______mul_____________________; d=$48*airCntDef
______std TEMP6_______________; [temp6:temp7] = $48*airCntDef
;************************************************* *******
; Factor in air temp, baro, etc... when no mas interrupts
;************************************************* *******
_____ldab iatCompFact
_____jsr M16_12________________; [temp6:temp7] = iatFact*[temp6:temp7]/128
_____ldab baroFact
_____jsr M16_12________________; [temp6:temp7] = baroFact*[temp6:temp7]/128
_____ldab coldTempEnrFact
_____jsr M16_12________________; [temp6:temp7] = coldtempEnr*[temp6:temp7]/128
_____ldab enrWarmup
_____clra______________________; d = enrWarmup
_____lsld______________________; d = 2*enrWarmup
_____addd #0x0080_____________; d = (2*enrWarmup)+$80
_____jsr MUL661________________; d and [temp6:tenp7] = ((2*enrWarmup)+$80)*[temp6:temp7]/128
_____jmp L9C9E________________; Jump to next section
Now what I was thinking was the 2D lookup table that I've highlighted could *possibly* be converted to be rpm vs MAP and used as an easy way of converting to SD???
Any thoughts??
Cheers
Andy