Pages: [1]
Author Topic: Modern MAP Sensor Handling for ME7.x – 16-bit Clean Implementation  (Read 1501 times)
_nameless
Hero Member
*****

Karma: +371/-2040
Offline Offline

Posts: 2954




 16-bit MAP Sensor Patch for ME7.x (No 5120 Hack Required)
This patch extends the internal MAP pressure resolution on Bosch ME7.x ECUs, including ME7.5, ME7.1, and ME7.1.1, by upgrading the filtered pressure variable from 8-bit to 16-bit. It enables the use of 3 to 5 bar MAP sensors without needing the 5120 hack or any axis rescaling, resulting in a cleaner, more stable solution that integrates directly with factory logic.

The implementation adds a new 16-bit variable at RAM address 0x0040F0. A custom routine reads the raw 10-bit ADC value from the MAP sensor input (typically 0x0021F4), applies linear scaling based on a 0.5 to 4.5V sensor range, and writes the result to this new variable. The scaling used is: ((adc_raw - 102) * 400) / 819, which provides a pressure range of approximately 50 to 450 kPa. The original 8-bit variable at 0x0033F5 remains in use for compatibility, but key ECU logic and maps are updated to read from the new 16-bit value instead.

The scaling routine is injected at flash address 0x83FA00, and it is triggered via a CALL placed at 0x83F7F0. The following map read routines have been modified to support the 16-bit pressure value: KFLDIMX at 0x812914, KFLBTS at 0x81297C, KFLDRAPP at 0x81F628, KFLDHBN at 0x813FC4, and KFVPDKSD at 0x814458. These were originally reading from 0x0033F5 using MOVB AL,[0x0033F5]; they now use MOV AX,[0x0040F0] instead.

To adapt this patch to other ME7.x files, locate an unused 16-bit RAM variable for the pressure value, identify the appropriate ADC source address, and inject the scaling code in available flash space. Then hook it with a CALL instruction in a main loop or sensor routine, and update any maps or logic that reference the original 8-bit pressure variable. This method is flexible across ME7.5 and ME7.1 variants and avoids the complications of reinterpretation logic or scaled axes.

A patched binary is included for reference.
« Last Edit: May 31, 2025, 06:05:47 PM by _nameless » Logged

If you are broke or expecting free handouts DO NOT message me. I'll probably put you on blast if you do.
IamwhoIam
Hero Member
*****

Karma: +103/-1638
Offline Offline

Posts: 1097



That's a very cute solution, but what about requested pressure pvds_w or plsol_w? Particularly as you're saying the 5120 hack isn't needed anymore.
Logged

I have no logs because I have a boost gauge (makes things easier)
_nameless
Hero Member
*****

Karma: +371/-2040
Offline Offline

Posts: 2954




That's a very cute solution, but what about requested pressure pvds_w or plsol_w? Particularly as you're saying the 5120 hack isn't needed anymore.
1. Injected 16-bit MAP scaling routine at: 0x83FA00
   - Reads ADC raw from 0x0021F4
   - Scaling: ((adc_raw - 102) * 400) / 819
   - Result stored at 0x0040F0

2. Hooked new MAP routine using CALL at: 0x83F7F0

3. Updated pressure references in maps:
   - KFLDIMX @ 0x812914
   - KFLBTS @ 0x81297C
   - KFLDRAPP @ 0x81F628
   - KFLDHBN @ 0x813FC4
   - KFVPDKSD @ 0x814458
   Old: MOVB AL,[0x0033F5] → New: MOV AX,[0x0040F0]

4. Updated logic to correctly read:
   - PLSOL_W (requested load) from 0x0040F0
   - PVDS_W (driver throttle angle) corrected
« Last Edit: May 31, 2025, 06:06:03 PM by _nameless » Logged

If you are broke or expecting free handouts DO NOT message me. I'll probably put you on blast if you do.
prj
Hero Member
*****

Karma: +1104/-520
Offline Offline

Posts: 6189



The main issue is ps_w being capped out and the ECU not being able to calculate load anymore.
I don't see anything dealing with that.
It's not the sensor pressure variable that is a problem, it's the 2559 limit on manifold pressure, which has to be rescaled. It's not 8 bit, it's 16 bit.

So this does not solve anything really besides boost request. Proper 5120 mod is the superior solution and it's also what Bosch did on MED9 et al...
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
_nameless
Hero Member
*****

Karma: +371/-2040
Offline Offline

Posts: 2954




The main issue is ps_w being capped out and the ECU not being able to calculate load anymore.
I don't see anything dealing with that.
It's not the sensor pressure variable that is a problem, it's the 2559 limit on manifold pressure, which has to be rescaled. It's not 8 bit, it's 16 bit.

