Author Topic: Square-wave generator  (Read 7698 times)

0 Members and 2 Guests are viewing this topic.

Offline leonerdTopic starter

  • Regular Contributor
  • *
  • Posts: 167
  • Country: gb
Square-wave generator
« on: October 31, 2015, 11:04:16 pm »
I've been looking at function generators and the like lately. A lot of them are primarily generators of sine waves, which sounds handy for analog work. But I mostly work in digital things, so my interest in such equipment would be mostly for generating clocks for MCUs, at a variety of frequencies (basically just to avoid having a huge selection of timing crystals to hand).

I feel like a lot of the fanciness in these existing generators is in the DAC and output circuitry to achieve a wide variety of amplitudes and nice smooth sine and triangle waves. None of which I'm interested in.

Does anyone make some sort of clock generator, as a full bench-ready product? Crucial requirements are 0-20MHz, with a resolution down to 100Hz or so, to be able to dial up the interesting baud-rate frequencies of 14.7456MHz and so on. Accuracy is no great deal for me - even the most demanding of serial protocols is quite happy with 100ppm or worse. Nor does a small amount of jitter really bother me, because this is "only" an MCU clock and will be subdivided greatly to generate real baud rates or other timing signals, so per-pulse jitter would effectively disappear.

I have ordered myself an Adafruit SI5351A board (https://learn.adafruit.com/adafruit-si5351-clock-generator-breakout/overview) to have a play with, but obviously this is just the timing generation core itself, and not a full bench product.

Am I likely to find such a device ready-made that I can buy, or will I be building this one myself?
 

Offline Groucho2005

  • Regular Contributor
  • *
  • Posts: 91
  • Country: es
Re: Square-wave generator
« Reply #1 on: October 31, 2015, 11:14:41 pm »
Crucial requirements are 0-20MHz, with a resolution down to 100Hz or so, to be able to dial up the interesting baud-rate frequencies of 14.7456MHz and so on. Accuracy is no great deal for me - even the most demanding of serial protocols is quite happy with 100ppm or worse. Nor does a small amount of jitter really bother me, because this is "only" an MCU clock and will be subdivided greatly to generate real baud rates or other timing signals, so per-pulse jitter would effectively disappear.
Even cheap Chinese function generators like a Siglent SDG1025 do what you require. A dedicated square wave generator is much harder to find and probably more expensive.
 

Offline leonerdTopic starter

  • Regular Contributor
  • *
  • Posts: 167
  • Country: gb
Re: Square-wave generator
« Reply #2 on: October 31, 2015, 11:20:15 pm »
Even cheap Chinese function generators like a Siglent SDG1025 do what you require. A dedicated square wave generator is much harder to find and probably more expensive.

Oh I'm aware of those, but even an SDG1025 is looking at over £200. I ordered this SI5351 for £11 - stick it in a box with an MCU, an LCD and a few buttons and I'm looking at under a quarter of that. I was more hoping that someone else had done the work for me on that :)
 

Offline Groucho2005

  • Regular Contributor
  • *
  • Posts: 91
  • Country: es
Re: Square-wave generator
« Reply #3 on: October 31, 2015, 11:28:18 pm »
Did you check Ebay or the Buy/Sell forum here?
 

Offline leonerdTopic starter

  • Regular Contributor
  • *
  • Posts: 167
  • Country: gb
Re: Square-wave generator
« Reply #4 on: November 01, 2015, 12:14:50 am »
There's things like this

  http://www.ebay.co.uk/itm/24Mhz-Dual-ch-DDS-Function-Arbitrary-Waveform-Signal-Generator-sweep-Software/121478483178

but from what I gather it's only good for squares up to about 6MHz. The kind of cheap DAC/output hardware that makes nice sine curves isn't good for sharp square waves. I suspect a dedicated clock generator would do much better
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Square-wave generator
« Reply #5 on: November 01, 2015, 12:35:59 am »
You are better off with a PLL (phase locked loop) based clock generator.

Adafruit has one that can be configured via I2C, with a range from 8KHz to 160MHz.

Related video by w2aew (forum member)


 

Offline leonerdTopic starter

  • Regular Contributor
  • *
  • Posts: 167
  • Country: gb
Re: Square-wave generator
« Reply #6 on: November 01, 2015, 01:50:56 am »
Adafruit has one that can be configured via I2C, with a range from 8KHz to 160MHz.

Yes; that is the SI5351 I mentioned in my very first post. It's a PCB with some chips on it. A useful building block but not a complete bench-ready solution. Hence my original statement of "maybe I should just put that in a box with some surrounding peripherals".

Thanks for the video link - I'll watch that now.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Square-wave generator
« Reply #7 on: November 01, 2015, 09:50:25 am »
The kind of cheap DAC/output hardware that makes nice sine curves isn't good for sharp square waves. I suspect a dedicated clock generator would do much better

The DDS+DAC+filter devices are extremely good at creating 50% duty cycle square waves - use an external comparator to detect above/below the mean value. (Internal comparators can add glitches onto the sinewave).

If you are less worried about the duty cycle, then the PLL synthesisers are probably sufficient for your needs.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline BytesGuy

  • Regular Contributor
  • *
  • Posts: 50
  • Country: gb
Re: Square-wave generator
« Reply #8 on: November 01, 2015, 06:27:33 pm »
I'm in the same boat, would be handy to have something like this as I am also an all-digital guy.

Beyond the usual low frequency stuff, I found this which might do the trick

http://www.ebay.co.uk/itm/AD9850-DDS-Signal-Generator-Module-0-30MHz-Sine-Square-Wave-Frequency-AD9851-/331685372752?hash=item4d39fd2350:m:mAIjnEQn4VPa3wZSWr7BdCw
 

Offline leonerdTopic starter

  • Regular Contributor
  • *
  • Posts: 167
  • Country: gb
Re: Square-wave generator
« Reply #9 on: November 05, 2015, 08:05:29 pm »
Update: my Adafruit Si5351 breakout board has now arrived. I guess I shall start playing with it and see what I can come up with...
 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: Square-wave generator
« Reply #10 on: November 05, 2015, 08:33:42 pm »
Look for a pulse generator rather than a function generator, this might be what you need.
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline SharpEars

  • Supporter
  • ****
  • Posts: 634
  • Country: us
Re: Square-wave generator
« Reply #11 on: November 05, 2015, 09:08:00 pm »
The kind of cheap DAC/output hardware that makes nice sine curves isn't good for sharp square waves. I suspect a dedicated clock generator would do much better

The DDS+DAC+filter devices are extremely good at creating 50% duty cycle square waves - use an external comparator to detect above/below the mean value. (Internal comparators can add glitches onto the sinewave).

If you are less worried about the duty cycle, then the PLL synthesisers are probably sufficient for your needs.

Why not just use a sine wave generator + Schmitt trigger?
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Square-wave generator
« Reply #12 on: November 05, 2015, 11:10:48 pm »
The kind of cheap DAC/output hardware that makes nice sine curves isn't good for sharp square waves. I suspect a dedicated clock generator would do much better

The DDS+DAC+filter devices are extremely good at creating 50% duty cycle square waves - use an external comparator to detect above/below the mean value. (Internal comparators can add glitches onto the sinewave).

If you are less worried about the duty cycle, then the PLL synthesisers are probably sufficient for your needs.

Why not just use a sine wave generator + Schmitt trigger?

That's what it is. Depending on the accuracy, resolution, stability, duty cycle, cost  and power consumption requirements, different techniques for generating the sine wave are optimum.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->