Bench Testing MAP Sensor - Boost

A1C calibration can be modified and configured to operate all EFI-SD4x ECUs in 4 cylinder, 6 cylinder and 8 cylinder configurations.
wwhite
Posts: 316
Joined: 2021 Feb 16, 15:53
Location: Victoria, BC, Canada
Vehicle Information: 1994 Flarside, XLT, 351w E4OD
SD48b, Quarter Horse, Burn2

Re: Bench Testing MAP Sensor - Boost

Unread post by wwhite »

I'm feeling generous:

Code: Select all

 Func_adb4:
adb4: ff,ff,f8,00           func  65535,   248               # 256		
adb8: 00,b9,f8,00         func  47360,   248               # 185
adbc: 80,89,e8,00         func  35200,   232               # 137.5
adc0: 00,41,d8,00         func  16640,   216               #  65
adc4: 80,25,c0,00         func   9600,   192               #   37.5
adc8: 00,19,b8,00         func   6400,   184               #   25
adcc: 80,07,70,00         func   1920,   112               #     7.5
add0: 00,00,70,00         func      0,   112               #  
add4: 00,00,70,00         func      0,   112
FN095(TP_REL) = Provides reasonable engine load value if MAP sensor is faulty.
Input: TP - RATCH, counts; Output: MAP, in Hg.
jsa
Posts: 272
Joined: 2021 Feb 16, 15:46
Location: Australia
Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV

Binary Editor
ForDiag

Re: Bench Testing MAP Sensor - Boost

Unread post by jsa »

efloth wrote: 2022 Sep 15, 20:14 Thanks jsa!

Ok i've got the call and the function addressed. Now I'm confused about what arg 2 is. Is it the lookup value for the function...?

Code: Select all

