Gpsdo Fw
Alternative firmware for a common GPSDO
Install / Use
npx skills add dankar/gpsdo-fwInstalls into whichever agent you are using.
README
Alternative firmware for the BH3SAP GPSDO
This is an alternative firmware for the BH3SAP GPSDO sold on various platforms.

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 frameTrend Screen: displays the number of detected satellites, the current PPB value and a graphical representation of the PPB trend over timeTrend 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 toON, 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 toON, 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 valueHorizontal 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 valueExit: press to exit the Trend sub-menu
PPB Screen: displays current PPB valueMean value: the mean PPB value (running average over 128 seconds)Instant value: last calculated PPB valueFrequency: 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 valueMillis: 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 toON, 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 toON, 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 memoryGPS Screen: displays the number of detected satellites and the current GPS timeTime: the current GPS timeLatitude: 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 satellitesHDOP: the current Horizontal Dilution Of Precision value
Uptime Screen: displays the number of seconds elapsed since last bootGGA Frames Screen: the number of GGA frames received from the GPS module since last bootContrast 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 cyclesShift milliseconds: the shift between MCU PPS output and GPS PPS output in millisecondsSync Count: the number of times the MCU PPS output has been re-synced to the GPS PPS outputSync.: press to set the synchronization activation status (when set toONthe MCU PPS Output will be resynced if it deviates from the GPS PPS output of more thanthresholdclock cycles during more thandelayseconds)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
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
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:

Boot Screen
After boot, the GPSDO will automatically display the last used screen between Main Scren and Trend Scren.
PPB 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:

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:

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:

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
Shiftentry shows the shift between MCU PPS output and GPS PPS output in clock cycles - The
Shift millisecondsentry shows the shift between MCU PPS output and GPS PPS output in milliseconds - The
Sync Countentry 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 toONthe MCU PPS Output will be resynced if it deviates from the GPS PPS output of more thanthresholdclock cycles during more thandelayseconds) - The
Delayentry sets the MCU PPS output synchronisation delay (in seconds) - The
Thresholdentry sets the MCU PPS output synchronisation threshold (in clock cycles) - The
Force Syncentry can be used to force the MCU Controlled PPS output to be synched with the GPS PPS output

GPS UART Passthrough
A G
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
commit-push-pr
140.7kCommit, push, and open a PR
