This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Quick switch between TX and RX in nrf51822 proprietary

Hi,

As well know, the nrf51822 can only work either TX or RX mode at the same time.

Normally, the nrf51822 device is working in RX mode (by using function "nrf_esb_start_rx()" for receive packet.

If I want to send packet, then this device need change to TX mode.  Does I need  use "nrf_esb_disable()" to disable ESB before change device to TX and use "nrf_esb_write_payload()"  to send packet?

The above procedure seems to take a lot of time to execute.

Would you please give me an method which can switch quick switch between TX and RX mode in proprietary protocol?

Thank you

Chianglin

Parents
  • Hi Chianglin

    The idea behind the ESB protocol is to use the built in ACK feature to send data from the PRX to the PTX, rather than having to manually switch modes. 

    By default the PRX will send an ACK packet after each packet received from the PTX, and you can embed data in this ACK if you want. 

    Have you looked into using this method to achieve bidirectional communication, or is there some reason this method is not suited for your application?

    Best regards
    Torbjørn

  • Hi Torbjørn,

    Thank you four your answer.

    I had study the ESB manual, but the PRX can only embed data in ACK and send to PTX site.

    For example, if PRX had receive one packet and the packet need forward to other node, then I need change current PRX node to PTX mode. After send packet to other node, the current node need change back to PRX mode, so it can listen packet.

    What is the fastest way to change between PTX and PRX?

    Thank you,

    Chianglin

  • Hi Chianglin

    In that case I agree using ACK payloads is probably a bit impractical. 

    Unfortunately the only safe way to change between PTX and PRX mode is to disable and re-init ESB. 
    Most applications don't have to change between the two, and we haven't tested what would happen if you were to start the RX mode after initializing ESB in PTX mode. 

    It should be possible to improve ESB to support a more dynamic switching between PTX and PRX modes, and I have requested this internally, but I don't know when we will be able to implement it unfortunately. 

    For the time being you would have to stick to the slow method. 

    I am a bit surprised the init takes such a long time. Have you measured this?

    Best regards
    Torbjørn

Reply
  • Hi Chianglin

    In that case I agree using ACK payloads is probably a bit impractical. 

    Unfortunately the only safe way to change between PTX and PRX mode is to disable and re-init ESB. 
    Most applications don't have to change between the two, and we haven't tested what would happen if you were to start the RX mode after initializing ESB in PTX mode. 

    It should be possible to improve ESB to support a more dynamic switching between PTX and PRX modes, and I have requested this internally, but I don't know when we will be able to implement it unfortunately. 

    For the time being you would have to stick to the slow method. 

    I am a bit surprised the init takes such a long time. Have you measured this?

    Best regards
    Torbjørn

Children
No Data
Related