Sub_38ff:
38ff: c3,e4,a2,58         stw   R58,[Re4+a2]     [122] = R58;
3903: ef,03,0e            call  4709             UUWFuncLU_4709 (
3906: fe,cd                     #arg 1              c1ac,
3908: 58,00                     #arg 2              58 );
R58 is the value used to lookup the function input column.

Code: Select all

   UUWFuncLU_4709:
4709: cc,36               pop   R36              R36 = pop();    # 0x3906
470b: b2,37,32            ldb   R32,[R36++]      R32 = [R36++];  # 0xFE
470e: b2,37,33            ldb   R33,[R36++]      R33 = [R36++];  # 0xCD
...
471f: b2,37,34            ldb   R34,[R36++]      R34 = [R36++];  # 0x58
4722: b2,37,35            ldb   R35,[R36++]      R35 = [R36++];  # 0x00
4725: c8,36               push  R36              push(R36);      # 0x390A
4727: a2,34,34            ldw   R34,[R34]        R34 = [R34];    # R34 = the value contained in 0x0058
   UUWFuncLU_472a:
472a: 8b,32,04,34         cmpw  R34,[R32+4]                      # Compare the input value contained in 0x0058
                                                                 # with the value at 0xC1B0
Your function is invalid.

Code: Select all

c1ac: 59,6c,00,00         func  27737,     0
c1b0: 64,5f,00,00         func  24420,     0
c1b4: 71,5a,00,00         func  23153,     0
c1b8: 7c,db,00,00         func  56188,     0
c1bc: 88,e0,00,00         func  57480,     0
c1c0: 96,72,00,00         func  29334,     0
c1c4: a2,3f,00,00         func  16290,     0
c1c8: ad,ff,00,00         func  65453,     0
c1cc: b9,ff,00,00         func  65465,     0
c1d0: c5,ff,00,00         func  65477,     0
c1d4: d1,ff,00,00         func  65489,     0
c1d8: dd,ff,00,00         func  65501,     0
c1dc: e9,ff,00,00         func  65513,     0
c1e0: f5,ff,ff,ff         func  65525, 65535
It must look like this one

Code: Select all

   Func_b96a:
b96a: ff,ff,00,40         func  65535, 16384
b96e: 56,36,00,40         func  13910, 16384
b972: 12,33,52,48         func  13074, 18514
b976: 3b,2f,b8,4e         func  12091, 20152
b97a: c1,2a,7b,54         func  10945, 21627
b97e: a2,25,29,5c         func   9634, 23593
b982: 10,20,1f,65         func   8208, 25887
b986: ec,19,14,6e         func   6636, 28180
b98a: 96,13,0a,77         func   5014, 30474
b98e: 2f,0d,14,7e         func   3375, 32276
b992: 98,06,66,86         func   1688, 34406
b996: 00,00,a4,90         func      0, 37028
Input column must range from 0xFFFF at the top to 0x0000 at the bottom.

So something like this, intermediate rows if you like...

Code: Select all

c1ac: ff,ff,ff,ff         func  65535, 65535
c1b0: f5,ff,ff,ff         func  65525, 65535
c1b4: e9,ff,00,00         func  65513,     0
c1b8: 00,00,00,00         func       0,    0
efloth
Posts: 298
Joined: 2021 Feb 15, 22:12
Location: Sacramento CA
Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1

Re: Bench Testing MAP Sensor - Boost

Unread post by efloth »

Thanks for the input guys. Do you suggest I leave the nested IF statements and just allow R58 to exceed 162hz? That would be pretty simple but I'm not sure if we would need additional slopes defined when in boost.

jsa, noted, thanks for clarifying proper function layout.

wwhite thank you: taking a look at the offset and slope code with the directives you supplied couldn't we just use the offsets to add to map_word? seems like a simple solution. I was under the impression that calling 4709 will interpolate so we wouldn't have to define all possible hertzes lol

Code: Select all

3977: a1,3f,a2,58         ldw   R58,a23f         R58 = a23f;
397b: a1,7e,53,56         ldw   R56,537e         R56 = 537e;
397f: a1,d3,15,5c         ldw   R5c,15d3         R5c = 15d3;
3983: 6c,56,58            ml2w  R58,R56          lR58 *= R56;
3986: 68,5c,5a            sb2w  R5a,R5c          R5a -= R5c;
3989: c3,e4,a6,5a         stw   R5a,[Re4+a6]     IMAP_WORD = R5a;
398d: 91,40,a0            orb   Ra0,40           B6_MUPET_FLAG_a0 = 1;
3990: 91,01,a1            orb   Ra1,1            B0_MAPUP_NORM_a1 = 1;
3993: 38,a7,19            jb    B0,Ra7,39af      if (B0_V_VACFLG_a7 = 0)  {
3996: 71,f7,a6            an2b  Ra6,f7           B3_MFMFLG_a6 = 0;
3999: c3,e4,a4,5a         stw   R5a,[Re4+a4]     MAP_WORD = R5a;
399d: 09,03,5a            shlw  R5a,3            R5a <<= 3;
39a0: b0,5b,ba            ldb   Rba,R5b          MAP = R5b;
39a3: 91,20,52            orb   R52,20           B5_ISF_UP_FLG_52 = 1;
39a6: c3,e4,a0,00         stw   R0,[Re4+a0]      DT12SA = 0;
39aa: c3,e4,a8,00         stw   R0,[Re4+a8]      MAPCNT = 0;
39ae: f0                  ret                    return; }

Another hurdle would be boosting past 255hz as that is the maximum currently (probably around 10psi). Could we reduce the resolution of that word without too much trouble? I don't understand the code well enough to know the pitfalls of attempting something like that.
efloth
Posts: 298
Joined: 2021 Feb 15, 22:12
Location: Sacramento CA
Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1

Re: Bench Testing MAP Sensor - Boost

Unread post by efloth »

Making some progress:

Code: Select all

MAP_CALC:
38ff: c3,e4,a2,58         stw   R58,[Re4+a2]     MAP_FREQ = R58;
3903: ef,03,0e            call  4709             UUWFuncLU_4709 (
3906: fe,cd                     #arg 1              Func_c1ac,
3908: 58,00                     #arg 2              58 );
390a: a2,38,56            ldw   R56,[R38]        R56 = [R38];
390d: ef,f9,0d            call  4709             UUWFuncLU_4709 (
3910: fe,ce                     #arg 1              Func_c2ac,
3912: 58,00                     #arg 2              58 );
3914: a2,38,5c            ldw   R5c,[R38]        R5c = [R38];

3917 -> 3982 = 0xff  ## fill ## 

3983: 6c,56,58            ml2w  R58,R56          lR58 *= R56;
3986: 68,5c,5a            sb2w  R5a,R5c          R5a -= R5c;
3989: c3,e4,a6,5a         stw   R5a,[Re4+a6]     IMAP_WORD = R5a;
398d: 91,40,a0            orb   Ra0,40           B6_MUPET_FLAG_a0 = 1;
3990: 91,01,a1            orb   Ra1,1            B0_MAPUP_NORM_a1 = 1;
3993: 38,a7,19            jb    B0,Ra7,39af      if (B0_V_VACFLG_a7 = 0)  {
3996: 71,f7,a6            an2b  Ra6,f7           B3_MFMFLG_a6 = 0;
3999: c3,e4,a4,5a         stw   R5a,[Re4+a4]     MAP_WORD = R5a;
399d: 09,03,5a            shlw  R5a,3            R5a <<= 3;
39a0: b0,5b,ba            ldb   Rba,R5b          MAP = R5b;
39a3: 91,20,52            orb   R52,20           B5_ISF_UP_FLG_52 = 1;
39a6: c3,e4,a0,00         stw   R0,[Re4+a0]      DT12SA = 0;
39aa: c3,e4,a8,00         stw   R0,[Re4+a8]      MAPCNT = 0;
39ae: f0                  ret                    return; }

Code: Select all

Func_c1ac:
c1ac: ff,ff,ee,26         func  65535,  9966
c1b0: ff,f5,80,2c         func  62975, 11392
c1b4: ff,e9,12,32         func  59903, 12818
c1b8: ff,dd,a4,37         func  56831, 14244
c1bc: ff,d1,36,3d         func  53759, 15670
c1c0: ff,c5,c8,42         func  50687, 17096
c1c4: ff,b9,5a,48         func  47615, 18522
c1c8: ff,ad,ec,4d         func  44543, 19948
c1cc: 3f,a2,7e,53         func  41535, 21374
c1d0: 72,96,10,59         func  38514, 22800
c1d4: e0,88,c4,5e         func  35040, 24260
c1d8: db,7c,88,63         func  31963, 25480
c1dc: 5a,71,f1,69         func  29018, 27121
c1e0: 5f,64,bd,6e         func  25695, 28349
c1e4: 6c,59,bd,6e         func  22892, 28349

Code: Select all

Func_c2ac:
c2ac: ff,ff,00,00         func  65535,     0
c2b0: ff,f5,00,00         func  62975,     0
c2b4: ff,e9,2f,02         func  59903,   559
c2b8: ff,dd,75,05         func  56831,  1397
c2bc: ff,d1,bb,08         func  53759,  2235
c2c0: ff,c5,01,0c         func  50687,  3073
c2c4: ff,b9,47,0f         func  47615,  3911
c2c8: ff,ad,8d,12         func  44543,  4749
c2cc: 3f,a2,d3,15         func  41535,  5587
c2d0: 72,96,19,19         func  38514,  6425
c2d4: e0,88,2a,1c         func  35040,  7210
c2d8: db,7c,7b,1e         func  31963,  7803
c2dc: 5a,71,4a,21         func  29018,  8522
c2e0: 5f,64,21,23         func  25695,  8993
c2e4: 6c,59,21,23         func  22892,  8993
efloth
Posts: 298
Joined: 2021 Feb 15, 22:12
Location: Sacramento CA
Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1

Re: Bench Testing MAP Sensor - Boost

Unread post by efloth »

Not sure I am using the correct opcode for reading R38 into R56 and R5c. The code does not work if I set it to A0 and the fuel pump just stays on. Using a2, Map_word is bouncing between 15.4 and 248. Do I need to clear R38 first?
jsa
Posts: 272
Joined: 2021 Feb 16, 15:46
Location: Australia
Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV

Binary Editor
ForDiag

Re: Bench Testing MAP Sensor - Boost

Unread post by jsa »

A2 will only work if R38 holds an address.

A0 requires R38 to hold data.

Functions are still not valid.
sailorbob
Posts: 21
Joined: 2021 Feb 15, 15:09
Location: UK
Vehicle Information: MR2 turbo / Lotus

Re: Bench Testing MAP Sensor - Boost

Unread post by sailorbob »

Another issue; you are not defining the clip limit values for FMAPn in your code.
efloth
Posts: 298
Joined: 2021 Feb 15, 22:12
Location: Sacramento CA
Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1

Re: Bench Testing MAP Sensor - Boost

Unread post by efloth »

I put the slope in offset functions on the back burner for now (I fixed the functions but still can't get the code to run, steep learning curve for me, thanks for all the input though).

A proof of concept turned out to be successful today using wwhite's suggestion. I successfully read map_word up to 238 on the dash using an air compressor to pressurize the map sensor. It wasn't very precise but at 5-7 PSI, map_word was reading around 60.

Using all the info you guys have provided so far we need to determine what the maximum safe limit is and prevent it from being exceeded, add additional nested if statements to define additional slopes and offsets in boost, and find out if there's any implications (and workaround if necessary) of bypassing the overflow detection code.

I simply changed line 3977 below to ff,ff,ff,ff.

Code: Select all

3977: a1,3f,a2,58         ldw   R58,a23f         R58 = a23f;
397b: a1,7e,53,56         ldw   R56,537e         R56 = 537e;
397f: a1,d3,15,5c         ldw   R5c,15d3         R5c = 15d3;
And same for 37ad below.

Code: Select all

Sub_378b:
378b: a3,e4,a8,5c         ldw   R5c,[Re4+a8]     R5c = MAPCNT;
378f: 3f,a5,03                jb    B7,Ra5,3795      if (B7_Ra5 = 0)  {
3792: 34,a4,20               jnb   B4,Ra4,37b5      if (B4_Ra4 = 0) goto 37b5; }
3795: 89,00,08,5c         cmpw  R5c,800
3799: d3,5d                      jnc   37f8             if (R5c < 800) goto 37f8;
379b: 4b,e4,18,6c,54      sb3w  R54,R6c,[Re4+18] R54 = R6c[198];
37a0: a1,ab,9a,58         ldw   R58,9aab         R58 = 9aab;
37a4: a1,5b,06,5a         ldw   R5a,65b          R5a = 65b;
37a8: 8c,54,58            divw  R58,R54          wR58 /= R54;
37ab: d5,04               jnv   37b1             if (OVF = 1)  {
37ad: a1,00,a5,58         ldw   R58,a500         R58 = a500; }
37b1: 29,4c               scall 38ff             MAP_CALC ();
37b3: 20,54               sjmp  3809             goto 3809; 
I'm open to any input you guys can/feel to share Thanks again for all the help. Next step will be actually turboing this thing.
jsa
Posts: 272
Joined: 2021 Feb 16, 15:46
Location: Australia
Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV

Binary Editor
ForDiag

Re: Bench Testing MAP Sensor - Boost

Unread post by jsa »

efloth wrote: 2022 Sep 23, 00:31 I fixed the functions but still can't get the code to run,
As the lookup is returning data in R38 you would also need to have used A0 as the opcode.

As a debugging tool, you could STW the various register values to an area in ram for logging to see what is happening in your code.
efloth
Posts: 298
Joined: 2021 Feb 15, 22:12
Location: Sacramento CA
Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1

Re: Bench Testing MAP Sensor - Boost

Unread post by efloth »

I tried this again today with a0. Same story. Data logging doesn't work when this error is occurring the items on the dash are either not updating or flickering back and forth between two values. I think r38 changing at this point in the code is causing the issue. Maybe I should store the value in r38 and put it back when I'm done? Is there a safe address zone for temporary storage somewhere?
Post Reply