Skip to main content
GNSS HAT Library Documentation
Shop GitHub Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Timepulse

The u-blox module outputs a configurable pulse signal on GPIO 5 — typically used as PPS (Pulse Per Second) for time synchronization.

Signal Shape

The same timepulse output can be aligned by either its rising edge or falling edge at the exact second boundary. The diagram starts with an annotated 1 Hz pulse at 10% duty cycle, then shows faster 5 Hz and 10 Hz examples plus a fix-dependent switch from one waveform to another. That is the timing model behind what timepulse() waits for when it blocks until the next event.

Timepulse waveform examples showing an annotated 1 Hz waveform with polarity-aligned edges, simplified 5 Hz and 10 Hz waveforms with period and pulseWidth labels, and a fourth example that switches from 5 Hz without fix to 10 Hz with fix. Timepulse waveform examples showing an annotated 1 Hz waveform with polarity-aligned edges, simplified 5 Hz and 10 Hz waveforms with period and pulseWidth labels, and a fourth example that switches from 5 Hz without fix to 10 Hz with fix.
The blocking wait aligns your application logic to the selected PPS edge on GPIO 5, even when the configured period or pulseWidth changes with receiver fix state.

Configure frequency, duty cycle, and no-fix behavior on Timepulse Configuration.

Usage

hat->enableTimepulse();
while (true)
{
    hat->timepulse();
    auto nav = hat->navigation();
    printf("PPS! %s\n",
        Utils::utcTimeFromGnss_ISO8601(nav.pvt).c_str());
}
hat->disableTimepulse();
hat.enable_timepulse()
while True:
    hat.timepulse()  # blocks until next PPS, releases GIL
    nav = hat.get_navigation()
    print(f"PPS! {gnsshat.utc_time_iso8601(nav)}")
hat.disable_timepulse()
Note
Kernel PPS Conflict — If you use the kernel PPS driver for chrony/gpsd (via dtoverlay=pps-gpio,gpiopin=5), do not call enableTimepulse() from the library. Both claim GPIO 5 and cannot coexist.
Note
GPSD Conflict — Do not use enableTimepulse() when gpsd/pps is managing the same GPIO pin.

See Timepulse Configuration for full details.