Skip to content

Clarify the timing of PVT (in the context of TIM TP) #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions examples/Basics/Example32_TIMTP/Example32_TIMTP.ino
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
Displaying the TIM TP timing information for the _next_ TP time pulse
(PVT provides the time of the _previous_ pulse)
By: Paul Clark
SparkFun Electronics
Date: March 24th, 2023
License: MIT. See license file for more information.

This example shows how to query a u-blox module for the TIM TP time-pulse-of-week.
This contains the timing information for the _next_ time pulse. I.e. it is output
_ahead_ of time. PVT contains the time of the _previous_ pulse.
_ahead_ of time. PVT provides the time of the navigation solution which is usually
aligned with the _previous_ pulse.

Feel like supporting open source hardware?
Buy a board from SparkFun!
Expand Down Expand Up @@ -78,7 +78,8 @@ void loop()
// Then getPVT will poll NAV PVT, wait and return true when the NAV PVT data arrives.
// The TIM TP data will then be one second old.
// Because TIM TP provides the time of the _next_ time pulse and NAV PVT provides
// the time of the _previous_ time pulse, the two Epochs should be the same!
// the time of the navigation solution close to the _previous_ time pulse,
// the two Epochs should be the same!
if (myGNSS.getTIMTP() && myGNSS.getPVT())
{
// Read the time pulse of week as Unix Epoch
Expand All @@ -101,7 +102,7 @@ void loop()
uint32_t epochPVT = myGNSS.getUnixEpoch(microsPVT); //Read the time of week as Unix Epoch

Serial.print("NAV PVT as Epoch: ");
Serial.print(epochPVT); //Print the time of the previous pulse
Serial.print(epochPVT); //Print the time of the previous navigation solution
Serial.print(".");
if (microsPVT < 100000) Serial.print("0"); //Pad the zeros if needed
if (microsPVT < 10000) Serial.print("0");
Expand Down
3 changes: 2 additions & 1 deletion src/u-blox_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,8 @@ typedef struct

// UBX-TIM-TP (0x0D 0x01): Time pulse time data
// Contains the Time-Pulse-Of-Week for the _next_ time pulse
// (PVT etc. provide the time of the _previous_ time pulse)
// (PVT provides the time of the navigation solution which is usually
// aligned with the _previous_ pulse)
const uint16_t UBX_TIM_TP_LEN = 16;

typedef struct
Expand Down