diff options
author | Martin Braun <martin.braun@ettus.com> | 2016-09-26 14:08:08 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-09-27 09:03:13 -0700 |
commit | 64423ac3cc011af21622fb296b6d5400879b5da3 (patch) | |
tree | 300755fd5bebfe14a2c5b80f76327934ada3bf1a /host/docs/sync.dox | |
parent | a6cf307d4494633e71f94b59c92c21e8ef3112f0 (diff) | |
download | uhd-64423ac3cc011af21622fb296b6d5400879b5da3.tar.gz uhd-64423ac3cc011af21622fb296b6d5400879b5da3.tar.bz2 uhd-64423ac3cc011af21622fb296b6d5400879b5da3.zip |
docs: More clarification on time sync between devices
Diffstat (limited to 'host/docs/sync.dox')
-rw-r--r-- | host/docs/sync.dox | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/host/docs/sync.dox b/host/docs/sync.dox index 8c609f407..15352c3a8 100644 --- a/host/docs/sync.dox +++ b/host/docs/sync.dox @@ -64,10 +64,10 @@ synchronize multiple pairs of devices. \section sync_time Synchronizing the Device Time The purpose of the PPS signal is to synchronously latch a time into the -device. You can use the uhd::multi_usrp::set_time_next_pps() function to either +device. You can use the uhd::usrp::multi_usrp::set_time_next_pps() function to either initialize the sample time to 0 or an absolute time, such as GPS time or UTC time. For the purposes of synchronizing devices, it doesn't matter -what time you initialize to when using uhd::multi_usrp::set_time_next_pps(). +what time you initialize to when using uhd::usrp::multi_usrp::set_time_next_pps(). \subsection sync_time_reg Method 1 - poll the USRP time registers @@ -80,6 +80,7 @@ determine that a PPS has occurred: while (last_pps_time == usrp->get_time_last_pps()){ //sleep 100 milliseconds (give or take) } + // This command will be processed fairly soon after the last PPS edge: usrp->set_time_next_pps(uhd::time_spec_t(0.0)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -97,9 +98,14 @@ PPS edge, and the user can also parse this string to determine GPS time: //call user's function to wait for NMEA message... //call user's function to parse the NMEA message... + gps_time = VALUE_IN_NMEA_MESSAGE; + // At the next PPS edge, set the device time to the GPS time: usrp->set_time_next_pps(uhd::time_spec_t(gps_time+1)); + // Now the device time should be in sync with the GPS time. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Take a look at the `sync_to_gps` example for more detail. + \subsection sync_time_mimocable Method 3 - MIMO cable Note: This only applies to USRP2 and N200/N210. This method does *not* |