digitaldanny / AudioEffectsGlove

A hand tracking glove that controls parameters of various audio effects.
1 stars 0 forks source link

MPU6050 Drivers - MSP432 Target #60

Closed digitaldanny closed 3 years ago

digitaldanny commented 3 years ago

Completed

Todo

MSP432 to MPU6500 breakout connections for I2C MSP432 Pin MSP432 Pin Mux MPU6500 Breakout Pin
P6.4 SDA SDA
P6.5 SCL SCL
digitaldanny commented 3 years ago

With the most recent commit, I am able to read the WHO_AM_I register from the MPU6050. I am also reading an extra unecessary byte at the end (red in the screenshot below). This is due to using the AUTO_STOP I2C configuration. To allow a re-start after the initial register address write for a 1 byte read, I have to make the number of byte transfers = numBytes + 1. This means allows the re-start to happen, but also means I am reading 1 extra byte for a 1 byte read. I am going to try fixing this in the next commit by manually sending the stop flag.

image

digitaldanny commented 3 years ago

Going with a polling approach I found on this TI forum.

WHO_AM_I Read image

digitaldanny commented 3 years ago

The MSP432 can now read pitch, yaw, and roll values from the MPU6050's DMP. Readings work for about 1 second before the i2c bus hangs. Increasing the delay seemed to help, but I'm not sure why I have to delay the i2c transfers still.

digitaldanny commented 3 years ago

Having problems with the MPU6050 readings still.

digitaldanny commented 3 years ago

Note - I upped the SMCLK to 24MHz from 12MHz in Pull Request #61. This will affect the I2C configurations for this PR too.

digitaldanny commented 3 years ago

Also improved the accuracy of the delay functions, which may help with this PR as well. It would be a good idea to merge the master into this branch after #61 is merged.

digitaldanny commented 3 years ago

Tried adding 0.1 uF capacitors on the Scl and Sda lines to remove any noise, but this just completely stopped the interrupt from triggering. Going to try probing the Scl and Sda lines with an oscilloscope. Maybe I will see some problems there that I did not see on the logic analyzer.

digitaldanny commented 3 years ago

Comparing the MSP432 and Arduino SPI lines, I am seeing similar types of noise. I do not think the small blips in the waveform is what's causing the problems.

MSP432 I2C Lines i2c lines

Arduino I2C Lines image

digitaldanny commented 3 years ago

I have the basic drivers working here. I am going to go ahead and merge and fix the remainder of features/bugs during the main program development.