View Single Post
Old 10-14-2011, 08:30 PM   #396 (permalink)
DJBecker
EcoModding Apprentice
 
Join Date: Nov 2010
Location: Annapolis
Posts: 159
Thanks: 0
Thanked 32 Times in 27 Posts
Quote:
Originally Posted by harlequin2 View Post
Was there a particular reason why you wanted the C compiler to generate the same asm instructions or was it just so you could be sure it would work the same without having to debug new C code if it didn't do quite what you expected?
I was so that I understood exactly what the code was doing. Not what the comments said.

Quote:
Originally Posted by harlequin2 View Post
I haven't even seen that it uses 24-bit arithmetic! Take your word for it, but wow! I managed to get my bms done with 8 bit integer arithmetic and still keep sufficient accuracy and resolution.
There is a 24 bit value tracking the battery capacity. That's just barely enough precision. Any less and you accumulate significant error with the SoC in some conditions.
  Reply With Quote