Disclosure of Invention
The utility model aims to solve the technical problem that not enough to above-mentioned prior art provides a simple and easy signal generation circuit based on AD9833, and this simple and easy signal generation circuit based on AD9833 can make its output sine wave, triangular wave, square wave through the key-in, and its output voltage amplitude is controllable moreover, and the circuit is simple reliable, and the output waveform is level and smooth, and is with low costs.
In order to realize the technical purpose, the utility model discloses the technical scheme who takes does:
the utility model provides a simple and easy signal generation circuit based on AD9833, includes AD9833 circuit, AD9833 clock reference circuit, signal amplification circuit, keying circuit, the minimum system circuit of singlechip and LCD display circuit, AD9833 clock reference circuit and AD9833 circuit connection, keying circuit, AD9833 circuit and LCD display circuit all with the minimum system circuit connection of singlechip, AD9833 circuit is connected with signal amplification circuit, signal amplification circuit is used for signal output.
As a further improved technical scheme of the utility model, AD9833 clock reference circuit includes crystal oscillator X2, resistance R3 and electric capacity C9, crystal oscillator X2's VCC pin passes through resistance R3 and connects +5V power, connects the ground wire through electric capacity C9, crystal oscillator X2's GND pin connects the ground wire, AD9833 circuit is connected to crystal oscillator X2's OUT pin.
As a further improved technical scheme of the utility model, the AD9833 circuit includes AD9833 and digital potentiometer MCP41010, pin 1 of AD9833 connects +5V power through electric capacity C3, pin 2 of AD9833 connects +5V power, electric capacity C6 and electric capacity C5 simultaneously, electric capacity C6 and electric capacity C5 other end connect the ground, pin 3 of AD9833 connects the ground through electric capacity C8, and connect the ground through electric capacity C7, pin 4 and pin 9 of AD9833 all connect the ground, pin 5 of AD9833 is connected with crystal oscillator X2, pin 6, pin 7 and pin 8 of AD9833 all are connected with the minimum system circuit of singlechip, pin 6 of AD9833 is connected with pin 3 of digital potentiometer MCP 10, pin 7 of AD9833 is connected with pin 2 of digital potentiometer MCP41010, pin 10 of AD9833 is connected with pin 5 of digital potentiometer MCP 4109810 and pin 10 of AD 4109833 passes through electric capacity C2, the pin 1 of the digital potentiometer MCP41010 is connected with a singlechip minimum system circuit, the pin 7 of the digital potentiometer MCP41010 is connected with a ground wire, the pin 6 of the digital potentiometer MCP41010 is connected with a signal amplification circuit, and the pin 8 of the digital potentiometer MCP41010 is connected with a +5V power supply.
As a further improved technical scheme of the utility model, signal amplification circuit includes operational amplifier AD8051, operational amplifier AD 8051's pin 3 and digital potentiometer MCP 41010's pin 6 are connected, operational amplifier AD 8051's pin 2 is connected ground wire and operational amplifier AD 8051's pin 2 through resistance R1 and is connected with operational amplifier AD 8051's pin 6 through resistance R2, and operational amplifier AD 8051's pin 6 is connected ground wire and operational amplifier AD 8051's pin through electric capacity C4 and is used for signal output, and operational amplifier AD 8051's pin V + is connected +5V power and pin V + is connected ground wire through electric capacity C1, and operational amplifier AD 8051's pin V-is connected the ground wire.
As a further improved technical scheme of the utility model, the minimum system circuit of the single chip microcomputer comprises an STC89C52 single chip microcomputer, a reset circuit and a crystal oscillator circuit, the reset circuit comprises a capacitor C10 and a resistor R4, the crystal oscillator circuit comprises a crystal oscillator X1, a capacitor C11 and a capacitor C12, pins 1 to 8 of the STC89C52 single chip microcomputer are all connected with a key circuit, pin 9 of the STC89C52 single chip microcomputer is connected with a +5V power supply through a capacitor C10 and is connected with a ground through a resistor R4, pin 11 of the STC89C52 single chip microcomputer is connected with pin 1 of a digital potentiometer MCP41010, pin 12 of the STC89C52 single chip microcomputer is connected with pin 7 of an AD9833, pin 13 of the STC89C52 single chip microcomputer is connected with pin 6 of an AD9833, pin 14 of the STC89C52 single chip microcomputer is connected with pin 8 of the AD9833, pin 18 of the STC 52 single chip microcomputer is simultaneously connected with one end of the crystal oscillator 686X 8 and the other end of the capacitor C11, and the other end of the STC 3519 and the singlechip microcomputer, the other ends of the capacitor C11 and the capacitor C12 are simultaneously connected with a ground wire, a pin 20 of the STC89C52 single chip microcomputer is connected with the ground wire, pins 21 to 25 and pins 32 to 39 of the STC89C52 single chip microcomputer are connected with an LCD display circuit, and a pin 40 of the STC89C52 single chip microcomputer is connected with a +5V power supply.
As the utility model discloses further modified technical scheme, keying circuit adopts 4 x 4 matrix keyboard, 4 x 4 matrix keyboard is connected with pin 1 to pin 8 of STC89C52 singlechip.
As the utility model discloses further modified technical scheme, LCD display circuit includes exclusion RB1 and LCD12864 display screen, pin 21 to pin 25 and pin 32 to pin 39 of STC89C52 singlechip all are connected with LCD12864 display screen, pin 32 to pin 39 of STC89C52 singlechip connect +5V power through exclusion RB1, and pin 1 and pin 20 of LCD12864 display screen all connect +5V power, and the ground wire is all connected to pin 2 and pin 19 of LCD12864 display screen.
The utility model has the advantages that: the AD9833 circuit of the embodiment adopts AD9833 as a signal generating unit of the whole circuit, and the single chip microcomputer can control the amplitude of the waveform through the digital potentiometer MCP 41010. The AD9833 clock reference circuit is mainly realized by a 25M external active crystal oscillator X2, and provides a clock reference for the AD 9833. And the signal amplifying circuit amplifies the signal output by the AD9833 through the operational amplifier AD 8051. The key circuit is realized by a 4-by-4 matrix keyboard, and changes of output waveforms, output frequencies and output amplitudes are realized by pressing different keys. The minimum system circuit of the singlechip receives an input instruction through the STC89C52 singlechip, and sends a signal to the AD9833 circuit through receiving a key instruction to generate a signal. And the LCD display circuit is realized by a liquid crystal display LCD12864 and displays the output waveform, and the frequency and the amplitude of the output waveform. The utility model discloses can make its output sine wave, triangle wave, square wave through the key input, but also can select different output voltage amplitude, the circuit is simple reliable, and the output waveform is level and smooth, and is with low costs. The circuit has the advantages of wide output signal frequency range, correct amplitude output, stable and smooth waveform and good anti-interference capability, and has important significance for the industry of instruments and meters.
Detailed Description
The following further description of embodiments of the present invention is made with reference to fig. 1 to 2:
as shown in FIG. 1, a simple signal generating circuit based on AD9833 comprises an AD9833 circuit, an AD9833 clock reference circuit, a signal amplifying circuit, a key circuit, a single chip microcomputer minimum system circuit and an LCD display circuit, wherein the AD9833 clock reference circuit is connected with the AD9833 circuit, the key circuit, the AD9833 circuit and the LCD display circuit are all connected with the single chip microcomputer minimum system circuit, the AD9833 circuit is connected with the signal amplifying circuit, and the signal amplifying circuit is used for outputting signals. The power module in fig. 1 outputs +5V power to power the rest of the circuits.
As shown in fig. 2, the AD9833 circuit includes an AD9833 (U3) and a digital potentiometer MCP41010(U1), pin 1 of the AD9833 is connected to a +5V power supply through a capacitor C3, pin 2 of the AD9833 is connected to a +5V power supply, a capacitor C6 and a capacitor C5 at the same time, the other ends of the capacitor C6 and the capacitor C5 are connected to a ground, pin 3 of the AD9833 is connected to a ground through a capacitor C8 and to a ground through a capacitor C7, pin 4 and pin 9 of the AD9833 are connected to a ground, pin 5 of the AD9833 is connected to a crystal X2 of an AD9833 clock reference circuit, pin 6, pin 7 and pin 8 of the AD9833 are connected to a minimum system circuit of a single chip microcomputer, pin 6 of the AD9833 is connected to pin 3 of the digital potentiometer MCP41010, pin 7 of the AD9833 is connected to pin 2 of the digital potentiometer MCP41010, pin 10 of the AD9833 is connected to a pin 10 of the digital potentiometer MCP41010 and pin 2 is connected to the ground through a capacitor C41032, the pin 1 of the digital potentiometer MCP41010 is connected with a singlechip minimum system circuit, the pin 7 of the digital potentiometer MCP41010 is connected with a ground wire, the pin 6 of the digital potentiometer MCP41010 is connected with a signal amplification circuit, and the pin 8 of the digital potentiometer MCP41010 is connected with a +5V power supply.
The simple signal generating circuit of the embodiment is mainly designed through an AD9833, is adjusted through a key, is driven by an STC89C52 single chip microcomputer, and is displayed on an LCD screen, and the circuit is shown in fig. 2. The design takes AD9833 as a signal generating unit, and signal output and display with different frequencies, different amplitudes and different types are designed by designing a key circuit, a singlechip minimum system circuit and an LCD display circuit. The AD9833 has 5 programmable registers inside, including a 16-bit control register for setting the device's operating mode, and 2 28-bit frequency registers for setting the frequency of the device's output waveform. AD9833 has 3 serial interface lines, compatible with SPI, QSPI, MICRO-WIRE and DSP interface standards. Under the action of a serial port clock SCLK, data are loaded to the equipment in a 16-bit mode.
The internal circuitry of the AD9833 is mainly a digital controlled oscillator (NCO), frequency and phase regulators, sineuro, D/a converters, voltage regulators. The core of the AD9833 is a 28-bit phase accumulator consisting of an adder and a phase register that is incremented by steps per clock, the output of the phase register being added to a phase control word and input to a sine look-up table address. The waveform lookup table contains digital amplitude information of 1-cycle waveforms, and each address corresponds to 1 phase point in the waveform lookup table. The lookup table maps the input address phase information into a digital quantity signal corresponding to the amplitude value, and drives the D/A converter to output an analog quantity, thereby achieving the effect of changing the frequency. The frequency of the output waveform is:
in the key program, the frequency value can be changed by pressing different keys after the corresponding data for the FREQREG value has been written. The AD9833 can work in a certain state according to the needs of an operator by setting a control register, and the AD9833 provides various types of outputs, such as MSB (corresponding to square wave output) of DAC data, sine wave output and triangular wave output which are externally connected to a VOUT pin. ControlD5 and D1 in the register can determine the type of the AD9833 output, and after a key is pressed down, a control signal is transmitted to the AD9833 control register through the singlechip, so that a desired waveform can be obtained from a VOUT pin. In order to change the output amplitude, a digital potentiometer MCP41010(U1) is introduced to realize voltage division of the output signal, the position of an internal tap of the digital potentiometer is adjusted through a key signal, and the output amplitude is changed by changing the voltage value of the internal tap of the digital potentiometer.
As shown in FIG. 2, the AD9833 clock reference circuit comprises a crystal oscillator X2, a resistor R3 and a capacitor C9, wherein a VCC pin of the crystal oscillator X2 is connected with a +5V power supply through the resistor R3 and is connected with a ground through the capacitor C9, a GND pin of the crystal oscillator X2 is connected with the ground, and an OUT pin of the crystal oscillator X2 is connected with the AD9833 circuit.
The clock reference circuit is mainly realized by an external active crystal oscillator X2, performs resistance-capacitance filtering on an input power supply through a resistor R3 and a capacitor C9, supplies power to the crystal oscillator X2, directly outputs a 25M clock reference signal at a pin 3 of the X2 and provides a clock reference for an AD 9833.
As shown in fig. 2, the signal amplification circuit includes an operational amplifier AD8051 (U2), a pin 3 of the operational amplifier AD8051 is connected to a pin 6 of the digital potentiometer MCP41010, a pin 2 of the operational amplifier AD8051 is connected to a ground through a resistor R1 and a pin 2 of the operational amplifier AD8051 is connected to the pin 6 of the operational amplifier AD8051 through a resistor R2, the pin 6 of the operational amplifier AD8051 is connected to the ground through a capacitor C4 and the pin of the operational amplifier AD8051 is used for being connected to the signal output interface J1, a pin V + of the operational amplifier AD8051 is connected to a +5V power supply and a pin V + is connected to the ground through a capacitor C1, and a pin V-of the operational amplifier AD8051 is connected to the ground.
The signal amplification circuit mainly realizes signal amplification through an operational amplifier AD8051 (U2), and the amplification factor of the operational amplifier can be changed by changing the resistance value of a feedback resistor R2, and then the signal amplification circuit outputs the signal after being filtered through a capacitor C4.
As shown in fig. 2, the minimum system circuit of the single chip microcomputer comprises an STC89C52 single chip microcomputer, a reset circuit and a crystal oscillator circuit, the reset circuit comprises a capacitor C10 and a resistor R4, the crystal oscillator circuit comprises a crystal oscillator X1, a capacitor C11 and a capacitor C12, pins 1 to 8 of the STC89C52 single chip microcomputer are all connected with a key circuit, pin 9 of the STC89C52 single chip microcomputer is connected with a +5V power supply through a capacitor C10 and is connected with a ground through a resistor R4, pin 11 of the STC89C52 single chip microcomputer is connected with pin 1 of a digital potentiometer MCP41010, pin 12 of the STC89C52 single chip microcomputer is connected with pin 7 of an AD9833, pin 13 of the STC89C52 single chip microcomputer is connected with pin 6 of the AD9833, pin 14 of the STC89C52 is connected with pin 8 of the AD9833, pin 18 of the STC89C52 is connected with one end of the single chip microcomputer X8 and one end of the crystal oscillator X6866, and the other end of the STC89C 3519 and the other end of the crystal oscillator 1C 1, the other ends of the capacitor C11 and the capacitor C12 are simultaneously connected with a ground wire, a pin 20 of the STC89C52 single chip microcomputer is connected with the ground wire, pins 21 to 25 and pins 32 to 39 of the STC89C52 single chip microcomputer are connected with an LCD display circuit, and a pin 40 of the STC89C52 single chip microcomputer is connected with a +5V power supply.
The minimum system of the single chip microcomputer comprises an STC89C52 single chip microcomputer, a power supply circuit, a RESET circuit and a crystal oscillator circuit, wherein the power supply circuit adopts direct current 5V power supply, in the RESET circuit, a capacitor C10 is connected to VCC on a RESET pin RESET, and a resistor R4 is connected to GND, so that an RC charge-discharge loop is formed to ensure that the single chip microcomputer has enough time on the RESET pin for resetting at power-on, and then the single chip microcomputer returns to a low level to enter a normal working state. The crystal oscillator circuit is the heart of the single chip microcomputer, and the operation of each functional component of the single chip microcomputer is based on the clock frequency and works orderly. Therefore, the clock frequency directly affects the speed of the single chip microcomputer, and the quality of the clock circuit also directly affects the stability of the single chip microcomputer system. STC98C52 uses 12M crystal oscillator X1 as an oscillation source, and because the single chip microcomputer is internally provided with an oscillation circuit, the single chip microcomputer is externally connected with only one crystal oscillator X1 and two capacitors C11 and C12, and the capacitor capacity is generally between 15pF and 50 pF.
As shown in fig. 2, the key circuit adopts a 4 × 4 matrix keyboard, and the 4 × 4 matrix keyboard is connected with pins 1 to 8 of an STC89C52 single chip microcomputer. The waveform, frequency and amplitude of the output signal can be directly changed through a keyboard, so that the method is convenient and quick. The single chip microcomputer detects whether the I/O port corresponding to the key is at a low level or not. During detection, low level is sent to the column direction, high level is sent to the row direction, then which row is output to be low level is detected immediately in turn, and then the judgment of the row is carried out, so that which row and which column are pressed keys can be detected.
As shown in fig. 2, the LCD display circuit includes a resistor RB1 and an LCD12864 display, the pins 21 to 25 and 32 to 39 of the STC89C52 single chip are connected to the LCD12864 display, the pins 32 to 39 of the STC89C52 single chip are connected to a +5V power supply through the resistor RB1, the pin 1 and the pin 20 of the LCD12864 display are connected to the +5V power supply, and the pin 2 and the pin 19 of the LCD12864 display are connected to the ground.
The LCD display circuit adopts an LCD12864 display screen (U5), which is a graphic dot matrix liquid crystal display, can generate dot matrix driving signals and various synchronous signals as long as power is supplied, and can effectively meet the display of output results.
In summary, the AD9833 circuit of the present embodiment adopts the AD9833 as the signal generating unit of the whole circuit, and the single chip microcomputer can control the amplitude of the waveform through the digital potentiometer MCP 41010. The AD9833 clock reference circuit is mainly realized by a 25M external active crystal oscillator, and provides a clock reference for the AD 9833. And the signal amplifying circuit amplifies the signal output by the AD9833 through the operational amplifier AD 8051. The key circuit is realized by a 4-by-4 matrix keyboard, and changes of output waveforms, output frequencies and output amplitudes are realized by pressing different keys. The minimum system circuit of the singlechip receives an input instruction through the STC89C52 singlechip, and sends a signal to the AD9833 circuit through receiving a key instruction to generate a signal. And the LCD display circuit is realized by a liquid crystal display LCD12864 and displays the output waveform, and the frequency and the amplitude of the output waveform.
The embodiment generates signals of different types, different frequencies and different amplitudes by designing the control circuit of the AD 9833. Through testing, the circuit has the advantages of wide and stable output waveform frequency range, good anti-interference performance, good waveform, smooth sine wave, no burr, steep rising edge and falling edge of square wave and short delay time. The circuit can be popularized to various signal generating instrument industries, and has the advantages of high precision, wide signal change range, reliable work and higher practical application value.
While the invention has been described with reference to the preferred embodiments, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.