Test of a DDS signal generator designer from China. Functional generator on a microcontroller Detailed description of the dds generator program

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

This generator is based on the Jesper DDS generator algorithm, the program has been modernized for 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 the MK with incorrect fuzzes and for other purposes.
The high-speed HS (High Speed) signal is taken directly from the Atmega16 OC1A (PD5) microcontroller.
DDS signals are generated from other MC outputs through a resistive R2R matrix and through the LM358N microcircuit, which allows adjustment of the signal amplitude and offset (Offset). Offset and amplitude are adjusted using two potentiometers. The offset can be adjusted in the range of +5V..-5V, and the amplitude is 0...10V. The frequency of DDS signals can be adjusted within the range of 0... 65534 Hz, this is more than enough for testing audio circuits and other amateur radio tasks.

Main characteristics of DDS generator V2.0:
- a simple circuit with common and inexpensive radioelements;
- single-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 turning on the power.

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

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

The power supply is assembled on a separate board:

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

LCD screen

All actions are displayed via an LCD screen. The generator is controlled by five keys

The up/down keys are used to move through the menu, the left/right keys are used to change the frequency value. When the center key is pressed, the selected signal begins to be generated. Pressing the key again stops the generator.

A separate value is provided to set 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. It uses the usual rand() function, which is 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:
- AVR Atmega16 microcontroller, with external quartz at 16 MHz;
- standard HD44780-type LCD screen 2×16;
- R2R DAC matrix made of ordinary resistors;
- operational amplifier LM358N (domestic analogue of KR1040UD1);
- two potentiometers;
- five keys;
- several connectors.

Pay:

The functional generator is assembled in a plastic box:


Software

As I said above, I based my program on the Jesper DDS generator algorithm. I added a few lines of assembly code to implement the generation stop. Now the algorithm 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 ;1 cycle" "\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 at 0xXX00. These sections are defined in the makefile, in the appropriate memory locations:
#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

You can take the library for working with LCD.

I don't want to go into a detailed description of the program code. The source code is well commented (though in English) and if you have any questions about it, you can always use ours or in the comments to the article.

Testing

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

In the next version of the generator I am thinking of implementing a rising sine wave signal.

The latest version of the software (), source, files can be downloaded below.

List of radioelements

Designation Type Denomination Quantity NoteShopMy notepad
Linear regulator

LM7805

1 To notepad
Linear regulator

LM7812

1 To notepad
Linear regulator

LM7912

1 To notepad
B1 Diode bridge 1 To notepad
C1, C7 2000 µF2 To notepad
C3, C5, C9 Electrolytic capacitor100 µF3 To notepad
C4, C6, C10 Capacitor0.1 µF3 To notepad
TR1 Transformer220V - 2x15V1 To notepad
F1 Fuse 1 To notepad
S1 Switch220V1 To notepad
X1 ConnectorNetwork 220V1 To notepad
JP1 Connector4 contacts1 PSU output To notepad
Main board
IC1 MK AVR 8-bit

ATmega16

1 To notepad
IC2 Operational amplifier

LM358N

1 KR1040UD1 To notepad
C2, C3 Capacitor0.1 µF2 To notepad
C6, C7 Capacitor18 pF2 To notepad
R1 Resistor

500 Ohm

1 To notepad
R2, R6, R8, R10, R12, R14, R16, R18 Resistor

10 kOhm

8 To notepad
R3, R21 Resistor

100 kOhm

2 To notepad
R20 Resistor

100 Ohm

1 To notepad
R22 Resistor

12 kOhm

1 To notepad
POT Trimmer resistor10 kOhm1

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

This generator is based on the Jesper DDS generator algorithm, the program has been modernized for 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 the MK with incorrect fuzzes and for other purposes.
The high-speed HS (High Speed) signal is taken directly from the Atmega16 OC1A (PD5) microcontroller.
DDS signals are generated from other MC outputs through a resistive R2R matrix and through the LM358N microcircuit, which allows adjustment of the signal amplitude and offset (Offset). Offset and amplitude are adjusted using two potentiometers. The offset can be adjusted in the range of +5V..-5V, and the amplitude is 0...10V. The frequency of DDS signals can be adjusted within the range of 0... 65534 Hz, this is more than enough for testing audio circuits and other amateur radio tasks.

Main characteristics of DDS generator V2.0:
- a simple circuit with common and inexpensive radioelements;
- single-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 turning on the power.

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

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

The power supply is assembled on a separate board:

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

LCD screen

All actions are displayed via an LCD screen. The generator is controlled by five keys

The up/down keys are used to move through the menu, the left/right keys are used to change the frequency value. When the center key is pressed, the selected signal begins to be generated. Pressing the key again stops the generator.

A separate value is provided to set 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. It uses the usual rand() function, which is 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:
- AVR Atmega16 microcontroller, with external quartz at 16 MHz;
- standard HD44780-type LCD screen 2×16;
- R2R DAC matrix made of ordinary resistors;
- operational amplifier LM358N (domestic analogue of KR1040UD1);
- two potentiometers;
- five keys;
- several connectors.

Pay:

The functional generator is assembled in a plastic box:


Software