So this does not solve anything really besides boost request. Proper 5120 mod is the superior solution and it's also what Bosch did on MED9 et al...
Took another whack at it. I patched all the key pressure consumers — including KFLDIMX (0x812914), KFLDRAPP (0x81F628), KFLBTS, KFLDHBN, and KFVPDKSD — to use MOV AX, [0x0040F0] instead of the original 8-bit MOVB AL, [0x0033F5]. With that change, the full 16-bit MAP value now flows into the load calculation path, and PS_W is no longer artificially limited.
Recap of what has been done:
1. 16-bit MAP Scaling Logic
- Routine address: 0x83FA00
- Reads 10-bit ADC from: 0x0021F4
- Scaling formula: ((adc_raw - 102) * 400) / 819
- Output stored in RAM at: 0x0040F0
- CALL to scaling routine inserted at: 0x83F7F0 (CALL 0x83FA00)
2. PS_W Path Correction
To ensure PS_W and load logic use the new 16-bit MAP value, references to the original 8-bit source (0x0033F5) were
replaced.
Patched locations (replaced with MOV AX, [0x0040F0]):
- KFLDIMX: 0x812914
- KFLBTS: 0x81297C
- KFLDRAPP: 0x81F628
- KFLDHBN: 0x813FC4
- KFVPDKSD: 0x814458
3. Load Axis Extensions (0-300%)
All 16-point X-axes were extended from 0-191% to 0-300% load.
Patched axis locations:
- KFMIRL axis: 0x1CE0D8
- LAMFA axis: 0x1CE830
- KFMIOP axis: 0x1CE9A4
- KFMIOPU axis: 0x1CEA00
- KFLDIMX axis: 0x1D1F3C
- KFLDRL axis: 0x1CF458
New axis values: 0, 20, 40, ..., 300 (%)
4. Map Rescaling
Maps were rescaled to fit the new load axis using interpolation based on their original shape.
Patched map locations:
- KFMIRL: 0x1CDA7C
- LAMFA: 0x1CE5A0
- KFMIOP: 0x1CE6E8
- KFMIOPU: 0x1CE774
- KFLDIMX: 0x1D1F4C
- KFLDRL: 0x1CF198
5. Logic Summary
This patch removes the need for the traditional 5120 hack by:
- Using a true 16-bit pressure value throughout the ECU logic
- Allowing PS_W to exceed 2559 mBar
- Maintaining full compatibility with stock logic flow

« Last Edit: May 31, 2025, 06:06:30 PM by _nameless » Logged

If you are broke or expecting free handouts DO NOT message me. I'll probably put you on blast if you do.
prj
Hero Member
*****

Karma: +1104/-520
Offline Offline

Posts: 6189



The factory (Bosch) did 5120 mod on all the newer ECU's. There is no issues with 5120 mod either when done right.
I don't see the point in this giant hack whatsoever.

There's even a few native ME7 5120 out in the wild.
« Last Edit: May 17, 2025, 04:20:15 PM by prj » Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
iLimitless
Jr. Member
**

Karma: +2/-1
Offline Offline

Posts: 36



Took another whack at it. I patched all the key pressure consumers — including KFLDIMX (0x812914), KFLDRAPP (0x81F628), KFLBTS, KFLDHBN, and KFVPDKSD — to use MOV AX, [0x0040F0] instead of the original 8-bit MOVB AL, [0x0033F5]. With that change, the full 16-bit MAP value now flows into the load calculation path, and PS_W is no longer artificially limited.
Recap of what has been done:
1. 16-bit MAP Scaling Logic
- Routine address: 0x83FA00
- Reads 10-bit ADC from: 0x0021F4
- Scaling formula: ((adc_raw - 102) * 400) / 819
- Output stored in RAM at: 0x0040F0
- CALL to scaling routine inserted at: 0x83F7F0 (CALL 0x83FA00)
2. PS_W Path Correction
To ensure PS_W and load logic use the new 16-bit MAP value, references to the original 8-bit source (0x0033F5) were
replaced.
Patched locations (replaced with MOV AX, [0x0040F0]):
- KFLDIMX: 0x812914
- KFLBTS: 0x81297C
- KFLDRAPP: 0x81F628
- KFLDHBN: 0x813FC4
- KFVPDKSD: 0x814458
3. Load Axis Extensions (0-300%)
All 16-point X-axes were extended from 0-191% to 0-300% load.
Patched axis locations:
- KFMIRL axis: 0x1CE0D8
- LAMFA axis: 0x1CE830
- KFMIOP axis: 0x1CE9A4
- KFMIOPU axis: 0x1CEA00
- KFLDIMX axis: 0x1D1F3C
- KFLDRL axis: 0x1CF458
New axis values: 0, 20, 40, ..., 300 (%)
4. Map Rescaling
Maps were rescaled to fit the new load axis using interpolation based on their original shape.
Patched map locations:
- KFMIRL: 0x1CDA7C
- LAMFA: 0x1CE5A0
- KFMIOP: 0x1CE6E8
- KFMIOPU: 0x1CE774
- KFLDIMX: 0x1D1F4C
- KFLDRL: 0x1CF198
5. Logic Summary
This patch removes the need for the traditional 5120 hack by:
- Using a true 16-bit pressure value throughout the ECU logic
- Allowing PS_W to exceed 2559 mBar
- Maintaining full compatibility with stock logic flow




Something its wrong with file size, i cant open it in WinOls 1025kb instead of 1024kb. I would like to try out your awesome work but cant open it at all, can you reuload your file once more?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.063 seconds with 15 queries. (Pretty URLs adds 0.008s, 0q)