Using AD7008 to construct a programmable sine wave signal generator

Publisher:ularof不加糖Latest update time:2006-05-30 Source: 单片机及嵌入式系统应用 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  In many electronic systems, it is often necessary to use a sine wave signal with adjustable frequency and amplitude as a reference or carrier signal. Sine wave signals are mainly generated through two methods: analog circuits or DDS (Direct Digital Synthesis). Compared with analog circuits, DDS has many advantages such as continuous phase, high frequency resolution, fast conversion speed, and stable signal. Therefore, DDS storage radar , communications, testing, instrumentation and other fields have been widely used.

1 System composition
  The core component of the system is AD7008, which is a highly integrated DDS frequency synthesizer launched by ADI. First, the microcontroller sends the frequency control word to the AD7008, and the required sinusoidal signal can be obtained at the output port of the AD7008. In order to make the frequency of the output signal more stable, the output signal is passed through a center frequency adjustable bandpass filter composed of MAX262 Carry out filtering processing. The center frequency of MAX262 is set according to the output frequency of AD7008 through the microcontroller. The function of DAC0832 is to control the amplitude of the output signal. The system block diagram is shown in Figure 1.

 


2 Main hardware circuit
  The main hardware circuit of the system is shown in Figure 2. It mainly consists of three parts: the interface between AD7008 and the microcontroller, program-controlled filter, and amplitude control. Now they are introduced separately.
1.2.1 The interface between A07008 and the microcontroller
  AD7008 can form parallel or serial interface modes with the peripheral MPU. The parallel interface can be divided into 8-bit and 16-bit. Since the system uses an 8-bit microcontroller, considering the response speed, an 8-bit parallel interface is adopted. When the microcontroller sends data to the PO port. If a negative pulse occurs on the WR pin of AD7008 (connected to P1.0 of the microcontroller), the data in the PO port is sent to the parallel register of AD7008. If the LOAD pin of AD7008 (connected to Pl.1 of the microcontroller) has a positive pulse, then according to the logical relationship of TC3 ~ TC0 (connected to PO.3 ~ PO.0 of the microcontroller), the data in the AD7008 parallel register will be Send it to the on-chip command register, frequency register 0, frequency register 1 or phase register. This is used to control the sinusoidal signal generated by the AD7008. The output pins lOUT and IOUT of AD7008 are connected to ground through a resistor, which converts the output current into voltage, and then passes through a subtraction circuit composed of an operational amplifier to generate a sine wave.
2.2 Design of program-controlled filter
  In order to improve the quality of the output signal, the sinusoidal signal generated by AD7008 must be filtered. Since the signal generator is used in electrical measuring instruments, its frequency requirement for sinusoidal signals is 40Hz to 5kHz. The author chooses MAX262 with an operating frequency of 1Hz ~ 140kHz to form a band-pass filter with a programmable center frequency. The MAX262 has three programmable parameters: center frequency , Q value and operating mode. All program control parameters are input through data pins DO and Dl. Address pins A3~A0 control input data into different registers. When the frequency of the AD7008 output signal is determined, the center frequency and Q value of MAX262 can be set. In this way, a programmable band-pass filter is formed to filter the output signal of AD7008.
2.3 Amplitude control
  The amplitude control of the sinusoidal signal is achieved through the D/A converter DAC0832. The filtered sinusoidal signal is connected to the reference voltage pin VREF of DAC0832. The eight-bit data input pin of DAC0832 is connected to the P0 port of the microcontroller, and the chip select signal CS (connected to PI.2 of the microcontroller) determines whether the input data is strobed. As can be seen from Figure 2, DAC0832 works in a single buffer register mode, that is, when CS is low level, the data sent by the DO~D7 data lines is directly converted to D/A.
According to the working principle of D/A conversion:
  
  Substituting , we have:
  
  The first-stage operational amplifier converts the current into a voltage output, then we have:
  Substituting the expression, we get that
  
  the second-stage operational amplifier acts as a reverse amplification, and its The relationship between the input and output voltages is:
  
  Substituting the expression, we finally get the following relationship:
  
  Because , after the input voltage passes through the circuit, its output is attenuated by digital control. When R changes the value of DO~D7, the output voltage also changes accordingly, that is, the amplitude control of the sinusoidal signal is realized.


 


3 Software Design
  After the microcontroller is powered on and reset, first initialize AD 7 0 0 8 and MAX262. Then start detecting the peripheral input unit. When there is frequency setting input. Then send the frequency control word to AD7008, and then set the center frequency and Q value of MAX262 according to the signal frequency. When there is an amplitude setting input, the amplitude control word is sent to DAC0832. The program flow diagram is shown in Figure 3.


 


Conclusion:
  This signal generator has been successfully used in an electrical measurement system with good results. Due to limitations of the actual needs of the system, the full advantages of DDS technology have not yet been fully utilized. DDS can also be used in frequency hopping communications, digital modulation and other fields. Especially in applications that require high frequency accuracy and short conversion time, the use of DDS technology has incomparable advantages over other frequency synthesis technologies. Due to its own advantages, DDS will be widely used in frequency synthesis fields with high performance requirements.

Reference address:Using AD7008 to construct a programmable sine wave signal generator

Previous article:Measurement and location of EFT/ESD issues
Next article:Using AD7008 to construct a programmable sine wave signal generator

Latest Analog Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号