Looking for some help with a modified program

For discussion and distribution of custom code and hacks
Site Admin
User avatar
Posts: 5679
Joined: Sat Feb 28, 2009 8:34 pm

Re: Looking for some help with a modified program

Postby antus » Wed May 31, 2017 9:04 am

The last 3 bytes line up so this is likely to do with mapping. The patch shows bytes as they are mapped in the pcm and the xdf has a header offset. Consider how the bin is split in the pcm for the two sides and mapped, and the global xdf offset.

Also identify where the checksum bytes are, you might be able to patch outside of TP then load the bin and it should correct checksum on save. Just verify everything looks right before flashing.
Have you read the FAQ? For lots of information and links to significant threads see here: viewtopic.php?f=7&t=1396

User avatar
Posts: 495
Joined: Thu Sep 17, 2009 2:00 pm
Location: Perth, WA

Re: Looking for some help with a modified program

Postby charlay86 » Sat Jun 03, 2017 4:37 pm

Xnke wrote:So here is the big issue right now. I have NO idea if the patch has different locations in it, or if the XDF needs offsets added/subtracted to make sense of the split-bin thing, but the locations that are edited in the XDF are VERY different than the locations being called for in the patch notes. The reason for doing it via the XDF is checksum calculations-Tunerpro handles that when using the patch function.

I have attached the new attempt at getting the data transferred across the from E-side to T-side, but when I go to edit the patch in the XDF, I find a LOT of things very different.

For example, the line that changes the spark table to 0-6400RPM:

Patch Notes:
4D5A:
$65 65 ;changes spark table to 0-6400RPM range

Actual XDF Patch:
1D5A:
New Data: 65 Old data: 61

That looks OK...

Then we get to the next few lines:

Patch Notes:
Code: Select all
1BAR emulation

99D6:
JSR L9410         BD 94 10

9BC3:
JSR L9410         BD 94 10

BD10:
JSR L940D         BD 94 0D

CCA1:
JMP L942F         7E 94 2F


940D:
LDAA L1031         B6 10 31


But then looking at the locations in the XDF:

99D6 seems to line up with 19D6
9BC3 seems to line up with 1BC3
BD10 seems to line up with 3D10
CCA1 seems to line up with 4CA1
940D seems to line up with 140D

But I have no way to really know...and patching the wrong sections of code means certain death to another PCM. I'd really rather not go through the process of disassembling the PCM again and burning the FLASH chips and re-assembling the PCM again-it isn't all that reliable and so far none of the socketed PCMs work exactly the same as they used to. They *work*, but Winflash complains about wrong responses at the end of the flash, wheras the stock unsocketed PCMs never complain.

If I can get the boost patch to work, and figure out if there is an offset for E-side code or if the numbers are just a bit off, then I can go ahead and write in the patch for the wideband sensor and get that going in the XDF as well.


The offset of 0x8000 in the xdf is to be expected.
The bin file loaded into tunerpro is the contents of the two flash chips stacked into one file.

addresses 0x0000 - 0x7FFF in tunerpro will map to the *E-side memory 0x8000-0xFFFF
addresses 0x8000 - 0xFFFF in tunerpro will map to the *T-side memory 0x8000-0xFFFF

* I'm not sure which way they have been stacked but you get the idea

Posts: 32
Joined: Thu Sep 24, 2015 1:42 pm

Re: Looking for some help with a modified program

Postby Xnke » Sat Jun 03, 2017 5:04 pm

