SkillAgentSearch skills...

Gpsdo Fw

Alternative firmware for a common GPSDO

Install / Use

npx skills add dankar/gpsdo-fw

Installs into whichever agent you are using.

About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Alternative firmware for the BH3SAP GPSDO

This is an alternative firmware for the BH3SAP GPSDO sold on various platforms.

Image of the GPSDO running this firmware

Usage

Power on the device with GPS antenna connected. Wait a long while for the PPB to reach close to zero. The used PWM value can then be stored in flash by going to PWM menu and press the encoder twice (a message will be shown after the first press).

This PWM will then be used on the next boot, and if no GPS antenna is connected, it will not be adjusted further.

The original manual for the device talks about running the device without a GPS antenna after calibration, but I would advice against that since the oscillator seems sensitive to both ambient temperature, vibrations and orientation. Best results will be had when the GPS antenna is connected at all times.

Menu system

This alternative firmware has a 2 level menu system. Moving from one menu item to another is done by turning the rotary encoder, and entering a given menu (when applicable) is done by pressing the encoder.

Here is the menu tree :

  • Main Screen: displays the number of detected satellites, the PPB value and the current UTC time read from GPS frame
  • Trend Screen: displays the number of detected satellites, the current PPB value and a graphical representation of the PPB trend over time
    • Trend Main Screen: same as above, press the encoder to enter navigation mode (scroll trend data over time by rotating the encoder)
    • Auto vertical scale: press to set the auto-vertical-scale status (when set to ON, vertical scale will be automatically adjusted to match the displayed trend values)
    • Auto horizontal scale: press to set the auto-horizontal-scale status (when set to ON, horizontal scale will be automatically adjusted to show available data)
    • Vertical scale: shows the current vertical scale (value of the max PPB in the graph), if auto-vertical-scale is off, press the encoder to set the vertical scale value
    • Horizontal scale: shows the current horizontal scale (number of seconds represented by a point in the trend graph), if auto-horizontal-scale is off, press the encoder to set the horizontal scale value
    • Exit: press to exit the Trend sub-menu
  • PPB Screen: displays current PPB value
    • Mean value: the mean PPB value (running average over 128 seconds)
    • Instant value: last calculated PPB value
    • Frequency: the measured current MCU frequency (based on the number ot ticks counted between two GPS PPS pulses, should be around 70 000 000 for 70 MHz)
    • Error: the last measured frequency error (in Hz)
    • Correction: the last correction applied to PWM value
    • Millis: the gap in milliseconds between GPS PPS reference and MCU calculated PPS (should be 0)
    • PWM auto save: press to set the PWM auto-save status (when set to ON, PWM value will automatically be saved the first time PPB mean value reaches 0)
    • PPS auto resync: press to set the PWM auto-sync status (when set to ON, MCU Controlled PPS output will automatically be resynced to GPS PPS Output the first time PPB mean value reaches 0)
  • PWM Screen: the current PWM value, press the encoder twice to save this value to flash memory
  • GPS Screen: displays the number of detected satellites and the current GPS time
    • Time: the current GPS time
    • Latitude: the GPS detected latitude (format: ddmm(.)mmmm)
    • Longitude: the GPS detected longitude (format: ddmm(.)mmmm)
    • Altitude: the GPS detected altitude (in meters)
    • Geoid: the Geoid-to-ellipsoid separation (in meters)
    • Sat. #: the numner of satellites
    • HDOP: the current Horizontal Dilution Of Precision value
  • Uptime Screen : displays the number of seconds elapsed since last boot
  • GGA Frames Screen: the number of GGA frames received from the GPS module since last boot
  • Contrast Screen : press the encoder to change the contrast value by turning the rotary encoder ; press again to exit (when editing contrast value, ? is displayed after contrast)
  • PPS Screen: This menu is dedicated to the MCU controlled PPS output ; it shows the number of times the MCU PPS Output has been synced (top left) and the shift with GPS PPS output in clock cycles (bottom)
    • Shift: the shift between MCU PPS output and GPS PPS output in clock cycles
    • Shift milliseconds: the shift between MCU PPS output and GPS PPS output in milliseconds
    • Sync Count: the number of times the MCU PPS output has been re-synced to the GPS PPS output
    • Sync.: press to set the synchronization activation status (when set to ON the MCU PPS Output will be resynced if it deviates from the GPS PPS output of more than threshold clock cycles during more than delay seconds)
    • Delay: press to set the MCU PPS output synchronisation delay (in seconds)
    • Threshold: press to set the MCU PPS output synchronisation threshold (in clock cycles)
    • Force Sync: press to force the MCU Controlled PPS output to be synched with the GPS PPS output
  • Version Screen : shows the current firmware version

Main screen

Main Screen The top left corner of the Main Scren contains an indicator for PPS pulses. Next to that is the current number of satellites used by the GPS module. To the right of that is the current measured PPB error. Bottom line is the current UTC time from GPS module.

Trend screen

Trend Screen The top left corner of the Trend Scren contains an indicator for PPS pulses (using default characters from the LCD driver, custom characters beeing used for graphical trend display). Next to that is the current number of satellites used by the GPS module. To the right of that is the current measured PPB error. Bottom line is a graphical representation of the PPB trend over time.

Trend menu gives access to trend navigation, and scale settings: Trend Menu

Boot Screen

After boot, the GPSDO will automatically display the last used screen between Main Scren and Trend Scren.

PPB Menu

PPB Menu

GPS Menu

GPS Menu

Flashing the firmware

To flash this alternative firmware in your GPSDO you will need :

First you need to open it to access the bluepill board inside it.

To do so, you only need to remove the 4 screews at the top left and right sides of the front and bacck pannels of your GPSDO: Open Case

You now have access to the bluepill board, but you need to bend the 4 pins of the programmation header to the top so that you can plug Dupont wires to that header: Bend pins

You can now launch the STM32CubeProgrammer software click Connect, click Open File, select the gpsdo.bin file downloaded in the Release section and hit Download in STM32CubeProgrammer: Bend pins

Hardware Extensions

MCU controlled PPS Output

An MCU controlled PPS Output has been added on pin PB1. It will output a 100 ms pulse every second, based on the clock of the Bluepill board. This output, compared to the PPS output of the original design, is available after boot, even if the GPS module is not yet locked or if the GPS antenna is not connected.

If Sync mode is on, the MCU controlled PPS output will be synchronized to the GPS PPS output as soon as the GPS module gets a fix. The deviation between the two PPS outputs will then be monitored and the MCU controlled PPS output will be resynced to the GPS PPS output as soon as it deviates from more than threshold clock cycles during more than delay seconds.

If the PPS auto resync is set to ON in the PPB menu, the MCU controlled PPS Output will also be automatically resynced to the GPS PPS Output the first time PPB mean value reaches 0.

The dedicated PPS menu allows monitoring the deviation between the MCU controlled PPS output and the GPS PPS output and setting the synchronization parameters:

  • The Shift entry shows the shift between MCU PPS output and GPS PPS output in clock cycles
  • The Shift milliseconds entry shows the shift between MCU PPS output and GPS PPS output in milliseconds
  • The Sync Count entry shows the number of times the MCU PPS output has been re-synced to the GPS PPS output
  • The Sync. entry sets the synchronization activation status (when set to ON the MCU PPS Output will be resynced if it deviates from the GPS PPS output of more than threshold clock cycles during more than delay seconds)
  • The Delay entry sets the MCU PPS output synchronisation delay (in seconds)
  • The Threshold entry sets the MCU PPS output synchronisation threshold (in clock cycles)
  • The Force Sync entry can be used to force the MCU Controlled PPS output to be synched with the GPS PPS output

PPS Out

GPS UART Passthrough

A G

Related Skills

View on GitHub
GitHub Stars37
CategoryDevelopment
Updated21d ago
Forks17

Languages

C

Security Score

95/100

Audited on Jul 17, 2026

No findings