Author Topic: TTL signal from GPS module, convert to sine/triangle etc  (Read 9421 times)

0 Members and 1 Guest are viewing this topic.

Offline MandelstamTopic starter

  • Newbie
  • Posts: 2
  • Country: se
TTL signal from GPS module, convert to sine/triangle etc
« on: February 05, 2024, 12:56:50 pm »
(First post and not an experienced tech so bear with me)

I'm building a programmable and variable frequency standard/reference using an arduino and a Ublox gps module. It's pretty straight forward. I'll be using it for testing and development of a counter. But it would be nice to add some functionality to the device in form of being able to use it as a signal generator, capable of making sine, triangle, etc, waveforms. The output signal from the gps module is a ttl signal that can be a little jittery for certain frequencies. Even if I can clean up the jitter it'll be nice to be able to generate nice sine waves etc.

What I want to do is to send an input to the gps module with the desired frequency and then being able to send that output signal to a secondary module/circuit that creates my choice of a sine/triangle waveform in the same frequency. Frequencies I'm interested in are low, from 1 to 1000 000 Hz. I've been starting to read up on phase locked loop circuits that seem to be able to do what I'm after, but not really sure if it's the best way forward.

I want to be able to use the gps module as a variable reference and not lock it in to be just an external clock with a single freq output.


Any input and suggestions welcome!
 

Offline berke

  • Frequent Contributor
  • **
  • Posts: 273
  • Country: ca
  • F4WCO
Re: TTL signal from GPS module, convert to sine/triangle etc
« Reply #1 on: February 05, 2024, 01:10:25 pm »
Converting square waves to triangles and sines is how old, cheper analog function generators work.  Typically an integrating circuit wil make a triangle from a square wave.  Getting a variable frequency sine wave is more complicated, one way is to use a non-linear circuit made with diodes to try to bend the triangle wave into a sine-like shape.  It's not too difficult but you will need to learn to use basic op-amp circuits.

The fact that you're generating the initial square wave from a GPS module that happens to have an adjustable output is sort of irrelevant, you could just as easily use a PWM output from the AVR.  Once you get that working you can switch in the GPS output if you want.

Actual equipment will use the PPS signal to discipline a clock, say a 10 MHz clock, and then run a digital synthesizer from that, for example an FPGA coupled to a fast DAC, but there are integrated solutions.
 

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
Re: TTL signal from GPS module, convert to sine/triangle etc
« Reply #2 on: February 05, 2024, 01:49:38 pm »
If you can connect a GPSDO 10MHz output to an AD9850 DDS module and filter the output, you're almost there.

Although the 10MHz output is fixed, your Arduino should be able to program the AD9850 to convert the 10MHz to anything between 1Hz and 1MHz.

The trick is filtering the output of the AD9850 to suit your bandwidth of 1Hz to 1MHz.  One solution is relay switched bandpass filters, but a motorised variable capacitor/inductor might be an alternative solution.
 

Offline MandelstamTopic starter

  • Newbie
  • Posts: 2
  • Country: se
Re: TTL signal from GPS module, convert to sine/triangle etc
« Reply #3 on: February 05, 2024, 03:25:27 pm »
Converting square waves to triangles and sines is how old, cheper analog function generators work.  Typically an integrating circuit wil make a triangle from a square wave.  Getting a variable frequency sine wave is more complicated, one way is to use a non-linear circuit made with diodes to try to bend the triangle wave into a sine-like shape.  It's not too difficult but you will need to learn to use basic op-amp circuits.

The fact that you're generating the initial square wave from a GPS module that happens to have an adjustable output is sort of irrelevant, you could just as easily use a PWM output from the AVR.  Once you get that working you can switch in the GPS output if you want.

Actual equipment will use the PPS signal to discipline a clock, say a 10 MHz clock, and then run a digital synthesizer from that, for example an FPGA coupled to a fast DAC, but there are integrated solutions.

If you can connect a GPSDO 10MHz output to an AD9850 DDS module and filter the output, you're almost there.

