Square-wave generator - Page 1
Forum section: electronics / testgear

author: leonerd
author_rank: Regular Contributor
timestamp: October 31, 2015, 11:04:16 pm
content: 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?

author: Groucho2005
author_rank: Regular Contributor
timestamp: October 31, 2015, 11:14:41 pm
content: Quote from: leonerd on October 31, 2015, 11:04:16 pmEven 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.

author: leonerd
author_rank: Regular Contributor
timestamp: October 31, 2015, 11:20:15 pm
content: Quote from: Groucho2005 on October 31, 2015, 11:14:41 pmOh 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

author: Groucho2005
author_rank: Regular Contributor
timestamp: October 31, 2015, 11:28:18 pm
content: Did you check Ebay or the Buy/Sell forum here?

author: leonerd
author_rank: Regular Contributor
timestamp: November 01, 2015, 12:14:50 am
content: There's things like thishttp://www.ebay.co.uk/itm/24Mhz-Dual-ch-DDS-Function-Arbitrary-Waveform-Signal-Generator-sweep-Software/121478483178but 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

author: miguelvp
author_rank: Super Contributor
timestamp: November 01, 2015, 12:35:59 am
content: 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)

author: leonerd
author_rank: Regular Contributor
timestamp: November 01, 2015, 01:50:56 am
content: Quote from: miguelvp on November 01, 2015, 12:35:59 amYes; 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.

author: tggzzz
author_rank: Super Contributor
timestamp: November 01, 2015, 09:50:25 am
content: Quote from: leonerd on November 01, 2015, 12:14:50 amThe 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.

author: BytesGuy
author_rank: Regular Contributor
timestamp: November 01, 2015, 06:27:33 pm
content: 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 trickhttp://www.ebay.co.uk/itm/AD9850-DDS-Signal-Generator-Module-0-30MHz-Sine-Square-Wave-Frequency-AD9851-/331685372752?hash=item4d39fd2350:m:mAIjnEQn4VPa3wZSWr7BdCw

author: leonerd
author_rank: Regular Contributor
timestamp: November 05, 2015, 08:05:29 pm
content: 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...

author: German_EE
author_rank: Super Contributor
timestamp: November 05, 2015, 08:33:42 pm
content: Look for a pulse generator rather than a function generator, this might be what you need.

author: SharpEars
author_rank: Unknown
timestamp: November 05, 2015, 09:08:00 pm
content: Quote from: tggzzz on November 01, 2015, 09:50:25 amWhy not just use a sine wave generator + Schmitt trigger?

author: tggzzz
author_rank: Super Contributor
timestamp: November 05, 2015, 11:10:48 pm
content: Quote from: SharpEars on November 05, 2015, 09:08:00 pmThat'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.