why would you use FIFO

Hi everyone, I'm working on a project which involves a mpu6050 and in the datasheet I find a lot of registers dedicated to FIFO buffers. Now, what is the benefit of using those. I do not understand since I am relative new in the arduino world.
Thanks in advance for answering

FIFO first in first out. Data is placed in a FIFO buffer, information comes into the FIFO buffer, and the device signals the Arduino that data is ready.

By placing them in a FIFO buffer, the device can get the next packet of data ready.

FIFO means First IN First Out.
It basically means that the first thing to come into the buffer is the First thing to come out.
(It's basically like a queue in the supermarket.)
This is useful if you want to work with you readings in the order they came in.
For other use cases, there's also FILO (First In, Last Out), wich is use more rarely.

Hi,
As stated First In First Out.

Consider an 8 bit word, and you want to store it in a register, and you can only load the register ONE bit at a time.
So you load the 1st bit, then the 2nd, then the 3rd all the way to the 8th. First bit in.

Then you want to read that register back to another controller or device.
Usually you unload, 1st bit, then 2nd bit, then 3rd bit all the way to the 8th.
So the first bit in is the first bit out when you read the register.

To the controller reading the bits, the word could have come directly from the originating device.

FIFO also allows for speed differences, like 1200 baud in, but you can read the register at 9600 baud out if that is the only speed the reading device can use.

I hope its a bit clearer and not mud, feel free anyone to edit/error check my explanation.
Its 2:46am, I'm off to bed.

Tom.... :sleeping: :sleeping: :sleeping:

It also helps with timing and/or multi-tasking. Serial data comes into the FIFO at the normal baud rate, and the processor can read it "whenever". You don't need to read that data "randomly". You want to read the data in the same order it came-in (first-in, first-out).

When you record audio (or video) on a computer the data flow-in at a smooth-constant rate and it goes into a buffer (first-in, first-out) and when the operating system gets around to it, the data is read from the buffer and written to the hard drive in a quick burst.

One example of a LIFO is a "stack" (often visualized as a stack of dinner plates where the last one added is the stack is the first one used). Your browser history is stored as a stack and the "back" button brings-back the web pages in reverse order.

A printer queue is FIFO.

PantherPlayz:
For other use cases, there's also FILO (First In, Last Out), wich is use more rarely.

Except, you're using right . . . now.

Heavily. :wink: