CN202886465U - Frequency test system based on single-chip microcomputer - Google Patents

Frequency test system based on single-chip microcomputer Download PDF

Info

Publication number
CN202886465U
CN202886465U CN 201220436952 CN201220436952U CN202886465U CN 202886465 U CN202886465 U CN 202886465U CN 201220436952 CN201220436952 CN 201220436952 CN 201220436952 U CN201220436952 U CN 201220436952U CN 202886465 U CN202886465 U CN 202886465U
Authority
CN
China
Prior art keywords
frequency
chip microcomputer
chip
external interrupt
counter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN 201220436952
Other languages
Chinese (zh)
Inventor
张海涛
张世伟
白舸
刘翠苹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Henan University of Science and Technology
Original Assignee
Henan University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Henan University of Science and Technology filed Critical Henan University of Science and Technology
Priority to CN 201220436952 priority Critical patent/CN202886465U/en
Application granted granted Critical
Publication of CN202886465U publication Critical patent/CN202886465U/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

The utility model relates to a frequency test system based on a single-chip microcomputer, belonging to the technical field of frequency measurement. According to the utility model, the single-chip microcomputer is used as a core component, rising edges of an external signal to be detected are counted by the single-chip microcomputer so as to acquire the frequency of the signal to be detected; the frequency is transmitted to a serial light-emitting diode (LED) display chip by a serial peripheral interface (SPI) so as to drive character display tubes to display the value of the frequency; and the single-chip microcomputer controls a counting initial value of a counter according to the frequency range of the signal to realize the automatic switching of the measurement range. By adopting the frequency test system, not only the signal frequency of more than 1Hz, but also the signal frequency of below 1Hz can be tested, and the automatic switching of the measurement range can be realized.

Description

SCM Based frequency testing system
Technical field
The utility model relates to a kind of SCM Based frequency testing system, belongs to the frequency measurement technical field.
Background technology
In industrial control system, often need to measure the frequency of various signals.Yet, although existing complex frequency meter test specification is wide, precision is high, and is expensive; And various simple and easy frequency meters have obvious deficiency, and mainly be that it has taked following method of testing: in the time, usage counter is counted test signal at 1s, and then the count results of counter is exactly the frequency of signal.Although this method of testing is easy to realize, be difficult to test the following signal frequency of 1Hz.Thereby existing simple and easy frequency meter can only be tested the above signal frequency of 1Hz.
The utility model content
The purpose of this utility model provides SCM Based frequency testing system, can't test the deficiency of the following signal frequency of 1Hz to solve existing frequency meter.
The utility model also provides a kind of based on the single-chip microcomputer frequency testing system for solving the problems of the technologies described above, this frequency testing system comprises the waveform generation chip, counter, single-chip microcomputer and display device, the output terminal of waveform generation chip links to each other with the clock signal terminal of counter, the FPDP of depositing the counting initial value in the counter links to each other with the counting initial value control output end mouth of single-chip microcomputer, the output port of counter links to each other with the first external interrupt interface of single-chip microcomputer, 4 these external interrupt are a test period, being used for frequency range is the counting of the measured signal of 0.01~9999Hz, show and zero clearing, measured signal links to each other with the second external interrupt interface of single-chip microcomputer, this external interrupt is counted for the measured signal that to frequency range is 0.01~9999Hz, single-chip microcomputer at first arranges a counting initial value, the cycle that makes the output signal of counter is 0.5S, a test period is 2S just, test period is 1S by to measured signal gate time, after the first external interrupt arrives for the first time, open the second external interrupt, after the first external interrupt arrives for the second time, do not carry out any processing; After the first external interrupt arrives for the third time, close the second external interrupt, preserve the overall counting variable that rising edge is to measured signal counted, the output terminal of single-chip microcomputer links to each other with display device by its SPI interface, shows for control display device frequency counting to measured signal; After the first external interrupt arrives for the 4th time, judgement treats within a test period whether the counting variable that the rising edge of side signal counts is 0, if be not 0, the frequency of judging measured signal is 1~9999Hz, the size of the counting variable that then obtains is exactly the frequency of measured signal, if counting variable is 0, single-chip microcomputer is made amendment to the counting initial value of counter, the cycle that makes counter output signal is 5S, then a test period is 20S, judgement treats within this test period whether the counting variable that the rising edge of side signal counts is 0, if be not 0, the frequency of judging measured signal is 0.1~0.9Hz, the size of the counting variable that then obtains is exactly the frequency of measured signal divided by 10, if counting variable is 0, single-chip microcomputer is made amendment to the counting initial value of counter, the cycle that makes counter output signal is 50S, then a test period is 200S, judgement treats within this test period whether the counting variable that the rising edge of side signal counts is 0, if be not 0, the frequency of judging measured signal is 0.01~0.09Hz, and the size of the counting variable that then obtains is exactly the frequency of measured signal divided by 100.
Described display device comprises serial LED display chip and four 8 segment numeral pipes, the input end of serial LED display chip links to each other with the SPI interface of single-chip microcomputer, the output terminal of serial LED display chip links to each other with described 48 segment numeral pipes, the control end of 8 segment numeral pipes links to each other with the chip selection signal end of serial LED display chip, and four 8 segment numeral pipes are respectively applied to a position of display frequency, ten, hundred and kilobit.When the frequency measurement scope of system is 1~9999Hz, only drives 7 bit data positions of charactron, and do not light radix point; If the frequency measurement scope of system is 0.1~0.9Hz, when then showing data, simultaneously the radix point of 10-bit digit pipe is lighted; If the frequency measurement scope of system is 0.01~0.09Hz, when then showing data, simultaneously the radix point of hundred position charactrons is lighted.
Described single-chip microcomputer is the AT89C51 single-chip microcomputer.
Described counter is programmable Timer/counter 8253.
Described waveform generation chip is 555 oscillators.
The beneficial effects of the utility model are: the utility model is take single-chip microcomputer as core, utilize single-chip microcomputer that the rising edge of outside measured signal is counted, obtain the frequency of measured signal, single-chip microcomputer is according to the frequency range of signal, the counting initial value of control counter is realized the automatic switchover of measurement range, and the utility model not only can be tested the above signal frequency of 1Hz, also can test the following signal frequency of 1Hz, and can realize the automatic switchover of measurement range.
Description of drawings
Fig. 1 is the system chart among the SCM Based frequency testing system embodiment of the utility model;
Fig. 2 is that the utility model embodiment peripheral interrupts 1 subroutine flow chart.
Embodiment
In order to make the purpose of this utility model, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the utility model is further elaborated.Should be appreciated that instantiation described herein only in order to explain the utility model, is not limited to the utility model.
The embodiment of SCM Based frequency testing system of the present utility model
We describe as 9999Hz as example take the highest frequency of measured signal.As shown in Figure 1, the SCM Based frequency testing system in the present embodiment comprises single-chip microcomputer, 555 oscillators, programmable Timer/counter 8253, serial LED display chip MAX7219 and 48 segment numeral pipes.
System selects AT89C51 single-chip microcomputer commonly used as control core, and its port P0 is connected to programmable Timer/counter 8253 as the least-significant byte data; And the output of P0 is through 8 latchs, its 8 outputs are as the least-significant byte address, Q0 and Q1 are connected to respectively A0 and the A1 of programmable Timer/counter 8253, Q7 is connected to the chip selection signal #CS of programmable Timer/counter 8253 through phase inverter, namely the base address of programmable Timer/counter 8253 is 80H, and occupies address 80H~83H;
555 oscillator generation cycles were the square-wave signal of 0.25s, and this signal is connected to the pin CLK0 of the counter 0 of programmable Timer/counter 82253;
The counter 0 that programmable Timer/counter 8253 is set works under the square-wave generator pattern, gate-control signal GATE0 is connected to+5V and always keep high level, so the counting initial value of programmable Timer/counter 8253 determined OUT0 output square-wave signal frequency, thereby determined the measurement range of measured signal frequency.If the counting initial value is that 2, OUT0 can be the square-wave signal of 0.5s in the output cycle, the frequency measurement scope of system is 1~9999Hz; If the counting initial value is that 20, OUT0 can be the square-wave signal of 5s in the output cycle, the frequency measurement scope of system is 0.1~0.9Hz; If the counting initial value is that 200, OUT0 can be the square-wave signal of 50s in the output cycle, the frequency measurement scope of system is 0.01~0.09Hz; OUT0 is connected to external interrupt 1 input pin of AT89C51, and when initial, the counting initial value is 2, and the measurement range of system is 1~9999Hz;
Outside measured signal connects external interrupt 0 pin of AT89C51 single-chip microcomputer, and the Interrupt Subroutine of external interrupt 0 is mainly finished the counting of measured signal rising edge;
The P3.4 of single-chip microcomputer~P3.7 pin connects serial LED display chip MAX7219, and wherein, P3.7 is connected to the sheet choosing of MAX7219, and P3.4~P3.6 simulation SPI agreement realizes the control of MAX7219;
The outside cascade of serial display chip MAX7219 48 segment numeral pipes, respectively a position, ten, hundred and the kilobit of display frequency.When the frequency measurement scope of system is 1~9999Hz, only drives 7 bit data positions of charactron, and do not light radix point; If the frequency measurement scope of system is 0.1~0.9Hz, when then showing data, simultaneously the radix point of 10-bit digit pipe is lighted; If the frequency measurement scope of system is 0.1~0.9Hz, when then showing data, simultaneously the radix point of 10-bit digit pipe is lighted; If the frequency measurement scope of system is 0.01~0.09Hz, when then showing data, simultaneously the radix point of hundred position charactrons is lighted; After arranging and opening the external interrupt 1 of 51 single-chip microcomputers, 4 times external interrupt 1 becomes one-period, finishes counting, demonstration and the zero clearing of measured signal: after the first time, external interrupt 0 arrived, open external interrupt 0; After the external interrupt 1 arrival second time, do not carry out any processing; After external interrupt 1 arrives for the third time, close external interrupt 0, preserve overall counting variable, and deliver to serial LED display chip MAX7219, thereby drive charactron display frequency value; After the 4th external interrupt 1 arrives, judge whether overall counting variable is 0, if be 0, then change 8253 counting initial value into 20, the frequency measurement scope that makes system is 0.1~0.9Hz; In like manner, when the frequency measurement scope of system is 0.1~0.9Hz, the value of overall situation counting variable still is 0, just change 8253 counting initial value into 200, the frequency measurement scope that makes system is 0.01~0.09Hz, and when the value of global variable was not less than 10, the counting initial value with 8253 changed 2 into, and the frequency measurement scope that makes system is 1~9999Hz; When the frequency measurement scope of system was 0.01~0.09Hz, the value of global variable was not less than at 10 o'clock, and the counting initial value with 8253 changes 20 into, and the frequency measurement scope that makes system is 0.1~0.9Hz.Simultaneously, with overall counting variable zero clearing, and show 0 by serial LED display chip MAX7219 at charactron.The Interrupt Subroutine process flow diagram of external interrupt 1 is seen Fig. 2, and the variable Int1Num among the figure represents which time in repetition period of external interrupt 1 interrupt, and its value can be 1,2,3 and 4; Variable Count is overall counting variable; Variable Fre represents the frequency measurement scope, is 1 expression, 1~9999Hz, is 2 expressions, 0.1~0.9Hz, is 3 expressions, 0.01~0.09Hz.Externally defeated the interruption adds 1 operation to overall counting variable in the 0 processing subroutine.

