{'fraction_non_alphanumeric': 0.025898078529657476, 'fraction_numerical': 0.022556390977443608, 'mean_word_length': 4.733716475095785, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Simple, Cheap and Precise Microcontroller Based DDS Function Generator

In electronics design and troubleshooting, the function generator is an important and versatile electronic test equipment. But the prices of finished function generator sold on market is expensive and not everyone can afford it. In order to create an economic and reliable function generator, microcontroller-based DDS function generator designed. AD9833 is DDS based programmable function generator from Analog Devices, which capable to producing sine, triangular and square wave output. To make an easy to use and flexible function generator, AD9833 connected with 4x4 matrix membrane keypad and LCD 1602. The microcontroller-based DDS function generator successfully created. The waveform generated by AD9833 offers not only exceptional accuracy and stability, but also low phase noise, an excellent frequency change and sudden waveform change ability, its useful in a wide variety of testing applications.


INTRODUCTION
Function generators are an important and versatile pieces of electronic test instrument. The basic function generator is able to generate sine, square and triangle waveforms [1]. In electronics design and troubleshooting, the tested circuit often requires a controllable yet stable and reliable signal to stimulate its normal operation.
Microcontroller-based DDS function generator is an economic function generator with high accuracy and high stability output, which are designed based on the DDS (Direct Digital Synthesized) technology.
Compared to finished product sold on market, this function generator is cheaper and flexible.

II. DESIGN SPECIFICATIONS
Direct Digital Synthesizer is a technique of producing an analog waveform by generating a time-varying signal using digital processing blocks in digital form and then performing a digital to analog conversion. After the DAC conversion the analog waveform already formed due to syntax programmed program [2,3,4].
AD9833 is a low power, DDS-based programmable waveform generator capable of producing sine, triangular and square wave output [2]. Its package on single chip with the configuration shown on Fig. 1.  The AD9833 programmed by writing the frequencies and phase to registers which contains two frequency registers and two-phase registers. The analog output from the AD9833 is expressed as in Eq. (1).

= 2 28
(1) Where FREQREG is the value loaded into the selected frequency register. The signal is phase shifted, which is expressed as in Eq. (2).
Where PHASEREG is the value contained in the selected phase register.
To input the desired frequency and select the waveform, additional part is required. A 4x4 matrix membrane keypad is 16-button keypad provides a useful human interface component with adhesive backing provides a simple way to mount the keypad in a variety of applications [5]. The actual view of keypad shown on Fig. 3. 4x4 Matrix membrane keypad used a combination of four rows and four columns to provide button states to the microcontroller. Underneath each key is a pushbutton with one end connected to one row and the other end is connected to one column [6]. The configuration is shown on Fig. 4. In order for the microcontroller to determine which button is pressed, it first needs to pull each of the four columns (pins 1-4) either low or high one at a time, and then poll the states of the four rows (pins 5-8). Depending on the states of the columns, the microcontroller can tell which button is pressed.
To displaying the inputted frequencies value and selected waveform the LCD 1602 is attached. The actual view of LCD 1602 shown on Fig. 5 below. The LCD 1602 is dot matrix module to show letters, numbers, and characters in 2 lines of 16 characters. To maintain and control the AD9833, keypad membrane 4x4 and LCD 1602, the Arduino Uno R3 is chosen as the main controller. The Arduino Uno is a microcontroller board based on ATmega328. It has 14 digital input/output pins, which 6 of them can be used as PWM outputs, 6 analog inputs and 16 MHz ceramic resonator [7]. The Arduino Uno selected as main controller of this work because it I/O pin and SPI communication included on its board is enough to fulfill controllable function generator.

III. DESIGN IMPLEMENTATION
The concept for proposed design is implementation of 4x4 matrix membrane keypad as a device to input the frequency and select the waveform, LCD 1602 as a display, Arduino Uno as the main processor and AD9833 as a main part of this system. For the detail refer to Fig. 6 below.  The schematic for all connected component is shown on Fig. 7 below. The generated frequencies and selected waveform outputted by AD9833 is directly connected to BNC connector in the end.
The designed program flow for this system is following the Fig. 8   As shown on Figure 8 above, after the desired frequency successfully inputted and the waveform has been generated, users are free to move to another waveform with the same frequency inputted with just push another button. For example, when the inputted frequency is 1000 Hz and the selected waveform is sine wave ("A" button was pressed), the waveform will change to triangle wave directly when the "B" button is pressed. Then when "C" button is pressed, the waveform will also directly change to square waveform.

IV. RESULT
A simple, cheap and precise microcontroller-based DDS function generator hardware and software (program) built successfully which shown with the fully working of 4x4 matrix membrane keypad, LCD 1602, and the low-cost low power AD9833 as main device to generate the waveform.
To prove the result is fine, testing the wave output is required. The base testing frequency 100KHz, the result is shown on Fig. (9 -11).

V. CONCLUSION
The waveform generated by AD9833 offers not only exceptional accuracy and stability, but also low phase noise, an excellent frequency change and sudden waveform change ability. It is useful in a wide variety of testing applications.