Keywords: single-chip microcomputer, frequency synthesis, A/D conversion, liquid crystal display, frequency sweeping
1 Introduction
In today's world, electronic technology is developing rapidly, and digitalization, networking, and informatization have affected people's clothing, food, housing, and transportation. However, the existing electronic research laboratories lack frequency sweeping instruments below 1MHz, which seriously hinders the speed of scientific researchers' creation. When a speech signal is to be digitally processed, it must first be sampled, quantized, and encoded. According to the Nyquist sampling theorem, if the original signal is to be reconstructed without distortion, the sampling frequency must be greater than or equal to twice the highest frequency of the original signal (Ws ≥ 2Wh), otherwise the spectrum of the sampled signal will be aliased, and the original signal cannot be restored at this time. Obviously, the lower the frequency Wh of the original signal, the lower the sampling frequency Ws, the lower the digital rate, and the storage space and information transmission rate can be greatly reduced. Therefore, before sampling, the original signal can be passed through a low-pass filter, allowing only frequency components below Ws/2 to pass, while filtering out higher frequency components. According to the standard of speech signals, the frequency band of the speech signal can be limited to 300Hz to 3400Hz by bandpass filtering before sampling. Undoubtedly, in the above series of speech signal processing processes, sweep frequency instruments below 1MHz are indispensable, especially when designing and producing 300Hz to 3400Hz bandpass filters, low-frequency sweep frequency instruments must be used for data verification during adjustment and testing.
2 Design and demonstration of the scheme
According to the above requirements, we can have the following three design schemes:
(1) With the help of the laboratory's low-frequency signal generator and oscilloscope,
use the manual method to perform fixed-point measurement, that is, the low-frequency signal generator generates frequency points one by one and transmits them to the circuit under test. Its output is connected to the oscilloscope to observe the attenuation amplitude of each frequency point and record it for data analysis.
(2) With the single-chip microcomputer as the core, the peripheral frequency synthesizer, rectifier filter, A/D conversion, LCD display, keyboard control and other parts are used to design an intelligent fully automated integrated system. The working principle is described in detail later. The system block diagram is shown in Figure 1.
Obviously, Scheme 1 is a traditional manual scheme, which is troublesome to test, slow, and inefficient. It does not meet the modern electronic design standards; Schemes 2 and 3 are both fully automated instrument design schemes. Scheme 3 has better test performance and accuracy indicators than Scheme 2, but Scheme 2 is low in cost and easy to produce, so we choose Scheme 2. 3 Working principle of sweep frequency meter In electronic measurement, the problem of measuring the impedance characteristics and transmission characteristics of the network is often encountered. The transmission characteristics include gain and attenuation characteristics, amplitude-frequency characteristics, phase-frequency characteristics, etc. The instrument used to measure the above characteristics is called a frequency characteristic tester, or sweeper for short. It provides great convenience for the adjustment, calibration and troubleshooting of the network under test. The sweeper is generally composed of a sweep sawtooth wave generator, a sweep signal generator, a broadband amplifier, a frequency standard signal generator, an X-axis amplifier, a Y-axis amplifier, a display device, a panel keyboard and a multi-channel output power supply. Its basic working process is to step down the 50Hz mains voltage through a power transformer and send it to the sweep sawtooth wave generator to form a sawtooth wave. On the one hand, this sawtooth wave controls the sweep signal generator to modulate the sweep signal. On the other hand, after the sawtooth wave is amplified by the X-axis deflection amplifier, it controls the X-axis deflection plate of the oscilloscope to make the electron beam produce horizontal scanning. Since this sawtooth wave controls the horizontal scanning of the electron beam and the sweep oscillator at the same time, each horizontal position of the electron beam on the oscilloscope screen corresponds to a certain instantaneous frequency. The frequency increases gradually from left to right and changes linearly. The swept frequency signal generated by the swept frequency signal generator is sent to the broadband amplifier for amplification, then sent to the attenuator, and then the swept frequency signal is output to the circuit under test. In order to eliminate the parasitic amplitude modulation of the swept frequency signal, the broadband amplifier is equipped with an automatic gain controller (AGC). The swept frequency signal output by the broadband amplifier is sent to the frequency standard mixer, where it is mixed with 1MHz and 10MHz or 50MHz crystal oscillator signals or external frequency standard signals. The generated frequency standard signal is sent to the Y-axis deflection amplifier for amplification and then output to the Y-axis deflection plate of the oscilloscope. After the swept frequency signal passes through the circuit under test, it is amplified by the Y-axis potentiometer, attenuator, and amplifier and then sent to the Y-axis deflection plate of the oscilloscope to obtain the amplitude-frequency characteristic curve of the circuit under test. 4 Hardware Design 4.1 Hardware Composition The hardware part of this system consists of CPU (89C51), frequency synthesizer (MC145151-1), rectifier and filter, A/D conversion (ADC0 809), LCD display, touch keyboard and other units. The system block diagram is shown in Figure 1. The keyboard controls the frequency sweep range. The microcontroller transmits 14-bit data to MC145151-1 to control the oscillation frequency of the voltage-controlled oscillator (VCO). The frequency passes through the circuit under test, is rectified and filtered, and then is sent back to the CPU through A/D conversion. The oscillation frequency of the VCO changes slowly from the low frequency end to the high frequency end to the low frequency end within the frequency sweep range. At the same time, the CPU controls the A/D conversion timing, and then the software converts it into a liquid crystal display code for display. 4.2 Phase-locked frequency synthesis circuit This unit is the key part of the machine's operation. The system structure is shown in Figure 3. The synthesis frequency step Fr is set to 1/128 of the frequency sweep range. The maximum frequency sweep range can be 20Hz~2MHz. Obviously, the smaller the frequency sweep range, the higher the frequency sweep accuracy. There are many frequency synthesizer integrated circuits on the market. We choose Motorola's MC145151. The chip is a single-mode, monolithic phase-locked loop frequency synthesizer with 14-bit parallel code input. It contains reference oscillator, reference divider, phase detector, programmable divider and other components. The maximum variable frequency ratio is 16383, and the maximum operating frequency is 30MHz, which can meet the design requirements of the system. In the phase-locked loop, the design of the loop filter is very important. This system uses a passive proportional integral filter, which has a simple structure, stable performance and convenient debugging. 4.3 Rectification and filtering circuit The task of the rectifier circuit is to convert the sinusoidal wave signal received from the circuit under test into direct current. The completion of this circuit mainly relies on the unidirectional conductivity of the diode, so the diode is the key component of the rectifier circuit. In the low-power rectifier circuit, the common rectifier circuits are half-wave, full-wave, bridge and voltage doubler rectifier circuits. In order to ensure the integrity of the measured signal, we use a bridge rectifier circuit, as shown in Figure 4.
The filter circuit is used to filter out the ripple in the rectified output voltage. There are many ways to classify the filter circuit. Common structures include C-type filter circuit, inverted L-type filter circuit, and π-type filter circuit. Comparing the above filters, we choose the π-type filter circuit with simpler circuit and better performance.
4.4 A/D conversion circuit
The function of the A/D converter is to convert the input analog signal into digital form, so that the CPU can process the analog signal received from the circuit under test. Because the A/D converter has a wide range of applications, there are many varieties and types of conversion chips. Common ones include ADC0809, ADC570, ADC574, ADC1210, ADC0804, 5G14433 and other integrated circuits. We choose ADC0809 integrated converter, which is an eight-channel multiplexer, monolithic CMOS analog/digital converter. Each channel can convert 8-bit digital quantity. It is a successive approximation comparison converter, including a high impedance chopper comparator, a tree switch network with 256 resistor dividers, a control logic link and an eight-bit successive approximation digital register. The final output stage has an eight-bit three-state output latch.
In order to ensure the frequency sweep accuracy, a sampling and holding circuit must be added before the A/D converter. This is because the conversion from analog quantity to digital quantity takes a certain amount of time. During the conversion, the signal should remain stable. The sampling and holding circuit is shown in Figure 5.
4.5 Liquid crystal display circuit Liquid
crystal display (LCD) is a passive display. Due to its low power consumption, strong anti-interference ability and good display interface effect, it is widely used in low-power single-chip microcomputer systems.
There are many types of LCD display screens on the market. We purchased the SMG12232B-2LCM product produced by Changsha Sunman Electronics Co., Ltd. Its display capacity is 122×32 dot matrix, the chip working voltage is 4.5~5.5V, the working current is 5mA (5.0V), it has 16 pins and eight data lines.
4.6 Touch keyboard part
The control panel is an essential part of the instrument. Like the display output device, it is a window for the operator to interact with the instrument, and it is also a link and interface between the system and the outside world. A safe and reliable application system must have convenient and flexible interactive functions, which can not only reflect the important status of the system operation in a timely manner, but also realize appropriate manual intervention when necessary. The
keyboard interface can be classified in different ways according to different standards. According to the keyboard arrangement method, it can be divided into independent mode and row and column mode; according to the method of reading key values, it can be divided into direct reading mode and scanning mode; according to whether hardware encoding is performed, it can be divided into non-encoding mode and hardware encoding mode; according to the CPU response method, it can be divided into interrupt mode and query mode. We choose a row and column scanning non-encoding interrupt mode keyboard with simple structure and easy processing. The circuit schematic is shown in Figure 6.
This panel has control keys for Y-axis attenuation, X-axis compression, center frequency adjustment, and corresponding tuning keys "+", "-", and full-automatic adjustment key (AUTO).
4.7 Single-chip microcomputer control console
The single-chip microcomputer (CPU) is the core of the entire automation system and the summary of the entire hardware part. It is driven by the software described below to drive each control unit. There are many types of CPUs. GI, Rockwell, Intel, Zilog, Motorola, NEC and other major computer companies in the world have launched their own single-chip microcomputer series. We selected the most commonly used AT89C51 chip in the MCS-51 series produced by Intel. It has 40 pins, 8-bit data lines, 16-bit address lines, 4KBROM, 128ByteRAM, two external interrupts, two 16-bit timers/counters, a programmable full-duplex serial port, and a total of 32 programmable I/O lines.
The interrupt signal line of the interrupt keyboard is connected to the CPU's external interrupt INT0, and its row and column scan lines are generated by port P1. The chip select signal of MC145151, ADC0809, SMG12232B-2 LCM is generated by the high 8-bit address line. Since MC145151 has 14-bit data lines, and AT89C51 outputs only 8-bit data lines, we send the CPU out twice, first sending the low byte and then the high byte (called right alignment). The corresponding interface circuit sets two latches to latch the high byte and the low byte respectively. ADC0809 uses interrupt mode to receive data, and its interrupt signal line is connected to the CPU's external interrupt INT1.
5 Software Design
The software part of this system adopts a modular programming method and is written in assembly language A51. It is divided into several modules, including the main program (MAIN), external interrupt 0 subroutine (INT00), external interrupt 1 subroutine (INT11), sweep signal generation subroutine (SPXHCS), and liquid crystal display subroutine (LCDSSEE).
A counting pointer R7 is set in the main program to represent the step from the low frequency end to the high frequency end within the sweep frequency range. When R7 finishes counting, reassign R7 and return to search for the key value. If the key value remains unchanged, the frequency sweep parameters remain unchanged and the frequency sweep is repeated; if the key value changes, the corresponding frequency sweep parameters are calculated and the frequency sweep is repeated, and the cycle repeats. The
external interrupt 0 subroutine is used as a keyboard scanning subroutine. This program adopts a new design method, that is, when initializing the CPU, data #0FH is sent to port P1 in advance. If a key is pressed, one of the column lines becomes a low level "0", and the column line AND gate also outputs a low level "0", and an interrupt is generated at this time; otherwise, if no key is pressed, all column lines are high level "1", and the column line AND gate also outputs a high level "1", and no interrupt is generated. In the interrupt subroutine, the data of port P1 is transferred to accumulator A, and "OR" with #0F0H, and then transferred to port P1. At this time, the data in port P1 can be used as the key value. The program flowchart is omitted.
The external interrupt 1 subroutine is used as the frequency sweep Y-axis scanning subroutine. When the program generates an interrupt, it immediately reads the data in ADC0809 and then converts it into a liquid crystal display code. The display code conversion adopts the table lookup method, and a display code table is established at the end of the program. The program flowchart is omitted.
The frequency sweep signal generation subroutine is not responsible for generating the frequency sweep signal. It only sends 14 bits of data to the MC145151 chip. The frequency sweep signal
is generated and calibrated by the hardware frequency synthesizer. Since MC145151 is a 14-bit data line and AT89C51 is an 8-bit data line, the software design adopts the right-aligned method to send the data twice, that is, first send the lower 8 bits and then send the upper 8 bits. In the hardware design, a two-level data latch is used. The program flowchart is omitted.
The liquid crystal display subroutine is divided into three steps: the first step is to detect the "busy" of the liquid crystal chip; the second step is to locate the internal write data pointer; the third step is to write the display code data. Among the above three steps, the key step is the second step of internal data pointer positioning, and the positioning pointer is controlled by the X-axis and Y-axis sweep frequency at the same time. The flowchart is omitted.
6 System expansion function
Since this system includes high-precision analog/digital conversion, it can be slightly modified in the software design and use the principle of sampling oscilloscope to complete the function of oscilloscope. And this oscilloscope can measure signals with long periods and slow changes, such as temperature changes, climate changes and other parameters.
2 Xie Liangyou. Electronic Measurement and Instrumentation (First Edition). Beijing: Publishing House of Electronics Industry, March 1994
Previous article:Design and implementation of YB4365/YB4345 digital cursor direct reading oscilloscope
Next article:Research on test methods based on IEEE1149.4
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- 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
- Solution to TI cc2538 serial port failure to program and bootloader failure to enter
- Shenzhen Electronic Hardware Engineer Recruitment
- Fill block copper plating hazards!
- Chinese Academy of Sciences releases domestic open source RISC-V processor "Xiangshan": the first version is scheduled to be taped out in July
- Trump administration "blacklists" Xiaomi, Xiaomi using Qualcomm chips is a "military-related company"???
- 『Anxinke Bluetooth Development Board PB-02-Kit』-3: Start Docker
- FAQ_How to calculate the response time from shutdown state to READY state
- Battery and external power switching circuit, MOS on and off conditions
- [NXP Rapid IoT Review] Low Power Consumption Experiment & Summary
- NVC voice ic offline commonly used models!