What this code does
Engine temperature
Below 190F, fan off
Above 199F, fan turns on
above 210F, fan forced on regardless of other conditions
If the vehicle speed is above 25 MPH, the fan turns off unless the 45 seconds has not elapsed, or the temperature is very high (above 210F) in which case the fan will run at any vehicle speed.
The fan is turned on when the A/C Clutch is engaged. Unless the vehicle speed is above 25 MPH.
The code includes a 45 second absolute minimum fan run time. This was the big change from my last code. I added this condition so that if the A/C Compressor is cycling every 10 seconds, its not beating the fan, relay and electrical system up. It was also needed because of the 25 MPH fan rule, where if you were driving along at 24-26 MPH, the fan would cycle with subtle changes in speed. This solved that issue.
You can add the calibrations at locations L7000-L7004 to your preferred editor to allow you to change the values you would like to use for temperature, speed, or even the minimum fan run time using your editor program.
Code:
Ram Variables:
L02A7 = MPH
L00A2 = Coolant Temp
L004D,BIT 0 = A/C STATUS (1 = A/C Requested on)
L0052,BIT 3 = Fan Output Control
L0150 = Minimum Fan Run Timer
To enable this routine, be sure to change the Value at address 7C6F from D399 to 7020
Connect the fan relay to E3, Connect the other end of the relay coil to Power. The computer GROUNDS E3 to run the fan.
Coolant temp example:
199 deg F
199 + 40 = 239
239/1.35 = 177.04 (round to 177)
177 is B1 in hexidecimal.
Calibrations:
L7000 19 db High MPH Fan Cutoff (25 MPH)
L7001 B9 db Coolant Temperature Very High Value Enable (210 deg F)
L7002 B1 db Coolant Temperature High Value Enable (199 deg F)
L7003 AA db Coolant Temperature Low Value Disable (190 deg F)
L7004 2D db Minimum Fan Run "MFR" Time (45 Seconds)
Algorithms:
L7020 CE 70 00 L7020 LDX #L7000 Start of fan Calibrations
L7023 12 52 08 1F BRSET L0052,#$08,L7046 If Fan is On, Skip to "Load MFR Timer Variable"
L7027 96 A2 LDAA L00A2 Load Coolant Temperature
L7029 A1 01 CMPA 1,X Compare to Coolant Temperature Very High Value
L702B 22 11 BHI L703E Go to "Turn On Fan" if Higher
L702D 12 4D 01 06 BRSET L004D,#$01,L7037 If A/C is On, Go To "Load MPH"
L7031 96 A2 LDAA L00A2 Load Coolant Temperature
L7033 A1 02 CMPA 2,X Compare to Coolant Temperature High Value Enable
L7035 23 37 BLS L706E Go To "End" if Lower
L7037 B6 02 A7 L7037 LDAA L02A7 Load MPH
L703A A1 00 CMPA 0,X Compare to High MPH Fan Cutoff
L703C 22 30 BHI L706E Go to "End" if Higher
L703E 14 52 08 L703E BSET L0052,#$08 Turn on Fan
L7041 A6 04 LDAA 4,X Load MFR Timer
L7043 B7 01 50 STAA L0150 Save MFR Timer to L0150
L7046 B6 01 50 L7046 LDAA L0150 Load MFR Timer Variable
L7049 26 16 BNE L7061 If timer is Not Zero go to "Load MFR Timer Variable"
L704B 12 4D 01 06 BRSET L004D,#$01,L7055 If A/C is On, Go To "Load MPH"
L704F 96 A2 LDAA L00A2 Load Coolant Temperature
L7051 A1 03 CMPA 3,X Compare to Coolant Temperature Low Value Disable
L7053 23 09 BLS L705E Go To "Turn off fan" if Lower
L7055 B6 02 A7 L7055 LDAA L02A7 Load MPH
L7058 A1 00 CMPA 0,X Compare to High MPH Fan Cutoff
L705A 22 02 BHI L705E Go To "Turn off Fan" if Higher
L705C 20 10 BRA L706E End
L705E 15 52 08 L705E BCLR L0052,#$08 Turn off Fan
L7061 B6 01 50 L7061 LDAA L0150 Load MFR Timer Variable
L7064 D6 02 LDAB L0002 Load Loop Counter
L7066 C4 F0 ANDB #$F0 Mask First 4 Bits
L7068 26 04 BNE L706E Skip To end if no Decrement of Timer Needed
L706A 4A DECA Decrease MFR Timer by 1
L706B B7 01 50 STAA L0150 Save MFR Timer to L0150
L706E 4F L706E CLRA Clear A Register
L706F 5F CLRB Clear B Register
L7070 39 RTS Return
Here is the code as you would paste it into a hex editor. Just be sure that it OVERWRITES this section when you paste it, or else it will shift the whole program around, and your vehicle will NOT RUN.
Code:
7000: 19 b9 b1 aa 2d 00 00 00 00 00 00 00 00 00 00 00
7010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7020: ce 70 00 12 52 08 1f 96 a2 a1 01 22 11 12 4d 01
7030: 06 96 a2 a1 02 23 37 b6 02 a7 a1 00 22 30 14 52
7040: 08 a6 04 b7 01 50 b6 01 50 26 16 12 4d 01 06 96
7050: a2 a1 03 23 09 b6 02 a7 a1 00 22 02 20 10 15 52
7060: 08 b6 01 50 d6 02 c4 f0 26 04 4a b7 01 50 4f 5f
7070: 39