This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: BOOSTXL-SENSHUB
Tool/software: Code Composer Studio
I managed to get the mpu9150 Accel/gyro/mag sensor with the tm4c123 - with the provided sample code. (compdcm_mpu9150). I have simplified the code a bit, taking out led driver, and serial output in order to measure the speed that the data is sampled at from the sensor.
Instead of measuring sample rate programmatically, I have attached a scope to GPIOB PIN 2, and I am able to see the interrupt happening from the sensor, and it looks like 20ms each reading approximately.
I tried to find relevant parts of the code, but I could not find where to adjust the sample rate.
// Write application specific sensor configuration such as filter settings
// and sensor range settings.
g_sMPU9150Inst.pui8Data = MPU9150_CONFIG_DLPF_CFG_94_98;
//g_sMPU9150Inst.pui8Data = MPU9150_CONFIG_DLPF_CFG_184_188;
g_sMPU9150Inst.pui8Data = MPU9150_GYRO_CONFIG_FS_SEL_250;
g_sMPU9150Inst.pui8Data = (MPU9150_ACCEL_CONFIG_ACCEL_HPF_5HZ | MPU9150_ACCEL_CONFIG_AFS_SEL_2G);
I tried to change MPU_CONFIG_DLPF_CFG_94_98 to MPU9150_CONFIG_DLPF_CFG_184_188, as defined at the hw_mpu9150.h file, but that did not had an effect at the sample rate measured by the scope.
Any ideas/recomendations/help greatly appreciated.
In this example the sample rate is set to 50 Hz. See lines 248-271 of mpu9150.c.
// Change to power mode complete, device is ready for configuration.
// Load index 0 with the sample rate register number.
psInst->uCommand.pui8Buffer = MPU9150_O_SMPLRT_DIV;
// Set sample rate to 50 hertz. 1000 hz / (1 + 19)
psInst->uCommand.pui8Buffer = 19;
psInst->uCommand.pui8Buffer, 2, MPU9150Callback, psInst);
// update state to show are in process of configuring sensors.
psInst->ui8State = MPU9150_STATE_INIT_SAMPLE_RATE_CFG;
Best Regards,Bob Crosby
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.