View Single Post
Old 05-23-2011, 08:49 PM   #249 (permalink)
Freyguy
EV Builder
 
Freyguy's Avatar
 
Join Date: Nov 2010
Location: Macungie, PA
Posts: 157
Thanks: 15
Thanked 64 Times in 40 Posts
Quote:
Originally Posted by jackbauer View Post
Thanks Chris. Much appreciated. As i say i will have a 2420 tomorrow so will test with that. Not as if i'll be doing the can stuff anytime soon anyway.
Ok, but I really don't think this is a PWM bug in the 2480 code. Alvin has the 2480 and he could adjust his after I discovered the rogue line of code that prevented PWM adjustment (back at post #169).

But I definitely think I messed up with the PWM frequency. I am so use to using PIC PWM for a poor man's DAC that I always use 2~4kHz frequencies out of habit...easy to filter with an RC.

So mods as follows:

Under the PWM fuel gauge setup section
line 592- change MOVLW 0x05 to 0x06 ; prescaler change from 4 to 16
(PWM freq should now be 488hz)

Under the Reload SOC section
After line 618 add this line- Call Capstore
(SOC reset value is immediately written to EEPROM)

I'll release another revision after a few more guys build & run this successfully.
We might find more bugs in the meantime.

-Chris

Last edited by Freyguy; 05-24-2011 at 05:32 AM.. Reason: Mental mixup of period vs freq
  Reply With Quote