Clock with BMP180

I am having a problem interfacing a Bmp180 into a clock program, without the Bmp180 clock functions as it should, adding the program of the Bmp180 clock stops and Bmp180 keeps working displaying Temp, Press, Alt, and Atm and a non functioning clock and no Date or Day.
I have pullup resistors (4.7k) on the Sda and Scl lines of the Bmp180 and Ds3231 into a Mega2560 and a 480x320 Tft Lcd.
The same clock program with a Dht11 works as it should, Time, Date, Day, Temp, and Humi.
Is there a problem interfacing the Bmp180 and Ds3231, or is there a part of the program I have missed.
I have enclosed the program as is at the moment.
Any advice will be of great help.

#include "Wire.h"
#include <DS1307.h> // link library DS1307
#include <UTFT.h> // link library UTFT
#include "Barometer.h"

 //#define DS1307_I2C_ADDRESS 0x68
 
 DS1307 rtc (20, 21); // Initialize inputs
 
 
float temperature;
float pressure;
float atm;
float altitude;
Barometer myBarometer;
 

 
 extern uint8_t BigFont []; // Connect the font DotMatrix_M
 extern uint8_t SevenSeg_XXXL_Num []; // Connect the font SevenSeg_XXXL_Num
 extern uint8_t SmallFont[];
 
 UTFT myGLCD (CTE32HR, 38,39,40,41); // Connect the display TFT01_22SP
  
 
 void setup ()
 {
  //rtc.setTime(15, 36, 00);     
  //rtc.setDate(05, 04, 2015);
  //rtc.setDOW(SUNDAY);
  
  rtc.halt (false); // Start the clock
  
  Serial.begin(9600);
  
  myBarometer.init();
  
  myGLCD.InitLCD (); // Initialize the display
  myGLCD.setFont(BigFont);
  myGLCD.fillScr (0, 0, 0); // Paint over the display in black
  
      
 }
 
 void loop ()
 {
   String stringOne = rtc.getTimeStr ();
   
   myGLCD.setColor (255, 255, 255); // Display color
  myGLCD.setFont (SevenSeg_XXXL_Num); // Font to display
  myGLCD.print (stringOne.substring (0,2), 02, 60); // Display the clock
  myGLCD.print (stringOne.substring (3,5), 150, 60); // Display the minute
  myGLCD.print (stringOne.substring (6,8), 310, 60); // Display the minute
  myGLCD.fillCircle (140, 88, 7); // The top point
  myGLCD.fillCircle (140, 133, 7); // Low Point
  myGLCD.fillCircle (295, 88, 7); // 2nd top point
  myGLCD.fillCircle (295, 133, 7); // 2nd Low Point

  myGLCD.setColor (0, 255, 0); // Display color
  myGLCD.setFont (BigFont); // Font to display
  myGLCD.print (rtc.getDateStr (), 120, 260); // Display the date
  myGLCD.print(rtc.getDOWStr(), 133, 290); // Display the day
  
   
   temperature = myBarometer.bmp085GetTemperature(myBarometer.bmp085ReadUT()); //Get the temperature, bmp085ReadUT MUST be called first
   pressure = myBarometer.bmp085GetPressure(myBarometer.bmp085ReadUP()); //Get the temperature
   altitude = myBarometer.calcAltitude(pressure); //Uncompensated calculation - in Meters 
   atm = pressure / 101325;
  
  
  myGLCD.setColor(255, 0, 0); //Red
  myGLCD.setFont (SmallFont); // Font to display
  myGLCD.print ("Temp: ", 30, 170);
  myGLCD.setColor(255, 255, 0); //Yellow
  myGLCD.setFont (BigFont);
  myGLCD.printNumF (temperature,2, 70,170);
  myGLCD.setFont (BigFont);
  myGLCD.print ("C", 160, 170);
  
  
  myGLCD.setColor(255, 0, 0); //Red 
  myGLCD.setFont (SmallFont); // Font to display
  myGLCD.print("Press:", 190, 170);
  myGLCD.setColor(255, 255, 0); //Yellow
  myGLCD.setFont (BigFont);
  myGLCD.printNumF (pressure,2, 240,170);
  myGLCD.setFont (BigFont);
  myGLCD.print ("Pa", 390, 170);
  
  myGLCD.setColor(255, 0, 0); //Red
  myGLCD.setFont (SmallFont); // Font to display
  myGLCD.print ("Atmos: ", 30, 200);
  myGLCD.setColor(255, 255, 0); //Yellow
  myGLCD.setFont (BigFont);
  myGLCD.printNumF (atm,2, 80,200);
  
  
  myGLCD.setColor(255, 0, 0); //Red
  myGLCD.setFont (SmallFont); // Font to display
  myGLCD.print ("Alt: ", 160, 200);
  myGLCD.setColor(255, 255, 0); //Yellow
  myGLCD.setFont (BigFont);
  myGLCD.printNumF (altitude,2, 195,200);
  myGLCD.setFont (BigFont);
  myGLCD.print ("m", 285, 200);
  
}

JQuinn:
Any advice will be of great help.

I2C logic level voltage for DS1307 ==> 5 volts
I2C logic level voltage for BMP180 ==> 3.3 volts

I think you will need a level shifter circuit for I2C to make both devices work on the same I2C bus at the same time. As the DS1307 only works with 5V I2C logic level, you will have to shift the BMP180 logic level voltage.

Or perhaps use a different RTC module:

  • which either works on a different bus (SPI instead I2C? DS3234?)
  • or which can work on lower I2C logic level voltages such like 3.3V (DS3231?)

When trying to use a DS3231 you are not allowed to use 2 sets of pull-up resistors:

  • BMP180 module pull-up resistors connected to 3.3V
  • DS3231 module pull-up resistors connected to 5.0V
    The resulting voltage (4.2V or something) would be too high for the BMP180!
    Remove the 5V pull-up resistors from the DS3231 module!

In answer to your response, I am using DS3231 and when more than two (2) I2C devices are used then pullup resistors are required to +5v.
Tronixstuff have a tutorial on “Arduino and the I2C bus” where the use of pull-ups is explained.
As a footnote I have the same configuration on a breadboard using a UNO, Bmp180, Ds3231 (with pull-ups), and a 20x4 lcd and this configuration works showing Temp, Press, Alt, Time, and Date as it is supposed to.
The combination of software of the Bmp180, Ds3231 and UTFT is causing Time and Date not to be shown, and this is the reason I am asking for help with this project.

Tronixstuff Tutorials : Arduino Tutorials | tronixstuff.com

Arduino and I2C Part 1
Arduino and I2C Part 2

At first glance, the information seems okay. I can't find how to mix a 3.3V and 5V I2C bus, I think they need "Part 3" for that.

JQuinn, jurs is right, you can't just mix 3.3V and 5V I2C devices. We don't care if it worked in an other situation.

I use a small I2C level shifter to create a 3.3V and 5V I2C bus, and connect every sensor to the appropriate bus. A level shifter shifts the levels from 3.3V to 5V and from 5V to 3.3V. In the sketch the I2C will be just like a single I2C bus.

You might have broken your chip testing it out in the bread board. Like the others have said you can't pull up a 3V3 chip to 5V.

One way to mix them on the same bus is to use analogue switches on both busses and switch between the two devices.

The other thing you could try is pulling up only to 3V3 as the 5V device might just work with that.
This means disabling the internal pull-ups in the library or using a library that does not enable then by default.