Pages: [1]   Go Down
Author Topic: i2cdevlib + MS561101BA + due  (Read 1512 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi I try to talk to an MS561101BA on the due.

The newest version of i2devlib works well on the due with HMC5883L MPU6050 and BMP085.
https://github.com/jrowberg/i2cdevlib

For the MS561101BA  I use the library made by Manuel J Guisado using i2devlib, which works just fine on the arduino uno.
https://github.com/mjguisado/i2cdevlib/tree/master/Arduino/MS561101BA

There is no example but this is an minimal one which works on the uno (sensor powered with 3.3V and pullups disabled):
Code:
#include "Wire.h"
#include "I2Cdev.h"
#include "MS561101BA.h"
MS561101BA baro(0x77); // address of the sensor on freeimu 0.4
float pressurem;
float temperaturem;

void setup() {
    Wire.begin();
    Serial.begin(57600);
    baro.initialize();
    Serial.println(baro.testConnection() ? "baro connection successful" : "baro connection failed");
    // this gives false positive value on the due I think due to the problems with wire ?
}

void loop() {
baro.setOverSampleRate(256);
baro.readValues(&pressurem, &temperaturem);
Serial.print(pressurem); Serial.print("\t");
Serial.print(temperaturem); Serial.println("\t");
}

I get no error message while uploading to the due, but it only prints 0 values for temperature and pressure.

Any idea is appreciated.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I still have no success with the i2cdevlib but i manged to use the MS5611 using Flavio Varesano freeimu libary.
After some minor changes the raw reading function of the libary works well on the due.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I have exactly the same setup and facing the same problems. Can you please post a link to the library you have used? What have you changed?

Best regards,
Dan.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can find the original libary here:
http://www.varesano.net/files/FreeIMU-20121122_1126.zip
It is not form me. I am not at home now, so I can not send you the changed one, but it is mainly replacing the int with int16_t.

Thomas
Logged

0
Offline Offline
God Member
*****
Karma: 24
Posts: 587
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a copy of FreeIMU with the last updates Fabio made.

http://www.pjrc.com/teensy/beta/freeimu_trunk-r49.tgz

This was ported and tested on Teensy 3.0, which has a similar 32 bit ARM CPU as Arduino Due.  The 16 bit integer problems are fixed in this version.  AVR-only hacks like TWBR are surrounded by #ifdef checks.  A difficult problem with the inverse square root function when compiling on ARM was also fixed.

It hasn't been tested on Arduino Due, but those fixes for Teensy 3.0 will probably save you a lot of trouble, hopefully leaving only relatively easy stuff to support Due.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thx,
I'll give it a try and keep you posted on the results.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did anyone manage to get the MS561101BA working with the Due?

I've spent 10 hours, trying absolutely everything but to no avail  smiley-sad
Logged

Pages: [1]   Go Up
Jump to: