Wrong values from the MS5611

Hi everyone,
I'm trying to build an altimeter, but I have some issue with the values that the sensor gives to me.

In the data sheet says that the max value for the digital preressure and temperature data is "16777216", but when I read those values I get numbers like : "4294966164" , "42949628962".

This is the output of my code:

4294959834
4294956092
1914
-37066863

4294959238
4294957386
1919
-37057747

4294958860
4294958674
1923
-37048674

The temperature is working good but the pressure values are wrong.

This is the link to the datasheet: https://www.te.com/commerce/DocumentDelivery/DDEController?Action=showdoc&DocId=Data+SheetMS5611-01BA03B3pdfEnglishENG_DS_MS5611-01BA03_B3.pdfCAT-BLPS0036

This is the code that I've programmed:

#include <Wire.h>
uint8_t MS5611 = 0x77;

int16_t C[7];

uint32_t D1, D2, loop_timer;

uint8_t start;
uint8_t cicle, Tcicle;
int32_t dT, TEMP, P;
int64_t OFF, SENS;


void setup() {
  
  Wire.begin();
  Serial.begin(57600); 
  
  
  for (start = 1; start <= 6; start++) {                       
    Wire.beginTransmission(MS5611);                             
    Wire.write(0xA0 + start * 2);                              
    Wire.endTransmission();                                    

    Wire.requestFrom(MS5611, 2);                              
    C[start] = Wire.read() << 8 | Wire.read();                
  }   
}

void loop() {
  
  Wire.beginTransmission(MS5611);
  Wire.write(0x48);
  Wire.endTransmission();
  delay(9);
  
  Wire.beginTransmission(MS5611);
  Wire.write(0x00);
  Wire.endTransmission();
  Wire.requestFrom(MS5611, 3);
  D1 = Wire.read() << 16 | Wire.read() << 8 | Wire.read();
  Serial.println(D1);

  Wire.beginTransmission(MS5611);
  Wire.write(0x58);
  Wire.endTransmission();
  delay(9);
  
  Wire.beginTransmission(MS5611);
  Wire.write(0x00);
  Wire.endTransmission();
  Wire.requestFrom(MS5611, 3);
  D2 = Wire.read() << 16 | Wire.read() << 8 | Wire.read();
  Serial.println(D2);

  dT = D2 - C[5] * 256;
  TEMP = 2000 + dT * C[6]/8388608;

  Serial.println(TEMP);
  
  OFF = C[2] * 65536 + (C[4] * dT)/128;
  SENS = C[1] * 32768 + (C[3] * dT)/256;
  P = (D1 * SENS/2097152 - OFF)/32768;

  Serial.println(P);
  Serial.println("  ");
  
  
}

Why don't you use one of the ready-made MS6511 libraries?

Why do you start counting at 1? You allocate but don't use the first int of array C. Are you sure that should be signed integers, not unsigned?

The common libraries use lots of delays that doesn't work in the project where I need this sensor to work.

In the data-sheet explains what type of variables should you declare for every value. Also in the data-sheet all the calibration values are storaged in variables from C1 to C5, so I decided to go the same way to minimize errors.

Does your sensor work with those libraries? If not, make sure your sensor is fine, or try another library/sensor. Make sure you have a known good starting point.

If so, that'd be my starting point for making the code delay()-free. As it's VERY unusual to see delay() in a library you should REALLY make sure you understand WHY the authors use delay() there. If you see it in multiple libraries (a quick Google search turned up three) you can expect it to be out of necessity, and you will have to build in the same waiting time. It's quite common to a command, then wait a bit for the sensor to do its thing, and when the measurement is ready, read it. Of course you can use the millis() timer as well with this, to make it non blocking.