Jump to content
I2Cdevlib Forums

timarm

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by timarm

  1. A big thank you to Mr. Rowberg for laying the ground work for communicating with the MPU6050! I write this to help others, and hopefully find a solution to my (apparently) randomly occuring problem. I'm doing this on an old 2007 Macbook Pro USB->Arduino debug port, with the GY-521 break out board wired as follows to the Arduino Zero: INT -> D0 ADO->GND VCC->3v3 GND->GND SDA->SDA SCL->SCL Both SDA and SCL have a 4k7 pull up to 3v3. Copied the following folders from jrowberg-i2cdevlib-aab2381 into my Ardunio->libraries folder: I2Cdev MPU6050 Opened MPU6050_DMP6 in the Arduino IDE 1.6.5. Compile had an error for 'TWBR' as it isn't called TWBR for this Arduino board (I assume). TWBR is for ATMega chips? Commented out the TWBR line. Compile had errors 'min' not declared in I2Cdev.cpp. Wrote a definition for min in I2Cdev.cpp. Compile completed, and uploaded. Opened Serial Monitor, set baud to 115200, and was getting data breifly before it froze. Found that min (max and others) bug was fixed in the current SAMD hourly build. Installed the hourly build for the SAMD https://github.com/arduino/ArduinoCore-samd#hourly-builds and removed the defininition I wrote for min in I2Cdev.cpp. Complied and get data out for a bit, but then it stops putting out data to the serial monitor and the arduino freezes with the debug LED lit. Freeze Notes: - The debug LED is lit, as if it's stuck in a Serial.println(). ?? - Nothing is tied to pin 13, and the LED attached to this pin is lit during the running state and frozen state. - Sometimes it will run for minutes before freezing, other times seconds. Seldom it will run for a long time >30mins. - Sometimes while it runs in the background and I have another application open on the computer, the debug light stops blinking and stays lit (frozen) until I tab back over to the Arduino sketch, when it starts blinking again (and sending serial data) with no intervention. - Haven't yet found anything I'm doing that will repeatedly cause it to freeze, other than pulling and reconnecting the wire connecting INT->D0 while it is outputing data. - Longest runs happen when following these steps: -- Unplug the USB cable for at least 10 minutes (to let the board caps discharge??) -- Restart the Arduino sketch -- Start the Arduino sketch -- Connect the USB cable -- Run sketch Does it have to do with the fact that the TWBR line was commented out? Does it have to do with the debug port serial communication? Is it a bug with the Arduino Zero? Could it be my Macbook? It is mild weather temps, is it solar flares? (: What am I not understanding here? Would like to better understand TWBR as it pertains to the Arduino Zero. Looking at page 536-537 of the spec sheet for the SAMD21 it is Bit[25:24] of CTRLA that changes the bit rate of the I2C port. Haven't figured out how to do this yet, and not sure if this is even the right track toward quelling this freeze issue. Will read more and post a solution when it becomes known. T
×
×
  • Create New...