Sines, squares and triangles up to 10 MHz

A few years ago I needed a function gen
erator for my home laboratory. In my
job I had worked with some expensive
commercial models and initially I had
planned to buy one of these. However,
none of them really was what I wanted
– too complex for simple use – and so I
decided to design and build my own. It
turned out to be DDS (direct digital syn
Sines, squares and triangles up to 10 MHzSines, squares and triangles up to 10 MHz
thesis) based but that was not the only
component selection issue I ran into. Here
are a few more.
My components, your
components?
After researching various techniques I
settled on a Direct Digital Synthesis (DDS)
based architecture for my project. DDS
employs a digital oscillator with quartz
crystal precision to accurately generate
sinewaves up to very high frequencies.
For the microcontroller I chose one from
Analog Devices. Although well known
for their Digital Signal Processor (DSP)
families, this may not be the first MCU
manufacturer that comes to mind. They
do have a nice family though of 32-bit
ARM controllers supported by something
I like a lot: comprehensive documenta
tion. Unlike other MCU manufacturers that
sometimes need more than one thou
sand pages to elucidate their devices,
Analog Devices manages to fit a com
plete description of a complex microcon
troller into a document of slightly more
than a hundred pages. Analog Devices
also specializes in DDS chips, operational
amplifiers and other analog support chips
and so made for a great one-stop shop
for this project. Their friendly sampling
service quickly got me started without
forking out a lot of money.
The
MCU
I selected was the
ADuC7024B
STZ62
, a member of the Precision Ana
log Microcontroller family in a 64-pin
package, containing an ARM7TDMI core
running at 44-MHz clock speed. These
MCUs are called analog because they
feature analog inputs and outputs (yup,
ADC and DAC) and an analog compara
tor. Besides, they sport PWM, timers and
standard serial ports (SPI, UART, I²C).
Our micro has 8 KB of RAM and 62 KB of
flash memory that can be programmed
in-circuit over a serial port. Note that
some types use I²C for flash memory
programming, so make sure you get the
specified type and not one with a slightly
different part number.
The
DDS chip
for the project is the popu
lar
AD9834
. The maximum frequency of
the external oscillator is 75 MHz, allowing
a maximum output frequency of 37.5 MHz
(half the clock frequency). The downside
of such a fast clock signal is a frequency
resolution of just 0.28 Hz owing to the
chip’s 28-bit integer frequency divider.
That doesn’t sound like a big deal, but
it does equate to almost 0.6% at 20 Hz.
To improve this, the clock frequency can
be lowered, albeit at the expense of the
maximum achievable output frequency.
At 1 MHz for instance the resolution
becomes 0.004 Hz, which corresponds
to an error of 0.005% at 20 Hz, but the
maximum frequency is then down to a
measly 500 kHz. In this project the DDS
clock frequency is 75 MHz to ensure a

 

For more detail:  Sines, squares and triangles up to 10 MHz

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter