# How to check at which GPS time correspond the pps edge of set\_time\_next\_pps()

**URL:** <https://www.ruby-forum.com/t/how-to-check-at-which-gps-time-correspond-the-pps-edge-of-set-time-next-pps/210320>\
**Category:** GNU Radio\
**Created:** [August 4, 2011, 9:13pm UTC](https://www.ruby-forum.com/t/how-to-check-at-which-gps-time-correspond-the-pps-edge-of-set-time-next-pps/210320 "2011-08-04T21:13:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [August 4, 2011, 9:13pm UTC](https://www.ruby-forum.com/t/how-to-check-at-which-gps-time-correspond-the-pps-edge-of-set-time-next-pps/210320/1 "2011-08-04T21:13:02Z")

</div>

Hi

USRP N210, UHD 3.2.1, GPSDO Jackson Labs installed  
windows7

Using set\_time\_next\_pps()  
How can I be sure at which GPS time (in seconds from 01/01/1970) the pps  
egde correspond to

So far, here is how I do :  
\_ get GPS time (get\_mboard\_sensors(“gps\_time”)), let it be gps\_t\_0  
\_ set\_time\_next\_pps(0, 1, 54000000)  
\_ add + 2 sec to gps\_t\_0. +1 because time is set at next PPS, +1 because  
this seems to be time needed to execute the sensor query on GPS  
(practically, I was always 1 sec behind, before this last +1)

This has shown to be stable in development lab, for the last few days.  
But is there another mechanism to map the “next pps” to a GPS time (in  
seconds from 01/01/1970) ?  
What bothers me, it’s that the second +1 I add is based on the  
get\_mboard\_sensors(“gps\_time”) execution time (approx 1 sec). But this  
may  
change randomly (depending on load, HW etc…)

Regards  
Bastien

---

<div class="post-metadata">

**Author:** ![Bastien\_Auneau](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/51bf81/32.png) [@Bastien\_Auneau](https://www.ruby-forum.com/u/Bastien_Auneau)\
**Post date:** [August 4, 2011, 9:29pm UTC](https://www.ruby-forum.com/t/how-to-check-at-which-gps-time-correspond-the-pps-edge-of-set-time-next-pps/210320/2 "2011-08-04T21:29:45Z")

</div>

On Thu, 2011-08-04 at 21:11 +0200, Bastien Auneau wrote:

> But is there another mechanism to map the “next pps” to a GPS time (in  
> seconds from 01/01/1970) ?  
> What bothers me, it’s that the second +1 I add is based on the  
> get\_mboard\_sensors(“gps\_time”) execution time (approx 1 sec). But this  
> may change randomly (depending on load, HW etc..)

The extra second is required because the GPSDO only outputs a report  
once per second. It returns immediately upon receiving a message, so as  
long as you call set\_time\_next\_pps soon after  
get\_mboard\_sensors(“gps\_time”), you should be fine.

–n
