Development of high precision function signal gene

  • Detail

Development of high-precision function signal generator based on DDS

Abstract: Based on direct digital frequency synthesis (DDS), the DDS chip AD9852 is controlled by single chip microcomputer, and an implementation scheme of high-precision function signal generator is proposed. This paper mainly introduces the hardware interface circuit between MCU and AD9852, the software design of the whole system and the processing method of 48b frequency control word in MCU. This method can be used for reference when dealing with integer data of more than 32 b in the program design of single chip microcomputer. This system has the main characteristics of high frequency and high precision, and the control is flexible and convenient, so it has a broad application prospect

Keywords: DDS; AD9852; Frequency control word; Signal generator

direct digital frequency synthesis (DDS) is a new frequency synthesis technology that directly synthesizes the required waveform from the concept of phase. DDS technology has the advantages of relatively wide bandwidth, short frequency conversion time and high frequency resolution. It is widely used in high-precision frequency synthesis and arbitrary signal generation. In this paper, DDS chip is controlled by single chip microcomputer, and a high-precision multi waveform signal source is designed and realized

1 DDS principle

the basic structure of DDS includes: phase accumulator, sine look-up table, digital to analog converter (DAC) and low-pass filter. DDS principle is shown in Figure 1

the expression of the relationship between the signal output frequency and the reference clock frequency in Figure 1 is:

where: FO is the output frequency, FOSC is the reference clock frequency, FTW is the frequency control word, and N is the number of bits of the frequency control word. Since n is a fixed value, the required frequency value can be obtained as long as the size of FTW is changed, and the resolution of frequency is determined by the value of N. when the value of n is larger, the resolution is higher. According to the Nyquist sampling theorem, to recover the ideal waveform, under the condition of the ideal low-pass filter, the output frequency must be less than 50% of the clock reference frequency, that is, fo 1/2fosc. If it exceeds this range, the first-order mirror frequency will fall within the Nyquist bandwidth. The actual LPF has a transition band problem, so in order to better remove the spurious caused by the first-order image, the output frequency of DDS is generally limited to o.4fosc. It can be seen that when the reference clock frequency of AD9852 is 300 MHz, it can fully meet the design requirements of output frequency of 50 MHz

2 system design

2.1 hardware design

system design principle is shown in Figure 2. The single chip microcomputer AT89C55 is selected as the control core in this design, and the parallel port communication mode is adopted between it and DDS chip AD9852. P1 port of single chip microcomputer is used as the data bus of LCD, P0 port is used for the address bus of AD9852 and the data bus of parallel port transmission, and the reuse of P0 port is realized by using 74als573 latch. The six digit value of 74als573 latch output is the address of AD9852 internal register. P2 and P3 ports are used as control ports for the control of keyboard chips HD7279 and AD9852

because the AD9852 uses CMOS technology, the power supply voltage is 3.3V, and the MCU uses tll level, so it is necessary to carry out level conversion between tll circuit and CMOS circuit. The system selects 74lvtl6245 as the converter from 5 V logic level to 3.3V logic level. The required output frequency can be set by pressing the key, and the operation is displayed on the LCD at the same time. AD9852 internal system clock frequency is obtained by external active crystal oscillator frequency doubling

since there is no low-pass filter inside the AD9852, the swept signal output through the internal cosine DAC inevitably contains high-frequency noise, so the signal output port needs to be externally connected with a low-pass filter to suppress high-frequency interference. This design adopts seven order elliptic function filter. The circuit diagram of the seventh order elliptic filter is shown in Figure 3

2.2 software design

software design is mainly divided into menu operation and frequency control value calculation. Different keys represent different numbers and functions. In addition to the normal 10 number keys 0 ~ 9, in order to facilitate the input of frequency values, left and right move keys, delete keys, output confirm output keys and other function keys are also designed. Press the output key after inputting the corresponding values such as frequency, phase and amplitude to generate the corresponding signal output. The overall software design flow chart is shown in Figure 4

2.3 processing of 48 B frequency control word

since the data operation in MCU C language is up to 32 b, such as single precision float type and long long integer type, while double is 64 B, but keil c compiles with errors, a method of calculating 48 B frequency control word in MCU will be introduced

in this design, the reference clock frequency FOSC is taken as 300 MHz. In the principle of DDS, the calculation method of the output frequency is introduced as follows:

the company has achieved a sales revenue of 12 billion yuan and a profit of 1.24 billion yuan

then the expression for calculating the frequency control word can be derived according to formula (1):

when fo FL1, the calculation formula of the frequency control word is:

ftw= (248*fo)/300 million △ 938249.922 369 * fo

when fo FL1.When, By dividing the 48 B frequency control word into 8 b+32 b+8 B, making the front 8 B and the rear 8 B equal to o, and introducing the critical frequency FL2, it can be calculated from formula (1):

fl2=*2 40/2 48 △ 1.17172mhz

when FL1 fo FL2, the calculation formula of the frequency control word is: FTW = (240*fo)/300000 △ 3665.038 759*fo. Finally, when fo is greater than FL2, that is, the last 16 b is set as 0, and then n=32, Then the frequency control word calculation formula is:

at this time, the frequency resolution is (300000 * 216)/248 △ 0.07 Hz. Similarly, it is appropriate to input 3: regularly check the transmission of the sprocket. When the frequency is less than FL1, greater than FL1 and less than FL2, the resolution is 1.07e-6 Hz and 2.73e-4 Hz respectively. This scheme is designed to have a resolution of o.001 Hz when the output frequency is less than 1 MHz, and avoid using the injection molding process with strong shear effect caused by high injection speed and high back pressure when it is higher than 1 MH. When Z, the resolution is o.1 Hz. It can be seen from the above that this method is reasonable and effective, which solves the 48b frequency control word algorithm of single chip microcomputer, and also achieves high frequency resolution and accuracy

3 conclusion

in view of the shortcomings of the function generator in the current market, such as narrow frequency band range, low precision, low accuracy, poor spectral purity and so on, a high-precision high-frequency numerical control function signal generator is designed. The function generator has the advantages of wide frequency band range, high precision, good spectral purity, stable frequency output and so on. After testing, the frequency range can reach 50 MHz, the frequency resolution is 0.001 Hz, and sine wave, FSK and BPSK waveform can be generated. It can be used in daily teaching and scientific research, and has a wide application prospect in the fields of crystal filter test, complex communication system test, audio system test, high-performance video test and so on

Copyright © 2011 JIN SHI