kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.03k stars 472 forks source link

Unable to access accelerometer and gyro data #253

Closed LuckierBread closed 6 years ago

LuckierBread commented 6 years ago

Hi Kris,

I am using the MPU9250 in a custom PCB. with an Arduino Nano as the controller.

VCC --> 3.3 V GND --> GND SCL --> A5 SDA --> A4 ADO --> GND

I am unable to read any part of the accelerometer or gyro, all reads come back as 0. The Who_Am_I register also returns 0.

I am using a logic level converter to change the 5V Arduino lines to 3.3V for the MPU9250, and have made sure that the data sent from the Arduino is making it to the SDA and SCLK pins with an oscilloscope. When data is requested the line gets held low for as long as it would take to send the requested data. I have 5K pull up resistors on each of the two lines.

I have confirmed that all my connections are solid. used an i2c scanner to confirm that a device exists at 0x68. and successfully retrieved data from the magnetometer.

To eliminate possible code errors I have tried several recommended codes including MPU9250BasicAHRS.ino I am currently using test code recommended by kriswiner in a simmaler issue. code shown here.

`#include

include

define MPU9250_ADDRESS 0x68

define MAG_ADDRESS 0x0C

define GYRO_FULL_SCALE_250_DPS 0x00

define GYRO_FULL_SCALE_500_DPS 0x08

define GYRO_FULL_SCALE_1000_DPS 0x10

define GYRO_FULL_SCALE_2000_DPS 0x18

define ACC_FULL_SCALE_2_G 0x00

define ACC_FULL_SCALE_4_G 0x08

define ACC_FULL_SCALE_8_G 0x10

define ACC_FULL_SCALE_16_G 0x18

// This function read Nbytes bytes from I2C device at address Address. // Put read bytes starting at register Register in the Data array. void I2Cread(uint8_t Address, uint8_t Register, uint8_t Nbytes, uint8_t* Data) { // Set register address Wire.beginTransmission(Address); Wire.write(Register); Wire.endTransmission();

// Read Nbytes Wire.requestFrom(Address, Nbytes); uint8_t index=0; while (Wire.available()) Data[index++]=Wire.read(); }

// Write a byte (Data) in device (Address) at register (Register) void I2CwriteByte(uint8_t Address, uint8_t Register, uint8_t Data) { // Set register address Wire.beginTransmission(Address); Wire.write(Register); Wire.write(Data); Wire.endTransmission(); }

// Initial time long int ti; volatile bool intFlag=false;

// Initializations void setup() { // Arduino initializations Wire.begin(); Serial.begin(115200); // Set accelerometers low pass filter at 5Hz I2CwriteByte(MPU9250_ADDRESS,29,0x06); // Set gyroscope low pass filter at 5Hz I2CwriteByte(MPU9250_ADDRESS,26,0x06);

// Configure gyroscope range I2CwriteByte(MPU9250_ADDRESS,27,GYRO_FULL_SCALE_1000_DPS); // Configure accelerometers range I2CwriteByte(MPU9250_ADDRESS,28,ACC_FULL_SCALE_4_G); // Set by pass mode for the magnetometers I2CwriteByte(MPU9250_ADDRESS,0x37,0x02);

// Request continuous magnetometer measurements in 16 bits I2CwriteByte(MAG_ADDRESS,0x0A,0x16);

pinMode(13, OUTPUT); Timer1.initialize(10000); // initialize timer1, and set a 1/2 second period Timer1.attachInterrupt(callback); // attaches callback() as a timer overflow interrupt

// Store initial time ti=millis(); }

// Counter long int cpt=0;

void callback() { intFlag=true; digitalWrite(13, digitalRead(13) ^ 1); }

// Main loop, read and display data void loop() { while (!intFlag); intFlag=false;

// Display Time

Serial.print (millis()-ti,DEC); Serial.print ("\t");

// ___ // ::: Counter :::

// Display data counter // Serial.print (cpt++,DEC); // Serial.print ("\t");

// ____ // ::: accelerometer and gyroscope :::

// Read accelerometer and gyroscope uint8_t Buf[14]; I2Cread(MPU9250_ADDRESS,0x3B,14,Buf);

// Create 16 bits values from 8 bits data

// Accelerometer int16_t ax=-(Buf[0]<<8 | Buf[1]); int16_t ay=-(Buf[2]<<8 | Buf[3]); int16_t az=Buf[4]<<8 | Buf[5];

// Gyroscope int16_t gx=-(Buf[8]<<8 | Buf[9]); int16_t gy=-(Buf[10]<<8 | Buf[11]); int16_t gz=Buf[12]<<8 | Buf[13];

// Display values

// Accelerometer Serial.print (ax,DEC); Serial.print ("\t"); Serial.print (ay,DEC); Serial.print ("\t"); Serial.print (az,DEC);
Serial.print ("\t");

// Gyroscope Serial.print (gx,DEC); Serial.print ("\t"); Serial.print (gy,DEC); Serial.print ("\t"); Serial.print (gz,DEC);
Serial.print ("\t");

// _____ // ::: Magnetometer :::

// Read register Status 1 and wait for the DRDY: Data Ready

uint8_t ST1; do { I2Cread(MAG_ADDRESS,0x02,1,&ST1); } while (!(ST1&0x01));

// Read magnetometer data
uint8_t Mag[7];
I2Cread(MAG_ADDRESS,0x03,7,Mag);

// Create 16 bits values from 8 bits data

// Magnetometer int16_t mx=-(Mag[3]<<8 | Mag[2]); int16_t my=-(Mag[1]<<8 | Mag[0]); int16_t mz=-(Mag[5]<<8 | Mag[4]);

// Magnetometer Serial.print (mx+200,DEC); Serial.print ("\t"); Serial.print (my-70,DEC); Serial.print ("\t"); Serial.print (mz-700,DEC);
Serial.print ("\t");

// End of line Serial.println(""); // delay(100);
}`

