Ian,
I believe we can make this work, but you'll need to change one line of code to invert PWM vs SOC direction.
1. Referencing version 1.3, change line 1755 from "subfwb RES2,f" to "addwf RES2,f ". This will make PWM increase as SOC decreases.
2. Make R20 on LCD board a 71 Ohm resistor (or something slightly less). A 100ohm in parallel with 220ohm will give 68.75ohms which is close enough.
3. Change constant "PWM_MAX" from 255 to 100~130 (decimal not hex)
This is going to be a trial and error process with PWM_MAX. Start with 100 and see where the needle goes to at 100%SOC. If it's less than full, increment to 110, program and observe again. Once needle is at full, then repower while holding down SW2 to force 20%SOC. Adjust VR2 until the needle reads empty. Cycle power to bring 100%SOC back again. The needle should still be at full. If not, adjust it, then recheck needle at 20% adjusting VR2 again if necessary.
|