@AndrewBCN I have few questions. I have made some changes to code, some things were really confusing for me in the beggining so I decided to change some names to something more meaningful.
Changes that are done, are made on
fit-gpsdo branch on my fork. (this is WIP - Work In Progress branch so it can be messy
![Wink ;)](https://www.eevblog.com/forum/Smileys/default/xwink.gif.pagespeed.ic.cldandycH0.png)
)
https://github.com/felixd/STM32-GPSDO/tree/fit-gpsdoIdea is:
GPSDO_FUNCTION_IDENTHow it looks right now on my side:
#define GPSDO_DISPLAY_OLED // SSD1306 128x64 I2C OLED display
//#define GPSDO_VCTL_MCP4725 // MCP4725 I2C 12-bit DAC
#define GPSDO_VCTL_PWM // STM32 16-bit PWM DAC, requires two rc filters (2xr=20k, 2xc=10uF)
//#define GPSDO_SENSOR_AHT10 // I2C temperature and humidity sensor
#define GPSDO_GEN_2kHz // Generate 2kHz square wave test signal on pin PB9 using Timer 4
//#define GPSDO_SENSOR_BMP280 // SPI atmospheric pressure, temperature and altitude sensor
//#define GPSDO_SENSOR_INA219 // INA219 I2C current and voltage sensor
// TODO: When UART2 (Bluetooth) is activated less messages are shown on OLED and UART1 (USB serial)
#define GPSDO_UART2 // UART2 (Bluetooth) serial (HC-06 module)
#define GPSDO_ADC_5V // Vcc (nominal 5V) ; reading Vcc requires 1:2 voltage divider to PA0
#define GPSDO_ADC_3V3 // Vdd or Vref (nominal 3.3V) reads AVREF internal ADC channel
// TODO: Below Calibration definition is not used..
#define GPSDO_CALIBRATION // Auto-calibration is enabled
#define GPSDO_GPS_UBX_CONFIG
//#define GPSDO_GPS_VERBOSE_NMEA // GPS module NMEA stream echoed to USB serial xor Bluetooth serial
--
Vcc and Vdd were super confusing for me in the beggining (same on Schematics). It was not clear what Voltages I should expect so I've changed names to point what voltages we are working with. Same with variable names
--
GPSDO_CALIBRATION is not used at all. From my point of view it should work as it is working right now: Calibration is done everytime after restart. This option sould be removed from code.
--
GPSDO_GPS_VERBOSE_NMEA I have just dirrectly connected to Serial1 on breadboard to see all GPS<->STM32 traffic. That's much better in my opinion. You have proper NMEA messages which can be decoded by
u-Center app. An for that, this port should be available as well on PCB
--
I have also formated code (autoformating in Arduino IDE v1 with
indent-preproc-block option ON)
Example of what I am writting about:
#ifdef GPSDO_SENSOR_INA219
#include <LapINA219.h> // LapINA219 library library
LapINA219 ina219(0x40); // create object INA219 with I2C address 0x40
float ina219volt = 0.0, ina219curr = 0.0;
TwoWire Wire3(PB4, PA8); // Second TwoWire instance for INA219 on SDA3/SCL3 (should be put somewhere more fitting but must stay global)
#endif // INA219
--
Once functions / block are recognized and corrected in
GPSDO.ino they should be move outside. Example
GPS should be moved to
gps.h /
gps.c file. Same with
sensors--
UART output format: I suggest to format data in Arduino IDE Serial Plotter format.
https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-serial-plotterYou can directly save that to CSV file and process data later on. You can as well parse data with an external application.
--
That's where I am slowly going to. Waiting for Your feedback.
BTW: My Racal-Dana 9514 (last calibrated 11/10/2012) was only 0.4 Hz off (it's running for more than 30 hours already). I have just adjusted it, which was a bit tricky but I have managed to do it
https://www.eevblog.com/forum/testgear/list-your-test-equipment-score-here!/msg790750/#msg790750Cheers, Paweł.