10 years, 1 month ago.

connected, but getting all zeros for an output

hi,

I'm using your example code with the mbed lpc1768 and the MPU9150 eval board, i've uncommented the outputs in your main.cpp, i can see "MPU9150 is ready" on the terminal(so i figure the i2C connections is correct), but all the outputs are 0. I have the interrupt pin p15, connecting to MPU-9150 pin 12.

i understand all the 9-axis data should be in "buffer" variable but its all zeros. is there anything else i need to setup? does the interrupt need a pullup?

Question relating to:

An example program that decodes the data returned from the MPU9150 DMP DMP, example, MPU9150

The interrupt is unused atm, the data is read from the fifo when there are more then 48 bytes, this also toggles LED1, does the LED flash for you?

posted by Chris Pepper 19 Oct 2014

yes LED1 flashes rapidly.

posted by jonathan liu 19 Oct 2014

That's odd, it sounds like everything is working, I cant think of any reason the fifo would get filled with zeros, even if the firmware transfer failed. could you assign extern Serial debug, in MPU9150.cpp and uncoment the debug messages in the initialiseDMP method. may give us a better idea whats happening.

posted by Chris Pepper 19 Oct 2014

oh sorry i want to correct myself. LED1 is solid on. below is my output when uncommenting the debug messages in the initialiseDMP

terminal output

MPU9150 is ready
Hardware Version: 165
Write Error 109
Read: Address Write Error 0
optValid: 0
Write Error 55
Write Error 109
Write Error 110
Write Error 111
invalid(0, 1)
0, 0, 0
0, 0, 0
0, 0, 0
0.000000, 0.000000, 0.000000, 0.000000
0.000000, 0.000000, 0.000000, 0.000000

I made sure AD0 is pulled low, so device_address = 0x68, correct from datasheet. so im quite baffled. i also have a duplicate setup that performs the same way. any ideas?

posted by jonathan liu 20 Oct 2014

ive extracted a bit more info. there is a write error on "0x6d"(109) which refers to "MPU9150::setMemoryBank". what is this?? i dont see anything about memory bank in the datasheet http://www.invensense.com/mems/gyro/documents/PS-MPU-9150A-00v4_3.pdf

terminal output

MPU9150 is ready
write to reg_addr 0x6b
write to data ì
write to length 1
write to reg_addr 0x6b
write to data ì
write to length 1
write to reg_addr 0x6d
write to data
write to length 1
Write Error 0x6d
write to reg_addr 0x6e
write to data
write to length 1
Write Error 0x6e
Hardware Version: 0
write to reg_addr 0x6d
write to data
write to length 1
optValid: 1

posted by jonathan liu 20 Oct 2014

Writing the firmware to the chip isn't documented, at least not in any datasheet I could find, This library is derived from I2Cdev, The mpu9150 I have is revision E, it only has a very basic breakout board. what revision do you have?

posted by Chris Pepper 20 Oct 2014

just noticed the write at the end of the terminal output to 0x6D succeeds, looks like the i2c is being erratic? too noisy long connections?

posted by Chris Pepper 20 Oct 2014

it was a silly mistake. your code definitely works well my eval board has a LDO that i was using. but i switch the power src of the mpu9150 and now its works well.

Thank you Chris for helping!

posted by jonathan liu 20 Oct 2014

Glad you got it sorted, a few things I need to mention about the code (as its unfinished I have a much easier to use version I haven't released yet), the i2c is currently set to 100kHz as mine was unstable at 400kHz, and the imu fifo is set to 20hz, which is definitely too slow, it can be modified on line 224 of dmpdata.h if you want to test, its explained in the comment, I'm currently trying to get the interrupt usable, as if it loses packet frame, it cant recover and the data stream becomes corrupt.

posted by Chris Pepper 20 Oct 2014

i got another question, the outputs all seem to be relatively correct except for the accelerometer. when at rest, the accelerometer 3-axis values swing wildly positive and negative. And when i swing the MCU, there seems to be no consistent number.

Is there a special way to use the accelerometer properly? I changed "MPU6050_ACCEL_FS" from 2 to 16, any other parameters i should touch?

posted by jonathan liu 27 Oct 2014
Be the first to answer this question.