Shop OBEX P1 Docs P2 Docs Learn Events
The riddle of the uncomplementary, two's complement data from an accelerometer — Parallax Forums

The riddle of the uncomplementary, two's complement data from an accelerometer

BillDerBillDer Posts: 33
edited 2009-04-09 21:28 in Accessories
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

Comments

  • GaryBagyGaryBagy Posts: 2
    edited 2009-04-02 20:25
    I don’t get it either, it should be -546 and not -606 by my calculations
    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
  • BillDerBillDer Posts: 33
    edited 2009-04-04 14:46
    I have the datasheet for the 16201 and it is similar info as the one you have.
    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.
  • BillDerBillDer Posts: 33
    edited 2009-04-04 14:46
    I have the datasheet for the 16201 and it is similar info as the one you have.
    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.
  • BillDerBillDer Posts: 33
    edited 2009-04-04 17:31
    OK, I think I got it working now. Not entirely sure, will need to do more tests. Once I confirm it I'll post the code.
    Bill
  • GaryBagyGaryBagy Posts: 2
    edited 2009-04-09 21:28
    Did you have to add a logic level converter or anything between your microcontroller and the ADIS 16201?
    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
Sign In or Register to comment.