I2C error handling diffs between 2.0 and 120622?

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
Alterscape
Posts: 11
Joined: Fri Jan 27, 2012 9:17 pm

I2C error handling diffs between 2.0 and 120622?

Post by Alterscape »

I am trying to run down a change in how I2C errors are handled between MWC 2.0 release and dev 120622. My IMU platform is an ebay-purchased 10dof IMU http://www.ebay.com/itm/10DOF-9-axis-sensor-module-L3G4200D-ADXL345-HMC5883L-BMP085- with the L3G4200D gyro, ADXL345 acc, HMC5883 mag, and BMP085 baro. My FC is an Arduino Pro Micro riding on a Bob's Super Simple Shield (http://bobsquads.com/shieldsmultiwii/supersimpleshield.html, with 3.5k I2C pull-ups between VCC and SCL + SDA. On 120622, using the GU_80 def, I get good data from the mag, gyro, and baro, but nothing (1000, 1000, -1000) from the ACC. The status LED blinks and the copter won't arm. Same thing if I manually comment out the ADXL345 defines in defs.h and/or manually enable just the sensors that seem to be working.

If I run 2.0 release (which doesn't have a BU_80 define), I can arm and fly the copter with the L3G4200D, HMC5883L, and BMP085 enabled, but as soon as I enable the ADXL345, it fails back to "blinking LED failure state."

Any idea what difference in I2C error handling between the versions might cause this change in behavior? I'd like to fly my quad in acro mode, anyway, with the latest development snapshot and/or work on debugging my ADXL345. Any thoughts on what I should look for when putting a scope on this thing?

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: I2C error handling diffs between 2.0 and 120622?

Post by Alexinparis »

GY_80 is defined with #define ADXL345_ADDRESS 0x53
try maybe the other possible address: #define ADXL345_ADDRESS 0x1D

Alterscape
Posts: 11
Joined: Fri Jan 27, 2012 9:17 pm

Re: I2C error handling diffs between 2.0 and 120622?

Post by Alterscape »

I'm more concerned about the blinking LED I2C comms error state -- that doesn't happen in 2.0, so long as the ADXL345 is not set up/defined.

In 120622, even if I have #define ADXL345 commented out, I get the blinking LED for I2C errors if I have any I2C devices active (for instance, just the L3G4200D. The only way to not get the blinking I2C error is to have no sensors whatsoever defined. If I use the default I2C address for the ADXL345, I do not get I2C errors in the MWConf gui. If I use any other address, the I2C error counter increments rapidly.

Additional data: In 120622's MultiWiiConf, I can see good gyro/mag/baro data if those sensors are enabled (but I still get the blinking LED for error state). If I have the ACC defined, it reads 1000, 1000, -1000. If I do not define the ACC, I still get the blinking error data, but no ACC data.

edit: ok, NOW it works. I am very confused, troubleshooting more, will post my final setup when I get it live.

Alterscape
Posts: 11
Joined: Fri Jan 27, 2012 9:17 pm

Re: I2C error handling diffs between 2.0 and 120622?

Post by Alterscape »

I think this was some combination of hardware error (possibly bad connection on SDA or SCL) and my own silliness. It's working now, on 0622. Defines as follows:

Code: Select all

#undef INTERNAL_I2C_PULLUPS
#define L3G4200D
#define ADXL345
#define ADXL345_ADDRESS 0x53
#define BMP085
#define HMC5883
#define ACC_ORIENTATION(X, Y, Z) {accADC[ROLL] = X; accADC[PITCH] = Y; accADC[YAW] = Z;}
#define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] = -Y; gyroADC[PITCH] = X; gyroADC[YAW] = -Z;}
#define MAG_ORIENTATION(X, Y, Z) {magADC[ROLL] = -X; magADC[PITCH] = -Y; magADC[YAW] = -Z;}

bill516
Posts: 334
Joined: Sun Aug 07, 2011 12:27 pm

Re: I2C error handling diffs between 2.0 and 120622?

Post by bill516 »

I have the same gyro and I had to go to sensor tab find the l3g4200d gyro and change the address from 0x69 to 0x68. I was pure luck I tried that address first as I was trying one of the dev versions that have moved to 7bit addressing and I was suffering the same problem. Commenting out the ADXK345 made it work except that sensor didnt work then. I had it working in V2 and devo22 due to the work that Katch did in sorting out the orientation of sensor. Changing the address will allow it to work in any of the present devs and prelease of 2.1

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: I2C error handling diffs between 2.0 and 120622?

Post by copterrichie »

Off-Topic question please, How do you guys like the l3g4200d gyro?

Thank you.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: I2C error handling diffs between 2.0 and 120622?

Post by shikra »

Huh - I had to do the same.
I have one board with adxl345 and put latest dev on it tonight. loads of I2c errors.
Had to change address from 0xa6 that always used previously on 1.9/2.0 to 0x53

Alterscape
Posts: 11
Joined: Fri Jan 27, 2012 9:17 pm

Re: I2C error handling diffs between 2.0 and 120622?

Post by Alterscape »

I've only flown with the WMP and the L3G4200D, so I don't have that much breadth of experience to speak from. I will say, however, that the L3G4200D feels much more stable than the WMP gyro, on my micro-quad. The WMP tended to have a serious bias to yaw nose-right (clockwise) that I had to trim out; with the L3G4200D, I'm pretty much bang-on stable. I never flew my WMP board with post-2.0 firmware, though, so there may have been changes in the code that are as much responsible for that as the different gyro.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: I2C error handling diffs between 2.0 and 120622?

Post by copterrichie »

Thank you.

User avatar
captaingeek
Posts: 228
Joined: Fri Jan 28, 2011 6:42 pm

Re: I2C error handling diffs between 2.0 and 120622?

Post by captaingeek »

im seeing a shit load of i2c errors in 2.1 and am unable to get a reading out of my adxl345... any tips?

Post Reply