UNO vs Mega2560

Here is the link to the clock. I use same Pins that you can see in the photo:

Here is the code:

#include <Wire.h>  
#define DS1307_I2C_ADDRESS 0x68

byte decToBcd(byte val)
{
  return ( (val/10*16) + (val%10) );
}
byte bcdToDec(byte val)
{
  return ( (val/16*10) + (val%16) );
}

void setDateDs1307(byte second,        // 0-59
                   byte minute,        // 0-59
                   byte hour,          // 1-23
                   byte dayOfWeek,     // 1-7
                   byte dayOfMonth,    // 1-28/29/30/31
                   byte month,         // 1-12
                   byte year)          // 0-99
{
   Wire.beginTransmission(DS1307_I2C_ADDRESS); 
   Wire.write(0);              
   Wire.write(decToBcd(second)); 
   Wire.write(decToBcd(minute));
   Wire.write(decToBcd(hour)); 
   Wire.write(decToBcd(dayOfWeek));
   Wire.write(decToBcd(dayOfMonth));
   Wire.write(decToBcd(month));
   Wire.write(decToBcd(year));
   Wire.endTransmission();
}

void getDateDs1307(byte *second,
          byte *minute,
          byte *hour,
          byte *dayOfWeek,
          byte *dayOfMonth,
          byte *month,
          byte *year)
{
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.write(0);
  Wire.endTransmission();

  Wire.requestFrom(DS1307_I2C_ADDRESS, 7);

  *second     = bcdToDec(Wire.read() & 0x7f);
  *minute     = bcdToDec(Wire.read());
  *hour       = bcdToDec(Wire.read() & 0x3f);  // Need to change this if 12 hour am/pm
  *dayOfWeek  = bcdToDec(Wire.read());
  *dayOfMonth = bcdToDec(Wire.read());
  *month      = bcdToDec(Wire.read());
  *year       = bcdToDec(Wire.read());
}
void setup()
{
  byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
  Wire.begin();
  Serial.begin(115200);
  second = 0;
  minute = 0;
  hour = 9;
  dayOfWeek  = 3; 
  dayOfMonth =  24;
  month = 10;  
  year = 12;
}
    Serial.print("<");                                     // Here is where I print the date, the delays are cause I send it via sms.
    if (dayOfMonth < 10) Serial.print("0");
    Serial.print(dayOfMonth);
    Serial.print("/");
    delay(1500);
    
    if (month < 10) Serial.print("0");
    Serial.print(month);
    Serial.print("/");
    delay(1500);
    
    Serial.print("20");
    Serial.print(year);
    Serial.print(",");
    delay(1500);
    
    if (hour < 10) Serial.print("0");
    Serial.print(hour);
    Serial.print(":");
    delay(1500);
    
    if (minute < 10) Serial.print("0");
    Serial.print(minute);
    Serial.print(":");
    delay(1500);
    
    if (second < 10) Serial.print("0");
    Serial.print(second);
    Serial.print(">*");
    delay(1500);