nrf24l01+

来源:互联网 发布:股票量化软件 编辑:程序博客网 时间:2024/05/22 02:24

nrf24l01+的datasheet比nrf24l01的datasheet要详细好多好多,在系统的状态机描述,以及异常情况的描述上。

nrf24l01+与nrf24l01的区别:

相比功耗有所降低。

250kbps传输模式。

数据包格式变化,添加数据长度段,实现变长数据包长度传输。

添加了no_ack,不需要应答flag。

接收端在应答的时候可以带数据了,一定程度上实现了全双工的通信。

An ACK packet can contain an optional payload from PRX to PTX. In order to use this feature, the 
Dynamic Payload Length (DPL) feature must be enabled. The MCU on the PRX side has to upload the payload by clocking it into the TX FIFO by using the W_ACK_PAYLOAD command. The payload is pending in the TX FIFO (PRX) until a new packet is received from the PTX. nRF24L01+ can have three ACK packet payloads pending in the TX FIFO (PRX) at the same time.

一个ack包可以包含一个从接收端到发送端的有效数据。需要使能Dynamic Payload Length (DPL)功能,接收端需要通过 W_ACK_PAYLOAD 命令把回送的有效数据送到

tx fifo中去。这些有效数据会一直保存在tx fifo中知道接收到新的从发送端发过来的数据包。nRF24L01+能同时保存三个应答有效数据。

Figure 7. shows how the TX FIFO (PRX) is operated when handling pending ACK packet payloads. From the MCU the payload is clocked in with the W_ACK_PAYLOAD command. The address decoder and buffer controller ensure that the payload is stored in a vacant slot in the TX FIFO (PRX). When a packet is received, the address decoder and buffer controller are notified with the PTX address. This ensures that the right payload is presented to the ACK generator.

图7显示 tx fifo在ack应答时是如何运作的。接收端通过 W_ACK_PAYLOAD 命令把回送的有效数据送到tx fifo中去,地址解码器和buf控制器确保有效数据被保存在空槽中。当接受

到一个数据包,地址解码器和buf控制器就获取到了发送端的地址,确保正确的数据被挂在正确的ack包中。

If the TX FIFO (PRX) contains more than one payload to a PTX, payloads are handled using the first in – first out principle. The TX FIFO (PRX) is blocked if all pending payloads are addressed to a PTX where the link is lost. In this case, the MCU can flush the TX FIFO (PRX) by using the FLUSH_TX command.

如果tx fifo有多个会送有效数据,先来的先发送。如果连接断开了,则tx fifo中的数据会被阻塞,这时候就需要用FLUSH_TX来清空fifo。

In order to enable Auto Acknowledgement with payload the EN_ACK_PAY bit in the FEATURE register must be set.

需要置位EN_ACK_PAY bit in the FEATURE register。


0 0
原创粉丝点击