Quote:
Originally Posted by harlequin2
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
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.