Are there any working examples of constantly listening and then periodic transmission?

Hi,
I would like to implement a logic in which:

  1. when the DWM1000 module is powered on, it goes to receiving mode forever using interrupts, and process received frames
  2. periodically, when a user defined timeout is triggered, the DWM1000 will send out a frame.

I have made individual receiving and transmission working, but not quite clear what are necessary steps to coordinate the receiving and transmission. Do I need to turn off RX before transmission, and what is the APIs to do so?

any help is appreciated.

Hi,

I am doing the same, although without interrupts.
I stop the receive and transmit, then enable the receive again.

I use the following calls to stop receive:

dwt_forcetrxoff(); // Turn the RX off
dwt_rxreset(); // Reset Rx in case we were late and a frame was already being received

Good luck, Hans.

Thanks Hans,
I have made some progress after I posted the message. The logic is quite similar to yours: before transmitting, I called dwt_forcetrxoff() to turn off receiving mode, after transmit complete, I turned on receiving mode by calling dwt_rxenable(0). This seems to be working for the transmission part. However, there is one potential problem on the receiving side: If the interrupt happens while WDM1000 is in middle of processing received frames, the transmission will break the receiving frame processing logic. I wonder how I can develop a logic similar to mutex, so that when transmit interrupt fires, I could wait until the receiving process finish before transmitting a frame.