As I said above, I based my program on the Jesper DDS generator algorithm. I added a few lines of assembly code to implement the generation stop. Now the algorithm 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 ;1 cycle" "\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 at 0xXX00. These sections are defined in the makefile, in the appropriate memory locations:
#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 sine wave generator is one of the most common instruments in any measurement laboratory. Industrially produced signal generators are large in size, weight and quite expensive. With the advent of direct frequency synthesis microcircuits DDS (Direct Digital Synthesizer), it became possible to produce a sinusoidal signal generator with fairly high parameters with a relatively simple circuit and design.

The generator allows you to smoothly adjust the frequency in the range of 0.1 Hz...6 MHz in steps of 0.1 Hz...1 MHz, the amplitude can be adjusted from 0 to 7 V. The output voltage can be shifted relative to zero in the range of up to +/- 5 Q. The generator uses one of the cheapest direct frequency synthesis microcircuits - AD9832 with a clock frequency of 25 MHz. Control controller PIC16F84 or PIC16F628. The set frequency and period are displayed on the LCD indicator.

The schematic diagram of a laboratory DDS signal generator is shown in the figure. The output signal from the DDS generator chip passes through a passive LC filter with a cutoff frequency of 10 MHz, which improves the signal spectrum by filtering higher harmonics. Since the DDS chip operates on a single-supply supply, a level shifter circuit is required. It is made using an “active feedback op amp” type AD8130. In addition to the level shift, this op-amp implements an active second-order low-pass filter with a cutoff frequency of 10 MHz and a gain of 2, which additionally suppresses higher harmonics.

The filtered and symmetrical relative to zero signal from the output of the op-amp is fed to the amplitude regulator - a regular variable resistor. The use of a conventional resistor rather than an electronic attenuator is due to the desire to simplify and reduce the cost of the design. And in practical work, it is much more convenient to turn the knob rather than go into the menu by repeatedly pressing buttons. Although the AD8130 output current can reach 40 mA, long-term operation at this current will cause overheating and chip failure. Therefore, an additional protective resistor R26 was introduced into the circuit, which limits the output current to a safe level even if the output is short-circuited for a long time. When operating on a low-resistance load, this resistor can be short-circuited with toggle switch SA2.

The operation of the direct synthesis generator is controlled by the microcontroller DD1. The HG1 indicator is a two-line indicator with 16 characters per line based on the HD44780 controller. The bottom line displays the frequency to the nearest 0.1 Hz. The required frequency value is entered using the SB1…SB4 buttons. You can smoothly tune the DDS generator in the frequency range 0.1 Hz...6 MHz with any step from the range of 0.1 Hz; 1 Hz; 10 Hz;...1 MHz. The top line of the indicator displays the period in microseconds for frequencies less than 300 Hz or in nanoseconds for frequencies above 300 Hz.

The program works as follows. First, based on the entered frequency, the values ​​of the coefficients loaded into the DDS synthesizer are calculated. Then, using this value, the period of the generated frequency is calculated. The result, especially at frequencies less than 10 Hz, may differ slightly from what would be obtained when calculating using the formula T=1/F. This is due to the fact that the frequency in a DDS synthesizer cannot be set to any frequency, but only in steps of FMCLK/2^32. For a 25 MHz clock, this is about 0.006 Hz. Contrary to the widespread belief about the primitiveness and imperfection of the command system of PIC controllers, two kilobytes of internal memory and 35 commands are quite enough to carry out all calculations without any simplifications or roundings. Therefore, the accuracy of frequency setting is determined only by the accuracy and stability of the DDS clock generator. Program versions have been developed for clock frequencies of 25 and 20 MHz.

The DA1 power monitor is not used as standard. In PIC controllers, unlike some AVRs, the internal memory is not prone to distortion when the supply voltage rises or falls slowly. Therefore, there is no need to take special measures to externally reset the controller when turning it on and off. The power monitor is connected to the RB0 port pin and is used to send a command to the controller to save the set frequency in the EEPROM PIC when the supply voltage drops below 4.7 V

The generator can use either the outdated, but widely used PIC16F84A controller, or the newer PIC16F628, which has a similar pinout. Indicator HG1 type MT 16S2Q-2YLG manufactured by MELT. The theoretical limit of the generated frequency in DDS is half the clock frequency. In practice, at frequencies above 1/4 of the clock frequency, a sharp decline in the amplitude of the first harmonic begins, which to some extent can be compensated by complicating the filter circuit. But setting up the signal generator becomes dramatically more complicated, so in this design the upper frequency is taken to be 6 MHz. However, taking into account that radio amateurs prefer to realize the maximum capabilities of their devices, the upper operating frequency of the DDS generator is software limited to 11 MHz.

Any home workshop should have the necessary set of tools and measuring instruments. For people involved in amateur radio as a hobby, the high monetary costs of purchasing the necessary equipment are often unacceptable.

So in my case, the list of this equipment was far from complete and lacked signal generator.

Signal generator It turned out to be easy to make yourself from available radio elements and not expensive in the end. So, after rummaging on the Internet, I found a large number of circuits for various generators, including more advanced models with a DAC, but already expensive to manufacture. I stopped at the simple one to begin with. DDS signal generator on the ATMEGA8 microcontroller from Atmel. This one, I didn’t improve or change anything - I left everything as is, I just created a copy and, especially, I don’t claim the authorship of this device.

So, signal generator has good characteristics and is suitable for solving simple problems.

Displaying information in signal generator produced on a 16x2 character LCD display with an HD44780 controller. It is noteworthy that to save microcontroller ports, the LCD display is controlled via only three wires; this was achieved by using a shift register - read about how to connect a display via three wires.

Saving ports is necessary, 8 ports are used for a resistive DAC, 7 ports for buttons. In the original article, the author promised to use PWM modulation, but apparently did not finish it, since he began developing a more advanced version on ATMEGA16.

Schematic diagram of a DDS signal generator and printed circuit board.

The circuit and boards are shown in the original; they also contain buttons for PWM control not used by the author.

For the DAC, I specifically bought precision resistors with an error of ±0.05%, but as it turned out, simple ones with an error of ±5% are quite sufficient. The waveform was quite acceptable for all types of signals.

When generator assembled and the program loaded into the microcontroller, no settings are required, unless you adjust the display contrast.

Working with the device is simple - select the signal shape, set the required frequency, and you can change the frequency setting step with limits of 1 - 10 - 100 - 1000 Hz per step. Then click on Start and the generator starts working. It should be noted that when the generator is started, the frequency and shape of the signal cannot be changed, this is due to the fact that the program goes into an endless loop and in order to increase the maximum generation frequency, the button polling procedure had to be removed. To stop generation, click on stop/reset, this restarts the program and it returns to the settings menu. Here's the nuance.

Separately, I would like to tell you about the manufacture of the housing for the generator. You can purchase a ready-made case in a store or use a suitable one from some other device, but I decided to make it entirely myself. A piece of double-sided fiberglass lay idle, which I donated to the body.

First, you need to take all the measurements, the dimensions of the LCD display and signal generator board, power supply, connectors and buttons, then place it on a sheet of paper as it will be inside the case. Based on the dimensions obtained, you can begin manufacturing.

This site is dedicated to my projects on PIC controllers, available for public exposure. All of the above circuits are implemented in hardware and currently work in everyday life or in production. To write programs, we used the MPLAB/x package, freely distributed by MICROCHIP. The programmer PICKIT2/3, ICD2/3 is used. You can assemble any design yourself, even if it’s paid, and get an unlock code for free. Can also be purchased as a kit for assembly or as a finished product. Orders are accepted for the development of analog-to-digital or digital electronics, control systems and electronics for production using controllers.
Write questions and suggestions by email [email protected]
If you have interesting offers, orders or questions and the forum did not help you, the address is the same.


Review.

It would seem that there are a great many amateur signal generators, take it and repeat it, but it’s not so simple. I always thought that industrial generators would cover all my needs, and they are better than amateur ones. But life put everything in its place, I had to make my own, which would cover my needs at least a little. Despite its simplicity of design, its capabilities are sufficient for use by radio amateurs and not only. In addition to its main function as a generator, it allows you to measure capacitance, resistance, and automatically take the frequency response with export to a computer. Also generate PWM signals (PWM) for single-act and push-pull circuits with automatic protection or controlled by feedback. Made with accessible parts and easy to set up.

Now briefly about the technical characteristics:
- Dimensions 67 * 88 * 19 mm, designed specifically for installation in the Z-19 housing
- Display 2*16 characters, LED backlight.
- Power supply 3.7 - 5 volts. 3 AAA cells or lithium battery or external. Maximum consumption 40 mA
- Output voltage Vp-p analog output - 3.3v.
- DDS sampling frequency -1.6 MHz. Digital part resolution (PWM) 62.5 nS
- Analogue frequency range 0-600 kHz, Digital 50Hz-320 kHz / PWM-7bit(0-100%).
- Built-in switchable filters
- Capacitance measurement range: 100pF - 10uF with +/-5% accuracy
- Resistance measurement range 10 Ohm - 200 kOhm with an accuracy of +/-5%
- Digital input and output external synchronization, open and closed input.
- Analog input.
- Output divider 1/10 for the analog part.
- Control - encoder with progressive characteristics
- Memory for 4 user waveforms, import and export to computer. There is manual setting.
- Automatic recording of frequency response without additional devices, export to a computer. Viewing mode without a computer.
- Video signal generator - vertical stripes - gradations of brightness
- Basic signals - sine wave, rectangle, forward and reverse saw, triangle, ECG, white noise.
- Sweep generator with adjustable band and speed of change.
- Formation of pulse trains with external synchronization.
- Monitoring the power source, recharging the battery, if available.

Appearance (all pictures are clickable)

Layout option in the Z-19 housing. Instead of the battery compartment, you can place a lithium battery.
Connection sockets can be located on the front panel and the terminals do not need to be soldered into the board.

DDS signal generator "OSKAR-DDS"
Hardware

The generator circuit is made using accessible parts and is easy to configure.

A little more about the scheme.
The core is the PIC18F26K22 microcontroller from MICROCHIP, which actually performs all the functions of the device. The analog part is made up of a dual operational amplifier MCP6022 with a unity gain bandwidth of 10 MHz, a digital dual variable resistor MCP41010, a dual op-amp MCP602 and an analog switch.
A dual variable resistor is used to adjust the output level and adjust the DC offset of the output signal. The voltage reference and virtual ground buffer (analog ground) are implemented on the MCP602.
DO NOT connect digital and analog grounds!!!
The display used is a black and white character indicator 2*16 BC1602 or compatible.
The entire circuit is powered from a stabilized 3.3 volt source (LM2950-3.3). Power control is performed on transistors T1 and T2.
The power supply of the analog part, despite the use of a Rail-to-Rail op-amp, is done with a twist. On D3, a negative bias is made, approximately 0.25V, and a positive bias to the supply voltage, at least 0.2V (drop on LowDrop LM2950), which ensures high signal quality over the entire amplitude range.
All elements are installed on a double-sided printed circuit board on one side, and the backlit display, terminals, quartz, power socket and encoder on the other. The result is a compact, rigid structure.

Arrangement of elements (clickable)

For assembly we need

List of elements
Nutrition
Bat1 = 1 x 4-9V AAA holder for 3 33x51
Capacitors
C17 = 1 x 200p
C18 = 1 x 82p
C1,C2,C3,C4,C5,
C8,C9,C10,C13,
C16,C20,C21 = 12 x 0.1
C11,C12 = 2 x 27
C15,C19 = 2 x 1.0
C6,C7 = 2 x 100.0
Quartz
Cr1 = 1 x 20 MHz
Diodes
D1 = 1 x LL4148
D2 = 1 x 5v6
D3 = 1 x SS12
D4 = 1 x BAV99
D5 = 1 x BAT54S
Microcircuits
DA1 = 1 x MCP42010
DA2 = 1 x MCP602
DA3 = 1 x MCP6022
DD = 1 x PIC18F26K22
IC1 = 1 x 74hc4066
LCD
LCD1 = 1 x BC1602(HD44780 and its analogues)
Resistors
R2 = 1 x 6k2
R7 = 1 x 220k
R8 = 1 x 11k
R13 = 1 x 910
R14 = 1 x 300
R16 = 1 x 2K
R17 = 1 x 3K
R20 = 1 x 100k
R21 = 1 x 4k7
R23 = 1 x 10K
R27 = 1 x 1
R1,R5 = 2 x 33
R10,R15 = 2 x 22k
R12,R18,R24,
R25,R26 = 5 x 100
R22,R38,R40,
R41,R42,R43,
R44,R45 = 8 x 1k 0.5%
R3,R4,R6,R9,
R11,R19,R28,
R29 = 8 x 10k
R30,R31,R32,
R33,R34,R35,
R36,R37,R39 = 9 x 2k 0.5%
Encoder
S = 1 x re11ct2
Transistors
T1 = 1 x BC807
T4 = 1 x 2N7002
T2,T3 = 2 x BC817
Stabilizer
VR1 = 1 x lp2950-3.3
Connector
X1 = 1 x 5mm
Terminal block
126-02P(5.0mm) x5

And also patience, skill and straight hands.

DDS signal generator "OSKAR-DDS"
Job description and management.
Description of inputs and outputs

So, the connection terminals from left to right:

1 - AGND - Analog virtual ground. Do not connect to digital ground!!!
2 - AUOT 1/10 - Analog output with 1/10 divider.
3 - AUOT 1/1 - Analog output. Maximum voltage relative to analog ground +3.3/-3.3 volts.
4 - Analog input Cx. Universal entrance. Works in relation to digital earth. The maximum input voltage without damage is 10 volts. Also RS232 9600 8N1 input.
5 - PWM - PWM digital module output. Output levels are 3.3 volt digital CMOS.
6 - PWM1 - Output of the PWM1 digital module. Output levels are 3.3 volt digital CMOS.
7 - Digital land.
8 - SYN output. Output levels are 3.3 volt digital CMOS. Also RS232 9600 8N1 output.
9 - SYN in - closed synchronization input. The maximum input voltage without damage is 50 volts. Input impedance more than 100 kOhm.
10 - SYN in - open synchronization input. The maximum input voltage without damage is 50 volts. Input impedance more than 100 kOhm.
100 Ohm protection resistors are included on all outputs.
10 kOhm protection resistors are included on all inputs.

Control

All control is done with one encoder. The following combinations are available:
Long press (more than 1 sec.) Turns the device on and off. When turned off, all settings and the current mode are remembered. After switching on it will be in the same place, generating the same signal.
Short press - select a parameter to change.
Rotation - change the parameter shown on the display. To the right is passion. To the left - decrease.
The rate of change depends on the rotation speed, for example, depending on the rotation speed, the frequency change can be 0.1 Hz or 10000 Hz per click. This allows you to quickly and accurately configure any parameters and does not tire the operator.

Nutrition

