Yes it did.exxon wrote:Did it help you?
What are the disadvantages to setting the ttpmin to 1 accross the board?
This is all for the Z32 ECU, I don't know about your ECU though.
You have to see about TTP MIN, this is specific to my setup.
Moderator: Matt
Yes it did.exxon wrote:Did it help you?
What are the disadvantages to setting the ttpmin to 1 accross the board?
Be careful:Matt wrote: This is interesting, the software now probes the knock flags (well in particular 0x0082 address for Z32) to determine if main or knock maps are selected).
Could you clarify who is who ? Doing the link b/w TKAS, TWST, TKTWEGI, TADVC andMatt wrote: TKAS EGI increasing in quantity revision 1×16
100/64% After idle enrich vs temp revision
TWST When starting output pulse width 1×16
TWK:10 ℃ Ms First Time Injection vs Temp
TKTW EGI increasing in quantity factor 1×16
TWK:10 ℃ 100/64% After idle enrich vs temp factor (non-neutral)
TADVC After the starting timing revision table water temperature 1×16
TWK:10 ℃ Deg After start timing vs temp
bit7 when 0 means knock is occurring
But be careful, at the end, that's the bit2 in 0x5A that tells you if you're still using the knock maps or not.Matt wrote:This is what I currently use. Based on the bit set check prior to the fuel / timing mapsbit7 when 0 means knock is occurring
Code: Select all
RAM1:005A flags10: rmb 1 ; ...
RAM1:005A ; Bit 2: 1=normal map, 0=knock map
RAM1:0082 flags8: rmb 1 ; ...
RAM1:0082 ; Bit 1: 1=inside knock learn region
RAM1:0082 ; Bit 7: 0=knock
knock occurrence:
CODE:B955 ci_86: ; ...
CODE:B955 ldd timing_offset2
CODE:B958 std timing_offset_old
CODE:B95B tim #%10000000, flags8 ; Bit 1: 1=inside knock learn region
CODE:B95B ; Bit 7: 0=knock
CODE:B95E bne ci_87
CODE:B95E
CODE:B960 ldaa knock_value
CODE:B963 cmpa knock_low
CODE:B966 ble ci_88
CODE:B966
CODE:B968 oim #%10000000, flags8 ; Bit 1: 1=inside knock learn region
CODE:B968 ; Bit 7: 0=knock
CODE:B96B bra ci_88
CODE:B96B
CODE:B96D
CODE:B96D ci_87: ; ...
CODE:B96D ldaa knock_value
CODE:B970 cmpa knock_high
CODE:B973 bgt ci_88
CODE:B973
CODE:B975 aim #%1111111, flags8 ; Bit 1: 1=inside knock learn region
CODE:B975 ; Bit 7: 0=knock
CODE:B978
CODE:B978 ci_88: ; ...
CODE:B978 rts
CODE:B978
CODE:B978 ; End of function compute_ignition
On the first knock occurrence, the switch to knock maps is memorized in flags10, and flags10 supersedes flags8:
CODE:CD2D loc_1429: ; ...
CODE:CD2D aim #%11111, interp_flags ; Bit 6: 0=rpm, 1=tp_d2_filt
CODE:CD30 oim #%10100, interp_flags ; Bit 6: 0=rpm, 1=tp_d2_filt
CODE:CD33 aim #%10111111, flags7 ; Bit 0: EGR off
CODE:CD36 ldx #timing_map_knock
CODE:CD39 aim #%11111011, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD3C tim #%10000000, flags8 ; Bit 1: 1=inside knock learn region
CODE:CD3C ; Bit 7: 0=knock
CODE:CD3F beq loc_6697
CODE:CD3F
CODE:CD41 ldx #timing_map
CODE:CD44 oim #%100, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD47
CODE:CD47 loc_6697: ; ...
CODE:CD47 stx param_map
CODE:CD49 ldx #ign_rpm_scale
CODE:CD4C stx param_rpm
CODE:CD4E ldx #ign_tp_scale
CODE:CD51 stx param_tp
CODE:CD53 jsr interp_2D
CODE:CD53
CODE:CD56 suba #128
CODE:CD58 psha ; Push timing
CODE:CD59 tim #%100, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD5C bne loc_6698
CODE:CD5C
CODE:CD5E tim #%10, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD61 beq loc_1433
CODE:CD61
CODE:CD63 aim #%11111101, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD66 ldx #timing_map
CODE:CD69 bra loc_6699
CODE:CD69
CODE:CD6B
CODE:CD6B loc_6698: ; ...
CODE:CD6B tim #%10, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD6E bne loc_1433
CODE:CD6E
CODE:CD70 oim #%10, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD73 ldx #timing_map_knock
CODE:CD76
CODE:CD76 loc_6699: ; ...
CODE:CD76 stx param_map
CODE:CD78 aim #%11111, interp_flags ; Bit 6: 0=rpm, 1=tp_d2_filt
CODE:CD7B oim #%10100, interp_flags ; Bit 6: 0=rpm, 1=tp_d2_filt
CODE:CD7E ldx #ign_rpm_scale
CODE:CD81 stx param_rpm
CODE:CD83 ldx #ign_tp_scale
CODE:CD86 stx param_tp
CODE:CD88 ldx interp_y_input_save
CODE:CD8B stx interp_y_input
CODE:CD8D ldx interp_x_input_save
CODE:CD90 stx interp_x_input
CODE:CD92 jsr interp_1616
Code: Select all
CODE:CA32 tim #%10000000, flags8 ; Bit 1: 1=inside knock learn region
CODE:CA32 ; Bit 7: 0=knock
CODE:CA35 beq cf_6 ; If not set then branch
CODE:CA35
CODE:CA37 tim #%10000000, flags6 ; Bit 7: High gear
CODE:CA3A beq cf_5 ; If not set then branch
CODE:CA3A
CODE:CA3C ldx #fuel_map_highgear
CODE:CA3F bra cf_8
CODE:CA3F
CODE:CA41
CODE:CA41 cf_5: ; ...
CODE:CA41 ldx #fuel_map
CODE:CA44 bra cf_8
CODE:CA44
CODE:CA46
CODE:CA46 cf_6: ; ...
CODE:CA46 tim #%10000000, flags6 ; Bit 0: throttle switch (1=idle)
CODE:CA46 ; Bit 1: high octane (if 1, becomes 0 when bit0 of flags5 is set to 1)
CODE:CA46 ; Bit 2: neutral switch(1=neutral)
CODE:CA46 ; Bit 3: power steering switch (1=on)
CODE:CA46 ; Bit 4: A/C switch (1=on)
CODE:CA46 ; Bit 7: gear engaged and high gear
CODE:CA49 beq cf_7
CODE:CA49
CODE:CA4B ldx #fuel_map_highgear_knock
CODE:CA4E bra cf_8
CODE:CA4E
CODE:CA50
CODE:CA50 cf_7: ; ...
CODE:CA50 ldx #fuel_map_knock
CODE:CA53
CODE:CA53 cf_8: ; ...
CODE:CA53 stx param_map
CODE:CA55 ldx #inj_rpm_scale
CODE:CA58 stx param_rpm
CODE:CA5A ldx #inj_tp_scale
CODE:CA5D stx param_tp
CODE:CA5F jsr interp_2D
CODE:CA5F
CODE:CA62 staa inj_pulse_raw
Based on proper flag usage given #80x0082 is knock determination it actually should beHIGH_FUEL,&H7D00,16,16,256,1,High octane Fuel map
REG_FUEL,&H7000,16,16,256,1,Low octane Fuel map
UPGEAR_HIGH_FUEL,&H7100,16,16,256,1,High-octane fuel map (more than gear position 4)
UPGEAR_REG_FUEL,&H7200,16,16,256,1,Regular fuel map (more than gear position 4)
Tried to verify with GRID Map Maker has 7000/7100/7200/7D00 but no proper labeling apart from Fuel map 1,2,3,4HIGH_FUEL,&H7D00,16,16,256,1,High octane Fuel map
REG_FUEL,&H7100,16,16,256,1,Low octane Fuel map
UPGEAR_HIGH_FUEL,&H7000,16,16,256,1,High-octane fuel map (more than gear position 4)
UPGEAR_REG_FUEL,&H7200,16,16,256,1,Regular fuel map (more than gear position 4)
Code: Select all
RAM1:0055 flags6: rmb 1
RAM1:005A flags10: rmb 1
RAM1:0082 flags8: rmb 1
DATA:F000 fuel_map_highgear
DATA:F100 fuel_map_knock
DATA:F200 fuel_map_highgear_knock
DATA:FD00 fuel_map
DATA:F800 timing_map
DATA:FC00 timing_map_knock
CODE:CD2D loc_1429: ; ...
CODE:CD2D aim #%11111, interp_flags ; Bit 6: 0=rpm, 1=tp_d2_filt
CODE:CD30 oim #%10100, interp_flags ; Bit 6: 0=rpm, 1=tp_d2_filt
CODE:CD33 aim #%10111111, flags7 ; Bit 0: EGR off
CODE:CD36 ldx #timing_map_knock
CODE:CD39 aim #%11111011, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD3C tim #%10000000, flags8 ; Bit 1: 1=inside knock learn region
CODE:CD3C ; Bit 7: 0=knock
CODE:CD3F beq loc_6697
CODE:CD3F
CODE:CD41 ldx #timing_map
CODE:CD44 oim #%100, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD47
CODE:CD47 loc_6697: ; ...
CODE:CD47 stx param_map
CODE:CD49 ldx #ign_rpm_scale
CODE:CD4C stx param_rpm
CODE:CD4E ldx #ign_tp_scale
CODE:CD51 stx param_tp
CODE:CD53 jsr interp_2D
CODE:CD53
CODE:CD56 suba #128
CODE:CD58 psha ; Push timing
CODE:CD59 tim #%100, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD5C bne loc_6698
CODE:CD5C
CODE:CD5E tim #%10, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD61 beq loc_1433
CODE:CD61
CODE:CD63 aim #%11111101, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD66 ldx #timing_map
CODE:CD69 bra loc_6699
CODE:CD69
CODE:CD6B
CODE:CD6B loc_6698: ; ...
CODE:CD6B tim #%10, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD6E bne loc_1433
CODE:CD6E
CODE:CD70 oim #%10, flags10 ; Bit 2: 1=normal map, 0=knock map
CODE:CD73 ldx #timing_map_knock
CODE:CD76
CODE:CD76 loc_6699: ; ...
CODE:CD76 stx param_map
CODE:CD78 aim #%11111, interp_flags ; Bit 6: 0=rpm, 1=tp_d2_filt
CODE:CD7B oim #%10100, interp_flags ; Bit 6: 0=rpm, 1=tp_d2_filt
CODE:CD7E ldx #ign_rpm_scale
CODE:CD81 stx param_rpm
CODE:CD83 ldx #ign_tp_scale
CODE:CD86 stx param_tp
CODE:CD88 ldx interp_y_input_save
CODE:CD8B stx interp_y_input
CODE:CD8D ldx interp_x_input_save
CODE:CD90 stx interp_x_input
CODE:CD92 jsr interp_1616
Matt wrote: HIGH_FUEL,&H7D00,16,16,256,1,High octane Fuel map
REG_FUEL,&H7100,16,16,256,1,Low octane Fuel map
UPGEAR_HIGH_FUEL,&H7000,16,16,256,1,High-octane fuel map (more than gear position 4)
UPGEAR_REG_FUEL,&H7200,16,16,256,1,Regular fuel map (more than gear position 4)
YesMatt wrote:Are you using IDA pro for your disassembly?
In IDAPro, you just have to pass the mouse cursor over the symbol to have the corresponding address and data content highlighted.Matt wrote: This way you get to see the memory addresses next to the symbol name in the code still
To give some reference, @WOT maxTP, injector pulse is about 15-16ms.Time RPM RPM Ref Temp Speed TPS Fuel temp DCFlags1 DCFlags2 Inj time (LHS) Inj time (RHS) Timing AAC AF Alpha (LHS) AF Alpha (RHS) TP Lambda LHS Lambda RHS AFR AFR RHS TP (MSB) Injector duty AOI Knock Timing flag Knock Fuel flag
00:08.5 0 0 16 0 0.46 -50 __ __ NT __ TP __ __ __ __ __ __ __ 1.32 1.32 16 0 100 100 0 [0] 1.36 1.29 20.1 19.1 0 0 ___ __ __
00:08.6 125 0 16 0 0.46 -50 __ __ NT ST TP __ __ __ __ __ __ __ 23 23 16 0 100 100 0 [0] 1.36 1.29 20.1 19.1 0 2 ___ __ __
00:08.7 162 0 16 0 0.46 -50 __ __ NT ST TP __ __ __ FP __ __ __ 22 22 16 0 100 100 2961 [11] 1.36 1.29 20.1 19.1 11 2 ___ __ __
00:08.8 200 0 16 0 0.46 -50 __ __ NT ST TP __ __ __ FP __ __ __ 20 20 16 0 100 100 3733 [14] 1.36 1.29 20.1 19.1 14 3 ___ __ __
00:08.9 212 0 16 0 0.46 -50 __ __ NT ST TP __ __ __ FP __ __ __ 21 21 16 0 100 100 4375 [17] 1.36 1.29 20.1 19.1 17 3 ___ __ __
00:09.1 225 0 16 0 0.46 -50 __ __ NT ST TP __ __ __ FP __ __ __ 19 19 16 0 100 100 4325 [16] 1.36 1.29 20.1 19.1 16 3 ___ __ __
00:09.2 200 0 16 0 0.46 -50 __ __ NT ST TP __ __ __ FP __ __ __ 20 20 16 0 100 100 5062 [19] 1.36 1.29 20.1 19.1 19 3 ___ __ __
00:09.3 200 0 16 0 0.46 -50 __ __ NT ST TP __ __ __ FP __ __ __ 20 20 16 0 100 100 5552 [21] 1.36 1.29 20.1 19.1 21 3 ___ __ __
00:09.4 475 0 16 0 0.46 -50 __ __ NT ST TP __ __ __ FP __ __ __ 10 10 16 0 100 100 3746 [14] 1.36 1.29 20.1 19.1 14 3 ___ __ __
00:09.5 925 0 16 0 0.46 -50 __ __ NT __ TP __ __ __ FP __ __ __ 5.97 5.97 28 0 100 100 2679 [10] 1.36 1.29 20.1 19.1 10 4 ___ __ __
Code: Select all
-40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110
120 120 75 67 46 33 17 11 9 8 6 6 6 6 6 6