In this update I’ve implemented a way of entering user parameters with the two momentary pushbuttons and the LCD display. It avoids having to reflash the PIC if you want to change a parameter. I’ve also added a function to cut back throttle if pack voltage dips to parameter “MINPV” for 6 seconds or more. I do this by setting the RB3 bit. This is normally canbus receive for 18F2480 or GP I/O for 18F2420. By using this bit with a transistor in place of U8, it is conveniently brought out to terminal block TB2. An optocoupler wired to this then switches in a resistor (or pot) in parallel with the throttle pot accomplishing the throttle cutback (circuit shown in addendum in attached zip). Another new parameter “HALLT” allows setting the current sensor to either Tamura L01Z400S05 (400A) or a LEM HASS 200-S (600A).
The addendum also shows an alternate way of wiring up the PWM output for the fuel gauge. This way it always stays within the resistance range of the sender it replaces.
My thinking is that this could do two things:
1. By staying within legal min-max resistance range of the sender it replaces, those whose fuel gauge has a microprocessor interface might have better luck.
2. Mechanical fuel gauges might “ring” less with chopped current alternating between two different levels versus full on & full off .
Besides, I saw this configuration used repeatedly online for other PWM fuel gauge sender replacements
Video below demonstrates setting parameters with the new firmware.
Attached zip contains the ASM and HEX files for both versions of the PIC. As always “a” version is 18F2420 and “b” is 18F2480. I have no way of testing the 18F2480 version so no guarantees.