Will I be able to accuratley generate a 2MHz square wave using the AD9833 (pdf data sheet) ? I know that as you approach the clock frequency on a DDS you get distorted output signals. I was just wondering whether this is a little to close and if anyone has any experiance with this?

I want to achieve a square wave at 2Mhz, I'd like it at around 3-5Vpp. I'm happy to use other signal generators, I'm not set on the AD9833 and I've been looking at the AD9850 but putting the sinewave through the comparator seems a very roundabout way of getting a square wave out...

Any help would be much appreciated.

  • 1
    \$\begingroup\$ The AD9833 seems to be overkill for this application, as well as of questionable suitability for the reasons you outline here. You can buy 2MHz crystals and fast comparators. I would suggest you use those instead. It will also be easier to produce 5V pk.-pk. with this method. \$\endgroup\$ – Oleksandr R. Feb 29 '16 at 13:19
  • \$\begingroup\$ What do you consider "accurate", an accurate frequency, shape of waveform, voltage ? All of these ? The AD9833 can also make a square wave as can the AD9850. But why do you (think you) need a DDS ? I can make a 5 V 2 MHz squarewave using an Arduino board for $2. \$\endgroup\$ – Bimpelrekkie Feb 29 '16 at 13:35

It actually is not a roundabout method if you really think about it.

The analog multi-pole low-pass filtering kills the higher harmonics that would otherwise cause large jitter in the output. How could you possibly expect to get sub-clock width resolution in the output waveform without an analog step?

However, if you just need 2MHz, you can buy a crystal oscillator that directly generates the 2MHz (eg. Fox FXO-HC736R-2 ) or use a higher frequency such as 8MHz and divide it down with a couple flip-flops. The DDS comes in handy if you want to generate oddball and/or variable frequencies or even frequency sweeps with relatively fine resolution.

Another approach is to use a reference frequency and a PLL such as a 74HC4046, by dividing down the output frequency before feedback you can generate various frequencies.


The MSB is directly available at the Vout pin by setting the OPBITEN (D5) control bit to 1, which directly generates a square wave. Offsets would be generated by analog post-processing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.