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
> [email protected]
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to