1 Introduction
The frequency sweeper is an instrument suitable for measuring the frequency response of a system. The frequency response of a system includes two aspects: amplitude-frequency response and phase-frequency response. At present, in the implementation of the frequency sweeper, the hardware platform is generally based on an 8-bit or 16-bit single-chip microcomputer, and the software implementation mostly adopts a single-process loop control method. This method has the following disadvantages:
(1) Except for the interrupt service program, each program module has no priority difference and is simply called by the main loop in a round-robin manner, which has poor real-time performance and unpredictable response time;
(2) The computing power is poor and it is difficult to complete more complex control algorithms;
(3) The hardware platform is highly dependent, which is not conducive to the development, upgrading and transplantation of application software;
(4) For more complex control systems, in the absence of a powerful multi-task scheduling mechanism, the application software is not only difficult to implement, but also difficult to ensure reliability;
(5) The distributed multi-task processing capability is poor, and the network and intelligent support are difficult to adapt to the needs of long-term development.
Embedded Linux can solve the above problems well. Linux not only has free and open source code and extensive technical support worldwide, but also supports multiple hardware platforms; the core code is highly efficient and the code volume is small; the system is highly stable and reliable; the system can be customized and configured according to specific needs, and is easy to upgrade. It is a true multi-user, multi-tasking operating system.
Based on the systematic analysis of the hardware structure of the frequency sweeper, this paper designs the software of the frequency sweeper according to the multi-task parallel processing characteristics of Linux.
2 System Hardware Composition
The hardware design scheme of the system is shown in Figure 1.
(1) The DDS signal source is based on the highly integrated frequency synthesizer AD9854. S3C2410X generates a variety of sine waves by sending frequency control words to AD9854, and then passes through 7th-order low-pass filtering, signal amplification, amplitude control, and outputs low-spurious and high-stability sine waves.
(2) Since the frequency sweeper has many buttons, the keyboard circuit cannot be designed according to the traditional design method. This article is based on the ZLG7290 chip. The keyboard is connected to the CPU through the I2C bus, which saves the CPU interface resources.
(3) The signal detection and conditioning circuit is mainly used to amplify and detect the amplitude and phase of the reference signal and the measured signal, and then send it to A/D conversion through low-pass filtering.
3 System software design
Linux has the advantages of small kernel, high efficiency, open source code, and direct kernel network support. However, the hardware resources of embedded systems are limited after all, so Linux cannot be directly used as an operating system. It is necessary to customize the system by configuring the kernel and embedded C library for specific applications so that the entire system can be stored in a small capacity FLASH. Linux's dynamic module loading makes Linux very convenient to tailor, and highly modular components make it very easy to add and delete. Based on the above advantages of Linux, the operating system used in this paper's implementation platform is arm-linux, which is customized for Linux.
3.1 Overall software design
The software design of the frequency sweeper is mainly divided into two parts: hardware driver; multi-task application. The structure diagram of the frequency sweeper system software is shown in Figure 2, where the innermost layer is the operating system layer, the middle layer is the application layer, and the outermost layer is the hardware driver layer. When the operating system is started, the hardware driver layer interface program is loaded first, and then the system kernel switches between tasks according to the priority of each task in the application layer and its ready state.
3.2 System multi-task design
When dividing a software system into parallel tasks, we must first analyze the data transformation in the data flow diagram to determine which changes can be performed in parallel and which transformations must be performed sequentially in nature. One transformation can become a task, or several transformations can form a task. The most important factor that determines the task division in the system is the asynchronous relationship between the functions implemented in the system, that is, how tasks are triggered and coordinated with each other, which can be solved through communication between tasks. According to the characteristics and requirements of concurrency and synchronization between tasks, the sweeper system is divided into tasks, as shown in Figure 3.
The system monitoring and protection tasks ensure that the system is safe and reliable. Faults can be self-checked and the fault location of the frequency sweeper can be diagnosed.
Data acquisition tasks Since the frequency sweeper needs to continuously read the amplitude and phase signal data collected from the A/D chip, otherwise it will be overwritten by later data, resulting in point loss, a data acquisition process is opened to handle the reading data. The data acquisition process uses a mutex to protect the input buffer to avoid competition; the message-driven data processing module and the display module are used to perform corresponding operations.
The data processing task first uses digital filtering technology to filter out interference sources; then performs calculations to determine whether the number of scanning frequency points has reached the requirement, whether the frequency sweep is over, and converts the data into a graphical display format; finally, it is sent to the display module for display. Since the data processing module has a large amount of calculation, a separate process is also opened for it to calculate to avoid affecting the work of other modules.
The development tool used for the development of the display task graphical interface is MiniGUI. Using MiniGUI's graphical control resources, the software interface development is very convenient. The display module is mainly responsible for displaying the phase and amplitude signals in a graphical manner. Since drawing is a very resource-intensive task, it is implemented in a separate process.
After the USB communication task completes the test of the object under test, the test data is copied or printed.
3.3 Multi-task communication
The concept of message is introduced in the frequency sweeper program, and the execution conditions of the process are converted into messages. The corresponding process is activated by the message, and the scheduling is implemented by the process scheduling module. The message is defined as: when a process is completed, the process sets the corresponding flag, and different flags represent different messages. The role of the message in multiple processes is equivalent to a bridge, making the processes both independent and organically related. The processes cannot be called directly, and need to be implemented by the process scheduling module with the help of messages. For example: There is a part of the content in the data display module that prints the results of the analysis and calculation on the screen. In order to save resource overhead, it is placed in the main process and processed through the message mechanism.
The interrupt service program sends a signal to the process scheduling module to indicate that an interrupt has occurred. For example, when the frequency sweep function key is pressed, the interrupt handler generates a signal to exit the interrupt, and the scheduling module activates the number setting module according to the received signal.
4 Conclusion
The application of the frequency sweeper based on the Linux embedded multi-tasking operating system, combined with the 32-bit microprocessor of S3C2410X, not only simplifies the software and hardware design, but also can conveniently measure the amplitude-frequency curve and phase-frequency curve of the network under test. More importantly, it reduces the frequency sweep response time and increases the data printing and analysis processing functions. The graphical interface developed using MiniGUI is user-friendly and has strong human-computer interaction. Programming based on the Linux multi-tasking operating system can reduce the workload and complexity of program design and greatly shorten the development cycle.
Previous article:Microwave Pulse Power Test System Based on Single Chip Microcomputer
Next article:Research and Development of Embedded Controller for Instrumentation System
Recommended ReadingLatest update time:2024-11-16 17:34
- Popular Resources
- Popular amplifiers
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- 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
- Today's live: TI uses DLP pico projection technology to design augmented reality smart glasses
- Laser driver circuit
- Looking for Windows XP SP3 ghost system!
- After the epidemic, will companies continue to work overtime like crazy?
- [RVB2601 Creative Application Development] CDK Development Environment Simple Application Experience Sharing
- How to embed OS in MSP430 series MCU
- Repost - The other side of electronic components you have never seen!
- 【CH579M-R1】+Drive LSM303DLH Magnetic Field Sensor
- BKP backup register
- msp430 to tft