Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Functional DDS generator. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Measuring technology

Comments on the article Comments on the article

This DDS function generator (version 2.0) of signals is assembled on the AVR microcontroller, has good functionality, has amplitude control, and is also assembled on a single-sided printed circuit board.

Functional DDS generator. Appearance of the DDS generator

This generator is based on the algorithm Jesper DDS generator, the program has been upgraded to AVR-GCC C with assembly code inserts. The generator has two output signals: the first is DDS signals, the second is a high-speed (1..8 MHz) "rectangular" output, which can be used to revive an MK with incorrect fuses and for other purposes.

The high-speed signal HS (High Speed) is taken directly from the Atmega16 OC1A (PD5) microcontroller.

DDS signals are generated from other outputs of the MK through a resistive R2R matrix and through the LM358N chip, which allows you to adjust the amplitude (Amplitude) of the signal and the offset (Offset). Offset and amplitude are adjustable with two potentiometers. The offset can be adjusted in the range +5V..-5V, and the amplitude 0...10V. The frequency of DDS signals can be adjusted from 0 to 65534 Hz, which is more than enough for testing audio circuits and other amateur radio tasks.

Key Features of DDS Generator V2.0

- a simple circuit with common and inexpensive radio elements;
- one-sided printed circuit board;
- built-in power supply;
- separate high-speed output (HS) up to 8 MHz;
- DDS signals with variable amplitude and offset;
- DDS signals: sine, rectangle, saw and reverse saw, triangle, ECG signal and noise signal;
- 2×16 LCD screen;
- intuitive 5-button keyboard;
- steps for frequency adjustment: 1, 10, 100, 1000, 10000 Hz;
- remembering the last state after power on.

The block diagram below shows the logical structure of the function generator:

Functional DDS generator. The logical structure of the function generator

As you can see, the device requires several supply voltages: +5V, -12V, +12V. The +12V and -12V voltages are used to control the signal amplitude and offset. The power supply is designed using a transformer and several voltage regulator chips:

Functional DDS generator. Scheme of the power supply of the DDS generator
(click to enlarge)

The power supply is assembled on a separate board:

Functional DDS generator. DDS generator power supply

If you don’t want to assemble the power supply yourself, then you can use a regular ATX power supply from a computer, where all the necessary voltages are already present. ATX connector pinout.

LCD screen

All actions are displayed through the LCD screen. The generator is controlled by five keys

Functional DDS generator. LCD menu

The up/down keys are used to move through the menu, the left/right keys are used to change the frequency value. When the central key is pressed, the generation of the selected signal starts. Pressing the key again stops the generator.

Generator menu system:

Functional DDS generator. Generator menu system

A separate value is provided for setting the frequency change step. This is convenient if you need to change the frequency over a wide range.

The noise generator does not have any settings. For it, the usual rand() function is used, continuously fed to the output of the DDS generator.

The HS high speed output has 4 frequency modes: 1, 2, 4 and 8 MHz.

Schematic diagram

The function generator circuit is simple and contains easily accessible elements:
- microcontroller AVR Atmega16, with external quartz at 16 MHz;
- standard HD44780-type LCD screen 2×16;
- R2R-matrix DAC from conventional resistors;
- operational amplifier LM358N (domestic analogue KR1040UD1);
- two potentiometers;
- five keys;
- several connectors.

Functional DDS generator. Schematic diagram of the DDS generator
(click to enlarge)

Plateau

Functional DDS generator. Generator board

The function generator is assembled in a plastic box

Functional DDS generator. Assembled generator

Test run

Functional DDS generator. Test run

Software

As I said above, at the heart of my program I used the algorithm Jesper DDS generator. I added a few lines of assembler code to implement stop generation. The algorithm now contains 10 CPU cycles instead of 9.

void static inline Signal_OUT(const uint8_t *signal, uint8_t ad2, uint8_t ad1, uint8_t ad0){
asm volatile( "eor r18, r18 ;r18<-0″ "\n\t"
"eor r19, r19 ;r19<-0" "\n\t"
"1:" "\n\t"
"add r18, %0 ;1 cycle" "\n\t"
"adc r19, %1 ;1 cycle" "\n\t"
"adc %A3, %2 ;1cycle" "\n\t"
"lpm ;3 cycles" "\n\t"
"out %4, __tmp_reg__ ;1 cycle" "\n\t"
"sbis %5, 2 ;1 cycle if no skip" "\n\t"
"rjmp 1b ;2 cycles. Total 10 cycles" "\n\t"
:
:"r" (ad0),"r" (ad1),"r" (ad2),"e" (signal),"I" (_SFR_IO_ADDR(PORTA)), "I" (_SFR_IO_ADDR(SPCR))
:"r18", "r19"
);}

The table of DDS-signal forms is located in the flash memory of the MK, the address of which starts with 0xXX00. These sections are defined in the makefile, in their respective locations in memory:

#Define sections where to store signal tables
LDFLAGS += -Wl,-section-start=.MySection1=0x3A00
LDFLAGS += -Wl,-section-start=.MySection2=0x3B00
LDFLAGS += -Wl,-section-start=.MySection3=0x3C00
LDFLAGS += -Wl,-section-start=.MySection4=0x3D00
LDFLAGS += -Wl,-section-start=.MySection5=0x3E00
LDFLAGS += -Wl,-section-start=.MySection6=0x3F00

The LCD library can be found at winavr.scienceprog.com.

I do not want to go into a detailed description of the program code. The source code is well commented (albeit in English) and if you have any questions about it, you can always use our MK forum, forum.cxem.net.

The test is

I tested the generator with an oscilloscope and a frequency counter. All signals are well generated in the entire frequency range (1...65535 Hz). Amplitude and offset control works fine.

Functional DDS generator. DDS generator signals
(click to enlarge)

In the next version of the generator, I think to implement a rising sinusoid signal.

The latest software version (WinAVR20071221), source code, EagleCAD and Proteus files can be скачать здесь.

Author: Koltykov A.V.; Publication: cxem.net

See other articles Section Measuring technology.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Machine for thinning flowers in gardens 02.05.2024

In modern agriculture, technological progress is developing aimed at increasing the efficiency of plant care processes. The innovative Florix flower thinning machine was presented in Italy, designed to optimize the harvesting stage. This tool is equipped with mobile arms, allowing it to be easily adapted to the needs of the garden. The operator can adjust the speed of the thin wires by controlling them from the tractor cab using a joystick. This approach significantly increases the efficiency of the flower thinning process, providing the possibility of individual adjustment to the specific conditions of the garden, as well as the variety and type of fruit grown in it. After testing the Florix machine for two years on various types of fruit, the results were very encouraging. Farmers such as Filiberto Montanari, who has used a Florix machine for several years, have reported a significant reduction in the time and labor required to thin flowers. ... >>

Advanced Infrared Microscope 02.05.2024

Microscopes play an important role in scientific research, allowing scientists to delve into structures and processes invisible to the eye. However, various microscopy methods have their limitations, and among them was the limitation of resolution when using the infrared range. But the latest achievements of Japanese researchers from the University of Tokyo open up new prospects for studying the microworld. Scientists from the University of Tokyo have unveiled a new microscope that will revolutionize the capabilities of infrared microscopy. This advanced instrument allows you to see the internal structures of living bacteria with amazing clarity on the nanometer scale. Typically, mid-infrared microscopes are limited by low resolution, but the latest development from Japanese researchers overcomes these limitations. According to scientists, the developed microscope allows creating images with a resolution of up to 120 nanometers, which is 30 times higher than the resolution of traditional microscopes. ... >>

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

Random news from the Archive

truffle forest 27.02.2016

Foresters from the Basque Country have figured out how to combine business with pleasure, namely: to restore forests and earn income from them. To do this, you need to grow oak seedlings along with black truffles. These expensive mushrooms live in symbiosis with oaks.

Therefore, to establish a truffle plantation, the roots of a young tree should be treated with fungus spores, and then grown in a greenhouse until the time comes for planting in a permanent place. After six to eight years, truffles will grow around the roots, and it will be possible to start harvesting.

It used to be thought that only the roots of the holly oak were suitable for black truffle. However, researchers from the Basque Institute for Agricultural Research and Development NEIKER-Tecnalia have shown that mushroom plantations can be established in areas where white oak grows, as well as Portuguese oak. This doubles the amount of land available for growing truffles, since it is the Portuguese oak that is most abundant in the Basque Country.

Peasants will be able to diversify their activities, and in addition, it will be profitable to restore forests precisely at the expense of local tree species.

Other interesting news:

▪ Nearby Share data service

▪ Transparent memory chip

▪ Shadow in the car where needed

▪ Earth's magnetic field has a clear cycle

▪ Lonely people's brains work differently.

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ site section Tone and volume controls. Article selection

▪ article Children's infectious diseases. Lecture notes

▪ article What weapon has killed more people in its manufacture than in its use? Detailed answer

▪ article Work on rewinders. Standard instruction on labor protection

▪ article S/PDIF adapter. Encyclopedia of radio electronics and electrical engineering

▪ article How many matches are in a fist? Focus Secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024