There is a certain amount of (deterministic) latency incurred in the pipelining of H/W signals, both data and control. The tick count applied to the data will be accurate w.r.t the instant the data left the DDC and was packetized.
-Ian > On May 23, 2018, at 2:26 AM, kf via USRP-users <usrp-users@lists.ettus.com> > wrote: > > Hi. > > I am having trouble understanding why the first samples I receive have a > tick count offset of 7. > > My setup is: > - B210 with gpsdo > - Time source and reference set to 'gspdo' > - Two-channel RX > - Sample rate set to 16Mhz > > The procedure is then to > - Reset to time to 0 using the PPS signal > - Requesting streaming to begin on time 2 > - The first samples received has a tick of 32000007, but it should have > been 32000000 (time 2) > > Why is the tick count 32000007 on the initially received samples? > > It seems very consistent, as the received tick count is the same on > three different B210 boards handled by three different PCs. > > Below is the relevant code parts mentioned above. > > Regards > /KF > > > === Code for resetting time to 0 === > > const uhd::time_spec_t last_pps_time1 = usrp->get_time_last_pps(); > while (last_pps_time1 == usrp->get_time_last_pps()) > boost::this_thread::sleep(boost::posix_time::milliseconds(50)); > usrp->set_time_next_pps(uhd::time_spec_t(0.0)); > const uhd::time_spec_t last_pps_time2 = usrp->get_time_last_pps(); > while (last_pps_time2 == usrp->get_time_last_pps()) > boost::this_thread::sleep(boost::posix_time::milliseconds(50)); > > > === Code for streaming === > > double seconds = 2.0; > std::cout << "Issuing stream command to start streaming at time " << > seconds << std::endl; > uhd::stream_cmd_t > stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS); > stream_cmd.num_samps = 0; > stream_cmd.stream_now = false; > stream_cmd.time_spec = uhd::time_spec_t(seconds); > rx_stream->issue_stream_cmd(stream_cmd); > > > === Printing the first tick received === > > size_t num_rx_samps = rx_stream->recv(buffers, > _startArguments.samplesPerBuffer, md, 10.0, false); > std::cout << "Received first samples. Tick: " << > md.time_spec.to_ticks(16000000) << std::endl; > > > > _______________________________________________ > USRP-users mailing list > USRP-users@lists.ettus.com > http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com _______________________________________________ USRP-users mailing list USRP-users@lists.ettus.com http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com