On 02/26/2018 03:57 PM, André Gomes via USRP-users wrote:
I have some USRPs B200 with GPS modules installed
(https://www.ettus.com/product/details/GPSDO-TCXO-MODULE). I plan to
use the GPS for timing alignment purposes of my application. The piece
of code I have been using is shown below. It displays the time in
seconds since 01/01/1970. I would like a better resolution than
seconds. Is it possible?
const uhd::device_addr_t dev_addr;
uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(dev_addr);
uhd::sensor_value_t gps_time = usrp->get_mboard_sensor("gps_time");
std::cout << gps_time.to_pp_string() << std::endl << std::flush;
Regards,
*André Gomes*
Email: andre.go...@dcc.ufmg.br <mailto:andre.go...@dcc.ufmg.br>
Homepage: http://homepages.dcc.ufmg.br/~andre.gomes/
<http://homepages.dcc.ufmg.br/%7Eandre.gomes/>
Mobile: +55 31 994859285 <tel:+55%2031%2099485-9285>
The gps_time sensor is derived from an NMEA sentence that is issued at
precise 1second intervals, so the fractional part is, by definition, all
zeros.
If you want the *USRP DEVICE TIME*, then, once you've synchronized time
with the GPSDO, use use get_time_now(), which returns a time_spec_t:
https://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__usrp.html#afb4bffe3f969c11ee7c0a2cba5178780
The time_spec_t type contains fractional seconds.
_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com