I am trying to use a BMP085 pressure/temperature sensor with a Teensy 3.5. The BMP085 is on a Sparkfun board (their SEN-09694), connected through a level shifter (SparkFun BOB-11955). The code I'm using is from AdaFruit. To reduce complexity, I've merged the AdaFruit code into one program instead of using #includes, and I've eliminated some AdaFruit code that is not relevant.
This works perfectly when the connection is made through the default I2C lines (pins D18 & D19), but it fails when I use the I2C lines at D03 & D04. In other words, the attached code fails (it does not find the expected 0x55 in the ChipID register) when the asterisk-heavy lines in
are left in place and the BMP085 is at D03 & D04, but it works when those lines are commented out and the sensor is moved to D18 & D19. Is there a known fix?
This works perfectly when the connection is made through the default I2C lines (pins D18 & D19), but it fails when I use the I2C lines at D03 & D04. In other words, the attached code fails (it does not find the expected 0x55 in the ChipID register) when the asterisk-heavy lines in
Code:
bool Adafruit_BMP085_Unified::begin(bmp085_mode_t mode)
{
// Enable I2C
Wire.setSDA(pinBMP085SDA); // Teensy-specific ************************
Wire.setSCL(pinBMP085SCL); // .. ************************
Wire.begin();
/* Mode boundary check */
if ((mode > BMP085_MODE_ULTRAHIGHRES) || (mode < 0))
{ mode = BMP085_MODE_ULTRAHIGHRES; }
/* Make sure we have the right device */
uint8_t id;
read8(BMP085_REGISTER_CHIPID, &id);
if (id != 0x55)
{ return false; }
_bmp085Mode = mode;
readCoefficients(); // coefficients need to be read once
return true;
} // Adafruit_BMP085_Unified::begin(bmp085_mode_t mode)