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.
jsa
Posts: 274
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 »

For logging you need to stw to a spare ram address, say 0xDf0 through 0xDfe right after the function look up returns. R38 is a scratch reg so it it overwritten by all sorts.
wwhite
Posts: 320
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 »

efloth wrote: 2022 Sep 28, 19:08 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?

Code: Select all

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];
You need to datalog R56 and R5c. Those will contain the changing value of R38.
R38 is the output that is stored in R56 then R5c, no need to store it again.
jsa
Posts: 274
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 »

It is not clear to me that R56 & R5C are unchanged elsewhere in the bin. One needs to understand the whole bin. So I suggested storing the values elsewhere for bug finding purposes.

I also take patchcode issues out of the picture for debug purposes.
wwhite
Posts: 320
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 »

Code: Select all

R5C = OFSET#(1-6) = Offset for the sixth linear equation describing MAP as a function of frequency and inches of Hg.
R56 = SLOPE#(1-6) = Slope for the first linear equation for MAP.

MAP_FREQ = [(ISF + 6 + lsf) * 0.5] / DT12SA
MAP_WORD = SLOPE(x) * MAP_FREQ - OFSET(x)
If you logging MAP_WORD, I see not point in logging R5C(ofset) or R56(slope).
efloth
Posts: 300
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'll be testing this theory today.

Code: Select all

