Research on frequency sweeper based on Linux multi-task operating system

Publisher:丹青妙手Latest update time:2012-01-09 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Reference address:Research on frequency sweeper based on Linux multi-task operating system

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

Design of component modules and implementation methods of MAX1303 driver based on ARM-Linux
In a data acquisition system, physical quantities in the natural world are usually converted into electricity through sensors. Electricity is an analog quantity and must undergo analog/digital conversion before it can be read by the system's processor. Many current microprocessors have on-chip ADs, but most of these A
[Microcontroller]
Design of component modules and implementation methods of MAX1303 driver based on ARM-Linux
Tiny4412 learning (IV) transplanting Linux-device tree (1) basic knowledge of device tree and GPIO interrupt
Hardware platform: tiny4412 System: linux-4.4 File system: busybox-1.25 Compiler: arm-none-linux-gnueabi-gcc (gcc version 4.8.3 20140320) uboot: Friendly, built-in uboot. 1. Introduction of DTS 1. What is DTS? Why introduce DTS? DTS stands for Device Tree Source. DeviceTree is a data structure that describes hardware.
[Microcontroller]
Tiny4412 learning (IV) transplanting Linux-device tree (1) basic knowledge of device tree and GPIO interrupt
Linux-2.6.32 ported to mini2440 development board (17) Keyboard driver ported
Editor: The key driver involves the writing of Linux interrupt programs. 1. Button schematic diagram. 2. Writing and transplanting drivers. Create a new driver file mini2440_buttons.c in the /linux-2.6.32.2/drivers/char/ directory. The content and detailed comments are as follows: #include linux/module.h #inc
[Microcontroller]
OK6410A development board (eight) 69 linux-5.11 OK6410A linux kernel synchronization mechanism interrupt disable/interrupt mask implementation
What is the problem being solved? Interrupt seize 1. Implementation principle 1/ Disable irq and fiq 2/ Disable interrupt source // Related to interrupt controllers such as vic/gic Applicable to the interrupt processing process of a certain interrupt source, and the interrupt from this interrupt source cannot be a
[Microcontroller]
ARM-Linux transplant (Part 2) - Linux2.6.22 kernel transplant
Platform: mini2440 Cross toolchain: arm-linux-gcc-4.3.2 1. Basic knowledge of kernel transplantation Porting the kernel is also called building a BSP (boardsupport packet). BSP has two functions: one is to provide low-level support for kernel operation, and the other is to shield board-related details.
[Microcontroller]
Application of arm driver linux waiting queue blocking interrupt IO
" Linux waiting queue blocking interrupt IO application" involves four kernel driver functions and zero kernel structures, and analyzes four kernel driver functions; one related application template or kernel driver template for reference, and one related application template or kernel driver for reference 1. Concept:
[Microcontroller]
OK6410A Development Board (VIII) 40 linux-5.11 OK6410A buddy alloc and free
The third stage is to establish a buddy Buddy's lifespan mm_init- mem_init returns - no end point Buddy managed memory size The memory managed by buddy is determined by memblock The portion of memblock.memory that does not include memblock.reserved memblock can reserve memory through memblock_alloc or memblock_r
[Microcontroller]
ARM-Linux driver--MTD driver analysis (I)
Host: Gentoo Linux 11.2 with linux kernel 3.0.6 Hardware platform: FL2440 (S3C2440) with linux kernel 2.6.35 MTD (memory technology device) provides an abstract interface between the hardware and file system layers. MTD is an intermediate layer used to access memory devices (such as ROM, flash). It extracts the comm
[Microcontroller]
ARM-Linux driver--MTD driver analysis (I)
Latest Test Measurement Articles
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号