Some questions about esb tx/rx packet transaction

Hi all,

In nRF5 SDK User Guide, this link.

I want to know what this sentence means.

An Enhanced ShockBurst packet transaction is initiated by a packet transmission from the PTX and successfully completed when the PTX has received an acknowledgment packet (ACK packet) from the PRX.

To enable a bidirectional data link, the PRX is allowed to attach a data payload to the ACK packet. To do so, the PRX adds a packet to its TX FIFO, which is sent as the payload in the next ACK packet.

If I want to send something over RX, I must attach a data payload to the ACK packet. So I have to use the nrf_esb_write_payload(&tx_payload); to add the packet to TX FIFO, and must do this in the event handler function.

Do I understand correctly?

And I did find that RX cannot send packets directly.

Best regards,

Lurn

Parents
  • Hello,

    The easiest may be to also look at prx example in the nRF5 SDK:
    \nRF5_SDK_17.1.0_ddde560\examples\proprietary_rf\esb_low_power_prx\

    There you can find that the prx for instance is calling nrf_esb_write_payload() to send data from the prx to the ptx, this data will be attached in reverse direction on the next packet is received from the ptx. You are right that the prx can only attach packets to a packet that is first initiated by the ptx, so if the ptx expects data from the prx, then the ptx should send a packet periodically to fetch this data.

    Kenneth

  • Hi Kenneth,

    if the ptx expects data from the prx, then the ptx should send a packet periodically to fetch this data.

    I can send some data over RX after receive TX message, but after sent a few messages, I found it doesn't send data anymore.

    In ESB PTX, I use a timer to send packet periodically(100ms), then I send data to PRX over UART, when PRX received the data, it will call nrf_esb_write_payload().

    I can make sure that PRX received the data from UART every time and called nrf_esb_write_payload(), but PTX only  received the first few pieces of data.

    Can you give me some advice on this issue?

    Best regards,

    Lurn

  • My best suggestion to go back to the sdk examples and compare how you are handling the nrf_esb_event_handler() handler.

    Kenneth

  • Hi Kenneth,

    I have another question about the tx/rx transaction.

    Can I send data to PTX2 when RX receives data from PTX1?

    If it is possible, how can I do it?

    Or can the TX only receive data within a short period of time after sending the data? It looks like this.

    Best regards,

    Lurn

Reply Children
Related