Design and Analysis of Signal Generator Based on C8051F130 and MAX038

Publisher:科技思想家Latest update time:2012-10-15 Source: 21ic Keywords:C8051F130 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

11.jpg

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

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:

Basic output frequency Fo

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

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]

22.jpg

33.jpg

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.

44.jpg

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 3 Output frequency

Table 4 Sine wave distortion coefficient

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.

Keywords:C8051F130 Reference address:Design and Analysis of Signal Generator Based on C8051F130 and MAX038

Previous article:Clock interrupt application of single chip microcomputer
Next article:Design of multi-point temperature detection system based on single chip microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号