Go Down

Topic: I2C issues (Read 5584 times) previous topic - next topic

erikyo

Thanks Mike for the fast reply,

I have tried the library you have attached and I changed in Arduino\libraries\Wire\utility\twi.h

from

Code: [Select]
#ifndef TWI_FREQ
 #define TWI_FREQ 100000L
 #endif


to

Code: [Select]
#ifndef TWI_FREQ
 #define TWI_FREQ 400000L
 #endif


and tried

Intel\hardware\arc32\1.0.4\cores\arduino\i2c.c -> function i2c_openadapter() and change

i2c_cfg.speed = I2C_SLOW;
into
i2c_cfg.speed = I2C_FAST; (400khz)


But nothing that gave me the improvements... register scan example of HMC58X3 lib give me always "1073972124 2 1073969280"

I have a friend who also has a HCM5883L like mine, i'm going to borrow it so I raise all my doubts about mine is faulty... but I find it strange because on Arduino UNO it works perfectly.




http://www.codekraft.it

https://github.com/codekraft-studio

Merlin513

#16
Feb 27, 2016, 03:16 pm Last Edit: Feb 27, 2016, 03:32 pm by Merlin513
Hi Erik

I know this is going to sound like I am nuts but did you try just swapping the sda/scl connections.  Also, what breakout board are you using. I'm using a GY271.

One other thing - try running the raw values sketch and see what happens.

Mike

erikyo

Still nothing ... I also tried the sensor of my friend (HCM5883L GY273 like mine) and not even work with that

also i have swapped sda&scl and also tried 4.7k pullup resistors, but it did not help :-(

Raw values sketch give me always "Could not find a valid HMC5883L sensor, check wiring!" until i move i bit the SDA/SCL wires. At that point if I stay perfectly still starts reading from the sensor but if I move it a bit just chash and it stops print serial datas.

http://www.codekraft.it

https://github.com/codekraft-studio

Merlin513

Hi Erik

Good timing on the post. 

It almost sound the connection is bad to the board.  Try changing the wires out and the breadboard.  I just loaded one of the sketches from the original library you posted and opened the associated processing sketch and it is working for me like a charm.

I am really at lose at this point except for a connection issue to sda/scl.

Mike

erikyo

#19
Feb 27, 2016, 05:38 pm Last Edit: Feb 27, 2016, 06:03 pm by erikyo
I tried (and this morning I had already done) to change the strings but does not work anyway.

I include photos in case I have become daltonian from today :-)

This makes me think Arduino 101 is not compatible with HCM5883L GY-273... To take away any doubts I'll now make a test with a Melexis MLX90614ESF (a i2c ir temp sensor)

Erik


http://www.codekraft.it

https://github.com/codekraft-studio

Merlin513

Hi Erik

Sorry I could not have been of more help but I am out of ideas.  You could always try moving the header on the 101 around while you have the sensor connected.  To see if there is a issue there.  Let me know it goes with Melexis sensor - I have the Melexis MLX90620 and was thinking about getting the 14.

Mike

erikyo

At this point I do not know if my Arduino 101 is working correctly with i2c devices... Even with the MLX90614ESF-bcf does exactly the same problem: initially i get wrong datas, I have to move a little wire to put in a certain position, but as soon as I release it "detaches" (and sometimes crashing).

i've make this tests with pin A4&A5 and SDA&SCL pins but the results are the same. 

May I have the grounding problems or some electrical problems? Others with Arduino 101 got this problem? may I have a defective Arduino?

Erik

PS Here wiring img and serial log of Arduino101 when glitching with mlx sensor




Code: [Select]
Ambient = 23.95*C Object = 21.99*C
Ambient = 75.11*F Object = 71.58*F

Ambient = 24.01*C Object = 22.35*C
Ambient = 75.22*F Object = 72.23*F

Ambient = 24.03*C Object = 21.75*C
Ambient = 75.25*F Object = 70.29*F

Ambient = 24.07*C Object = 18.79*C
Ambient = 75.33*F Object = 65.82*F

Ambient = 24.17*C Object = 18.61*C
Ambient = 75.51*F Object = 66.76*F

