Author Topic: Generating a specific clock signal  (Read 5711 times)

0 Members and 1 Guest are viewing this topic.

Offline tszabooTopic starter

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nl
  • Current job: ATEX product design
Generating a specific clock signal
« on: September 01, 2023, 08:10:21 am »
Hi. I would like to create a 1280KHz +/-0.5% clock signal for a project. It just need to be a regular 3.3V CMOS voltage level clock. So far I used a signal generator for it, but I need to make the setup more mobile and production ready. Do you have a good idea about for creating this clock signal?
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3403
  • Country: au
Re: Generating a specific clock signal
« Reply #1 on: September 01, 2023, 08:45:20 am »
Hi. I would like to create a 1280KHz +/-0.5% clock signal for a project. It just need to be a regular 3.3V CMOS voltage level clock. So far I used a signal generator for it, but I need to make the setup more mobile and production ready. Do you have a good idea about for creating this clock signal?

How adjustable does it need to be. There are i2c Clock generator modules (eg Adafruit) based on Si5351A, that can set any frequency.

A crystal, resonator, or a oscillator are the obvious choices, and an oscillator with divider is also an option.
You can still buy 74HC6323 parts, which give many choices in SO8  /1 /2 /4 /8 allowing 2.56Mhz 5.12Mhz and 10.24Mhz as alternate choices.
Or, you can use a 74HC4060 and 20.48MHz Xtal or Osc source to give /16 at 1.28Mhz

Mouser have 5.12MHz ceramic resonators that have some pull range, needing a /4
Digikey and Mouser have a lot of 20.48MHz crystals that will work with a 74HC4060
« Last Edit: September 01, 2023, 08:55:39 am by PCB.Wiz »
 

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 4599
  • Country: gb
Re: Generating a specific clock signal
« Reply #2 on: September 01, 2023, 11:30:00 am »
Are there still companys that "grow" custom crystals or have they all disappeared?
 

Offline tszabooTopic starter

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nl
  • Current job: ATEX product design
Re: Generating a specific clock signal
« Reply #3 on: September 01, 2023, 11:51:55 am »
Hi. I would like to create a 1280KHz +/-0.5% clock signal for a project. It just need to be a regular 3.3V CMOS voltage level clock. So far I used a signal generator for it, but I need to make the setup more mobile and production ready. Do you have a good idea about for creating this clock signal?

How adjustable does it need to be. There are i2c Clock generator modules (eg Adafruit) based on Si5351A, that can set any frequency.

A crystal, resonator, or a oscillator are the obvious choices, and an oscillator with divider is also an option.
You can still buy 74HC6323 parts, which give many choices in SO8  /1 /2 /4 /8 allowing 2.56Mhz 5.12Mhz and 10.24Mhz as alternate choices.
Or, you can use a 74HC4060 and 20.48MHz Xtal or Osc source to give /16 at 1.28Mhz

Mouser have 5.12MHz ceramic resonators that have some pull range, needing a /4
Digikey and Mouser have a lot of 20.48MHz crystals that will work with a 74HC4060
I need a 2^n * 40KHz. I'm trying to run a 40KHz ultrasonic transducer with a TDC1000-EVM. The original description was calling for a 1280KHz clock input (from the user manual), but now on the third look, it accepts anywhere between a 1-16MHz signal. I did this in the past with a signal generator, but as I said, it needs to be more mobile.
I think on the final design, I should be able to generate this clock somehow with a microcontroller.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3403
  • Country: au
Re: Generating a specific clock signal
« Reply #4 on: September 01, 2023, 08:51:12 pm »
Hi. I would like to create a 1280KHz +/-0.5% clock signal for a project.
...
I need a 2^n * 40KHz. I'm trying to run a 40KHz ultrasonic transducer with a TDC1000-EVM. The original description was calling for a 1280KHz clock input (from the user manual), but now on the third look, it accepts anywhere between a 1-16MHz signal. I did this in the past with a signal generator, but as I said, it needs to be more mobile.
I think on the final design, I should be able to generate this clock somehow with a microcontroller.

The TDC1000 would need a crystal derived clock, for low jitter, but the spec says  0.06 ~16 MHz.
It looks to support 2~256 divides, so can accept up to 10.24MHz, which is getting 'common enough' and easy to get from a Crystal + MCU clock out / timer.
It's not clear if a higher CLK has any benefit, so you could divide more inside the MCU and less inside the TDC1000 for a lower RFI solution
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 12014
  • Country: us
  • Retired, now restoring antique test equipment
