SPI Reading Speed Acceleration Sensor

Hello,

I have a problem reading my acceleration sensor fast enough.
I'm using an Arduino Nano Every and two ADXL 357 acceleration sensors. I want to log the Data to an SD card and achieve at least a frequency of 1kHz (rather 2 kHz).
I'm using the FIFO buffer to read a lot of sensor data at once. The Buffer can take up to 96 values and I'm reading it when 81 (27*x, y & z) are reached. The Acceleration Data consists of 20 Bit, so I have to read 3 Byte per value. That makes it 243 Byte (1944 Bit) to read the FIFO Buffer. I'm using an SPI frequency of 5Mhz, so I would ideally need about 0.4 ms to read the FIFO Buffer (I know that this is impossible, because SPI also needs to send Data before reading, but im just looking at the magnitude).
I measure the time for the read and it takes about 16 ms to read the FIFO Buffer of one Sensor. The time also doesn't change when I lower the SPI frequency to 1Mhz and I can't use 10 Mhz because thats too much for my wiring (even though the Sensor could do it).

Here is the code for the read function and my SPI settings.

void ADXL357::readMultipleFIFORegisters(int dataSize, uint8_t *Dataread, int start) {
    uint8_t address = 0x23;
    digitalWrite(_CS_Pin, LOW);
    SPI.transfer(address);
    for (int i = start; i < dataSize + start; i++) {
        Dataread[i] = SPI.transfer(0x00);
    }
    digitalWrite(_CS_Pin, HIGH);
}
    SPI.begin();
    SPISettings settings(5000000, MSBFIRST, SPI_MODE0);
    SPI.beginTransaction(settings);

Thank you for your Help!
Till

It sounds like a fun project. You might want to re-think your approach. SD cards have read and write times and they are not all the same. Without any knowledge of what card you have I can only suggest you look it up and determine if it is fast enough. Also there is some overhead when writing to the SD card and they also do wear leveling. Take a look at FRAM, it is fast and does not wear out like SD cards.

Thanks for your input. I looked up FRAM and i couldn't find any with enough storage capacity for my project (about 1 GB).
The SD card takes about 16 ms to write the full FIFO Data from both Sensors, which is not ideal but I can deal with that. The only problem there is that after about 30 seconds of recording the write time jumps up to 35 ms which I have to figure out why that happens and solve the problem.
The main thing that holds me back right now is the read time for the Sensor.

In case anyone has the same problem, here is my solution.
The Logic Level Converter is too slow for a high SPI Frequency, so this was the problem. You can use the LLC for all lines, except the MISO line. Just plug the MISO directly into the Arduino, it is able to read Data with a voltage of 3.3V and I think that the Arduino does not supply any voltage through this pin, so the Sensor doesn't take any damage (all Inputs to the Sensor should be 3.3V, not 5V!). Please correct me if I'm wrong, but it is working for me right now.