Ambient = 24.23*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 24.57*C Object = 28.31*C
Ambient = 76.23*F Object = 84.22*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 24.75*C Object = 21.89*C
Ambient = 76.41*F Object = 71.40*F

Ambient = 24.71*C Object = 21.85*C
Ambient = 76.48*F Object = 70.93*F

Ambient = 24.69*C Object = 21.81*C
Ambient = 76.44*F Object = 71.26*F

Ambient = 24.67*C Object = 21.85*C
Ambient = 76.41*F Object = 71.40*F

Ambient = 1037.55*C Object = 1037.55*C
Ambient = 1899.59*F Object = 1899.59*F

Ambient = 1037.55*C Object = 21.91*C
Ambient = 76.55*F Object = 71.47*F

Ambient = 24.71*C Object = 21.97*C
Ambient = 76.48*F Object = 71.55*F

Ambient = 24.73*C Object = 22.03*C
Ambient = 76.55*F Object = 71.76*F
http://www.codekraft.it

https://github.com/codekraft-studio

Merlin513

Hi Erik

For the heck of it I tried connecting to the HMC5883L via wires to a breadboard versus using a protoboard (thought the pin length may be an issue).  Anyway it worked well.  I can not think of anything else - so must be a issue with the board itself.  Sorry I couldn't help you more.  Maybe the Moderator could help here.

Mike

Merlin513

Hi Erik,

Was playing around with some other functions and just went back to the HMC5883L - now the same board that was work with no problems is no longer recognized by the scanned - I attached a different board and the same thing.  Oh well. Just thought you would like to know.

erikyo

#24
Mar 07, 2016, 03:17 am Last Edit: Mar 07, 2016, 01:15 pm by erikyo
Excuse Marlin but I have not received the notifications of answers, and I had not seen you wrote.

I also have tried 101/i2c later with other computers, with other versions of the IDE but compass do not want to work. At that point I had left and I decided to start to do another project, hoping that sooner or later I could figure out what's wrong.

Now I tried again to download it from github Arduino corelibs but nothing changes, I tried to look for an older version of corelib but have not found them.

I ordered a 9 dof (MPU-9255), I hope this is compatible, in the worst case I'll use it with my Arduino UNO.

Last week I sent a couple of emails to technical support I am still waiting for the answer ... :-/

Erik
http://www.codekraft.it

https://github.com/codekraft-studio

Merlin513

Hi Erik

Thanks for getting back to me.  The compass was working for me and then I started playing around with BLE then went back to the magnetometer and that's when the trouble started with the I2C bus.  I put the same breakout board on the mega and ran the same program and I2Cscanner and it worked fine so I know its not the breakout board.    Based on the tests with the other IMUs the I2C issue seems to be with the corelib or the board design, not sure.

Either way I shelved the 101 for awhile since I had a couple of projects I was in the middle of. I will eventually get back to it.

Let me know how the 9250 works out for you.

Mike

erikyo

I think also the core lib can be the problem, especially if you say that once worked and now it does not work both to me and to you. You have any idea where I can download the old corelibs?

I took the MPU 9255, and not 9250 because I remember you said that was not recognized (http://www.invensense.com/products/motion-tracking/9-axis/mpu-9255-2/)

Erik
http://www.codekraft.it

https://github.com/codekraft-studio

Merlin513

Hi Erik

Try going to the Boards Manager - do a remove and then a re-install - that should be the current version.  I think the version on Github is the one that is the work in progress.

Thanks for the info on th 9255 - didn't know it was out.  Just order a 10Dof version from Amazon.  


Thanks
Mike

erikyo

Try going to the Boards Manager - do a remove and then a re-install - that should be the current version.  I think the version on Github is the one that is the work in progress.
Hi Mike,
In board manager I can't install an old version of corelib, but only the last stable. I'm looking for an older, if possible, but i can't find nothing.

Erik
http://www.codekraft.it

https://github.com/codekraft-studio

Merlin513

Hey Erik

Sorry - misunderstood.  Not sure you can - just poked around Github and didn't notice any way to get earlier versions of the corelib. 

Did notice that there is an outstanding issue on I2C but not sure that will help this problem or not, its identified as a bug.  Our moderator put it in.

Mike

Go Up