Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User register memory map #30

Open
raess1 opened this issue Oct 3, 2019 · 2 comments
Open

User register memory map #30

raess1 opened this issue Oct 3, 2019 · 2 comments

Comments

@raess1
Copy link

raess1 commented Oct 3, 2019

read_register(0x04, gyro_low[0]);
read_register(0x06, gyro_low[0]);

Why is gyro_low referenced twice?

Looking in the User register memory map in 16470 datasheet
It looks like this:

X_GYRO_LOW 0x04
X_GYRO_OUT 0x06
Y_GYRO_LOW 0x08
Y_GYRO_OUT 0x0A
Z_GYRO_LOW 0x0C
Z_GYRO_OUT 0x0E
X_ACCL_LOW 0x10
X_ACCL_OUT 0x12
Y_ACCL_LOW 0x14       
Y_ACCL_OUT 0x16
Z_ACCL_LOW 0x18
Z_ACCL_OUT 0x1A

TEMP_OUT  0x1C               

@7675t
Copy link
Member

7675t commented Oct 3, 2019

It may be misleading, but read_register() is an SPI communication. It send an address to read, but we can get actual value in the next read. So the first read_register() return meaningless value, and actual gyro_low[0] is received the next read_register(0x06, gyro_low[0]); call. That's also why the last read_register(0x00, temp_out); returns TEMP_OUT value (0x00 is a kind of NOP command).

@raess1
Copy link
Author

raess1 commented Oct 4, 2019

thanks for the reply! Just tested it for 16465-1 and seems to work good.

This changes are made for 16465-1, 16465-2 and 16465-3

  //ADIS16465-1, 32-bit GYROSCOPES Sensitivity 10,485,760 LSB/°/sec
   gyro[i] = ((int32_t(gyro_out[i]) << 16) + int32_t(gyro_low[i])) * M_PI / 180.0 / 10485760.0;
   accl[i] = ((int32_t(accl_out[i]) << 16) + int32_t(accl_low[i])) * 9.8 / 262144000.0;
   
   //ADIS16465-2, 32-bit GYROSCOPES Sensitivity 2,621,440 LSB/°/sec
   /*
   gyro[i] = ((int32_t(gyro_out[i]) << 16) + int32_t(gyro_low[i])) * M_PI / 180.0 / 2621440.0;
   accl[i] = ((int32_t(accl_out[i]) << 16) + int32_t(accl_low[i])) * 9.8 / 262144000.0;
   */
   
   //ADIS16465-3, 32-bit GYROSCOPES Sensitivity 655,360 LSB/°/sec
    /*
   gyro[i] = ((int32_t(gyro_out[i]) << 16) + int32_t(gyro_low[i])) * M_PI / 180.0 / 655360 .0;
   accl[i] = ((int32_t(accl_out[i]) << 16) + int32_t(accl_low[i])) * 9.8 / 262144000.0;
   */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants