I put the puck antenna over the rooftop, using a 6m SMA extension cable. It is only getting around 5 or 6 satellites. Should I upgrade the antenna, or is that ok?
When you say "getting around 5 or 6 satellites" is that satellites in view or satellites used to get a fix. I suggest you pull the M8N module off the breadboard and plug a usb cable from a computer into the usb socket on the M8N module. You can then use a program to see exactly what satellites are in view and their signal strength, and what satellites are used for a fix. I am not 100% sure what the signal strength value means, but I suspect SNR in dB. If you are getting four or more satellites at 30 (dB?) or greater then all should be well and you don't need to do anything with your antenna. The critical value for good readings is HDOP or PDOP (dilution of precision). Ideally this is always below 2. VDOP can be higher.
A well positioned antenna will "see" many more satellites than needed. There are recommendations elsewhere for timing GPS modules how to get the best results by selecting constellations and only accepting signals from satellites above a certain angle.
5 or 6 satellites is the number shown in the OLED display. Sometimes it goes up to 9 or 10 and decreases again.
I connected the module using the USB as suggested and I used the VisualGPS software. It never had 4 satellites above 30. The best I can get is 2 satellites above 30, sometimes less in the same antenna position. The total of satellites in view inside the VisualGPS software is around 10. The VisualGPS never get a fix or show any coordinates, so no HDOP, PDOP or VDOP values.
It was a goot test to show that the 6m SMA cable degrates the antenna signal significantly, it is much better to leave the antenna in an obstructed view than over the rooftop using the extension cable.
Probably, I'll need to buy a better antenna and a better extension cable, maybe coaxial intead of this thin SMA extension cable. To put the antenna over the rooftop, passing the cable inside the walls, I'll need around 10m of cable.
There are two problems somewhere in your setup, because after three hours uptime, the OCXO frequency should have stabilized at 10MHz +/- 0.01Hz, and you should be getting at least a dozen satellites in view or so with a rooftop antenna.
1. Are you using the PWM 16-bit DAC or the redundant 12-bit DAC module? Try using the 16-bit PWM DAC (requires 2 resistors and 2 capacitors).
2. Try to reposition your puck antenna. Even indoors I get > 10 satellites in view with the M8N module.
3. Please copy/paste a 1s sample of what the GPSDO is reporting through the USB serial or the Bluetooth.
4. Please copy paste the configuration section of the firmware you have compiled (the #define's).
Regarding your questions:
1- I was using the 12-bit DAC. Now I'm using the PWM and the circuit now is working good. Maybe the problem was not the DAC, but the Universal Counter that I'm using to measure the output frequency. It's impendance is 1Mohm, but if I connect it after the resistor R5 the 10MHz signal deteriorates. Now I'm connecting it between the oscillator and the R5, and it is ok.
2- As discussed above, I tested the antenna connecting it to the USB using the VisualGPS software. The extension cable is really bad, so no success placing the antenna in a better position, like over the rooftop. Sometimes I get 9-10 satellites on the OLED screen too, but most of the time it is around 6.
3- Please, see the output (only coordinates edited):
$GNGSA,A,3,02,05,18,24,25,29,20,12,,,,,2.30,1.19,1.97*1E
$GNGLL,XXXX.XXXXX,S,XXXXX.XXXXX,W,154555.00,A,A*72
$GNRMC,154556.00,A,XXXX.XXXXX,S,XXXXX.XXXXX,W,0.040,,181121,,,A*69
$GNGGA,154556.00,XXXX.XXXXX,S,XXXXX.XXXXX,W,1,11,0.92,744.5,M,-7.7,M,,*5F
Fix time 879mS
Uptime: 000d 17:53:41
New GPS Fix:
Lat: -XX.XXXXXX Lon: -XX.XXXXXX Alt: 744.5m
Sats: 11 HDOP: 0.92
UTC Time: 15:45:56 Date: 18/11/2021
Voltages:
Vctl: 1.88 DAC: 2336
VctlPWM: 1.66 PWM: 30046
Vcc: 4.83
Vdd: 3.28
Frequency measurements using 64-bit counter:
64-bit Counter: 644065948477
Frequency: 10000000 Hz
10s Frequency Avg: 10000000.0 Hz
100s Frequency Avg: 10000000.00 Hz
1,000s Frequency Avg: 9999999.999 Hz
10,000s Frequency Avg: 0.0000 Hz
BMP280 Temperature = 27.6 *C
Pressure = 947.2 hPa
Approx altitude = 729.9 m
AHT10 Temperature: 26.95 *C
Humidity: 70.20% rH
4- When I was using the 12-bit DAC, the configuration were:
// Define hardware options
// -----------------------
#define GPSDO_OLED // SSD1306 128x64 I2C OLED display
#define GPSDO_MCP4725 // MCP4725 I2C 12-bit DAC
// #define GPSDO_PWM_DAC // STM32 16-bit PWM DAC, requires two rc filters (2xr=20k, 2xc=10uF)
#define GPSDO_AHT10 // I2C temperature and humidity sensor
#define GPSDO_GEN_2kHz // generate 2kHz square wave test signal on pin PB9 using Timer 4
#define GPSDO_BMP280_SPI // SPI atmospheric pressure, temperature and altitude sensor
// #define GPSDO_INA219 // INA219 I2C current and voltage sensor
// #define GPSDO_BLUETOOTH // Bluetooth serial (HC-06 module)
#define GPSDO_VCC // Vcc (nominal 5V) ; reading Vcc requires 1:2 voltage divider to PA0
#define GPSDO_VDD // Vdd (nominal 3.3V) reads VREF internal ADC channel
#define GPSDO_CALIBRATION // auto-calibration is enabled
#define GPSDO_UBX_CONFIG // optimize u-blox GPS receiver configuration
#define GPSDO_VERBOSE_NMEA // GPS module NMEA stream echoed to USB serial xor Bluetooth serial
Now, using the PWM, it is:
// Define hardware options
// -----------------------
#define GPSDO_OLED // SSD1306 128x64 I2C OLED display
#define GPSDO_MCP4725 // MCP4725 I2C 12-bit DAC
#define GPSDO_PWM_DAC // STM32 16-bit PWM DAC, requires two rc filters (2xr=20k, 2xc=10uF)
#define GPSDO_AHT10 // I2C temperature and humidity sensor
#define GPSDO_GEN_2kHz // generate 2kHz square wave test signal on pin PB9 using Timer 4
#define GPSDO_BMP280_SPI // SPI atmospheric pressure, temperature and altitude sensor
// #define GPSDO_INA219 // INA219 I2C current and voltage sensor
// #define GPSDO_BLUETOOTH // Bluetooth serial (HC-06 module)
#define GPSDO_VCC // Vcc (nominal 5V) ; reading Vcc requires 1:2 voltage divider to PA0
#define GPSDO_VDD // Vdd (nominal 3.3V) reads VREF internal ADC channel
#define GPSDO_CALIBRATION // auto-calibration is enabled
#define GPSDO_UBX_CONFIG // optimize u-blox GPS receiver configuration
#define GPSDO_VERBOSE_NMEA // GPS module NMEA stream echoed to USB serial xor Bluetooth serial
If I comment the 12-bit DAC line, the compilation returns a error because a non declared variable is used.
I attached two multimeter screens that shows the control voltage of the oscillator over time.
The 10MHz output measure by the universal counter is 9.999,999,966,5MHz, the last two digits varying aproximately between 50 to 78.
So, the frequency variantion is < 1ppb and my universal counter is off by 3.35ppb.