Subscribe to EDN
RSS
Reprints/License
Print
Email

Microcontroller provides an alternative to DDS

Use a microcontroller to generate the codes for a DAC.

Daniele Danieli, Eurocom-Pro, Venice, Italy; Edited by Martin Rowe and Fran Granville -- EDN, January 7, 2010

PDF

Audio and low-frequency circuit systems often require a signal source with a pure spectrum. DDS (direct-digital-synthesis) devices often perform the signal generation by using these specialized integrated circuits. A DDS device uses a DAC but often with no more than 16-bit resolution, limiting the SNR (signal-to-noise ratio). You can perform the same task with a microcontroller programmed as a DDS and use an external high-resolution DAC. To achieve 18 to 24 bits of resolution requires a large memory table containing the cosine function for any values of phase progression.

An alternative approach lets you use a standard microcontroller with a small memory and still implement an effective synthesizer. You can design a circuit to produce a sine wave using a scalable digital oscillator built with adder and multiplier block functions in a simple structure.

Microcontroller provides an alternative to DDS figure 1Microcontroller provides an alternative to DDS figure 2Figure 1 shows a microcontroller driving an audio DAC. To develop your code to generate a sine wave, the circuit in Figure 2 comprises two integrators with an analog feedback loop equivalent to that of an ideal resonator. Parameter F defines the frequency and ranges from 0 to –0.2, and Parameter A sets the amplitude of the output signal with a single initial pulse at start-up. The following equation derives the frequency of generated signals: FOUT=01di5eq/(2×π×T), where T denotes the time for computing an entire sequence to obtain output data. The firmware for implementing this system is relatively straightforward. It requires just a few additions and one multiplication. Thus, you can use a slow microcontroller. Remember, though, that the precision of every operation must be adequate to warrant a complete signal reconstruction. Processing data with 8 or 16 bits isn’t sufficient. You must write your firmware to emulate a greater number of bits, which requires accurate code implementation.

See all of EDN's
Design Ideas

If you properly develop your code, then you should generate the DAC output codes that produce a sine wave (Figure 3). Remember that Parameter F is nonlinear with respect to the output frequency. If you need a directly proportional rate, you can square the value of F before applying it to the input. You’ll find it useful when you need to make an easy frequency setting.

Microcontroller provides an alternative to DDS figure 3


You can use just about any microcontroller to implement the oscillator, together with a high-performance DAC. You can achieve an output SNR greater than 110 dB. Many audio DACs operating in monophonic mode have 20- to 24-bit resolution at a 192-kHz sampling rate. They also offer a dynamic range of 120 dB or more.


Update (Aug 29, 2011)

You can use this Excel file for testing the algorithm. This application was implemented years ago on Texas Instruments microcontroller. While the complete code has not survived, an early assembler routine can be found here. It is very basic, but might be a useful starting place.

 

RSS
Reprints/License
Print
Email
Canon Resource Center

Featured Company


Most Recent Resources

Advertisement
Related Content

No related content found.

  • 0 rated items found.
Advertisement

KNOWLEDGE CENTER

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
Engineering Careers
Jobs sponsored by
Advertisement
About EDN   |   Site Map   |   Contact Us   |   Subscription   |   RSS
© 2011 UBM Electronics. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other UBM Canon sites

UBM Canon | Design News | Test & Measurement World | Packaging Digest | EDN | Qmed | Pharmalive | Appliance Magazine | Plastics Today | Powder Bulk Solids | Canon Trade Shows