discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] time tags for transition time using USRPs


From: Henning Bredenberg
Subject: Re: [Discuss-gnuradio] time tags for transition time using USRPs
Date: Fri, 29 Apr 2016 11:30:05 +0200
User-agent: Horde Application Framework 5

Hi Marcus,

Thanks for your response. I realized that I have a more fundamental problem before optimizing this project: Can u give me hints on how I can generate one simple PDU? My flowgraph now keeps generating one PDU after the other and the time sink display is continuously filled with samples.

In my understanding the different blocks create output items as long as input items are generated. In this case the flowgraph only stops when closed manuelly. So I would need a generator block who generates one output item, i.e. one PDU, and then stops creating output items. Maybe it is possible to create one PDU following by output items that are just zeros? Is it possible to do that with the random_pdu_generator block or are there any other generation blocks that I should investigate?

My goal in general is to generate one simple packet burst that fits into a 20 ms slot. I have issues with this first step, before changing things like adding delays etc.


Best regards,
Henning


Quoting Marcus Müller <address@hidden>:

Hi Henning,

to only answer the first part of your questions:
On 04/27/2016 03:22 PM, Henning Bredenberg wrote:
Hi Martin,

the time tag 'tx_time' tells the USRP when to transmit - so far so
good. So I don't need any delay blocks because the USRP sink realizes
the delay, right?
Nearly! In fact, the USRP itself realizes that in hardware -- which is
much, much better, because that hardware "knows" and runs at a rate
directly linked to the sampling rate and LO frequencies; if your PC
waited the 240ms of "PC clock time", that might be anything between 238
and 300ms "USRP time", if we add non-deterministic delay of the USB
transport for commands. So: there's a feature in the FPGA image that
allows you to specify "hey, FPGA, I want you to execute that "start
streaming" command *exactly* at the clock tick nr 12147, and it will do
that.
Assume i want to add a propagation delay of 240ms: Setting 'tx_time'
at the begin of the burst to 240ms will realize that?
No, you should first set the device time to something sensible (or just
roll with it being set to zero on device initialization) and use
relative times to that.
Minor caveat: if you're using a device with adjustable master clock rate
(mainly: B2xx and E31x), and you change the MCR after setting the time,
the host won't know when that change of "tick rate" happened, and the
conversion between timestamps and tick numbers will be pretty random.

Best regards,
Marcus


Do I tag the burst in the code of the PDU-generator using
add_item_tag() or is there another block who does it after the
generator (I thought the pdu_to_tagged_stream - block tags the packet)?

The crucial code in the random_pdu_impl.cc is:
[...]
      // pick a random vector length
      int len = d_rvar();
      len = std::max(d_length_modulo, len - len%d_length_modulo);

      // fill it with random bytes
      std::vector<unsigned char> vec(len);
      for (int i=0; i<len; i++)
        vec[i] = ((unsigned char) d_bvar()) & d_mask;

      // send the vector
      pmt::pmt_t vecpmt(pmt::make_blob(&vec[0], len));
      pmt::pmt_t pdu(pmt::cons(pmt::PMT_NIL, vecpmt));

      message_port_pub(PDU_PORT_ID, pdu);
[...]

My idea then is to use add_item_tag here with 'tx_time' as key for the
output vector "PDU_PORT_ID", i.d. "pdus" in GRC.

An additional question: How do I set a data rate that determines how
long a packet needs to be transmitted? Is that done by USRP as well?

By now the time sink just shows a blue, continuous signal as seen in
the attached picture.

Best regards,
Henning


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio






reply via email to

[Prev in Thread] Current Thread [Next in Thread]