I have been using the knock count logging but was getting some strange results. So i have put it on the test bench and found that the RPM and MAP are incorrect. The RPM is offset by 400RPM and a MAP of 80kPa logs as 90kPa. This makes it difficut to use this to adjust the spark maps. In the below example the engine is at 3288RPM which is using a window of 150RPM so it should be logging to 3200RPM not 3600RPM.
One error is X axis on the screen, it should be 20,30,40,50,60,70,80,90,100 but reads 20,30,40,60,80,85,90,95,100. This is why there is a 10kPa MAP shift
The other errors are in the bin so I checked the code and found the errors...
First for RPM...
- Code: Select all
LAAE7: ldx #L8552 ; Logging 6400RPM To 9600RPM
ldaa *L006C ; RPM
brset *L003D,#0x08,LAAF5 ; Branch If RPM Is Greater Than 6400RPM
; Else...
ldx #L84CB ; Logging - 400RPM To 6400RPM
ldaa *L006C ; RPM
;
LAAF5: tab ; Keep A Copy
anda #0x0F ; Keep The Last 4bits
cmpa L8203 ; Knock Count Logging - RPM Window
bls LAB07 ; Branch If Inside Upper Part Of Window
; Else...
adda L8203 ; Add The Window And Now Check Below
cmpa #0x10 ;
bcs LAB3D ; Branch If Not Inside The Window
; Else...
addb L8203 ; Make It Positive
LAB07: lsrb ; \
lsrb ; |
lsrb ; | 400RPM breakpoints
lsrb ; /
ldaa #0x09 ; 9 MAP Points
mul ;
abx ; Add To The Table Offset
The low RPM table starts at 400RPM and not zero RPM, so this needs to be subbed off at the start.
The other error is logging at 100kPa causes the 20kPa cell to be populated.
- Code: Select all
ldaa *L005A ; MAP
tab ;
anda #0x1F ; Keep The Last Last 5bits
cmpa L8204 ; Knock Count Logging - MAP Window
bls LAB23 ;
; Else...
adda L8204 ; Knock Count Logging - MAP Window
cmpa #0x20 ;
bcs LAB3D ;
; Else...
addb L8204 ; Knock Count Logging - MAP Window
After the 'addb L8204' instruction the code rolls past 0xFF if the MAP is greater than 0xFF minus L8204. This causes the roll to 20kPa so need to check for that and modify the value.
I am really hoping Ken is able to fix these up and release a new version, i use knock logging heaps and its caused hours of frustration trying to work out whats going on.
Thanks