kriswiner commented 6 years ago

void readBytes(uint8_t address, uint8_t subAddress, uint8_t count, uint8_t

On Wed, Mar 28, 2018 at 11:49 AM, LuckierBread notifications@github.com wrote:

Hi Kris,

I am using the MPU9250 in a custom PCB. with an Arduino Nano as the controller.

VCC --> 3.3 V GND --> GND SCL --> A5 SDA --> A4 ADO --> GND

I am unable to read any part of the accelerometer or gyro, all reads come back as 0. The Who_Am_I register also returns 0.

I am using a logic level converter to change the 5V Arduino lines to 3.3V for the MPU9250, and have made sure that the data sent from the Arduino is making it to the SDA and SCLK pins with an oscilloscope. When data is requested the line gets held low for as long as it would take to send the requested data. I have 5K pull up resistors on each of the two lines.

I have confirmed that all my connections are solid. used an i2c scanner to confirm that a device exists at 0x68. and successfully retrieved data from the magnetometer.

To eliminate possible code errors I have tried several recommended codes including MPU9250BasicAHRS.ino I am currently using test code recommended by kriswiner in a simmaler issue. code shown here.

`#include

include

define MPU9250_ADDRESS 0x68

define MAG_ADDRESS 0x0C

define GYRO_FULL_SCALE_250_DPS 0x00

define GYRO_FULL_SCALE_500_DPS 0x08

define GYRO_FULL_SCALE_1000_DPS 0x10

define GYRO_FULL_SCALE_2000_DPS 0x18

define ACC_FULL_SCALE_2_G 0x00

define ACC_FULL_SCALE_4_G 0x08

define ACC_FULL_SCALE_8_G 0x10

define ACC_FULL_SCALE_16_G 0x18

// This function read Nbytes bytes from I2C device at address Address. // Put read bytes starting at register Register in the Data array. void I2Cread(uint8_t Address, uint8_t Register, uint8_t Nbytes, uint8_t* Data) { // Set register address Wire.beginTransmission(Address); Wire.write(Register); Wire.endTransmission();

// Read Nbytes Wire.requestFrom(Address, Nbytes); uint8_t index=0; while (Wire.available()) Data[index++]=Wire.read(); }

// Write a byte (Data) in device (Address) at register (Register) void I2CwriteByte(uint8_t Address, uint8_t Register, uint8_t Data) { // Set register address Wire.beginTransmission(Address); Wire.write(Register); Wire.write(Data); Wire.endTransmission(); }

// Initial time long int ti; volatile bool intFlag=false;

// Initializations void setup() { // Arduino initializations Wire.begin(); Serial.begin(115200); // Set accelerometers low pass filter at 5Hz I2CwriteByte(MPU9250_ADDRESS,29,0x06); // Set gyroscope low pass filter at 5Hz I2CwriteByte(MPU9250_ADDRESS,26,0x06);

// Configure gyroscope range I2CwriteByte(MPU9250_ADDRESS,27,GYRO_FULL_SCALE_1000_DPS); // Configure accelerometers range I2CwriteByte(MPU9250_ADDRESS,28,ACC_FULL_SCALE_4_G); // Set by pass mode for the magnetometers I2CwriteByte(MPU9250_ADDRESS,0x37,0x02);

// Request continuous magnetometer measurements in 16 bits I2CwriteByte(MAG_ADDRESS,0x0A,0x16);

pinMode(13, OUTPUT); Timer1.initialize(10000); // initialize timer1, and set a 1/2 second period Timer1.attachInterrupt(callback); // attaches callback() as a timer overflow interrupt

// Store initial time ti=millis(); }

// Counter long int cpt=0;

void callback() { intFlag=true; digitalWrite(13, digitalRead(13) ^ 1); }

// Main loop, read and display data void loop() { while (!intFlag); intFlag=false;

// Display Time

Serial.print (millis()-ti,DEC); Serial.print ("\t");

// ___ // ::: Counter :::

// Display data counter // Serial.print (cpt++,DEC); // Serial.print ("\t");

// ____ // ::: accelerometer and gyroscope :::

// Read accelerometer and gyroscope uint8_t Buf[14]; I2Cread(MPU9250_ADDRESS,0x3B,14,Buf);

// Create 16 bits values from 8 bits data

// Accelerometer int16_t ax=-(Buf[0]<<8 | Buf[1]); int16_t ay=-(Buf[2]<<8 | Buf[3]); int16_t az=Buf[4]<<8 | Buf[5];

// Gyroscope int16_t gx=-(Buf[8]<<8 | Buf[9]); int16_t gy=-(Buf[10]<<8 | Buf[11]); int16_t gz=Buf[12]<<8 | Buf[13];

// Display values

// Accelerometer Serial.print (ax,DEC); Serial.print ("\t"); Serial.print (ay,DEC); Serial.print ("\t"); Serial.print (az,DEC); Serial.print ("\t");

// Gyroscope Serial.print (gx,DEC); Serial.print ("\t"); Serial.print (gy,DEC); Serial.print ("\t"); Serial.print (gz,DEC); Serial.print ("\t");

// _____ // ::: Magnetometer :::

// Read register Status 1 and wait for the DRDY: Data Ready

uint8_t ST1; do { I2Cread(MAG_ADDRESS,0x02,1,&ST1); } while (!(ST1&0x01));

// Read magnetometer data uint8_t Mag[7]; I2Cread(MAG_ADDRESS,0x03,7,Mag);

// Create 16 bits values from 8 bits data

// Magnetometer int16_t mx=-(Mag[3]<<8 | Mag[2]); int16_t my=-(Mag[1]<<8 | Mag[0]); int16_t mz=-(Mag[5]<<8 | Mag[4]);

// Magnetometer Serial.print (mx+200,DEC); Serial.print ("\t"); Serial.print (my-70,DEC); Serial.print ("\t"); Serial.print (mz-700,DEC); Serial.print ("\t");

// End of line Serial.println(""); // delay(100); }`

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qrOQfyxjkxstg0pJa5yzugrBLxvtks5ti9s7gaJpZM4S_KzN .

LuckierBread commented 6 years ago

Thank you for the timely response. I have made the recommended change, However, I still receive constant 0s from the accelerometer and gyro. The magnetometer reads fine.

kriswiner commented 6 years ago

Try rea

On Wed, Mar 28, 2018 at 12:50 PM LuckierBread notifications@github.com wrote:

Thank you for the timely response. I have made the recommended change, However, I still receive constant 0s from the MPU9250.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-377013661, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qtXD4o7Qn_KhQJSogBkxAn8H4I1Uks5ti-mDgaJpZM4S_KzN .

kriswiner commented 6 years ago

Doesn't make sense you can read the mag butnot accel.

On Wed, Mar 28, 2018 at 1:10 PM Tlera Corporation tleracorp@gmail.com wrote:

Try rea

On Wed, Mar 28, 2018 at 12:50 PM LuckierBread notifications@github.com wrote:

Thank you for the timely response. I have made the recommended change, However, I still receive constant 0s from the MPU9250.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-377013661, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qtXD4o7Qn_KhQJSogBkxAn8H4I1Uks5ti-mDgaJpZM4S_KzN .

LuckierBread commented 6 years ago

Is it possible that the MPU9250 is fried? normally I wouldn't expect an IC to report back anything if it was fried. That's what made me assume it was human error. Here is what I am reading back. The first column is the time since start. The next three columns should be Accelerometer x,y,z followed by Gyro x,y,z and finally Magnetometer x,y,z capture

kriswiner commented 6 years ago

Always possible

On Wed, Mar 28, 2018 at 1:15 PM LuckierBread notifications@github.com wrote:

Is it possible that the ic is fried? normally I wouldn't expect an ic to report back anything if it was fried.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-377021349, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qtk6sBpudurahC0OfjWK4zTIRKhEks5ti-99gaJpZM4S_KzN .

LuckierBread commented 6 years ago

Stranger still is that this code I wrote as an earlier test seems to return random values every once and a while. Column order accelerometer x,y,z gyro x,y,z. capture

`#include const int MPU_addr=0x68; // I2C address of the MPU-6050 int Tmp, ax,ay,az,gx,gy,gz;

void setup(){ Wire.begin(); Wire.setClock(400000); Wire.beginTransmission(0x68); Wire.write(0x6B); // PWR_MGMT_1 register Wire.write(0x00); // set to zero (wakes up the MPU-6050) Wire.write(0x00); //set PWR_MGMT_2 register to full operation Wire.endTransmission(true); Serial.begin(9600); } void loop(){ Wire.beginTransmission(4); Wire.write(0x3B); // starting with register 0x3B (ACCEL_XOUT_H) Wire.endTransmission(false); Wire.requestFrom(MPU_addr,14,true); // request a total of 14 registers ax=Wire.read()<<8|Wire.read(); // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)
ay=Wire.read()<<8|Wire.read(); // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L) az=Wire.read()<<8|Wire.read(); // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L) Tmp=Wire.read()<<8|Wire.read(); // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L) gx=Wire.read()<<8|Wire.read(); // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L) gy=Wire.read()<<8|Wire.read(); // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L) gz=Wire.read()<<8|Wire.read(); // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)

// Accelerometer Serial.print (ax,DEC); Serial.print ("\t"); Serial.print (ay,DEC); Serial.print ("\t"); Serial.print (az,DEC);
Serial.print ("\t");

// Gyroscope Serial.print (gx,DEC); Serial.print ("\t"); Serial.print (gy,DEC); Serial.print ("\t"); Serial.print (gz,DEC);
Serial.println(); delay(100); }`

kriswiner commented 6 years ago

Wire.beginTransmission(4);

Why 4 here?

You need to first write the address Wire.write(0x68);

This is prett sloppy code writing.

Why not try something like this https://github.com/kriswiner/ESP8285/blob/master/MPU9250/MPU9250_MS5637_BasicAHRS2_ESP8266.ino example?

Or at least take the I2C read/write functions from here.

On Wed, Mar 28, 2018 at 1:55 PM, LuckierBread notifications@github.com wrote:

Stranger still is that this code I wrote as an earlier test seems to return random values ever once and a while. Column order accelerometer x,y,z gyro x,y,z. [image: capture] https://user-images.githubusercontent.com/37879913/38055760-dbcc7420-3297-11e8-8fb8-ee8a04ba411a.PNG

`#include const int MPU_addr=0x68; // I2C address of the MPU-6050 int Tmp, ax,ay,az,gx,gy,gz;

void setup(){ Wire.begin(); Wire.setClock(400000); Wire.beginTransmission(0x68); Wire.write(0x6B); // PWR_MGMT_1 register Wire.write(0x00); // set to zero (wakes up the MPU-6050) Wire.write(0x00); //set PWR_MGMT_2 register to full operation Wire.endTransmission(true); Serial.begin(9600); } void loop(){ Wire.beginTransmission(4); Wire.write(0x3B); // starting with register 0x3B (ACCEL_XOUT_H) Wire.endTransmission(false); Wire.requestFrom(MPU_addr,14,true); // request a total of 14 registers ax=Wire.read()<<8|Wire.read(); // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L) ay=Wire.read()<<8|Wire.read(); // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L) az=Wire.read()<<8|Wire.read(); // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L) Tmp=Wire.read()<<8|Wire.read(); // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L) gx=Wire.read()<<8|Wire.read(); // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L) gy=Wire.read()<<8|Wire.read(); // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L) gz=Wire.read()<<8|Wire.read(); // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)

// Accelerometer Serial.print (ax,DEC); Serial.print ("\t"); Serial.print (ay,DEC); Serial.print ("\t"); Serial.print (az,DEC); Serial.print ("\t");

// Gyroscope Serial.print (gx,DEC); Serial.print ("\t"); Serial.print (gy,DEC); Serial.print ("\t"); Serial.print (gz,DEC); Serial.println(); delay(100); }`

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-377033331, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkGG3zvjedK7iEogKuFfsjNJj6eEks5ti_jXgaJpZM4S_KzN .

LuckierBread commented 6 years ago

Hi Kris, I'm back. I acknowledge that the last post's code was messy. I'm sorry for that.

Using the code that I displayed in my original post with the changes you recommended. I have ruled out that the error is the fault of the mpu9250 IC. I ordered a replacement and it is having the same problem. I am using a breakout board from SparkFun found here: https://www.sparkfun.com/products/13762 The breakout board is connected to a custom PCB. The net that it is connected to can be seen here: capture Note that there is a BQ32002 Real-time clock also on the i2c line on the 3.3V side of the logic converter. however, it's address should be 0xC0 so that shouldn't really affect it. The Bi-Directional Logic Converter circuit is here: capture I am having a difficult time figuring out if this is a hardware issue or a software issue. Please let me know if you see a glaring issue that I am missing here.

kriswiner commented 6 years ago

Are you connecting 3V3 to VDDIO?

On Thu, Apr 5, 2018 at 9:58 AM, LuckierBread notifications@github.com wrote:

Hi Kris, I'm back. I acknowledge that the last post's code was messy. I'm sorry for that.

Using the code that I displayed in my original post with the changes you recommended. I have ruled out that the error is the fault of the mpu9250 IC. I ordered a replacement and it is having the same problem. I am using a breakout board from SparkFun found here: https://www.sparkfun.com/products/13762 http://url The breakout board is connected to a custom PCB the net that it is connected to can be seen here: [image: capture] https://user-images.githubusercontent.com/37879913/38379739-e840ab4a-38be-11e8-94ce-86099ac2e895.PNG Note that there is a BQ32002 Real-time clock also on the i2c line on the 3.3V side of the logic converter. however, it's address should be 0xC0 so that shouldn't really affect it. The Bi-Directional Logic Converter circuit is here: [image: capture] https://user-images.githubusercontent.com/37879913/38379826-25841258-38bf-11e8-9b4d-2d1c6f5473ff.PNG I am having a difficult time figuring out if this is a hardware issue or a software issue. Please let me know if you see a glaring issue that I am missing here.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-379005044, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qgfWQLNtS6rbzj80S6Zht2MPdRvWks5tlk1TgaJpZM4S_KzN .

LuckierBread commented 6 years ago

yes, the break out board has them bound together via jumper. AD0 is also bound to ground via jumper.

kriswiner commented 6 years ago

This is a custom pcb, but using Sparkfun's breakout?

On Thu, Apr 5, 2018 at 10:08 AM, LuckierBread notifications@github.com wrote:

yes, the break out board has them bound together.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-379007942, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qgQUvmtvzu30gekDWSSJ1PCRdgIXks5tlk-lgaJpZM4S_KzN .

LuckierBread commented 6 years ago

yes, I am using SparkFun's breakout because I did not feel confident soldering the very small pins on the MPU9250 with my soldering iron. To be clear, I am an Electronics Engineering Technology student. I am using this for my final project that is due in 3 weeks. this is really my last big hurdle before I finish the project.

kriswiner commented 6 years ago

And remind me, what is the problem exactly?

Can you get a Sparkfun breakout to work by itself with oyur code?

On Thu, Apr 5, 2018 at 10:14 AM, LuckierBread notifications@github.com wrote:

yes, I am using SparkFun's breakout because I did not feel confident soldering the very small pins on the MPU9250 with my soldering iron.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-379009584, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qv0qyXjJk5VDQSY-n6HhjxaRtGreks5tllDigaJpZM4S_KzN .

kriswiner commented 6 years ago

Well, one obvious thing is you have the low and high side of the logic level converter switched, no?

On Thu, Apr 5, 2018 at 10:22 AM, Tlera Corporation tleracorp@gmail.com wrote:

And remind me, what is the problem exactly?

Can you get a Sparkfun breakout to work by itself with oyur code?

On Thu, Apr 5, 2018 at 10:14 AM, LuckierBread notifications@github.com wrote:

yes, I am using SparkFun's breakout because I did not feel confident soldering the very small pins on the MPU9250 with my soldering iron.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-379009584, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qv0qyXjJk5VDQSY-n6HhjxaRtGreks5tllDigaJpZM4S_KzN .

LuckierBread commented 6 years ago

Wow. That is embarrassing. I have no idea how I missed that. Thank you for spotting that. I don't understand how I was able to read the magnetometer and not the other stuff though that.

kriswiner commented 6 years ago

Why are you using a 5 V AVR? Why not a 3V3 STM32l4?

On Thu, Apr 5, 2018 at 10:46 AM, LuckierBread notifications@github.com wrote:

Wow. That is embarrassing. I have no idea how I missed that. Thank you for spotting that. I don't understand how I was able to read the magnetometer and not the other stuff though that.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-379019917, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qs-Zbne0hl8aQKhk94mV0drairAXks5tlliBgaJpZM4S_KzN .

LuckierBread commented 6 years ago

The honest answer is ignorance. My course doesn't go in depth for picking processers. For a project that is worth 80% of my grade, I didn't want to risk using a processor that i was unfamiliar with as the core of my project.

kriswiner commented 6 years ago

This might be worth the trouble:

https://www.tindie.com/products/TleraCorp/ladybug-stm32l432-development-board/?pt=ac_prod_search

This has a 1 ppm RTC built in, and is 3V3, and will allow fusion at a 20 kHz rate. Arduino core, easy to use, lot's of examples, etc.

On Thu, Apr 5, 2018 at 10:55 AM, LuckierBread notifications@github.com wrote:

The honest answer is ignorance. My course doesn't go in depth for picking processers. For a project that is worth 80% of my grade, I didn't want to risk using a processor that i was unfamiliar with as the core of my project.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-379022688, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qsWj6TmrZtSNC8v6kQRhZ0KXU6vAks5tllqYgaJpZM4S_KzN .

LuckierBread commented 6 years ago

I don't really know what you mean by fusion. It looks like it has some very nice specs. If it accepts the same code format as the nano then I might have to swap to that for the V2 of this project. Also Thank you very much for your time. It ended up having nothing to do with your code but you helped anyway. You have both my gratitude and respect.

kriswiner commented 6 years ago

You don't intend to use the mPU9250 data to estimate absolute orientation?

On Thu, Apr 5, 2018 at 11:30 AM, LuckierBread notifications@github.com wrote:

I don't really know what you mean by fusion. It looks like it has some very nice specs. If it accepts the same code format as the nano then I might have to swap to that for the V2 of this project. Also Thank you very much for your time. It ended up having nothing to do with your code but you helped anyway. You have both my gratitude and respect.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-379033866, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qswnbY8Y7TIu9coioweWn2oIV0Qdks5tlmLZgaJpZM4S_KzN .

LuckierBread commented 6 years ago

oh, that's what you meant. I definitely am trying to get the absolute orientation. I am building a self-balancing one-wheeled skateboard. the wheel is powered and will be controlled like a Segway. just lean in the direction that you want to go. I picked the MPU9250 because of the built-in DMP.

kriswiner commented 6 years ago

DMP cannot do 9 DoF fusion, only roll and pitch. Maybe this is good enough. But you get the fusion out at 100 Hz, that;'s it.

Good luck using it...

On Thu, Apr 5, 2018 at 11:40 AM, LuckierBread notifications@github.com wrote:

oh, that's what you meant. I definitely am trying to get the absolute orientation. I am building a self-balancing one-wheeled skateboard. the wheel is powered and will be controlled like a Segway. just lean in the direction that you want to go. I picked the MPU9250 because of the built-in DMP.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/253#issuecomment-379036530, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qhb5hmCXyuea2Y8LtiNy-dTZEL0kks5tlmUCgaJpZM4S_KzN .

LuckierBread commented 6 years ago

I am realizing now that a combination of the ladybug and the mpu9250 addon does 80% of what I need my project to do. If only I knew sooner. could have saved some money.