Skip to content

Commit 9441470

Browse files
committed
Update Example23_TimePulseParameters.ino
1 parent 34f15c2 commit 9441470

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Diff for: examples/Example23_TimePulseParameters/Example23_TimePulseParameters.ino

+15-4
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,29 @@ void setup()
5656
while (1) ; // Do nothing more
5757
}
5858

59+
// Print the CFG TP5 version
60+
Serial.print(F("UBX_CFG_TP5 version: "));
61+
Serial.println(timePulseParameters.version);
62+
5963
timePulseParameters.tpIdx = 0; // Select the TIMEPULSE pin
6064
//timePulseParameters.tpIdx = 1; // Or we could select the TIMEPULSE2 pin instead, if the module has one
6165

6266
// We can configure the time pulse pin to produce a defined frequency or period
6367
// Here is how to set the frequency:
64-
timePulseParameters.freqPeriod = 1000; // Set the frequency/period to 1000Hz
65-
timePulseParameters.pulseLenRatio = 0x80000000; // Set the pulse ratio to 2^31 * 2^-32 to produce 50:50 mark:space
68+
69+
// While the module is _locking_ to GNSS time, make it generate 2kHz
70+
timePulseParameters.freqPeriod = 2000; // Set the frequency/period to 2000Hz
71+
timePulseParameters.pulseLenRatio = 0x55555555; // Set the pulse ratio to 1/3 * 2^32 to produce 33:67 mark:space
72+
73+
// When the module is _locked_ to GNSS time, make it generate 1kHz
74+
timePulseParameters.freqPeriodLock = 1000; // Set the frequency/period to 1000Hz
75+
timePulseParameters.pulseLenRatioLock = 0x80000000; // Set the pulse ratio to 1/2 * 2^32 to produce 50:50 mark:space
6676

6777
timePulseParameters.flags.bits.active = 1; // Make sure the active flag is set to enable the time pulse. (Set to 0 to disable.)
78+
timePulseParameters.flags.bits.lockedOtherSet = 1; // Tell the module to use freqPeriod while locking and freqPeriodLock when locked to GNSS time
6879
timePulseParameters.flags.bits.isFreq = 1; // Tell the module that we want to set the frequency (not the period)
69-
timePulseParameters.flags.bits.isLength = 0; // Tell the module that pulseLenRatio is a ratio / duty cycle (2^-32) - not a length (in us)
70-
timePulseParameters.flags.bits.polarity = 0; // Tell the module that we want the falling edge at the top of second. (Set to 1 for rising edge.)
80+
timePulseParameters.flags.bits.isLength = 0; // Tell the module that pulseLenRatio is a ratio / duty cycle (* 2^-32) - not a length (in us)
81+
timePulseParameters.flags.bits.polarity = 1; // Tell the module that we want the rising edge at the top of second. (Set to 0 for falling edge.)
7182

7283
// Now set the time pulse parameters
7384
if (myGNSS.setTimePulseParameters(&timePulseParameters) == false)

0 commit comments

Comments
 (0)