Quantcast
Channel: Power management forum - Recent Threads
Viewing all articles
Browse latest Browse all 35901

bq27531-G1 Signing Format

$
0
0

In what format is the bq27531-G1 Instantaneous Current register signed? It looks like two's complement - please confirm I've got a proper method of decoding.

I first read two bytes then concatenate them into a 16-bit word. This procedure is working for Voltage and other unsigned values.

With a reference discharge load of about -50mA, I am reading back Instantaneous Current=65487.

Two's complement conversion (add one then change the sign) gives me -64588 (-1111 1111 1101 0000). Flipping the bits (-0000 0000 0010 1111) gives -47mA.

A colleague suggested a shortcut - I tried subtracting 65535 from the 16-bit word (65487) and I actually get a decent answer of -48mA. But I am hesitant to use this shortcut without understanding what's going on.  There's one correct way to do this...

Please advise on the signing format.

Thanks for the support,

Bryan


Viewing all articles
Browse latest Browse all 35901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>