0 Introduction
In the research and application of modern electronic measurement technology, high-precision and frequency-adjustable signal sources are often required. The signal source generation circuit can be made of RC oscillation circuit, LC oscillation circuit and oscillation circuit composed of 555 timer. More often, it is generated by a special function signal generator IC, such as ICL8038, BA205, XR2207/2209, etc., but they have fewer functions, low accuracy, and the upper frequency limit is only 300 kHz, which cannot generate higher frequency signals. In addition, the adjustment method is not flexible enough, and the frequency and duty cycle cannot be adjusted independently, and the two affect each other. There are also signal generators using special DDS chips, but the circuit structure is complex and the cost is high. The design frequency range of the signal source specifically for extremely low frequencies is narrow and the application range is small. Therefore, this paper studies and designs a signal source generator based on the single-chip microcomputer C8051F130 and MAX038, which can generate triangle wave, sine wave and square wave within 15 MHz, with high precision and low distortion, which can effectively make up for the shortcomings of the above design and meet the requirements of most tests for signal sources.
1 Overall design of signal generator
The signal source generator mainly uses the single-chip microcomputer C8051F130 as the control core, and realizes the output of different amplitudes, frequencies and different types of signals by controlling the waveform generator chip MAX038 of Maxim Company and its external circuits. Among them, C8051F130 is an integrated mixed-signal system-on-chip launched by Silicon Laborat or ies Company with 8051 core and instruction set fully compatible. The fastest execution speed of instructions can reach 100 MIPS. It has 8448 (8K+ 256) bytes of on-chip RAM and 128 K bytes of flash memory, and has up to 64 input and output ports, which can fully meet the control requirements of this design. MAX038 is a waveform generator that can generate accurate sine waves, triangle waves and square waves with only a small number of external components. The output frequency and duty cycle can be adjusted by the current, voltage and resistance of the peripheral circuit. The entire signal source generator consists of a frequency control part, a waveform selection part, a duty cycle adjustment part, a keyboard input control part, a signal status display part, a power supply part, etc. The circuit block diagram is shown in Figure 1.
Figure 1 Signal generator
2 Hardware circuit design of each part of the signal source generator
2.1 Waveform selection section
Directly use the I/O ports P0.0 and P0.1 on C8051F130 to connect the A0 and A1 pins on MAX038. By setting the input, sine waves, square waves and triangle waves can be generated. The relationship between the pin level and the waveform is shown in Table 1.
Table 1 Corresponding waveform relationship between A0 and A1 pin levels
Waveform switching can be performed at any time regardless of the phase of the output signal, and the switching time is less than 0.3 us.
2.2 Frequency control part
The frequency of the MAX038 output signal is determined by the current IIN injected into the pin IIN, the capacitor CF connected to the COSC pin, and the voltage V FADJ on the pin FADJ. When VFADJ = 0 V, the basic output frequency Fo is given by the following formula:
Where: IIN is the current flowing into the IIN pin (10 A to 400 A for optimal performance), CF is the capacitance connecting the COSC pin and ground (selected from 20 pF to 100 F), if VFADJ is known, then any output frequency Fx = Fo [1- (0.2915 VFADJ)], in this design, a 10-bit D/A converter AD7533 is used to output different voltages, a 30 k resistor is connected to control the current flowing into the IIN pin of the MAX038, and C8051F130 controls CD4051 to select different CF to jointly determine the output frequency value of the signal. The frequency of the entire output signal is divided into 7 frequency bands. The corresponding relationship between the frequency band division and the CF value and the current value flowing into IIN is shown in Table 2.
Table 2 Correspondence between frequency band division, CF value and current value flowing into IIN
2.3 Duty cycle adjustment part
The voltage on the DADJ pin controls the duty cycle of the output waveform. When VDADJ = 0, the duty cycle is 50%. When the voltage changes from + 2.3 V to - 2.3 V, the output duty cycle will change from 15% to 85%. A voltage change of 1 V can cause the duty cycle to change by 15%. The duty cycle adjustment part uses the AD7303, an 8-bit D/A converter with serial input and dual voltage output. The AD7303 output is controlled by C8051F130 to output - 2.3 to + 2.3 V, and the duty cycle is adjusted by connecting to the DADJ pin.
2.4 Amplitude adjustment part
After frequency control and duty cycle adjustment, the output of MAX038 can output a waveform with an amplitude of 2 V (VPP), which is symmetrical to the ground, that is, -1~+1 V relative to the ground potential, and the output impedance is less than 0.1 Ω. The driving current that can be directly provided to the capacitive load of 50 pF is ±20 mA. In order to meet the requirements of the signal source in actual use, an amplitude adjustment circuit is also required to adjust the output signal amplitude and increase the signal driving capability. The amplitude adjustment circuit is composed of an inverting proportional operation circuit composed of a broadband high-speed current feedback amplifier AD811, in which the feedback resistor size is realized by the single-chip microcomputer C8051F130 controlling the X9C103 digital potentiometer. The output signal varies with the gain of the op amp, and the amplitude can be between 200 mV and 20 V (VPP), with an increase or decrease step of 200 mV (VPP). Figure 2 shows the electrical schematic diagram of the frequency control part, duty cycle adjustment part and amplitude adjustment part of the signal source generator.
2.5 Power supply
The power supply circuit mainly provides the voltage required for each chip to work to other circuits, which requires +15V, -15V, +5V, -5V. In order to reduce the influence of power supply interference on each circuit, especially on the conversion accuracy of D/A converter, the wide voltage input isolation voltage regulator positive and negative dual output isolation power supply chip ZY_WHAD-3W series produced by Guangzhou Zhou Ligong Company is adopted. It has the characteristics of high conversion efficiency, good high and low temperature characteristics, high voltage accuracy, etc. In addition, the +10V reference voltage required for the work of AD7533 is provided by AD584 (see Figure 2). The power supply circuit schematic is shown in Figure 3. [page]
2.6 Keyboard input and signal status display
This part of the circuit uses the LCD display module SG19264 and key switches to realize the frequency, amplitude, duty cycle adjustment and signal status output display of the signal source generator. The I/O port of C8051F130 is used to connect the 4+4 keyboard matrix and the SG19264 data port and control port. The output signal type, frequency, amplitude, duty cycle and other status information are displayed on the LCD module according to the key conditions.
3 Software Design
The signal generator software design adopts a modular programming structure, which is divided into initialization program, keyboard processing program, waveform selection program, frequency adjustment program, duty cycle adjustment program, amplitude adjustment program, and signal status display program. The signal generator is powered on and executes the initialization program to generate a square wave with a frequency of 1 kHz, an amplitude of 2 V (VPP), and a duty cycle of 50%. After initialization, the response is any key pressed, and the corresponding signal status adjustment program is entered. Finally, the signal status display program is displayed on the LCD. The program flow chart is shown in Figure 4.
Figure 4 Program flow
4 Conclusion
In order to verify the performance of the designed signal source generator, after the hardware and software design mentioned above, the various index parameters of its output signal were actually tested. The test data of its main parameters output frequency accuracy and total distortion coefficient using Agilent 53132A and National VP7720A are shown in Table 3 and Table 4.
Table 3 Output frequency
Table 4 Sine wave distortion coefficient
It can be seen from Table 3 and Table 4 that the signal generator designed in this paper can achieve an output waveform distortion of less than 0.3% and an output frequency accuracy better than 2 × 10-4, which is better than other similar designs.
This design uses the single-chip microcomputer C8051F130 as the core, supplemented by peripheral circuits such as D/A converters AD7533 and AD7303 and digital potentiometer X9C103 to control MAX038 to generate the required signal. Experimental verification shows that the designed signal generator can output square waves, sine waves, and triangle waves with a frequency less than 15 MHz, an amplitude of 200 mV~ 20 V (VPP) that is continuously adjustable, and a duty cycle of 15%~85%. It has the advantages of simple peripheral circuits, small size, high accuracy, and low output waveform distortion. This signal generator has been widely used in electrical and electronic testing work in our institute.
Previous article:Clock interrupt application of single chip microcomputer
Next article:Design of multi-point temperature detection system based on single chip microcomputer
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【Anxinke NB-IoT Development Board EC-01F-Kit】3. Serial port networking test
- STM32 DCMI driver OV2640 project source code
- Embedded USB driver-free device communication method based on WinUSB
- Generate random 0,1 signal
- Problems using Saber to simulate SPWM driving H-bridge via 2110
- Espressif ESP32-Korvo Audio Development Board Review Summary
- STM32mini MCU external clock method high-precision frequency capture
- TI DSP Bit Field and Register-File Struc...
- power supply
- [ESK32-360 Review] 3. LCD displays Chinese characters