Although the 10MHz output is fixed, your Arduino should be able to program the AD9850 to convert the 10MHz to anything between 1Hz and 1MHz.

The trick is filtering the output of the AD9850 to suit your bandwidth of 1Hz to 1MHz.  One solution is relay switched bandpass filters, but a motorised variable capacitor/inductor might be an alternative solution.

Thank you both!

I had the AD9850 suggested to me elsewhere as well. Maybe that's worth looking into some more.

And I might be looking on this problem from the wrong end. Instinctively I was thinking about a circuit that would copy/follow the output signal from the gps module but that would be cleaner and also available in sine wave for instance. One other solution I was thinking about was to be able to, with a switch, switch the device from variable raw ttl signal from the gps to "signal generator" mode and then the gps would switch over to a fixed reference frequency, used by a DDS module for instance.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3360
  • Country: au
Re: TTL signal from GPS module, convert to sine/triangle etc
« Reply #4 on: February 05, 2024, 09:58:05 pm »
The output signal from the gps module is a ttl signal that can be a little jittery for certain frequencies.
...  Frequencies I'm interested in are low, from 1 to 1000 000 Hz.
How bad is the jitter, at what frequencies ?
I'm not sure what counter size they use, but GPS time pulse output derives from 48MHz, so frequencies 48M/2N should be divider jitter free.
If you are working at low frequencies, that integer divider rule may be good enough ?


Instinctively I was thinking about a circuit that would copy/follow the output signal from the gps module but that would be cleaner and also available in sine wave for instance.
That's a whole lot more complex, and while $$$ jitter cleaners do exist, they like a fixed, MHz input signal, and output MHz clocks.

 DDS modules are readily available on Aliexpress etc, since you already have a MCU, that may be an option.

Note the AD9850/9851 has a high DDS clock, but outputs sine only, no triangle.
The lower CLK, cheaper AD9833/9834 has a triangle option, so it may be good enough ?

The AD9102 looks very flexible, with a 4096 x 14 lookup RAM, and 14b DAC, but I've not seen low cost modules for that ?

This AliExpress store has a good range of DDS modules, including a USB ready to go unit, based on AD9833

https://ec-buying.aliexpress.com/store/1762106/pages/all-items.html?sortType=bestmatch_sort&SearchText=DDS


Note none of the DDS modules will be locked to GPS, but you can measure the output and SW correct if required.

 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3360
  • Country: au
Re: TTL signal from GPS module, convert to sine/triangle etc
« Reply #5 on: February 05, 2024, 10:14:55 pm »
.... One other solution I was thinking about was to be able to, with a switch, switch the device from variable raw ttl signal from the gps to "signal generator" mode and then the gps would switch over to a fixed reference frequency, used by a DDS module for instance.
The idea is good, but the simpler DDS modules like to have 25~180MHz CLKIN, which does not line-up well with what the GPS can output.

Maybe you can use a predefined but flexible PLL like this - in SO8N
https://datasheet.lcsc.com/lcsc/1912111437_Diodes-Incorporated-PT7C4511WEX_C150452.pdf