Power supply from a unipolar source with voltage from 3.7 to 5 volts. Exceeding 5 volts leads to damage to the device.
Internal power supply from a 3.3 volt stabilizer.
Acceptable use:
- three 1.5 volt batteries (the design is designed to install a 3*AAA battery compartment.
- Lithium battery with protection circuit, mounting or from a mobile phone.
- External source of stabilized voltage 5 volts/200mA, fortunately there are now plenty of USB charges. If there is a built-in battery, it will be charged. There is no charge controller as such, charging is carried out with a limited current. Therefore, you should limit the charging time and do not use batteries with a capacity of at least 900 mA/hour. Also a prerequisite is a protection circuit on the battery itself. (everyone has a mobile phone).
Isolated power allows the generator to be used for live devices, including mains power. Caution and precautions should be taken to protect against electric shock.

Frequency characteristics

The generator has two plug-in active low-pass filters with cutoff frequencies of 300 kHz and 20 kHz

Frequency response without filter (for sine wave)

Frequency response with 300 kHz filter (for sine wave)


Frequency response with 20 kHz filter (for sine wave)

Enabling filters for digital signals will distort the waveform.

Operating modes

Sine wave generator

Frequency range from 0.09 Hz to 600 kHz. It is recommended to include appropriate filters for a high-quality signal.
- Maximum amplitude Vp-p 3.3 volts. 256 steps adjustment
- DC offset +/- 1.65 volts. 256 steps adjustment

Additional modes

Pulse burst mode (PULSE MODE).

1 - Pulse mode with synchronization signal output to the SYN OUT output. "PULSE ENABLE"
A signal is generated with the settings made earlier, with the duration TIME PULSE.
The end of generation is accompanied by the setting "0" at the SYN OUT output.
A pause of TIME PAUSE duration is maintained, and during the pause the DC level PAUSE LEVEL is set. And so on in a circle.
Configuring these parameters in the "SETTING" section
The range of changes for the pause and pulse timers is from 0 to 1.048 seconds in increments of 64 μs.
DC pause level +/- 1.65 volts. 256 steps adjustment
The SYN OUT output generates a signal relative to digital ground.

2 - Pulse mode (generation) from an external synchronizing signal."ONE PULS SYNC"
Start at the edge of the pulse.
The start of generation is accompanied by the setting "1" at the SYN OUT output.
According to external synchronization, a pause is first waited with the TIME PAUSE duration set to PAUSE LEVEL, then a burst of TIME PULSE duration is formed once, and then all over again, waiting for the edge of the clock signal.

3 - Generation mode from an external synchronizing signal. "START OF SYNC"
Start at the edge of the pulse.
The start of generation is accompanied by the setting "1" at the SYN OUT output.
The end of generation is accompanied by the setting "0" at the SYN OUT output. The SYN OUT pin generates a signal relative to digital ground.
According to external synchronization, first there is a pause with the TIME PAUSE duration set to PAUSE LEVEL, then the generator is turned on continuously. To start, you first need to press the encoder and the cycle will start all over again, waiting for the edge of the clock signal.

The sine wave generator mode is selected, rotating the encoder - changing the mode, pressing - setting the mode.
The left and right arrows indicate that when rotated, the mode will change.

Amplitude adjustment
The asterisk and the name of the parameter indicate which parameter will change when rotated.

Frequency selection

Constant level shift

The settings mode is selected, rotating the encoder - changing the mode, pressing - setting the mode.
The left and right arrows indicate that when rotated, the mode will change.

Connecting filters. Change is rotation.
Filters are disabled. A 300 kHz filter is connected. 20kHz filter connected

Switching additional heart rate modes. Change is rotation.
Heart rate mode is disabled. Synchro launch mode. One-shot mode. Auto mode with sync output.

Global settings - SETUP. Change is rotation.
Home screen. Adjusting display contrast. Turn on/off the backlight. Supply voltage. Show serial number.

Sine wave 1000 Hz.

90 kHz sine wave without filters. Steps are visible.

90 kHz sine wave with 300 kHz filter. Everything is fine now

300 kHz sine wave with 300 kHz filter. The picture is beautiful, the amplitude has dropped slightly, according to the frequency response.

600 kHz sine wave with 300 kHz filter. The picture is not beautiful, the amplitude has dropped, according to the frequency response. Frequencies above 300k - to remove the frequency response, for full use you need a normal external low-pass filter with a cutoff frequency of 600k.

5 kHz sine wave with 300 kHz filter. Shift along a constant level is positive.

5 kHz sine wave with 300 kHz filter. Shift along a constant level to minus.

58 kHz sine wave with 300 kHz filter. Pulse mode, pause and time 2.1 mS

58 kHz sine wave with 300 kHz filter. Pulse mode, pause and time 1.98 mS, sync output

58 kHz sine wave with 300 kHz filter. Pulse mode single, pause and time 1.98 mS, external sync signal input 100 Hz. From the front, a pause with a level, then a burst.

The swing of the incoming clock signal must be at least 3 volts. If there is a DC component, use a closed input.

Square, sawtooth, reverse ramp, triangle signal generator.

Frequency range from 0.09 Hz to 200 kHz. It is recommended to disable the filter for a high-quality signal.

Illustrations of display on the indicator

Square wave generator


Ramp Generator


Back Ramp Generator

Triangle signal generator

Illustrations of signal oscillograms from the generator

Rectangle 5000 Hz.

Saw 5000 Hz.

Reverse saw 5000 Hz.

Triangle 5000 Hz.


ECG signal generator.

Illustrations

Screen

Oscillogram


White noise generator.

It is recommended to connect a 20 kHz filter for a high-quality signal.
Adjustable parameters: Amplitude, constant level shift, tonality.
All additional modes and their adjustments are also available.

Illustrations

Oscillogram

Generator of low-frequency television signal.

It is recommended to disable the filter for a high-quality signal.
Full B/W video signal of two half-frames (625 lines), vertical stripes - grayscale.
Adjustable parameters: Amplitude, constant level shift.

Illustrations

Oscillogram 1 line

Sweep generator.

The principle of operation is the generation of a sinusoidal signal from the initial frequency FRQ START to the final frequency FRQ END with a frequency step FRQ STEP and a time step of 1 TIME STEP.
Frequency tuning range and step 0.09 Hz - 600 kHz, time from 64 µs to 1 sec.
The following parameters can also be adjusted: Amplitude, constant level shift, log file recording on/off (LOG ENABLE /LOG DISABLE)
It is recommended to connect an appropriate filter for a high-quality signal, depending on the frequency range.
The level of the constant component in the pause is also taken from the corresponding setting.
Additional modes are not available.
It is recommended to select a step time of at least 10-20 periods of the lowest signal to measure the frequency response.
Log recording is used to automatically record the frequency response of the device under study. Log depth - 1280 values. For each value, the frequency and measured amplitude of the constant signal at the analog input Cx are recorded. The maximum input voltage is 3.3 volts for maximum reading.
Recording always starts from the lowest frequency first. To record the entire frequency response, the following condition must be met: (Final frequency - initial frequency) / frequency step
Additionally, a pause is set between cycles, equal to the pause time setting, and a clock pulse is generated at the SYN OUT output, the length of which in the high state is equal to the generation time. During the pause, SYN OUT = "0".

Illustrations

Oscillogram

Read more about automatically obtaining the frequency response of the device under study and viewing the log.

So, it is necessary to remove the frequency response of the filter plug formed by an oscillatory circuit of inductance and capacitance. Also, by indirect measurements we find out the value of inductance, with a known capacitance.
Let's assemble the diagram shown in the figure:

The oscillatory circuit under study consists of an inductance and a capacitor C2 loaded onto a resistor R1.
This chain is connected to the generator output - OUT and AGND.
Let's assemble a measuring circuit. DC decoupling is performed by C3, followed by a detector using a doubling circuit on diodes D1 and D2. Which in turn is loaded on R3, the ripples are smoothed out by capacitor C1.
The measuring circuit is connected to the Cx and GND inputs.
Let's set up the generator; to do this, set the pause time in the settings to 100mS, the signal level during the pause to the minimum. Go to the Sweep Generator section, set the start frequency to 10 kHz, the end frequency to 15 kHz, the tuning step to 50 Hz, the tuning time to 20 mS, the maximum amplitude, zero offset, turn on the log, go to the beginning and wait for some time.

Illustrations for settings







While we wait, connect the oscilloscope to the Cx input



There is clearly a gating pulse 100 mS long, and the frequency response with a characteristic dip at the resonance of the filter - plug.
This means we have chosen the tuning range correctly.

Go to the log view section

Select viewing

And by rotating the encoder, we look at the frequency and amplitude. You can select the minimum value in your mind, you can write it down on a piece of paper and build the frequency response point by point, but this is not our method.
Let's use the computer. We will need a USB-COM TTL converter, for example this one


Connecting
GND - GND
RXD - SYN OUT

On the computer, launch the hyperterminal program, select the COM port that was created when installing the USB-COM converter.
We configure the speed of 9600 8N1, enable data recording from the port to a file, connect to the port.
On the generator we select data transmission, and by rotating we start the transmission.


After finishing, turn off the connection and close the file.
Let's see what we got
It must be something like this

OSKAR DDS VER=3.0.0 START LOG FRQ-Hz,VOLUME 0010050.39,068 0010100.45,070 0010150.52,069 0010200.59,069 0010250.65,068 0010300.72,068 00103 50.79.069 0010400.86.069 0010450.93.068 0010501.00.068 0010551.07.068 0010601.13.069 0010651.20.068 0010701.27.068 0010751.33.068 0010801.40.068 0010851.47.069 0010901.54.068 0010951.61.068 0011001.67.068 0 011051.74,068 0011101.81,068 0011151.88,068 0011201.95,067 0011252.01,067 0011302.08,067 0011352.15,067 0011402.22,067 0011 452.29, 066 0011502.35.066 0011552.42.067 0011602.49.066 0011652.56.065 0011702.63.065 0011752.69.065 0011802.76.065 0011852.83.0 64 0011902.90,063 0011952.96,063 0012003.03,063 0012053.10,062 0012103.17,061 0012153.24,060 0012203.30,060 0012253.37,058 0012303.44 , 057 0012353.51.055 0012403.58.58,054 0012453.64.052 0012503.71.71.71.71.050 001255.78.048 0012603.85.045 ROUSED , 038 0012804.12.035 0012854.19,033 0012904.26.032 0012954.32.031 0013004.39.39.030 001305.46.031 0013104.53.03.03.03.03AL 0013154.60.034 0013204.66.035 0013254.73.038 0013304.80.040 0013354.86.042 0013404.93.045 0013455.00.047 0013505.07.049 0 013555.14.050 0013605.21.053 0013655.27.054 0013705.34.055 0013755.41.057 0013805.48.057 0013855.54.058 0013905.61.059 0013 955.68, 060 0014005.75,061 0014055.82,061 0014105.88,062 0014155.95,062 0014206.02,063 0014256.09,064 0014306.15,064 0014356.23,0 64 0014406.29,065 0014456.36,065 0014506.43,066 0014556.49,065 0014606.56,065 0014656.63,066 0014706.70,066 0014756.77,066 0014806.83 ,067 0014856.90,067 0014906.97,067 0014957.04,067 0015007.11,067 END LOG

If everything is in order, then launch EXCEL and build a graph

Now everything is very clear, the resonance frequency is 13 kHz.
I must say that I approximately knew the inductance rating, which is why I chose this particular range to measure the frequency response

Now is the time to take a calculator and calculate the inductance using the well-known LC resonance formula.
I got 149.9 microhenry, and the throttle itself was taken from a box labeled 150 microhenry.

The frequency response of any four-port network is measured in the same way; the main thing is to ensure that the signal at the Cx input is of sufficient amplitude.
In addition
- If you have a standard COM port, and not TTL, then you need to select inverse transmission. But it should be remembered that not all ports understand a signal with an amplitude of only 3 volts.
-The detector circuit must have a low output resistance, or bypass the Cx input with a capacitor to ground. But in the latter case, a low rate of frequency change is required.

Measuring capacitance and resistance.

Everything is simple here, just connect and watch





Arbitrary signal generation mode. Editing, loading and uploading waveforms.

Frequency range from 0.09 Hz to 600 kHz. It is recommended to enable/disable the filter for a high-quality signal, depending on the shape and frequency.
All other parameters, modes, controls correspond to the sinusoidal signal generator.
All additional modes and their adjustments are also available.
The number of waveforms is 4, numbered #0 to #3. The table size for a period is 256 samples. For each reading, the amplitude is indicated from 0 to 255.

Generation of an arbitrary signal.

Switch to USER #x WAVE mode. Adjustments of frequency, amplitude, constant level shift and selection of signal number are available

Illustrations of settings and preset signals



Manual editing of an arbitrary signal.

Switch to USER #x EDIT mode.
During the editing process, the signal continues to be generated with the parameters set in the previous section and can be observed, for example, on an oscilloscope.
First of all, you need to select the number of the table that we will edit; when entering the mode, it coincides with the number selected in the previous mode. And the waveform will be loaded from the same table.
If the edit pattern requires a sine wave, then you need to go to the custom waveform generation menu, select a table number, then go back to sweep mode and go back forward to edit.
In this case, the editing example will be the sine and table number from the previous menu. If you change the table number in edit mode, the waveform will be reloaded from the user data.

The next item is to select signal editing.
Rotate to select a position in the POS table from 0 to 255

Click and select the amplitude in this position

Click and you will be taken to the selection of the next position.
Exit requires a position transition from value 255 to 0.
You will be prompted to save this table to memory.

Rotate to save, or click and move on.
The next prompt is to export this table to your computer. The connection to the COM port is the same as in the case of exporting frequency response. Export in port signal inversion is also available, as described earlier in the next paragraph.


Saving in the same way as described earlier, we obtain an array of data, for example this

START TABLE #3 OSKAR DDS VER=3.0.0 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,2 55,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 ,255,255,255,255, 255,255,255,255,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000, 000,000,000,000,000,000, 000,000,000,000,000,000,000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,00 0,000,000,000, 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000 ,000,000,000,000,000,000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0 00,000,000, 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,00 0,000,000,000,000,000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000, 000,000, 000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000, END TABLE

In this mode, a signal is not generated, but data from the computer is waited in the format
#001:127 0x0D 0x0A
Where # is the beginning sign, then the position number is 3 digits from 000 to 255, then the colon is the separator
then the amplitude value is 3 digits from 000 to 255, then the end of line and carriage return codes.
You can transfer as much data as you like until you exit the mode by pressing.
Connection only via USB-TTL adapter, TXD is connected to the SYN OUT terminal after entering boot mode.
Connection
GND - GND
TXD - SYN OUT

During the input process, the indicator will display the position number that has been changed.
Then, without changing the table number, go to editing, where you can view the entered data. You can also view the output waveform and then save.
Without saving, the table is stored only in RAM and will be lost after shutdown

Digital part of the generator

PWM module, general information.

The generator provides signals for all typical converter circuits in the frequency range from 50Hz to 320kHz.
Typical converter circuits (simplified) and their connections.

Typical timing diagrams.

This diagram is for a half bridge converter.
In the flyback there is no PWM1 signal and filling (FILL) can reach 100% of the period.
To guarantee the absence of through currents, the generator generates an adjustable delay time from 0 to 7.937 microseconds with a step of 62.2 nS for the high-frequency module and 1/200 of the period for the low-frequency one.
Filling is adjustable from 0 to 100% in 1% increments.

There are two main operating modes - standard and auto.
In standard mode, the signal from the current sensor R is supplied to the Cx input and if it exceeds 200mV, the PWM Module will turn off (output signal = 0 on PWM and PWM1) until the overload stops. If overload protection is not needed, leave the Cx input unconnected or connect it to GND to eliminate noise.

In automatic mode, an output voltage sensor is used and is supplied to the Cx input through an optocoupler. Power for the optocoupler can be taken from analog ground (if the analog oscillator is set to zero bias).
As the output voltage increases, the optocoupler opens and the voltage at the Cx input increases. The generator automatically reduces the filling down to zero. The input sensitivity for complete shutdown is about 1 volt.
To prevent overload, the filling cannot exceed the set value for the main mode. Thus, if you set FILL = 50% and the Auto mode, the filling will be automatically adjusted within the range of 0-50%

If feedback is not required, leave the Cx input unconnected or connect it to GND to eliminate interference.
For a high-frequency converter, the Delay parameter is used instead of the FILL parameter.

Only transistors controlled by a logical level and with a small gate capacitance can be directly connected to the output of the generator. There are already 100 Ohm resistors at the outputs.
In all other cases, the use of drivers is required. They are also needed for a half-bridge network converter circuit, as in a computer power supply.
Output voltage of PWM outputs "0" - 0V "1" - 3V
The input impedance of the Cx input is 10 kOhm.

PWM module LF HB, LF - low frequency, Half Bridge - half bridge

Frequencies - 50, 60 and 400 Hz.

Filling 0-100%
Guaranteed guard interval 1/200 of the period.

Typical waveform

Adjustable Parameters
Frequency
Filling
Mode

Illustrations of display on the indicator



Switch to manual, automatic, filling to automatic





The main application is power frequency inverters.

PWM module LF FL, LF - low frequency, FL - flyback

Frequency range 50 Hz - 4800 Hz with variable step
Operating mode - standard and auto.
Filling 0-100%
Guaranteed guard interval 1/100 of the period.

Typical waveform

The signal is generated at the PWM output and duplicated at the analog output with the ability to adjust the amplitude and offset. Adjustable Parameters
Frequency
Filling
Mode
Amplitude
Bias

Illustrations of display on the indicator

Select mode, frequency, fill



Switching to manual, automatic, amplitude setting



Offset setting, automatic operation mode


In automatic mode - filling is always no more than that set in standard mode.
In standard mode - shutdown when a signal appears at the Cx input
The main application is low frequency flyback converters, PWM control at low frequency.

PWM module HF HB, HF - high frequency, Half Bridge

Frequency range 3906Hz - 250kHz
Operating mode - standard and auto.
Guard interval (DELAY TIME) 250 nS - 7397 nS in 62.5 nS steps in automatic mode
Guard interval (DELAY TIME) 0 - 7397 nS in 62.5 nS steps in standard mode
The output power during feedback is reduced by increasing the guard interval. At frequencies of 60 kHz and higher, 100% PWM regulation is provided; at lower PWM, the filling is not reduced to zero.

Typical waveform

Adjustable Parameters
Frequency
Guard interval time
Mode

Illustrations of display on the indicator

Select mode, frequency, time

Standard, automatic. The letter A is added.

In automatic mode, the guard interval is always no less than that set in standard mode.
In standard mode - shutdown when a signal appears at the Cx input
The main application is half-bridge converters of low and high voltage, PWM control, network power supplies, boost converters.

PWM module HF FL, HF - high frequency, FL - flyback

Frequency range 5 kHz - 320 kHz with variable step
Operating mode - standard and auto.
Filling 0-100%
Adjustable guard interval (DELAY TIME) 0 - 7397 nS in steps of 62.5 nS

Typical waveform

The signal is generated at the PWM output. Additionally, a signal is generated on PWM1. High level during PWM off, with a guard interval, for example to control a synchronous rectifier. Adjustable Parameters
Frequency
Filling
Guard interval time
Mode

Illustrations of display on the indicator

Standard mode, automatic mode

Setting frequency, filling

In automatic mode - filling is always no more than that set in standard mode.
In standard mode - shutdown when a signal appears at the Cx input
Main applications are flyback converters, power supplies, PWM control.

In the HELP section there is information if you suddenly forgot what to connect where. There will be no pictures, just read.

DDS signal generator "OSKAR-DDS"
Calibration, setup.

A correctly assembled generator from serviceable parts of the required accuracy does not need adjustment.
What to check
Linear operation of the DAC on the R-2R matrix.
To do this, run the sawtooth voltage generator and check the linearity of the inclined section. If a large nonlinearity is visible, then resistors R30-R45 of a higher accuracy class should be used or selected. For an 8-bit DAC, the required accuracy is 0.5%. But it’s realistic to pick from twice as many usual ones, 5%.
Also check the accuracy of measurement of resistors and capacitors. If not approved, pick up R28. Or use 1%. It simultaneously affects both the measurement of resistors and the measurement of capacitors. There are no other customizable elements. The accuracy of other resistors and capacitors, except for power supply blocking and transition ones, is sufficient to 5%.
Another note, as it turned out, 74HC4066 are not all equally good; with microcircuits from some companies there is a blockage in the HF section. I try to use ST.
Now there is only one thing left to do, install it in the case, if desired. I have taken root in the half of the Z-19 case with a lithium battery and spring terminals.

DDS signal generator "OSKAR-DDS"
Firmware.

For those who managed to read to the end -