map/boost over OBD2 on evo9
map/boost over OBD2 on evo9
I have an evo9 with an aeroforce OBD2 gauge that replaced an AEM boost gauge using the analog input and AEM sensor. It worked for several years but eventually the sensor failed. Went through 2 ebay sensors which also failed in a few months and finally gave up. It's frustrating that the 8/9s come stock with 1 bar MAP sensors and the JDM/X sensor doesn't have the right scaled output over OBD2. So I decided to modify the scaling as a small project to learn more about the ECU:
This code is 2 cases in a switch statement for LTFT and MAP output to OBD. It's basically filling in some data into RAM which represents the packet. The compiler left a bunch of NOPs in the delay slots which helps to make room for more code without branching somewhere.
Here is the modification where the MAP value is scaled up by 1/4+1/16 for the JDM sensor. It's missing a saturation check and could use another 1/32 increase.
Now I have a working boost gauge using OBD2 without having to worry about wiring an additional sensor that will fail. The engine and turbo are stock so the 8-bit MAP value is enough to cover the boost range.
The code output comes from sh2dis which is great for getting a quick text disassembly.
JDM map sensor: https://www.evolutionm.net/forums/ec...tructions.html
disassembler: https://www.evolutionm.net/forums/ec...assembler.html
This code is 2 cases in a switch statement for LTFT and MAP output to OBD. It's basically filling in some data into RAM which represents the packet. The compiler left a bunch of NOPs in the delay slots which helps to make room for more code without branching somewhere.
Code:
0003A9D0 sub_3A9D0: 64 13 mov r1, r4 ! XREF: word_3A88A 0003A9D2 B4 91 bsr sub_3B2F8 0003A9D4 00 09 nop 0003A9D6 DA 3F mov.l @(0xFC,pc), r10 0003A9D8 2A 01 mov.w r0, @r10 0003A9DA A0 C3 bra sub_3AB64 0003A9DC 00 09 nop 0003A9DE sub_3A9DE: DA 3E mov.l @(0xF8,pc), r10 0003A9E0 6A A1 mov.w @r10, r10 0003A9E2 6A AD extu.w r10, r10 0003A9E4 4A 01 shlr r10 0003A9E6 DB 3B mov.l @(0xEC,pc), r11 0003A9E8 2B A1 mov.w r10, @r11 0003A9EA A0 BB bra sub_3AB64 0003A9EC 00 09 nop
Code:
0003A9D0 sub_3A9D0: B4 92 bsr sub_3B2F8 ! XREF: word_3A88A 0003A9D2 64 13 mov r1, r4 0003A9D4 DA 3F mov.l @(0xFC,pc), r10 0003A9D6 A0 C5 bra sub_3AB64 0003A9D8 2A 01 mov.w r0, @r10 0003A9DA sub_3A9DA: DA 3F mov.l @(0xFC,pc), r10 0003A9DC 6A A1 mov.w @r10, r10 0003A9DE 6B A3 mov r10, r11 0003A9E0 4B 09 shlr2 r11 0003A9E2 3A BC add r11, r10 0003A9E4 4B 09 shlr2 r11 0003A9E6 3A BC add r11, r10 0003A9E8 DB 3A mov.l @(0xE8,pc), r11 0003A9EA A0 BB bra sub_3AB64 0003A9EC 2B A1 mov.w r10, @r11
The code output comes from sh2dis which is great for getting a quick text disassembly.
JDM map sensor: https://www.evolutionm.net/forums/ec...tructions.html
disassembler: https://www.evolutionm.net/forums/ec...assembler.html
Nice!
I love seeing folks still tinkering around with the stock ecu. If it helps, this online dissasembler has SH2 support, and will calculate the PC relative addresses for you.
https://onlinedisassembler.com/static/home/index.html
https://onlinedisassembler.com/static/home/index.html
Thread
Thread Starter
Forum
Replies
Last Post
Womb Raider
General Engine Management / Tuning Forum
9
Mar 10, 2019 03:01 PM