Re: Generating a specific clock signal
« Reply #5 on: September 01, 2023, 08:54:16 pm »
There are companies that supply packaged crystal oscillators for the customer's frequency.
One example (thanks to Google):  https://pccomponents.com/datasheets/MF-h3291.pdf
 

Offline tszabooTopic starter

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nl
  • Current job: ATEX product design
Re: Generating a specific clock signal
« Reply #6 on: September 01, 2023, 09:26:31 pm »
Hi. I would like to create a 1280KHz +/-0.5% clock signal for a project.
...
I need a 2^n * 40KHz. I'm trying to run a 40KHz ultrasonic transducer with a TDC1000-EVM. The original description was calling for a 1280KHz clock input (from the user manual), but now on the third look, it accepts anywhere between a 1-16MHz signal. I did this in the past with a signal generator, but as I said, it needs to be more mobile.
I think on the final design, I should be able to generate this clock somehow with a microcontroller.

The TDC1000 would need a crystal derived clock, for low jitter, but the spec says  0.06 ~16 MHz.
It looks to support 2~256 divides, so can accept up to 10.24MHz, which is getting 'common enough' and easy to get from a Crystal + MCU clock out / timer.
It's not clear if a higher CLK has any benefit, so you could divide more inside the MCU and less inside the TDC1000 for a lower RFI solution
True, that's what I see as well from the datasheet. Unfortunately the software doesn't support less than 1MHz otherwise I would have given it a 80KHz pwm made by a microcontroller.
I think the 10.24 is probably the easiest for now. I haven't decided on the MCU yet, maybe it's going to be an ESP32 or an STM32. The first one would be more difficult to clock from that crystal.
 

Offline ConKbot

  • Super Contributor
  • ***
  • Posts: 1418
Re: Generating a specific clock signal
« Reply #7 on: September 01, 2023, 11:50:07 pm »
SItime "time machine II" and a blank programmable sample oscillator programmed to the frequency of interest.
If I was at work at least, $300 for the programmer ain't very cheap for the home gamer.
Iirc digikey does programming for some of them, so if there isn't an unreasonable minimum, that may be viable?

Though I would be mindful of jitter on the cheapest mems oscillators. There is a reason the jitter spec is an integration of phase noise from 10 or 12 khz up, because they shoved all the phase noise somewhere.

Using a lower jitter oscillator and a higher division ratio will crush that phase noise down into a narrower and narrower bandwidth. Though that's assuming that running an 8x higher frequency doesn't result in an 8x spreading of the oscillators phase noise plot.
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6930
  • Country: es
Re: Generating a specific clock signal
« Reply #8 on: September 02, 2023, 12:51:55 am »
The LTC6907 is a bit expensive will do it with minimal external components.
Also a cheap mcu running a 4MHz xtal with a timer output dividing the clock by 100.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline bostonman

  • Super Contributor
  • ***
  • Posts: 2845
  • Country: us
Re: Generating a specific clock signal
« Reply #9 on: September 04, 2023, 03:26:16 pm »
I'm curious, can the LTC6907 be used to generate 50Hz?

If it allows for a range of frequencies, then maybe it can be set to an odd frequency and then use dividers to get it to 50Hz, but will the jitter be too much to run 50Hz electronics?
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3403
  • Country: au
Re: Generating a specific clock signal
« Reply #10 on: September 04, 2023, 07:47:02 pm »
I'm curious, can the LTC6907 be used to generate 50Hz?

If it allows for a range of frequencies, then maybe it can be set to an odd frequency and then use dividers to get it to 50Hz, but will the jitter be too much to run 50Hz electronics?
What exactly is 50Hz electronics, and how much jitter can it tolerate ?
The LTC6907 has museum level prices, if you are adding a divider to get to 50Hz, just add a divider that can run a crystal ?
Eg x4060, AHC1G42xx, x4521, or even a vanilla MCU that has xtal pins.
 

Offline tszabooTopic starter

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nl
  • Current job: ATEX product design