You got the stacking correct-I subtracted 0x8000 from the E-side locations (but I didn't in the actual code, just the locations!) so tunerpro would understand it. With any luck, tomorrow will be the day I shout and laugh when this thing works properly.

I *just* finished writing the patch data into Tunerpro, and it checksums correctly. I have dumped it to the PCM, and was able to read it back, so at least the PCM isn't bricked, even if the code doesn't work.

Posts: 32
Joined: Thu Sep 24, 2015 1:42 pm

Re: Looking for some help with a modified program

Postby Xnke » Tue Jun 27, 2017 9:05 am

Thanks to Charlay86, this code is mostly working. Only a few little details to work, but they'll come eventually.

Now to work on getting the logs into something usable!

Site Admin
User avatar
Posts: 5679
Joined: Sat Feb 28, 2009 8:34 pm

Re: Looking for some help with a modified program

Postby antus » Tue Jun 27, 2017 9:22 am

Excellent news! Great work, both of you!
Have you read the FAQ? For lots of information and links to significant threads see here: viewtopic.php?f=7&t=1396

Posts: 32
Joined: Thu Sep 24, 2015 1:42 pm

Re: Looking for some help with a modified program

Postby Xnke » Sat Jun 09, 2018 12:55 pm

OK, so near enough as makes no difference to a year ago, Charlay86 and I got this going. The truck returns 30+MPG/7.7L/100km or better currently, and there are only a few things left to do:

Fix the take-fun-out table (boost control/bypass method/table, probably gonna use some EGR code?)
Make the A/C work properly (if MAP is above 50kpA, A/C clutch is disabled. Can't find anything in the existing XDF to fix this...)
Test this with a 4L60E transmission (currently it should all work but haven't tried it yet.)

For the TKFNOUT table, I'm not too sure what I can do there. I have three on/off EGR outputs that are more than capable of controlling the L67 boost control solenoid, and there is no EGR control on this engine anymore. Some of the EGR output code can likely be deleted to make room.

As far as the A/C, I have no idea what it could be. These exisiting things supposedly affect it:

N/V ratio to use A/C WOT disable
A/C WOT TPS Disable above
A/C MAX RPM above which disables

and best I can tell all of these are set to numbers that should prevent them from being the culprit. N/V ratio stands for eNgine/Vehicle speed ratio, so engine RPM/speedometer MPH. A/C WOT TPS is set to 100%, so anything under 100% should not disable the A/C. A/C max RPM is set to 6350RPM, which seems to be the max RPM this PCM deals with for a lot of things.

I am pretty stuck on these two things.

Posts: 32
Joined: Thu Sep 24, 2015 1:42 pm

Re: Looking for some help with a modified program

Postby Xnke » Thu Jun 14, 2018 12:09 pm

Still hunting the A/C buzzkill...it's 34C when I drive home from work a lot of days here and I only have A/C if my MAP value is less than 50KpA. There's nothing in the current XDF that links A/C clutch disable/enable with MAP, and I'm hunting through the dissassembly and not finding much. Mostly on the T-Side, I can find this:

RAM:0089 ; A/C BIT STATUS WORD
RAM:0089 ; 0 0 = A/C CLUTCH ENABLED
RAM:0089 ; 1 1 = A/C WOT LOGIC USING N/V TIME THRESHOLD
RAM:0089 ; 2 1 = A/C PRESSURE REQUESTS FAN
RAM:0089 ; 3 1 = A/C PRESSURE REQUESTS FAN # 2
RAM:0089 ; 4 1 = A/C LOAD SWAP (A/C FORCED OFF)
RAM:0089 ; 5 1 = A/C OLD (6.25 MS.) 3RD GEAR FLAG
RAM:0089 ; 6 1 = A/C EVAP TEMPERATURE CLUTCH DISABLE (F-only?)
RAM:0089 ; 7 1 = A/C CFIV FREON LOW CLUTCH DISABLE (F-only?)

It seems that if I can figure out what byte 0089 bit 4, does, I might have a chance at fixing this. I suspect it's just another location that needs to pick up the new 2-bar map value, because if it's meant to force the A/C off at max load of 100kpA, and it did NOT get the new 2-bar map value, it would tend to force the A/C off at the 50kpA with the new MAP sensor. Problem is, I don't have the slightest idea of how or where to find it.

I don't think it's bit 6 or 7, as bit 6 is disabled and bit 7 isn't being toggled (it's currently in the ADX as part of the datastream). Currently, the ADX is logging bit 0, bit 2, bit 3.

Site Admin
User avatar
Posts: 5679
Joined: Sat Feb 28, 2009 8:34 pm

Re: Looking for some help with a modified program

Postby antus » Thu Jun 14, 2018 5:16 pm

It could be looking at voltage before processing too.
Have you read the FAQ? For lots of information and links to significant threads see here: viewtopic.php?f=7&t=1396

Posts: 32
Joined: Thu Sep 24, 2015 1:42 pm

Re: Looking for some help with a modified program

Postby Xnke » Fri Jun 15, 2018 1:55 pm

Not sure what you're getting at there with the voltage. I can drive along and have the air running, it'll get nice and frosty in the cab of the truck if I keep the manifold vacuum below 50kpA. I can then toe into it and push manifold vacuum to 55kpA, and the air will shut off, drop back to <50kpA and it'll turn right back on, and if you're cruising along at 50kpA, as you tip to <50kpA or >50kpA, the air will chatter on and off. No hysteresis values are being used to manage the air on/off. Sometimes it'll chatter and bark as it tries to engage while loaded, it takes a few seconds for the head pressure to bleed down on the compressor!

In other news I did put a new alternator on, on Wednesday. The problem didn't change at all, but at least now I have 13.8v at the battery, instead of 12 volts...the old alternator would JUST barely keep up with keeping the battery up. It'll get rebuilt with new guts and kept as a core.

I thought it was a mechanical problem, but watching the datalog, you'll see it say A/C Request: YES, A/C Clutch: ENABLED, A/C CLUTCH ENGAGED: YES then as you nose over 50kpA, it says A/C Request: YES, A/C Clutch: (blank space), A/C CLUTCH ENGAGED: NO, indicating that AC is being requested, but is being disabled and is not being commanded on.

The clutch engaged wiring really monitors the status of the A/C relay, if the relay has kicked and applied voltage to the compressor coil, 12 volts is also routed back to the PCM on the sense wire to tell the PCM that yep, the relay is supplying 12V to the coil. This is used in the T-side code to detect if the Freon level in the system is low, the low-pressure cutout will open the circuit between the switched power and the relay common terminal, preventing the compressor coil from receiving 12V and by extension the PCM input line from receiving 12V.

Posts: 334
Joined: Thu May 03, 2012 10:50 pm
Location: Castlemaine, Vic

Re: Looking for some help with a modified program

Postby pman92 » Fri Jun 15, 2018 2:40 pm

By voltage I think antus means with the new 2 bar map sensor, 100KPa will be half way along the scale say 2.5v.
With the 1 bar map sensor, half way along the scale (say 2.5v) would be 50kpa.

So with the new sensor, 50kpa will be a quarter of the scale (say 1.25v), which woild of been 25 or 75kpa or whatever with the 1 bar sensor.

So if it's looking at raw voltage and assuming a 1 bar sensor, it will be cutting off bwcause its under 25kpa or over 75kpa or something
VR-VY Holden BCM Simulator: LINK
Ford Smartlock Bypass Module: LINK

PreviousNext

Return to Custom Code

Who is online

Users browsing this forum: No registered users and 3 guests