I don't find the datasheet at all clear on how to read out the values from the FIFO.
Is it necessary to repeatedly read the individual triplets
for each triplet
{
sensor_comm_read( handle, FXLS896xAF_BUF_X_LSB, 6, data );
}
Or will a single burst read get all the triplets
sensor_comm_read( handle, FXLS896xAF_BUF_X_LSB, number_of_triplets*6, data );
ie, does the auto-increment loop-back from BUF_Z_MSB to BUF_X_LSB so long as there is more data in the FIFO?
Hello andrewneil,
I hope all is great with you. Thank you for using the NXP communities.
The byte order of the output data is programmable via SENS_CONFIG2[LE_BE], and defaults to little-endian mode.
If SENS_CONFIG2[F_READ] = 1, the auto increment mechanism skips over the MSB registers. This operation shortens the output data size from 6 bytes to 3 bytes per XYZ sample.
I do recommend downloading the driver example from the link below and using it as a reference for your design.
Sensor Drivers for NXP Sensors
I hope this information helps.
Regards,
David
I'm sorry, that doesn't answer the question at all.
The question is, to read the entire FIFO:
In other words, what happens in a burst read after reading BUF_Z_MSB (0x11):
I have downloaded the drivers - they do not illustrate this.
Hello andrewneil,
Please accept my apologies for the misunderstanding.
You are correct, should perform multiple burst reading procedures to read the entire buffer.
Regards,
David
@diazmarin09 - should perform multiple burst reading procedures
Really?
As already noted, that Table 20 in the datasheet is very confusing:
But I think I've now managed to figure it out:
So a Normal (F_READ=0) burst read of 13 bytes starting at 0x0B should get:
Yes ?
Or have I still not understood Table 20 ?
Hello andrewneil,
I know that Table 20 is indeed confusing, but your understanding is correct. I mean, that is the expected registers sequence with the auto-increment feature and F_READ=0.
Regards,
David
Good.
So it should require just one burst to read the entire FIFO?
BUF_STATUS[BUF_CNT] indicates the number of triplets required, so the total burst length required would be six times the BUF_STATUS[BUF_CNT] value ?
I know that Table 20 is indeed confusing
It certainly is!
I will update the other thread on that topic:
Hello andrewneil,
BUF_STATUS[BUF_CNT] indicates the number of triplets required, so the total burst length required would be six times the BUF_STATUS[BUF_CNT] value?
You are correct, my apologies for the confusion. I do appreciate your efforts.
Regards,
David