Design of Multi-function Counter Based on Single Chip Microcomputer and FPGA

Publisher:平和梦想Latest update time:2010-05-24 Source: 国外电子元器件Keywords:FPGA Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

Frequency, period and phase are the three major elements of AC signals. In general, the analysis of AC signals requires the study of their frequency and phase, while the period can be directly calculated from the frequency. The requirements for the accuracy of frequency and phase measurement of sinusoidal signals are constantly increasing, and with the development of electronic technology, the measurement methods are still being improved and perfected. The frequency measurement method of direct frequency measurement was adopted earlier. In order to ensure the test accuracy, the period measurement method was generally used for low-frequency signals, while the frequency measurement method was used for high-frequency signals, which was very inconvenient to measure. The phase measurement initially used the method of measuring a cycle parameter of the signal. The accuracy of this method is suitable for low frequencies, while the error becomes larger at high frequencies. The multifunctional counter uses an equal-precision measurement method to measure the signal frequency, and uses a counting phase measurement method based on a single-chip microcomputer and FPGA to complete the precise phase measurement, and can display the frequency, period and phase difference of the current signal in real time on the LCD display. The counter integrates the measurement of the frequency and phase of the sinusoidal signal, with high accuracy and strong practicality.

2 Design demonstration

2.1 Frequency Measurement

The measurement time of the equal-precision measurement method is set manually, and the opening and closing of the gate is controlled by the rising edge of the measured signal. The measurement accuracy is independent of the measured signal frequency, so the measurement accuracy can be guaranteed to remain unchanged in the entire measurement frequency band. The count of the measured signal is synchronized, and there is an error of ±1 for the reference signal. As long as the count is large enough, it can meet the high-precision requirements.

2.2 Phase Measurement

The phase difference-time measurement method is to send the two shaped square waves into the FPGA, detect the rising edges of the two signals respectively, and count the crystal oscillator between the rising edges of the two signals through the internal counter of the FPGA. In the low frequency band, the output of the RC filter circuit fluctuates greatly. This phase measurement uses high-frequency counting pulses, and the phase is less affected by the signal frequency, which can achieve higher measurement accuracy.

3 System Hardware Circuit Design

The hardware circuit design of this system is composed of peak detection sampling, shaping comparison, broadband channel amplification, frequency measurement, phase measurement, display and other modules. The low-frequency comparator LM311 has a good shaping effect on signals from 1 Hz to 2 MHz, and the high-frequency comparator TL3116 has a good shaping effect on signals above 200 kHz. In order to achieve the frequency measurement of 1 Hz to 10 MHz signals, the system uses 1 as 0.01~5 V signal, which should be selected after peak detection and A/D conversion, and then the analog switch channel is selected for program-controlled amplification, and the measurement is performed after shaping, and finally the measurement result is sent to the display module. Figure 1 is the overall block diagram of the system.

System overall block diagram

3.1 Programmable amplifier circuit

The program-controlled amplification is divided into three stages. The small signal of 0.01-50 mV is amplified 100 times, the small signal of 50 mV-1 V is amplified 10 times, and the signal of 1-5 V is not amplified. The 8-way analog switch MAX308 is selected. In order to collect and realize the millivolt level signal, a broadband amplifier circuit must be used for amplification. Therefore, the OPA637 broadband operational amplifier of TI is used to realize the amplification of Gain="11" and Gain"=120. Figure 2 shows the amplifier circuit of OPA637 with a gain of 11 times. The amplifier circuit with a gain of 120 can be realized by cascading 2 stages of OPA637.

OPA637 amplifier circuit with a gain of 11 times [page]

3.2 Zero-Crossing Comparison Circuit

The input signal is sent to LM311 for hysteresis comparison, which can effectively eliminate edge glitches and realize low-frequency signal shaping. TL3116 is a high-frequency comparator. The input signal is sent to TL3116 for hysteresis comparison to obtain a more ideal high-frequency square wave shaping signal. Therefore, the shaping circuit is designed in two stages when measuring the frequency. The shaping circuit shapes the input periodic signal into a square wave of the same frequency and inputs it into FPGA for frequency measurement. Figure 3 shows the LM311 hysteresis comparison circuit, and the TL3116 external circuit is the same as it.

LM311 hysteresis comparator circuit

4 System Software Design

