@@ -56,18 +56,29 @@ void setup()
56
56
while (1 ) ; // Do nothing more
57
57
}
58
58
59
+ // Print the CFG TP5 version
60
+ Serial.print (F (" UBX_CFG_TP5 version: " ));
61
+ Serial.println (timePulseParameters.version );
62
+
59
63
timePulseParameters.tpIdx = 0 ; // Select the TIMEPULSE pin
60
64
// timePulseParameters.tpIdx = 1; // Or we could select the TIMEPULSE2 pin instead, if the module has one
61
65
62
66
// We can configure the time pulse pin to produce a defined frequency or period
63
67
// 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
66
76
67
77
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
68
79
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.)
71
82
72
83
// Now set the time pulse parameters
73
84
if (myGNSS.setTimePulseParameters (&timePulseParameters) == false )
0 commit comments