This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

mpu9250 magnetometer zero readings

hi,

10040 nrf52dk softdevice 132 v2. keil ide I am trying to read magnetometer values so that i can calibrate it using this method. For this to happen, i need magnetometer, accelerometer and magnetometer values. However, im not able to obtain the correct magnetometer values. I'm getting 0000 as values in all directions. here is my code. Also i have used the nrf5 mpu magnetometer example code as the basis.

any help will be greatly appreciated.

edit: From trail and error, i understoood that the issue is with err_code/ret_code. But i have no idea on how to solve it.

Parents
  • No, the issue has not been resolved. Here’s what I found out about it.

    1. Mpu9250 uses imu6500 and ak8963. So, I changed the code such that the magnetometer part of app_mpu.h accepts only mpu9250.

    2. I’m unable to read or write the magnetometer. It might be because of having ak8963_adr wrongly defined. However, I verified it and it was right (0x0C). All the other registers were defined correctly.

    3. I get 0s because the magn read and write functions doesn’t work at all.

    I’m working on it continuously. Any help will be greatly appreciated.

Reply
  • No, the issue has not been resolved. Here’s what I found out about it.

    1. Mpu9250 uses imu6500 and ak8963. So, I changed the code such that the magnetometer part of app_mpu.h accepts only mpu9250.

    2. I’m unable to read or write the magnetometer. It might be because of having ak8963_adr wrongly defined. However, I verified it and it was right (0x0C). All the other registers were defined correctly.

    3. I get 0s because the magn read and write functions doesn’t work at all.

    I’m working on it continuously. Any help will be greatly appreciated.

Children
No Data
Related