STEP 8
It looks to me like this Hitachi ECU encodes the errors in a similar way to the JECS ECU on my SVX. But that is just from reading the code, I haven't actually run it through a simulator or on paper to check.
I think the error codes are stored internally as bit flags in addresses FB85 through FB87.
| FB85 | n/a | Injector4(17) | Injector3(16) | Injector2(15) | Injector1(14) | CamSensor(13) | Starter(12) | CrankSensor(11) |
| FB86 | PurgeSol(35) | SpeedSensor(33) | O2Sensor(32) | ThrottleSensor(31) | IdleSolenoid(24) | MAFsensor(23) | n/a | CoolantTemp(21) |
| FB87 | n/a | IdleSW(42) | n/a | n/a | n/a | AIRsensor(49) | NeutralSW(51) | n/a |
So, for example, a value of 0x41 in FB86 would indicate errors with the "SpeedSensor (code 33)" and the "Coolant Temp Sensor (code 21)"
"Old" errors are stored in FE84 through FE86 in the same way.
STEP 9
Now I'm going to start with the Throttle Sensor. I want to find the subroutine that sets and clears bit 4 (0x10) of address FB86.
grep of the files reveals:
Func4197:41C2 15FB86D4 BCLR.B #4,@H'FB86:16
Func4197:41D9 15FB86C4 BSET.B #4,@H'FB86:16
Now I open Func4197 and have a look at the code:
4197 15FC2B80 MOV:G.B @H'FC2B:16,R0
419B 400A CMP:E.B #H'0A:8,R0
419D 2529 BCS H'41C8
419F 40F0 CMP:E.B #H'F0:8,R0
41A1 2225 BHI H'41C8
41A3 400F CMP:E.B #H'0F:8,R0
41A5 2504 BCS H'41AB
41A7 40C8 CMP:E.B #H'C8:8,R0
41A9 2306 BLS H'41B1
41AB 15FC9713 CLR.B @H'FC97:16
41AF 2032 BRA H'41E3
41B1 15FC9781 MOV:G.B @H'FC97:16,R1
41B5 2A07 BPL H'41BE
41B7 15FC970601 MOV:G.B #H'01:8,@H'FC97:16
41BC 2025 BRA H'41E3
41BE 4101 CMP:E.B #H'01:8,R1
41C0 251D BCS H'41DF
41C2 15FB86D4 BCLR.B #4,@H'FB86:16
41C6 201B BRA H'41E3
41C8 15FC9781 MOV:G.B @H'FC97:16,R1
41CC 2B07 BMI H'41D5
41CE 15FC970681 MOV:G.B #H'81:8,@H'FC97:16
41D3 200E BRA H'41E3
41D5 4182 CMP:E.B #H'82:8,R1
41D7 2506 BCS H'41DF
41D9 15FB86C4 BSET.B #4,@H'FB86:16
41DD 2004 BRA H'41E3
41DF 15FC9708 ADD:Q.B #1,@H'FC97:16
41E3 19 RTS
Looking at this, I think the TPS value is at FC2B. I also think that FC97 is a counter for the number of consecutive out-of-range readings that are allowed before the error code gets reported.
So, hopefully we just found the first parameter. I'm going to email Alexander and ask him to test it and see if it is correct.