The riddle of the uncomplementary, two's complement data from an accelerometer
BillDer
Posts: 33
Hello and thanks in advance to anyone interested in helping me solve this riddle
I am trying to interface to a ADIS6204 and I've attached the datasheet for it.
Here is the issue, it gives an example on page 13 that shows the following data
From table 6 on page 13is shows that the scale factor per LSB is 17.125 and the data is 14 bits long, two's complement.
In the example fig. 23 below table 6, it shows an example resulting in the following of -10.377g
Next I try to figure out how they calculated the -10.377 g's so that I can program my Prop to do it the same way and give me G's.
So, according to my logic, the -10.377 g is equal to -606 scale factor or -10.377
I am trying to interface to a ADIS6204 and I've attached the datasheet for it.
Here is the issue, it gives an example on page 13 that shows the following data
From table 6 on page 13is shows that the scale factor per LSB is 17.125 and the data is 14 bits long, two's complement.
In the example fig. 23 below table 6, it shows an example resulting in the following of -10.377g
Next I try to figure out how they calculated the -10.377 g's so that I can program my Prop to do it the same way and give me G's.
So, according to my logic, the -10.377 g is equal to -606 scale factor or -10.377
pdf
580K
Comments
Maybe they messed up in the documentation
Ok this is how I convert two’s complement binary to decimal:
First look at the MSB to see if it is positive or negative.
If positive, convert the number from binary to decimal as usual
If negative complement (switch) all the bits (from 0s to 1s or 1s to 0s) then add 1
Next convert the number to decimal and put a negative sign in front
Bill, in your example the binary 14 bit number is 11 1101 1101 1110
Since the first number is a 1 this is a negative number
The complement would be 00 0010 0010 0001
Add 1 and the result is 00 0010 0010 0010
If you convert it to a decimal you get 546 then add the negative sign and you get -546
Actually I think I can confirm that they made a mistake:
The example is practically the same as the one on my ADIS16251 data sheet on page 12, figure 18 but in this case the answer is correct:
(-10deg/sec) / (0.01832deg/sec) =~546
I have since contacted analog devices for help. They are asking me to send them some screen shots of the oscilloscope. I'm going to do this and see if they can figure out what I'm doing wrong.
I have since contacted analog devices for help. They are asking me to send them some screen shots of the oscilloscope. I'm going to do this and see if they can figure out what I'm doing wrong.
Bill
I had to put a pull-up resistor for the CS line and a logic level converter for the MISO line for my microcontroller.
Has analog devices support gotten back to you?
Alex