The system software design is divided into two parts: frequency measurement and phase measurement. When measuring frequency, the signal is peak detected, A/D sampled and sent to FPGA, and the analog switch is selected to program-controlled amplification of signals of different amplitude segments. The amplified signals are shaped by two comparators respectively, and then sent to FPGA for counting respectively. When high frequency, the count value shaped by the high frequency comparator is used, and when low frequency, the count value shaped by the low frequency comparator is used to accurately measure the signal frequency. For phase measurement, the signal shaped by the low frequency comparator is directly sent to FPGA for counting. The program flow is shown in Figure 4.

Program flow chart

5 Conclusion

The multifunctional counter for measuring the frequency, period and phase difference of sinusoidal signals realizes accurate frequency measurement of sinusoidal signals with a frequency of 1Hz to 10 MHz and an amplitude of 0.01 to 5 Vrms. Its accuracy reaches 10-6Hz. At the same time, the counter design also realizes accurate phase measurement of sinusoidal signals with a frequency of 10 Hz to 100 kHz and an amplitude of 0.5 to 5 Vrms, with an accuracy of 1°, and can display the frequency, period and phase difference of the current signal in real time on the LCD display. The system is simple to operate, highly modularized, highly accurate, and has a friendly display interface. It has strong feasibility and practicality and has good market prospects.

Keywords:FPGA Reference address:Design of Multi-function Counter Based on Single Chip Microcomputer and FPGA

Previous article:Design of USB2.0 Controller Based on FPGA and VHDL
Next article:Design of RS485 Interface Error Code Tester Based on FPGA

Recommended ReadingLatest update time:2024-11-16 22:57

Design of frame synchronization system based on FPGA
The frame synchronization system designed in the scheme was implemented on Xilinx FPGA device XC3S200-4FT200, and the simulation test was carried out using Modelsim 6.0 software. The simulation results show that the synchronization system designed in this scheme works stably and meets the performance requirements. 0 I
[Power Management]
Design of frame synchronization system based on FPGA
LED Graphic Display Screen Control System Based on MCU and FPGA
introduction At present, small and medium-sized LED display systems on the market generally use traditional single-chip microcomputers as the main control chip. For large-screen LED display screens, due to the large amount of data transmission, fast scanning speed is required, while the internal resources of th
[Power Management]
LED Graphic Display Screen Control System Based on MCU and FPGA
Home remote control design based on FPGA
introduction As the types of household appliances in people's lives increase day by day, the types of remote controls also increase accordingly. Different types of remote controls generally cannot replace each other, which brings many inconveniences to people's lives. The functions of various remote contro
[Industrial Control]
Home remote control design based on FPGA
Hardware system design for parallel processing of image acquisition, compression and high-definition analysis
0 Introduction With the development of science and technology and the application needs of social development, people have higher and higher requirements for high-definition video image acquisition and processing, real-time transmission and intelligent control. High-definition video images have been more widely us
[Test Measurement]
Hardware system design for parallel processing of image acquisition, compression and high-definition analysis
Do you know what ARM, MCU, DSP, FPGA, and SOC are?
ARM The ARM processor is the first RISC microprocessor designed by Acorn Computer Co., Ltd. for the low-budget market. Earlier it was called the Acorn RISC Machine. The ARM processor itself is a 32-bit design, but it also has a 16-bit instruction set, which generally saves up to 35% of the equivalent 32-bit code, wh
[Microcontroller]
Do you know what ARM, MCU, DSP, FPGA, and SOC are?
Preserving Repeatable Results in Xilinx FPGA Designs
Meeting the timing requirements of a design is challenging enough in itself, and achieving full repeatability of the overall timing of a design is sometimes an impossible task. Fortunately, designers can rely on design flow concepts that help achieve repeatable timing results. The four areas that have the greatest impa
[Embedded]
Preserving Repeatable Results in Xilinx FPGA Designs
Design of wireless subsystem based on DSP+FPGA co-processing architecture
You can significantly improve the performance of signal processing functions in wireless systems. How? By taking advantage of the flexibility of the FPGA fabric and the embedded DSP blocks in today's FPGA architecture that benefit from parallel processing. Such processing commonly found in wireless applications inclu
[Embedded]
Design of wireless subsystem based on DSP+FPGA co-processing architecture
Design of Fiber Channel Interface Adapter Using Host Computer and FPGA Development Board
With the rapid development of storage technology, storage capacity has grown rapidly, and the data transmission speed of storage systems has become a major bottleneck. Fiber optic transmission has its speed advantage, however, fiber optic transmission is limited by the fiber channel interface. Therefore, a key techn
[Industrial Control]
Design of Fiber Channel Interface Adapter Using Host Computer and FPGA Development Board
Latest Embedded 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号