Claims (5)

1. SCM Based frequency testing system, it is characterized in that: this frequency testing system comprises the waveform generation chip, counter, single-chip microcomputer and display device, the output terminal of waveform generation chip links to each other with the clock signal terminal of counter, the FPDP of depositing the counting initial value in the counter links to each other with the counting initial value control output end mouth of single-chip microcomputer, the output port of counter links to each other with the first external interrupt interface of single-chip microcomputer, 4 these external interrupt are a test period, being used for frequency range is the counting of the measured signal of 0.01~9999Hz, show and zero clearing, measured signal links to each other with the second external interrupt interface of single-chip microcomputer, this external interrupt is counted for the measured signal that to frequency range is 0.01~9999Hz, single-chip microcomputer at first arranges a counting initial value, the cycle that makes the output signal of counter is 0.5S, a test period is 2S just, test period is 1S by to measured signal gate time, after the first external interrupt arrives for the first time, open the second external interrupt, after the first external interrupt arrives for the second time, do not carry out any processing; After the first external interrupt arrives for the third time, close the second external interrupt, preserve the overall counting variable that rising edge is to measured signal counted, the output terminal of single-chip microcomputer links to each other with display device by its SPI interface, shows for control display device frequency counting to measured signal.
2. SCM Based frequency testing system according to claim 1, it is characterized in that: described display device comprises serial LED display chip and four 8 segment numeral pipes, the input end of serial LED display chip links to each other with the SPI interface of single-chip microcomputer, the output terminal of serial LED display chip links to each other with described 48 segment numeral pipes, the control end of 8 segment numeral pipes links to each other with the chip selection signal end of serial LED display chip, four 8 segment numeral pipes are respectively applied to a position of display frequency, ten, hundred and kilobit, when the frequency measurement scope of 10-bit digit pipe and hundred figure place code guard systems is 1~9999Hz, only drive 7 bit data positions of charactron, and do not light radix point; If the frequency measurement scope of system is 0.1~0.9Hz, when then showing data, simultaneously the radix point of 10-bit digit pipe is lighted; If the frequency measurement scope of system is 0.01~0.09Hz, when then showing data, simultaneously the radix point of hundred position charactrons is lighted.
3. SCM Based frequency testing system according to claim 1, it is characterized in that: described single-chip microcomputer is the AT89C51 single-chip microcomputer.
4. SCM Based frequency testing system according to claim 1, it is characterized in that: described counter is programmable Timer/counter 8253.
5. SCM Based frequency testing system according to claim 1, it is characterized in that: described waveform generation chip is 555 oscillators.
CN 201220436952 2012-08-30 2012-08-30 Frequency test system based on single-chip microcomputer Expired - Fee Related CN202886465U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201220436952 CN202886465U (en) 2012-08-30 2012-08-30 Frequency test system based on single-chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201220436952 CN202886465U (en) 2012-08-30 2012-08-30 Frequency test system based on single-chip microcomputer

