Mark, the xdf and cal I'm looking at are displayed correctly. BJYM uses a 10 degree spark bias. The open and closed throttle spark tables are displayed with the spark bias subtracted using Advanced $0d TP5 v2.50. The correct formula is .351623 * ( X - Y ). Verify that the main spark bias is subtracted from the table by opening hex editor, viewing values starting at L4168 (open throttle table) or L428C (closed throttle table). Convert hex values to decimal using windows calculator or other tool then multiply by .351623. In BJYM the spark value at the 400 rpm and 20 kPa cell (both open and closed throttle) is displayed as 20 degrees in TP but is actually 55 hex ($55) which converts to 29.88 degrees. If the math is right and the number displayed is right, you've got an issue somewhere else.
Everything that follows explains why this answer is correct.
Since almost all ecm spark values are equal to hex value * .35163 both the spark table entries and the bias have to be multiplied by .351623. So the actual conversion would be spark table value = .351623 * X - .351623 * Y. As Six said, the rules of algebra determine that multiplication gets done first. Anything in parenthesis is also done first so the previous equation is the same as ( .351623 * X ) - ( .351623 * Y ) although the second version is easier to read. Finally, there are more math rules (the Distributive Property of Multiplication) that say (.351623 * X) - (.351623 * Y) is the same as .351623 * ( X - Y ).
IOW:
.351623 * X - .351623 * Y =
( .351623 * X ) - ( .351623 * Y ) =
.351623 * ( X - Y )
The main spark bias represents the distributor base timing and must be accounted for if the displayed table values are to match crankshaft timing values. This was a big issue at one time on gmecm. Technically all the biases should be included but anything that's looked up from a table or calculated on the fly can't very well be included since it's not a constant like main spark bias.
FWIW, I have not not seen a code that needs any sort of offset of the main spark bias to be correct between the table and the crank.
The ecmguy hac for $0D has clearly labeled the section of code where spark biases are subtracted.
Code:
; SUB OFF SPARK BIAS VALUES
; (RETARD)
;
A8C3: SUBB L413C ; 9 Deg MAIN SPK BIAS
A8C6: SBCA #$00 ;
A8C8: SUBB L413D ; 20 DEG COOLANT SPK BIAS
A8CB: SBCA #$00 ;
A8CD: SUBB L413E ; 10 Deg ALT ADV SPK BIAS
A8D0: SBCA #$00 ;
A8D2: SUBB L413F ; 00 Deg EGR SPK BIAS
A8D5: SBCA #$00 ;
A8D7: SUBB L022E ; LOW OCTAINE SPK RETARD
A8DA: SBCA #$00 ;
A8DC: SUBB L0154 ; ??? SPK RETARD
A8DF: SBCA #$00 ;
A8E1: STD L0220 ; FINAL SPK ADV
It's also commented in ASDZ for $42:
Code:
;
; SUB OFF SPARK BIAS
;
E81B: LE81B TAB ; A to B Reg.
E81C: CLRA ;
E81D: ADDD L0057 ;
E81F: SUBB LD014 ; Main SA BIAS, (10 Deg)
E822: SBCA #$00 ; ROUND
E824: SUBB LD015 ; COOL SA BIAS, (20 Deg)
E827: SBCA #$00 ; ROUND
E829: STD L0051 ; SAVE ADJUSTED SPARK ADVANCE (Temp)
Bookmarks