Re: Generating a specific clock signal
« Reply #11 on: September 05, 2023, 09:39:44 am »
Ok, so for now, I used a RP2040 with it's PWM generator to make a clock signal.
The code is below. I plan to measure the accuracy of this signal this afternoon.
It has some sort of fractional clock generator inside so in theory the signal is accurate, we will see. Unfortunately there is no specification or any publication on how it actually works or how accurate signal we can get. Code is circuitpython.

Code: [Select]
import board
import pwmio

pwm = pwmio.PWMOut(board.GP14, variable_frequency= True)
pwm.duty_cycle = 128*256
pwm.frequency =1280*1000
 

Offline tszabooTopic starter

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nl
  • Current job: ATEX product design
Re: Generating a specific clock signal
« Reply #12 on: September 05, 2023, 11:57:24 am »
Frequency 1280KHz nominal, 1275.5KHz actual, that is a 0.35% deviation, which is acceptable.
The next step in the PWM settings seem to be 1286.6KHz. Duty cycle is 49-50% according to the scope, and the rise time is 20ns.
I don't think the transducer would mind if it's driven at 39.8KHz instead of the nominal 40KHz.
After trying to get the system to work for like two hours, I found my settings file from 4 years ago for the TDC1000.
 

Offline MathWizard

  • Super Contributor
  • ***
  • Posts: 2545
  • Country: ca
Re: Generating a specific clock signal
« Reply #13 on: September 08, 2023, 05:22:34 am »
How good or bad is a typical microcontroller at outputting a user-defined clock pulse ? Why does it have to be 1280kHz ?
 

Online fourfathom

  • Super Contributor
  • ***
  • Posts: 2300
  • Country: us
    • Turn Island Systems
Re: Generating a specific clock signal
« Reply #14 on: September 08, 2023, 06:18:50 am »
How adjustable does it need to be. There are i2c Clock generator modules (eg Adafruit) based on Si5351A, that can set any frequency.

This. 

You can get a Si5351 on a board with a (good enough) crystal for US$8 from Amazon, and cheaper elsewhere.  If you can connect it to an I2C port it will do everything you want.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline jbb

  • Super Contributor
  • ***
  • Posts: 1338
  • Country: nz
Re: Generating a specific clock signal
« Reply #15 on: September 08, 2023, 09:13:11 am »
I’ve used TI CDCE913 before to good effect.
But it’s got much the same specs as the Si5… part and probably costs more
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3403
  • Country: au
Re: Generating a specific clock signal
« Reply #16 on: September 08, 2023, 09:45:58 am »
I’ve used TI CDCE913 before to good effect.
But it’s got much the same specs as the Si5… part and probably costs more

Another source has appeared for Si5351, and that works wonders on the price :)  (both are now sub 65c/30+ at lcsc)

Alternates are MS5351M MSOP10 and newer MS5351 eMSOP10, tho I've not seen anyone selling the EPAD version yet.
 

Offline HalFoster

  • Frequent Contributor
  • **
  • Posts: 282
  • Country: us
Re: Generating a specific clock signal
« Reply #17 on: September 08, 2023, 09:46:24 am »
Mouser has many crystals and oscillators that would only need a divide by x to be exactly the value that you need.

Hal
--- If it isn't broken... Fix it until it is ---
 

Offline tszabooTopic starter

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nl
  • Current job: ATEX product design
Re: Generating a specific clock signal
« Reply #18 on: September 08, 2023, 09:59:32 am »
How good or bad is a typical microcontroller at outputting a user-defined clock pulse ? Why does it have to be 1280kHz ?
It's 40KHz x 32 for an ultrasonic project. I have my accuracy measurement for a RP2040 just above.
 

Offline tszabooTopic starter

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nl
  • Current job: ATEX product design
Re: Generating a specific clock signal
« Reply #19 on: September 08, 2023, 10:10:55 am »
How adjustable does it need to be. There are i2c Clock generator modules (eg Adafruit) based on Si5351A, that can set any frequency.

This. 

You can get a Si5351 on a board with a (good enough) crystal for US$8 from Amazon, and cheaper elsewhere.  If you can connect it to an I2C port it will do everything you want.
Thanks, this kind of info is exactly why I asked.
Funny PCB.Wiz also posted this as first reply, but I somehow missed it. Seems to be 1.3 USD on aliexpress so I placed a few in my shopping basket.
I was getting a bit of jitter on my measurements, and I suspect it to come from the RP20240 so let's try an update.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->