Hi,
These days I am trying to synchronize two USRP2 with PPS signal and
UHD. The two USRP2 is connect with same reference clock and PPS signal.
I use function “set_time_next_pps(uhd::time_spec_t(0))” to set time to
be zero, and make two USRP2 start sampling after 3 seconds. The result
shows that there is still phase difference, which means a delay( about
30ns) between USRP2s.
I used 10MHz reference clock as input and set DDC frequence to 10MHz.
Then I get two complex DC signal. The phase difference is about 0.3*2pi.
It seems that the PPS impedence difference between USRP2s is the reason
of delay. Any clues or solution???
By the way, the stream mode "
STREAM_MODE_NUM_SAMPS_AND_DONE" does not work with “set_time_next_pps”
function. It works with “set_time_now”. But stream mode "
STREAM_MODE_START_CONTINUOUS " works well with “set_time_next_pps”
function.
Thank you!
Liang
These days I am trying to synchronize two USRP2 with PPS signal and UHD. The two USRP2 is connect with same reference clock and PPS signal. I use function “set_time_next_pps(uhd::time_spec_t(0))” to set time to be zero, and make two USRP2 start sampling after 3 seconds. The result shows that there is still phase difference, which means a delay( about 30ns) between USRP2s.
I used 10MHz reference clock as input and set DDC frequence to 10MHz. Then I get two complex DC signal. The phase difference is about 0.3*2pi. It seems that the PPS impedence difference between USRP2s is the reason of delay. Any clues or solution???
You need to configure the usrp2 to use the external reference. Did you
run set_clock_config(…) prior to setting the time?
(making an example of this is on my whiteboard TODO list)
By the way, the stream mode "
STREAM_MODE_NUM_SAMPS_AND_DONE" does not work with “set_time_next_pps” function. It works with “set_time_now”. But stream mode " STREAM_MODE_START_CONTINUOUS " works well with “set_time_next_pps” function.
When performing set_time_next_pps(…) you will want a sleep(1) prior to
starting streaming. Because it could take as much as 1 second for the
registers to latch the new time value.
-Josh
When performing set_time_next_pps(…) you will want a sleep(1) prior to
starting streaming. Because it could take as much as 1 second for the
registers to latch the new time value.
Yes, I have used sleep(1) commmand after I call set_time_next_pps() function. The problem is that if I replace the mode "
STREAM_MODE_NUM_SAMPS_AND_DONE" with " STREAM_MODE_START_CONTINUOUS ",it works. The rest of code is same.
Ok, just checking. I will try to reproduce the problem on monday.
Two more questions:
-
When you used STREAM_MODE_NUM_SAMPS_AND_DONE, was there a time set,
and if so, was it greater than the time set by set_time_next_pps?
-
When you used STREAM_MODE_START_CONTINUOUS, did the timestamps on the
RX packets appear to be correct (after the time set by
set_time_next_pps)?
Thanks,
-Josh
Could you check that the revisions of the USRP2s are the same. I
remember that the lower impedance in the rev 1 caused a pretty long
delay, but I think we fixed this. You could still look at the PPS
inputs with an oscilloscope probe and see what it looks like.
juha
2010/5/21 周亮 [email protected]:
Hi,
These days I am trying to synchronize two USRP2 with PPS signal and UHD.
The two USRP2 is connect with same reference clock and PPS signal. I use
function “set_time_next_pps(uhd::time_spec_t(0))” to set time to be zero,
and make two USRP2 start sampling after 3 seconds. The result shows that
there is still phase difference, which means a delay( about 30ns) between
USRP2s.
I tried to use the set_time_next_pps() too and had the problem, that
it updates the timing information even if no PPS pulse occurs.
Attached is a patch that first sets the PPS configuration and updates
the timing information afterswards.
Manuel
It turns out that the time registers were being written in the wrong
order.
I have pushed a fix to the master (seconds need to be written last).
-Josh
On Mon, May 24, 2010 at 3:49 AM, Manuel F.