How manage multiples modules with SPI?

I wouldn't do that. Running it without VCC is running the chip off parasitic power derived from the data lines. That won't be good for it. Solve the problem instead.

I agree with SurferTim. Fiddling with the CS for the SD card in the readRegister function is completely the wrong place for it. Leave those lines out.

If you look at their diagram on page 10 of the datasheet, I would not be lowering and raising CS for the barometer for each reading.

Put the CS stuff around all this:

    writeRegister(0x24, 0x00);      // Start Both Conversions
    //writeRegister(0x20, 0x00);    // Start Pressure Conversion
    //writeRegister(0x22, 0x00);    // Start temperature conversion
    delay(2);                       // Max wait time is 1ms, typ 0.8ms
    
    // Read pressure
    uiPH = readRegister(PRESH);
    uiPL = readRegister(PRESL);
    uiTH = readRegister(TEMPH);
    uiTL = readRegister(TEMPL);

And don't change it in writeRegister or readRegister. Of course all that could be simplified now:

    digitalWrite(MPL115A1_SELECT_PIN, LOW);
    SPI.transfer (0x24 & MPL115A1_WRITE_MASK);
    SPI.transfer (0x00);
    digitalWrite(MPL115A1_SELECT_PIN, HIGH);
    
    delay(1);                       // Max wait time is 1ms, typ 0.8ms
    
    digitalWrite(MPL115A1_SELECT_PIN, LOW);
    SPI.transfer (PRESH | MPL115A1_READ_MASK);
    uiPH = SPI.transfer (0x00);
    SPI.transfer (PRESL | MPL115A1_READ_MASK);
    uiPL = SPI.transfer (0x00);
    SPI.transfer (TEMPH | MPL115A1_READ_MASK);
    uiTH = SPI.transfer (0x00);
    SPI.transfer (TEMPL | MPL115A1_READ_MASK);
    uiTL = SPI.transfer (0x00);
    digitalWrite(MPL115A1_SELECT_PIN, HIGH);

Tip: Might be nice to have a define for 0x24, since you have ones for all the others. :slight_smile: