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
β
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