A FIFO (First In First Out)

本文介绍了FIFO(先进先出)缓冲机制的工作原理及其在BrainBoxes串行设备中的应用。通过使用硬件FIFO,可以有效减少数据丢失的风险,并提高数据传输效率。文章还探讨了不同大小FIFO的应用场景及如何通过设置触发级别来进一步优化数据处理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

A FIFO (First In First Out) is a type of buffer, where the first byte to arrive is the first to leave.

BrainBoxes Serial Devices all have Hardware FIFOs. FIFOs reduce the chances of data loss by 'buffering' the data. This way the device driver can then read all of the data from the FIFO in one go, whilst communication is still continuing.

If you imagine someone asking you to load apples on to a lorry. If they hand you one at a time they are likely to be ready with the next apple before you have got back from the lorry. If you ask them to fill a box however, whilst you take a box they can be filling the next box. This is how a FIFO works. You use what is called a trigger level to determine at what point (how full) the buffer should be emptied by the driver; or in the analogy how full do you let the box get before taking it to the lorry. Some Brain Boxes cards have the standard 16 byte FIFO on it, but some have a 64 byte FIFO and Photon cards have a 128 byte FIFO. In an application where it may not be possible to implement flow control a very large buffer with a modest receive trigger level can significantly reduce data loss.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值