Code: [Select]
PT7C4511  Clock Output Table
S1 S0   CLK      GPS 8MHz GPS 6MHz (I'm guessing these are divider jitter free)
0  0   ×4           32M     24M
0  ~   ×(16/3)      42.667  32M
0  1   ×5           40M     30M
~  0   ×2.5         20M     15M 
~  ~   ×2           16M     12M
~  1   ×(10/3)      26,667  20M
1  0   ×6           48M     36M
1  ~   ×3           24M     18M
1  1   ×8           64M     48M

Addit2: the TI CDCS504 is a similar PLL, x4/x1, with wider 2~27Mhz input range. TSSOP8.

Addit: Or, the Si5351A might work, tho that needs i2c programming, and GPS output is a bit lower than spec. (unless 24MHz is possible?)
« Last Edit: February 05, 2024, 11:33:33 pm by PCB.Wiz »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 19220
  • Country: us
  • DavidH
Re: TTL signal from GPS module, convert to sine/triangle etc
« Reply #6 on: February 05, 2024, 10:30:22 pm »
A DDS waveform generator will be the easiest way now, but in the past synthesized function generators worked by phase locking an analog function generator to a digital source.  HP made a bunch of these, and I think Tektronix had one, which are fully documented in their service manuals so you could get an idea of how it was done.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3360
  • Country: au
Re: TTL signal from GPS module, convert to sine/triangle etc
« Reply #7 on: February 05, 2024, 11:57:28 pm »
Seems these GPS modules are steadily improving, the NCO clock is getting faster over time.

I find this mention of NCO clock frequency by model family
https://portal.u-blox.com/s/question/0D52p0000Dvnnd6CQA/time-pulse-output-specs-at-high-frequency


Says
The output is generated by an NCO, the jitter depends on the nominal frequency
M8  :               48 MHz
M9,M10,F10T : 64 MHz
F9 :                 128 MHz


Chatter on the web suggests the 48MHz models can output clean (48M/2N) up to 24MHz, which should be easy to try ?
That could feed into a AD9833 DDS MCLK
« Last Edit: February 06, 2024, 12:12:04 am by PCB.Wiz »
 

Offline Solder_Junkie

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: gb
Re: TTL signal from GPS module, convert to sine/triangle etc
« Reply #8 on: February 06, 2024, 11:18:18 am »
(First post and not an experienced tech so bear with me)

I'm building a programmable and variable frequency standard/reference using an arduino and a Ublox gps module. It's pretty straight forward.
I would firstly concentrate on obtaining a clean and stable frequency from a standard/reference. The addition of a synth IC is something you can do after you have the initial circuit tested and working. By way of comparison, the Leo Bodnar GPSDO can output any frequency from 400 Hz to 810 MHz and claims to be low jitter. The synth used in the Leo Bodnar is an SI5328, see this teardown link: https://www.eevblog.com/forum/metrology/leo-bodnar-mini-precision-gps-reference-clock-teardown/

See attached image showing the output of my dual output Leo Bodnar unit operating at 10 MHz compared to the 10 MHz output of my home made Lars Walenius GPSDO... Quite some difference in the jitter, the red trace is the home made GPSDO. The reference for the comparison is a rubidium used with a TinyPFA (phase frequency analyser) and TimeLab software.

SJ
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3360
  • Country: au
Re: TTL signal from GPS module, convert to sine/triangle etc
« Reply #9 on: February 07, 2024, 05:25:48 am »
What I want to do is to send an input to the gps module with the desired frequency and then being able to send that output signal to a secondary module/circuit that creates my choice of a sine/triangle waveform in the same frequency. Frequencies I'm interested in are low, from 1 to 1000 000 Hz.
You can almost manage that, but where the Sine out is divided by a fixed number from the main clock.

Take a look at Switched Capacitor filters, and parts like MAX7418/MAX7421 are modern, claim THD levels of 80dB and can operate up to 45Khz Sine out frequencies, which may be good enough for high performance sine (<0.1% ~ 0.01%). Those have a divide by 100.
The stop-band numbers of those mean for best possible performance, you probably want a somewhat shaped sine to feed in, rather than a brutal square wave.

For higher frequency sines, some trade off is needed, good examples of Digital to Sine are here. These are giving a Sine of Clk/16.
https://www.ti.com/lit/an/sboa550/sboa550.pdf

I've not found full precision equations on the GPS NCO (are they 32bit adders ?), but if you are careful with the choice of frequencies, I think you can keep the NCO jitter 'inside the divider', which keeps the sine more stable.

A Switched Capacitor filter and a couple of logic chips, and a few passives should give you good sine outputs.

Or, you could pick a MCU that can clock to 24MHz and has a DAC, and use a few lines of assembler to do a clocked sine ROM. (Silabs EFM8BB52 has 10b DAC and is < $1)
You can add a Switched Capacitor filter as an option.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->