Global Sources
EE Times-India
Stay in touch with EE Times India
 
EE Times-India > Controls/MCUs
 
 
Controls/MCUs  

MCU offers an alternative to direct-digital-synthesis

Posted: 18 Jul 2011     Print Version  Bookmark and Share

Keywords:microcontroller  direct-digital-synthesis  DAC  ADC 

Audio and low-frequency circuit systems usually call for a signal source with a pure spectrum. Direct-digital-synthesis (DDS) devices often perform the signal generation by using these specialised integrated circuits. A DDS device uses a DAC but often with no more than 16bit resolution, limiting the signal-to-noise ratio (SNR).

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 synthesiser. 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.

image name

Figure 1: A microcontroller with a small memory can drive a DAC to generate audio-frequency signals.

Figure 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 analogue feedback loop equivalent to that of an ideal resonator.

image name

Figure 2: The functional software for a digital sine oscillator uses only two adders, one multiplier, and storage registers.

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:

image name

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.

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 non-linear 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.

image name

Figure 3: Use DDS to generate a sine wave.

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 24bit resolution at a 192kHz sampling rate. They also offer a dynamic range of 120 dB or more.

To download the PDF version of this article, click here.

- Daniele Danieli
  Eurocom-Pro





Comment on "MCU offers an alternative to direct-..."
Comments:  
*  You can enter [0] more charecters.
*Verify code:
 
 
Webinars

Seminars

Visit Asia Webinars to learn about the latest in technology and get practical design tips.

 

Go to top             Connect on Facebook      Follow us on Twitter      Follow us on Orkut

 
Back to Top