How could I synchronize a few MPU-6050s?

By tdasnoy , 26 July 2013

Hi,

Short version: I'd like to be able to sychronize the DMP output (interrupt) of many MPU-6050s. Can I do this? (And was there any documentation on the CLKIN and CLKOUT signals?)

And then the long version:

I would like to use several MPU-6050s in my project with DMP. I'm currently able to use jrowberg's code to initialize a bunch of 6050's and read their FIFO in a parallel I2C implementation on the 80MHz Arduino DUE. (That parallel I2C bit bang code is written specifically for this task. I first loop until every sensor's FIFO_COUNT reaches at least 42 bytes, then read the always 42-byte packet from the FIFO and lastly reset the FIFO to avoid overflow. It's not very fast, but it works.)

However every now and then, because there are many sensors with their own separate clocks and thus slightly different update rates, one gets read when the FIFO_COUNT just prior to the 42-byte packet read is not a multiple of 42. I think that the DMP might be putting a new set of data into the FIFO at that very moment. In the consequent attempt to read of the 42-byte packet of that sensor, I believe that it gives corrupt data: The resulting quaternion is no longer normalized (magnitude is not 1).

I could try to just wait until every sensor gives a FIFO_COUNT % 42 == 0, but that's probably not a guarantee that I'll always avoid the problem. Reading the FIFO just after an interrupt would be a solution, because the next update won't happen for another 10 ms or so.

Am I guessing correctly that this is the reason why interrupts are "required" when using the DMP? (As stated in viewtopic.php?f=3&t=515 )

Anyway, I appreciate any ideas on how to deal with this :)

phpbb Topic ID
15489