MAP_CALC:
38ff: c3,e4,a2,58         stw   R58,[Re4+a2]     MAP_FREQ = R58;
3903: a1,f0,0d,f0         ldw   Rf0,df0          Rf0 = df0;
3907: c3,f0,00,38         stw   R38,[Rf0+0]      [Rf0+0] = R38;
390b: ef,fb,0d            call  4709             UUWFuncLU_4709 (
390e: fe,cd                     #arg 1              Func_c1ac,
3910: 58,00                     #arg 2              58 );
3912: a0,38,56            ldw   R56,R38          R56 = R38;
3915: ef,f1,0d            call  4709             UUWFuncLU_4709 (
3918: fe,ce                     #arg 1              Func_c2ac,
391a: 58,00                     #arg 2              58 );
391c: a0,38,56            ldw   R56,R38          R56 = R38;
391f: a3,f0,00,38         ldw   R38,[Rf0+0]      R38 = [Rf0+0];
3923: 20,5e               sjmp  3983             goto 3983;

3925 -> 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; }

39af: 91,08,a6            orb   Ra6,8            B3_MFMFLG_a6 = 1;
39b2: 27,ef               sjmp  39a3             goto 39a3;
wwhite
Posts: 320
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 »

efloth wrote: 2022 Oct 20, 15:48 I'll be testing this theory today.
Your code snippet is, um, not correct. R56 is written twice first value set by Func_c1ac is overwritten when Func_c2ac sets R56 again.
R5C is not set.

Not sure if you realize the code changes you have made do not look correct to me.
efloth
Posts: 300
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 »

wwhite wrote: 2022 Oct 20, 23:04
efloth wrote: 2022 Oct 20, 15:48 I'll be testing this theory today.
Your code snippet is, um, not correct. R56 is written twice first value set by Func_c1ac is overwritten when Func_c2ac sets R56 again.
R5C is not set.

Not sure if you realize the code changes you have made do not look correct to me.
Nice catch! Thanks for proof reading my code The second function should be written to R5c as before.
efloth
Posts: 300
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 »

wwhite wrote: 2022 Oct 20, 23:04
efloth wrote: 2022 Oct 20, 15:48 I'll be testing this theory today.
Your code snippet is, um, not correct. R56 is written twice first value set by Func_c1ac is overwritten when Func_c2ac sets R56 again.
R5C is not set.

Not sure if you realize the code changes you have made do not look correct to me.
Nice catch! Thanks for proof reading my code The second function should be written to R5c as before.
jsa
Posts: 274
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 »

Rf0 is typically an Rbase, so you don't want to overwrite it.

Code: Select all

Rf0 = df0
You can STW to [R0+DF0]

Code: Select all

c3,01,F0,0D,38
efloth
Posts: 300
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 »

This code works beautifully on the bench using compressed air. Map_word appears to be correct but I'm not sure how mapope is calculated. Anyone have a turbo setup to try this on?

Code: Select all

MAP_CALC:
c200: 89,6c,59,58         cmpw  R58,596c         
c204: db,0e               jc    c214             if (R58 < 596c)  {
c206: a1,6c,59,58         ldw   R58,596c         R58 = 596c;
c20a: a1,bd,6c,56         ldw   R56,6cbd         R56 = 6cbd;
c20e: a1,21,23,5c         ldw   R5c,2321         R5c = 2321;
c212: 20,de               sjmp  c2f2             goto c2f2; }

c214: 89,5f,64,58         cmpw  R58,645f         
c218: db,0a               jc    c224             if (R58 < 645f)  {
c21a: a1,bd,6e,56         ldw   R56,6ebd         R56 = 6ebd;
c21e: a1,21,23,5c         ldw   R5c,2321         R5c = 2321;
c222: 20,ce               sjmp  c2f2             goto c2f2; }

c224: 89,5a,71,58         cmpw  R58,715a         
c228: db,0a               jc    c234             if (R58 < 715a)  {
c22a: a1,f1,69,56         ldw   R56,69f1         R56 = 69f1;
c22e: a1,4a,21,5c         ldw   R5c,214a         R5c = 214a;
c232: 20,be               sjmp  c2f2             goto c2f2; }

c234: 89,db,7c,58         cmpw  R58,7cdb         
c238: db,0a               jc    c244             if (R58 < 7cdb)  {
c23a: a1,88,63,56         ldw   R56,6388         R56 = 6388;
c23e: a1,7b,1e,5c         ldw   R5c,1e7b         R5c = 1e7b;
c242: 20,ae               sjmp  c2f2             goto c2f2; }

c244: 89,e0,88,58         cmpw  R58,88e0         
c248: db,0a               jc    c254             if (R58 < 88e0)  {
c24a: a1,c4,5e,56         ldw   R56,5ec4         R56 = 5ec4;
c24e: a1,2a,1c,5c         ldw   R5c,1c2a         R5c = 1c2a;
c252: 20,9e               sjmp  c2f2             goto c2f2; }

c254: 89,72,96,58         cmpw  R58,9672         
c258: db,0a               jc    c264             if (R58 < 9672)  {
c25a: a1,10,59,56         ldw   R56,5910         R56 = 5910;
c25e: a1,19,19,5c         ldw   R5c,1919         R5c = 1919;
c262: 20,8e               sjmp  c2f2             goto c2f2; }

c264: 89,3f,a2,58         cmpw  R58,a23f         
c268: db,0a               jc    c274             if (R58 < a23f)  {
c26a: a1,7e,53,56         ldw   R56,537e         R56 = 537e;
c26e: a1,d3,15,5c         ldw   R5c,15d3         R5c = 15d3;
c272: 20,7e               sjmp  c2f2             goto c2f2; }

c274: 89,ff,ad,58         cmpw  R58,adff         
c278: db,0a               jc    c284             if (R58 < adff)  {
c27a: a1,00,4e,56         ldw   R56,4e00         R56 = 4e00;
c27e: a1,00,13,5c         ldw   R5c,1300         R5c = 1300;
c282: 20,6e               sjmp  c2f2             goto c2f2; }

c284: 89,ff,b9,58         cmpw  R58,b9ff         
c288: db,0a               jc    c294             if (R58 < b9ff)  {
c28a: a1,00,49,56         ldw   R56,4900         R56 = 4900;
c28e: a1,00,11,5c         ldw   R5c,1100         R5c = 1100;
c292: 20,5e               sjmp  c2f2             goto c2f2; }

c294: 89,ff,c5,58         cmpw  R58,c5ff         
c298: db,0a               jc    c2a4             if (R58 < c5ff)  {
c29a: a1,00,44,56         ldw   R56,4400         R56 = 4400;
c29e: a1,00,0e,5c         ldw   R5c,e00          R5c = e00;
c2a2: 20,4e               sjmp  c2f2             goto c2f2; }

c2a4: 89,ff,d1,58         cmpw  R58,d1ff         
c2a8: db,0a               jc    c2b4             if (R58 < d1ff)  {
c2aa: a1,00,3f,56         ldw   R56,3f00         R56 = 3f00;
c2ae: a1,00,0c,5c         ldw   R5c,c00          R5c = c00;
c2b2: 20,3e               sjmp  c2f2             goto c2f2; }

c2b4: 89,ff,dd,58         cmpw  R58,ddff         
c2b8: db,0a               jc    c2c4             if (R58 < ddff)  {
c2ba: a1,00,3a,56         ldw   R56,3a00         R56 = 3a00;
c2be: a1,00,0a,5c         ldw   R5c,a00          R5c = a00;
c2c2: 20,2e               sjmp  c2f2             goto c2f2; }

c2c4: 89,ff,e9,58         cmpw  R58,e9ff         
c2c8: db,0a               jc    c2d4             if (R58 < e9ff)  {
c2ca: a1,00,35,56         ldw   R56,3500         R56 = 3500;
c2ce: a1,00,07,5c         ldw   R5c,700          R5c = 700;
c2d2: 20,2e               sjmp  c302             goto c302; }

c2d4: 89,ff,f5,58         cmpw  R58,f5ff         
c2d8: db,0a               jc    c2e4             if (R58 < f5ff)  {
c2da: a1,00,30,56         ldw   R56,3000         R56 = 3000;
c2de: a1,00,05,5c         ldw   R5c,500          R5c = 500;
c2e2: 20,0e               sjmp  c2f2             goto c2f2; }

c2e4: a1,ff,ff,58         ldw   R58,ffff         R58 = ffff;
c2e8: db,0a               jc    c2f4             if (R58 < f5ff)  {
c2ea: a1,00,2a,56         ldw   R56,2a00         R56 = 2a00;
c2ee: a1,00,02,5c         ldw   R5c,200          R5c = 200;
c2f2: 6c,56,58            ml2w  R58,R56          lR58 *= R56;
c2f5: 68,5c,5a            sb2w  R5a,R5c          R5a -= R5c;
c2f8: c3,e4,a6,5a         stw   R5a,[Re4+a6]     IMAP_WORD = R5a;
c2fc: 91,40,a0            orb   Ra0,40           B6_MUPET_FLAG_a0 = 1;
c2ff: 91,01,a1            orb   Ra1,1            B0_MAPUP_NORM_a1 = 1;
c302: 38,a7,19            jb    B0,Ra7,c31e      if (B0_V_VACFLG_a7 = 0)  {
c305: 71,f7,a6            an2b  Ra6,f7           B3_MFMFLG_a6 = 0;
c308: c3,e4,a4,5a         stw   R5a,[Re4+a4]     MAP_WORD = R5a;
c30c: 09,03,5a            shlw  R5a,3            R5a <<= 3;
c30f: b0,5b,ba            ldb   Rba,R5b          MAP = R5b;
c312: 91,20,52            orb   R52,20           B5_ISF_UP_FLG_52 = 1;
c315: c3,e4,a0,00         stw   R0,[Re4+a0]      DT12SA = 0;
c319: c3,e4,a8,00         stw   R0,[Re4+a8]      MAPCNT = 0;
c31d: f0                  ret                    return; }

c31e -> ffff = 0xff  ## fill ## 
Post Reply