2

I am learning how to run USRP devices using GNURadio. I am able to send a stream of data from one USRP to another, and receive it successfully. Now I want to do more advanced stuff. Currently, I want to set a USRP to receive some data, then when the data is completely received, I want this same USRP to automatically become a transmitter and send data back (such as ACK/NACK or something else). Here are my questions:

  1. I think I need to use a UHD source and a UHD sink with the same address to allow the USRP to transmit at some times and receive at others. How can I control both UHD blocks so that I am receiving when I am not transmitting, and vice versa?

  2. I have noticed there are many ways to pass data and control between blocks (pmt, blob, message passing, tagged streams). I come from EE background and tried to read the documentation but I am not sure what should I use for this project?

Doe
  • 185
  • 3
  • 13

2 Answers2

3

For your first question. Using the UHD source/sink block you can achieve full or half duplex communication. If you select for the source block the RX2 antenna and for the sink the TX/RX respectively, you can receive and transmit simultaneously.If you prefer half-douplex, choose the TX/RX antenna in both source and sink block. The device would receive samples constantly, unless you transmit something, where the USRP device switched in TX mode until the end of transmission.

For the second question: It depends your application. The default connection is preferable for stream oriented applications, whereas the PMT and message queues mechanism is ways better for bursty or packet based transmissions.

Manos
  • 2,136
  • 17
  • 28
  • I am thinking of sending packets. I need to study PMT first, but do you think I should use PMT to pass both data and control, or should I use PMT for data and something else for control? – Doe Sep 06 '16 at 20:59
  • @Doe It depends on many aspects. One serious consideration is that gnuradio supports the majority of signal processing operations using streams and not messages. So for the sake of re-usability you should use the existing stream blocks and use the PMT for control or feedback. Personally, I use PMTs on higher layers of the protocol (bit scrambling, bit interleaving, etc) and as my flowgraph propagates towards the PHY (physical layer) I use streams. Nevertheless, when dealing with bursty transmissions and UHD , you have to use the burst tags to ensure proper frame transmission. – Manos Sep 07 '16 at 10:35
3

(not enough rep to comment on Manos' good answer).

Look at the UHD API and then at the USRP block headers (usrp_sink.h usrp_source.h) for tag command support. You can easily make a GRC example using a tag strobe with PMT to send, for example, a "tx_freq" command to change the transmit frequency. Of course, it helps to had a scope or spectrum analyzer to see the result. Start/end of burst are also interesting to learn about.

You may also gain some clarity by looking at the uhd example programs. That's where I started...

eeKnud
  • 96
  • 8