minIMU-9 v3 port to LPC13xx

I am using a LPC port for the sensor firmware I found here:

The IMU sensor is not moved but the values are all over the place.

!ANG:163.3,0.8,-18.6
!ANG:168.1,-15.10,-57.7
!ANG:155.0,-12.7,-5.8
!ANG:-168.4,-48.2,-67.3
!ANG:94.4,-53.4,11.2
!ANG:-44.0,-69.3,144.6
!ANG:-12.9,-32.5,81.9
!ANG:-37.7,-14.3,108.4
!ANG:129.5,16.8,72.1
!ANG:-60.5,17.1,78.8
!ANG:-70.0,52.4,74.0
!ANG:-90.9,24.8,44.0
!ANG:-132.9,45.0,-0.0
!ANG:-162.10,14.2,16.5
!ANG:-176.9,-0.4,-24.2

I expected some noise but this data is not usable. Is there a chance that the sensor is damaged?

I found some indication of a problem when I print out the raw data. The Y value of the accelerometer and Z value of the magnetometer are always 0 even if I move the sensor around. I think this causes the problem in the fused sensor data. How can this happen?

I double-checked the register addresses a couple of times, the v3 board uses the DLHC variant, right?

A: -976,0,2063 M: 768,16640,0 G: -13368,15692,-25023
A: -976,0,-198 M: 768,16640,0 G: 14024,15753,11153
A: -976,0,2063 M: 768,16640,0 G: -13368,15692,-25023
A: -976,0,2063 M: 768,16640,0 G: -13368,15692,-25023
A: -976,0,851 M: 768,16640,0 G: 10952,15751,-5624
A: -976,0,2063 M: 768,3848,0 G: -13368,15692,-25023
A: -976,0,2063 M: 768,3848,0 G: -13368,15692,-25023
A: -976,0,2063 M: 768,3848,0 G: -13368,15692,-25023

I ordered the v3 version because I thought it would be a good idea to get improvements. Now I realize that there are many changes. I noticed that enableDefault sets more registers and I added that but it did not impact the quality of the data.
Is there a list of changes v2 => v3 that I could use to update the firmware port?

I attached the source in case you want to take a look.
minIMU9_v3_lpc1343.zip (23.4 KB)

Hello.

The new MinIMU-9 v3 uses newer MEMS sensors than the MinIMU-9 v2. The accelerometer and magnetometer is the LSM303D, which compared to its predecessors, has a number of improvements, such as the accelerometer and magnetometer are now a single unified I2C device.

From your code, it looks like you do not have the accelerometer and magnetometer’s I2C address declared correctly. You use the old magnetometer’s address, and the accelerometer address is the one for when the SA0 pin is driven low. You can find the correct I2C address in the “I2C Communication” section of the MinIMU-9 v3’s product page. Could you see if fixing the addresses solves your problem?

- Jeremy

The hint about the addresses is very helpful. I ported Gyro_autoDetectAddress from L3G but it could not detect the address so far :frowning: But I am convinced I am on the right track.

with the fixed addresses the IMU firmware port delivered much better values. To resolve the remaining issues I had to exchange the i2c lib. Now I use the version I found here: github.com/microbuilder/LPC11U_ … c/core/i2c

You can find the current version of my IMU firmware here:
github.com/markfink/epicii/tree … amples/imu

I am glad you got it working. Thanks for sharing your code.

- Jeremy