Author Topic: Yet another DIY GPSDO - yes, another one  (Read 192382 times)

liszt955 and 1 Guest are viewing this topic.

Offline instantcrow

  • Contributor
  • Posts: 31
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #550 on: February 28, 2022, 12:16:06 pm »
Right. I missed that important function! I have every option installed other than bluetooth and ina219.

Here is what serial monitor shows. Appears to hang up and sticks here for over fifteen minutes:

Code: [Select]
07:03:54.141 -> Now sending UBX commands to GPS
07:03:54.141 -> Setting u-Blox M8 receiver navigation mode to stationary:
07:03:54.141 -> B562624240FFFF23000010270050FA0FA06402C100001027000000004953
07:03:54.141 -> UBX command sent, waiting for UBX ACK...
07:03:54.141 ->  * Reading ACK response: B5625120624325B (SUCCESS!)
07:03:54.328 -> Success: UBX ACK received!
07:03:54.703 -> AHT10 found
07:03:54.797 -> GPSDO Starting
07:03:54.797 ->
 

Offline Badwater

  • Contributor
  • Posts: 18
  • Country: de
Re: Yet another DIY GPSDO - yes, another one
« Reply #551 on: February 28, 2022, 01:17:23 pm »
Right. I missed that important function! I have every option installed other than bluetooth and in .....

Carefully check all #defines!
Do only enable these which you have in your HW setup. E.g. if you have OLED display, do NOT enable LCD ...
 

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 574
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #552 on: February 28, 2022, 02:21:33 pm »
...
I have every option installed other than bluetooth and ina219.
...

Please copy paste the configuration section as you compiled it, and list the hardware you have. Definitely not every option should be enabled, as Badwater explained.

On the other hand, we already know that your GPS module is wired correctly, because it responded correctly to the UBX command.  ;)
 

Offline instantcrow

  • Contributor
  • Posts: 31
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #553 on: February 28, 2022, 03:46:51 pm »
Here's my config:

Code: [Select]
#define Program_Name "GPSDO"
#define Program_Version "v0.05f"
#define Author_Name "André Balsa"

// Debug options
// -------------
#define FastBootMode          // reduce various delays during boot
#define TunnelModeTesting     // reduce tunnel mode timeout

// Hardware options
// ----------------
// #define GPSDO_STM32F401       // use an STM32F401 Black Pill instead of STM32F411 (reduced RAM)
#define GPSDO_OLED            // SSD1306 128x64 I2C OLED display
// #define GPSDO_LCD_ST7735      // ST7735 160x128 SPI LCD display
// #define GPSDO_LCD_ST7789      // ST7789 240x240 SPI LCD 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_PB5    // generate 2kHz square wave test signal on pin PB5 using Timer 3
#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
// #define GPSDO_PICDIV          // generate a 1.2s synchronization pulse for the picDIV

Hardware:

stm32f411 black pill weact
BMP280
ssd1306 oled
aht10
ublox neo-m9n
yellow led
CIT OCXO
PWM DAC with RC filter as described in circuit
--------------------

FWIW: I've built several circuits in my life, and am quite comfortable in wiring, etc. Nonetheless I am human so it is possible that I made circuit error, so will continue to review. My OCXO is warm, the GPS PPS led is blinking, and every piece of hardware is powered up.

Tnx agn,

instantcrow
 

Offline instantcrow

  • Contributor
  • Posts: 31
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #554 on: February 28, 2022, 04:09:37 pm »
If I disconnect the OCXO 10mhz output from circuit, I get this:

Code: [Select]
11:02:15.396 -> Now sending UBX commands to GPS
11:02:15.396 -> Setting u-Blox M8 receiver navigation mode to stationary:
11:02:15.396 -> B562624240FFFF23000010270050FA0FA06402C100001027000000004953
11:02:15.396 -> UBX command sent, waiting for UBX ACK...
11:02:15.396 ->  * Reading ACK response: B5625120624325B (SUCCESS!)
11:02:15.443 -> Success: UBX ACK received!
11:02:15.771 -> AHT10 found
11:02:15.864 -> GPSDO Starting
11:02:15.864 ->
11:07:31.397 ->
11:07:31.397 -> Warming up 15s
11:07:32.428 ->
11:07:32.428 -> Warming up 14s
11:07:41.358 ->
11:07:41.358 -> Warming up 13s
11:07:42.389 ->
11:07:42.389 -> Warming up 12s
11:07:43.411 ->
11:07:43.411 -> Warming up 11s
11:07:44.395 ->
11:07:44.395 -> Warming up 10s
11:07:45.426 ->
11:07:45.426 -> Warming up 9s
11:07:46.455 ->
11:07:46.455 -> Warming up 8s
11:07:47.439 ->
11:07:47.439 -> Warming up 7s
11:07:48.460 ->
11:07:48.460 -> Warming up 6s
11:07:49.491 ->
11:07:49.491 -> Warming up 5s
11:07:50.475 ->
11:07:50.475 -> Warming up 4s
11:07:51.504 ->
11:07:51.504 -> Warming up 3s
11:07:52.488 ->
11:07:52.488 -> Warming up 2s
11:07:53.510 ->
11:07:53.510 -> Warming up 1s
11:07:54.494 ->
11:07:54.494 -> Calibrating...

Then it hangs up again after reinserting OCXO output back into circuit.
 

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 574
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #555 on: February 28, 2022, 04:35:54 pm »
The configuration is absolutely correct  :-+ and we know the GPS module is correctly wired. Also the AHT10 is correctly recognized, so that would rule out any major problem with the I2C bus. I would check the SPI bus wiring (Black Pill to BMP280) and the VCC/VDD connections to the various modules.

If you are not getting the OCXO warmup and calibration countdown messages on the serial monitor, that would indicate there is a problem before you get to the calibration routine. And actually even before that, since the i2C OLED is initialized in the setup routine with the program name and version. I am scratching my head because you are not even getting the OCXO warmup countdown messages on the serial monitor.  :-//

EDIT: OK, so if you disconnect the OCXO output you do get to the warmup countdown.

So that suggests there is possibly a problem with your OCXO output or wiring or power (it needs 5V @ 600mA during warmup). Do you have an oscilloscope to check what it's putting out? You should see a TTL-level 10MHz squarewave. See my first posts in this thread, I posted a picture of the OCXO output. Also eventually if you have too much ringing, put a 100R resistor in series with the OCXO output.

 

Offline bob91343

  • Super Contributor
  • ***
  • Posts: 2675
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #556 on: February 28, 2022, 05:36:10 pm »
I have done all that and am getting a nice 10 MHz square wave from the OCXO.  There is no control voltage being fed to it.  Is there a startup procedure for the black pill?  Pressing RESET and so on?  The 10 MHz reads about 20 Hz low.  The GPS receiver is getting a signal and pulsing 1 per second.
 

Offline instantcrow

  • Contributor
  • Posts: 31
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #557 on: February 28, 2022, 06:14:05 pm »
Prior to building circuit, I tested the CTI OCXO on my oscilloscope, and it put out a nice square 10Mhz wave. I'll check again with my scope now that it is in circuit.

I've been running power off of my laptop USB, so might have a low current. The OCXO definitely gets warm if not hot, though.

I'm wondering if the SSD1306 OLED serial address is incorrect for my particular model (StemmaQT adafruit ssd1306 oled). Where in the code is the I2C serial address defined for OLED? I couldn't find it.

great project, I'm really enjoying making it work. I never was able to get it to work with a Feather STM32f405, but was able to pick up a Black Pill.

InstantCrow
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #558 on: February 28, 2022, 07:08:30 pm »
I have every option installed other than bluetooth and ina219.
INA226 is a nicer chip. Just saying.
 

