I am trying to make a board that will stream IMU data via serial bluetooth to my computer. However, is my first time using I2C but I have read about it online.
The spec for this chip says: "Communication with all registers of the device is performed using I2C at 400kHz."
I am having trouble figuring out what kind of sample rate I can get out of this.
First off, do I need to have an external clock for this chip?
And how many sample per second can I get at at 400kHz?
Lastly, any suggestions for how I go about implementing this?
Thanks
Chet
- Log in to post comments
phpbb Topic ID
14901
Re: Re: MPU-9150 sample rate
No, I2C uses clock stretching so the MCU and MPU-9150 don't have to have an accurate external clock
Depends what you mean by sample. Are you going to use the DMP? If so, then a sample is 4 quaternion values (as 2 or 4 bytes each) plus optional header and raw data. If you want to fuse the magnetometer data for accurate heading information, you will need to send 6 additional bytes. Thus you will reading a minimum of 8 bytes, and a maximum of whatever you choose. The MotionFit 5.1 does the following each time it gets data:
2.2688815 0x68 Read 0x49 (EXT_SENS_DATA_00) 8bytes 0x01 0x0B 0x00 0x5B 0x00 0x7D 0x00 0x00
2.2762755 0x68 Read 0x72 (FIFO_COUNTH) 2bytes 0x00 0x0C
2.2764295 0x68 Read 0x74 (FIFO_R_W) 12bytes 0xFE 0xB2 0xFF 0x72 0x40 0x32 0xFF 0xF3 4 more...
2.2769960 0x68 Read 0x41 (TEMP_OUT_H) 2bytes 0xF5 0xF7
From the timing you can see that it only takes ~8ms to get this data, so the maximum you could get would be ~125Hz but there may be other limiting factors.
I'm actually somewhat confused as to why you are making this device, as this ("a board that will stream IMU data via serial bluetooth to my computer") is exactly what the MotionFit does. What will be different about your board? If you want to use the DMP (i.e. get quaternion data from the MPU9150), this is not a trivial task, especially if you are not using the MSP430F5528 and can't use the current MPL.
Re: Re: MPU-9150 sample rate
We typically recommned using one of the gyroscopes as the clock source, but you can provide an external clock if desired. You may want to look at the documentation for the MotionFit SDK board. There is a software schematic, and even a software reference project for the MSP430 which might answer some of your questions.
http://demo5.baytechdata.com/invensense/developers/index.php?_r=developerkit