Publications (1)

Publication Number Publication Date
CN202886465U true CN202886465U (en) 2013-04-17

Family

ID=48077876

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201220436952 Expired - Fee Related CN202886465U (en) 2012-08-30 2012-08-30 Frequency test system based on single-chip microcomputer

Country Status (1)

Country Link
CN (1) CN202886465U (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105866542A (en) * 2016-05-23 2016-08-17 南京航空航天大学 High-accuracy sliding frequency measurement method
CN106291099A (en) * 2016-07-29 2017-01-04 上海华岭集成电路技术股份有限公司 Chip port frequency test method
CN106569032A (en) * 2016-10-17 2017-04-19 长沙开元仪器股份有限公司 Signal frequency and duty ratio prediction method based on embedded microcontroller

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105866542A (en) * 2016-05-23 2016-08-17 南京航空航天大学 High-accuracy sliding frequency measurement method
CN106291099A (en) * 2016-07-29 2017-01-04 上海华岭集成电路技术股份有限公司 Chip port frequency test method
CN106291099B (en) * 2016-07-29 2019-10-25 上海华岭集成电路技术股份有限公司 Chip port frequency test method
CN106569032A (en) * 2016-10-17 2017-04-19 长沙开元仪器股份有限公司 Signal frequency and duty ratio prediction method based on embedded microcontroller
CN106569032B (en) * 2016-10-17 2019-05-31 长沙开元仪器股份有限公司 A kind of detection method of signal frequency and duty ratio based on embedded microcontroller

Similar Documents

Publication Publication Date Title
CN102901870B (en) Frequency testing system based on singlechip and testing method using same
CN103837741B (en) Equally accurate frequency testing system based on FPGA and method for designing thereof
CN103487649B (en) Method and device capable of measuring both frequency of continuous waves and frequency of pulse modulation carrier waves
CN102035455B (en) M/T speed measuring method for frequency converter
CN102128979B (en) Deng Precision Measuring Frequency circuit and frequency measuring method thereof
CN202886465U (en) Frequency test system based on single-chip microcomputer
CN102680726A (en) High-precision adaptive device for motor rotation speed measurement
CN203929885U (en) Based on FPGA etc. precision frequency testing system
CN202387589U (en) Centrifuge velometer based on programmable logic controller
CN102901871B (en) Signal frequency detection system and method
CN104698929B (en) Take the real-time control method of control intelligent electric energy meter
CN206235863U (en) Gauge table and its metering module based on low-power consumption sensor interface
CN202300375U (en) Drilling depth tester for roller-bit hole rig
CN207529214U (en) A kind of rotation speed measuring module for DCS system
CN206891372U (en) A kind of portable power cable length-measuring appliance
CN202330695U (en) Electric energy meter calibrating device capable of conducting dual-track error calculation
CN207317904U (en) A kind of flowmeter on-line detector
CN205317180U (en) Angle code appearance test system
CN203673293U (en) Position measuring and controlling device
CN203630573U (en) Instrument detection control system based on PLC single chip microcomputer
CN207718184U (en) A kind of digital displacement detecting system based on CPLD controllers
CN203101615U (en) Pointer type electric detection meter automatic verification device
CN204508770U (en) Eye drops packing control system
CN201242568Y (en) Frequency-measurement input circuit for programmable control computer
CN203302069U (en) Automatic greenhouse sprinkling control system

Legal Events

Date Code Title Description
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130417

Termination date: 20150830

EXPY Termination of patent right or utility model