Offline iannez

  • Regular Contributor
  • *
  • Posts: 64
  • Country: it
Re: Yet another DIY GPSDO - yes, another one
« Reply #559 on: February 28, 2022, 09:37:18 pm »
Hi Istantcrow,
The line that sets the I2C address of the oled is
In the setup() function at the end of the script, before the void().

you have to insert in the brackets in the line:

Code: [Select]
disp.begin();

of the code block:

Code: [Select]
#ifdef GPSDO_OLED
  // Setup OLED I2C display
  // Note that u8x8 library initializes I2C hardware interface
  disp.setBusClock(400000L); // try to avoid display locking up
  disp.begin();  //       <======= INSERT HERE YOUR i2c CODE
  disp.setFont(u8x8_font_chroma48medium8_r);
  disp.clear();
  disp.setCursor(0, 0);
  disp.print(F(Program_Name));
  disp.print(F(" - "));
  disp.print(F(Program_Version));
  #endif // OLED


Your exact ID that detects using this script:


Code: [Select]
#include <Wire.h>
 
void setup()
{
  Wire.begin();
 
  Serial.begin(9600);
  while (!Serial);             // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}
 
void loop()
{
  byte error, address;
  int nDevices;
 
  Serial.println("Scanning...");
 
  nDevices = 0;
  for(address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
 
    if (error == 0)
    {
      Serial.print("Appareil I2C trouve a cette adresse 0x");
      if (address<16)
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");
 
      nDevices++;
    }
    else if (error==4)
    {
      Serial.print("Erreur inconnue a cette address 0x");
      if (address<16)
        Serial.print("0");
      Serial.println(address,HEX);
    }   
  }
  if (nDevices == 0)
    Serial.println("Aucun appareil I2C trouve\n");
  else
    Serial.println("Fin\n");
 
  delay(5000);           // wait 5 seconds for next scan
}

bye, A.
 

Offline instantcrow

  • Contributor
  • Posts: 31
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #560 on: February 28, 2022, 10:25:04 pm »
Almost! Ran the I2C scanner code, got 0x3D which matches what is known about my SSD1306 oled.

I added code as you suggested:
Code: [Select]
#ifdef GPSDO_OLED
  // Setup OLED I2C display
  // Note that u8x8 library initializes I2C hardware interface
  disp.setBusClock(400000L); // try to avoid display locking up
  disp.begin(0x3D);
  disp.setFont(u8x8_font_chroma48medium8_r);
  disp.clear();

Returned this error:
Code: [Select]
C:\Users\lavam\Documents\Arduino\STM32-GPSDO-main\software\GPSDO\GPSDO.ino: In function 'void setup()':
GPSDO:1931:18: error: no matching function for call to 'U8X8_SSD1306_128X64_NONAME_HW_I2C::begin(int)'
 1931 |   disp.begin(0x3D);
      |                  ^
In file included from C:\Users\lavam\Documents\Arduino\STM32-GPSDO-main\software\GPSDO\GPSDO.ino:220:
C:\Users\lavam\Documents\Arduino\libraries\U8g2\src/U8x8lib.h:232:10: note: candidate: 'bool U8X8::begin()'
  232 |     bool begin(void) {
      |          ^~~~~
C:\Users\lavam\Documents\Arduino\libraries\U8g2\src/U8x8lib.h:232:10: note:   candidate expects 0 arguments, 1 provided
C:\Users\lavam\Documents\Arduino\libraries\U8g2\src/U8x8lib.h:237:10: note: candidate: 'bool U8X8::begin(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)'
  237 |     bool begin(uint8_t menu_select_pin, uint8_t menu_next_pin, uint8_t menu_prev_pin, uint8_t menu_up_pin = U8X8_PIN_NONE, uint8_t menu_down_pin = U8X8_PIN_NONE, uint8_t menu_home_pin = U8X8_PIN_NONE) {
      |          ^~~~~
C:\Users\lavam\Documents\Arduino\libraries\U8g2\src/U8x8lib.h:237:10: note:   candidate expects 6 arguments, 1 provided
exit status 1
no matching function for call to 'U8X8_SSD1306_128X64_NONAME_HW_I2C::begin(int)'

Will continue to plug away but not sure how to parse this out.

On other fronts, my CTI OXCO in the GPSDO circuit puts out the following waveforms on my scope. One with a 220ohm resister, one without. The ringing seemed minor to begin with.
 

Offline iannez

  • Regular Contributor
  • *
  • Posts: 64
  • Country: it
Re: Yet another DIY GPSDO - yes, another one
« Reply #561 on: February 28, 2022, 10:52:29 pm »
try this before disp.begin()

u8x8.setI2CAddress(0x3D);
disp.begin();
...

bye,A.
 

Offline iannez

  • Regular Contributor
  • *
  • Posts: 64
  • Country: it
Re: Yet another DIY GPSDO - yes, another one
« Reply #562 on: February 28, 2022, 11:00:31 pm »
also try
disp.setI2CAddress(DISPLAY_I2C_ADDRESS * 2)

bye, A.
 

Offline instantcrow

  • Contributor
  • Posts: 31
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #563 on: February 28, 2022, 11:00:45 pm »
returned:

Code: [Select]
GPSDO:1931:3: error: 'u8x8' was not declared in this scope
 1931 |   u8x8.setI2CAddress(0x3D);
      |   ^~~~
exit status 1
'u8x8' was not declared in this scope
 

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 574
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #564 on: February 28, 2022, 11:08:02 pm »
Two things:
1. the disp.begin() function does not take any parameters, so disp.begin(0x3D) is incorrect. Check the u8x8 manual here: https://github.com/olikraus/u8g2/wiki/u8x8reference
You can try a different constructor.
Please take a picture of your OLED module with its pinout and post it here.

2. You have a problem with your OCXO, or it's wired incorrectly, or it's not getting the required power, or you are overloading its output with a capacitor. You definitely should not get a triangular waveform.

If the STM32 does not get a proper 10MHz input, then the counter does not advance and the GPSDO simply won't work. Please make sure you get a 10MHz squarewave with the proper amplitude.
 

Offline instantcrow

  • Contributor
  • Posts: 31
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #565 on: February 28, 2022, 11:10:51 pm »
Got it.

This line:
disp.setI2CAddress(DISPLAY_I2C_ADDRESS * 2)
fixed the OLED display.

In order to start the warm up timer, I had to disconnect the OXCO. Then it just hangs in calibration mode. Probably because of aforementioned waveform problem.

Will work on this.

Thanks everyone.

instantcrow

 
The following users thanked this post: jpwolfe31

Offline instantcrow

  • Contributor
  • Posts: 31
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #566 on: March 01, 2022, 12:04:51 am »
2. You have a problem with your OCXO, or it's wired incorrectly, or it's not getting the required power, or you are overloading its output with a capacitor. You definitely should not get a triangular waveform.

If the STM32 does not get a proper 10MHz input, then the counter does not advance and the GPSDO simply won't work. Please make sure you get a 10MHz squarewave with the proper amplitude.

I'm stumped. It's a weird waveform for this OCXO. I'm using CTI OSC5A2B02 OCXO, and their datasheet indicates they're square wave. But, alas, they're from Ebay so who knows. I did capture the wave on the scope with just 5V and no other circuit components. Must be fried...but have to wonder what would cause square wave to degrade to triangular wave.

Will have to source a better OCXO. hard to trust ebay.
 

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 574
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #567 on: March 01, 2022, 12:12:55 am »
...
I've been running power off of my laptop USB, so might have a low current.
...
Did you connect the OCXO Vcc to the +5V pin on the Black Pill? That's a no-no.

Please take out your multimeter and check the voltage across Vcc and GND for your OCXO. You should have 5V +/- 5%, but I suspect you have much less than that during OCXO warmup, with possibly a ton of noise too.
 

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 574
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #568 on: March 01, 2022, 12:21:14 am »
...
I'm using CTI OSC5A2B02 OCXO,
...Must be fried
...
These things are pretty tough, so unless you supplied it with 12V accidentally or shorted its output, it should still be good. Just give it a separate 5V (not from your laptop USB !) and check its output waveform with your scope, it should be back to a nice squarewave. Just wondering, what scope are you using and what is its bandwidth, and the bandwidth of the probes?
 

Offline instantcrow

  • Contributor
  • Posts: 31
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #569 on: March 01, 2022, 01:49:26 am »
All the waveforms I’ve shown were using 5V and 5 amp wall wart with usb to black pill. I was using the 5V pin on black pill to power the ocxo. Oops.

Using a tektronix 475 scope. 200Mhz and my probes are good but can’t remember bandwidth.

Here is a waveform of ocxo removed from circuit and bare. using 5V DC power directly from high quality Astron DC supply. I think it’s good enough? I’ll have to wire it back into gpsdo circuit and clean up my power.

 

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 574
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #570 on: March 01, 2022, 07:18:40 am »
... I was using the 5V pin on black pill to power the ocxo. Oops.
...

That was the source of all your problems.  |O If you had measured the OCXO Vcc with a multimeter you would have noticed that you were supplying your OCXO with 4V or less during warmup.  :-DMM

Note that the schematic has a separate 5V@1A power supply and there is a jumper that goes to the +5V pin on the Black Pill, for that exact reason. The +5V pin on the Black Pill is a power input, not a power output.
« Last Edit: March 01, 2022, 07:20:12 am by AndrewBCN »
 

Offline AndrewBCNTopic starter

  • Frequent Contributor
  • **
  • Posts: 574
  • Country: fr
Re: Yet another DIY GPSDO - yes, another one
« Reply #571 on: March 01, 2022, 08:00:19 am »
Here is the note marked "Important" on the main page in the STM32 GPSDO schematic, about the 5V and 3.3V pins on the Black Pill:
 

Offline iannez

  • Regular Contributor
  • *
  • Posts: 64
  • Country: it
Re: Yet another DIY GPSDO - yes, another one
« Reply #572 on: March 01, 2022, 08:13:41 am »
Good morning everyone!

Quote
This line:
disp.setI2CAddress(DISPLAY_I2C_ADDRESS * 2)
fixed the OLED display.

Great news   ;D

As recommended AndrewBNC, now separates the power supplies and guarantees at OCXO at least 1A / 5V.

bye, A.


 

Offline instantcrow

  • Contributor
  • Posts: 31
  • Country: us
Re: Yet another DIY GPSDO - yes, another one
« Reply #573 on: March 01, 2022, 02:32:57 pm »
Right on. My obvious mistake...Usually I'm building radio circuits. so the MCU's are a bit new for me.  :horse:

Now that power lined up (5V at OXCO), the OLED shows version of firmware. Then it just hangs. does not start warmup procedure unless I pull OCXO output from circuit, then warm up procedure starts. Reinserting OCXO output halts the warmup procedure. If I reinsert OCXO output once calibration starts, it just hangs there forever.

I have two different CTI OCXO, and both put out same waveform. Get same results with both...

I'll keep revising...not sure if it's code, or my hardware or my wiring. :scared:
 

Offline iannez

  • Regular Contributor
  • *
  • Posts: 64
  • Country: it
Re: Yet another DIY GPSDO - yes, another one
« Reply #574 on: March 01, 2022, 04:20:23 pm »
please report here output of serial console.

Check that the 10MHz output pin of OCXO is connected to PA15 and PPS on PB10.
Check all wirings on blackpill.

bye, A.
 
The following users thanked this post: AndrewBCN


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf