KR940009815B1 - Frequency detecting apparatus and method using directport of microcomputer - Google Patents

Frequency detecting apparatus and method using directport of microcomputer Download PDF

Info

Publication number
KR940009815B1
KR940009815B1 KR1019910011337A KR910011337A KR940009815B1 KR 940009815 B1 KR940009815 B1 KR 940009815B1 KR 1019910011337 A KR1019910011337 A KR 1019910011337A KR 910011337 A KR910011337 A KR 910011337A KR 940009815 B1 KR940009815 B1 KR 940009815B1
Authority
KR
South Korea
Prior art keywords
frequency
microcomputer
counter
serial
sampling
Prior art date
Application number
KR1019910011337A
Other languages
Korean (ko)
Other versions
KR930002830A (en
Inventor
김종필
Original Assignee
주식회사금성사
이헌조
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 주식회사금성사, 이헌조 filed Critical 주식회사금성사
Priority to KR1019910011337A priority Critical patent/KR940009815B1/en
Publication of KR930002830A publication Critical patent/KR930002830A/en
Application granted granted Critical
Publication of KR940009815B1 publication Critical patent/KR940009815B1/en

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R23/00Arrangements for measuring frequencies; Arrangements for analysing frequency spectra
    • G01R23/02Arrangements for measuring frequency, e.g. pulse repetition rate; Arrangements for measuring period of current or voltage
    • G01R23/04Arrangements for measuring frequency, e.g. pulse repetition rate; Arrangements for measuring period of current or voltage adapted for measuring in circuits having distributed constants

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Measuring Frequencies, Analyzing Spectra (AREA)

Abstract

The device consists of a micom (1) for giving sampling pulses or sampling intervals through serial ports and measuring the frequency of a high and a low input signals (Fh,Fl), a timing processing part (4) for operating frequencys of input signals (Fh,Fl) by control of the micom, a counter (5) for counting frequency of input signals (Fh,Fl) by control of the micom, and a parallel/serial latch (7) for transferring outputs of the counter into the micom (1) in parallel or serial.

Description

마이컴의 직렬포트를 이용한 주파수 측정장치 및 방법Frequency measuring device and method using serial port of microcomputer

제 1 도는 본 발명 주파수 측정장치의 블록구성도.1 is a block diagram of a frequency measuring device of the present invention.

제 2 도는 (a) 내지 (h)는 본 발명 장치의 동작설명을 위한 신호 타이밍도.Figure 2 (a) to (h) is a signal timing diagram for explaining the operation of the apparatus of the present invention.

제 3 도는 본 발명 방법을 설명하기 위한 인터럽트 플로우챠트.3 is an interrupt flowchart for explaining the method of the present invention.

제 4 도는 본 발명 방법을 설명하기 위한 타이머 인터럽트 플로우챠트.4 is a timer interrupt flowchart for explaining the method of the present invention.

제 5 도는 종래 주파수 측정장치 실시예 1의 블록구성도.5 is a block diagram of a conventional frequency measuring apparatus of Embodiment 1.

제 6 도는 종래 주파수 측정장치 실시예 2의 블록구성도.6 is a block diagram of a second embodiment of a conventional frequency measuring device.

제 7 도는 (a) 내지 (d)는 종래 실시예 1의 신호 타이밍도.7 (a) to (d) are signal timing diagrams of the first embodiment.

제 8 도는 (a) 내지 (d)는 종래 실시예 2의 신호 타이밍도.8 (a) to (d) are signal timing diagrams of the second embodiment.

제 9 도는 종래 실시예 1 및 실시예 2의 에러율을 나타낸 그래프.9 is a graph showing the error rate of the conventional Example 1 and Example 2.

* 도면의 주요부분에 대한 부호의 설명* Explanation of symbols for main parts of the drawings

1 : 마이컴 2, 3 : 낸드게이트1: Micom 2, 3: NAND Gate

4 : 타이밍 처리부 5 : 카운터4: timing processing unit 5: counter

6 : 병렬/직렬래치 1 : 카운터/래치부6: parallel / serial latch 1: counter / latch

본 발명은 마이컴의 직렬포트를 이용한 주파수 측정장치 및 방법에 관한 것으로 특히, 마이컴의 직렬포트를 이용하여 샘플링 펄스를 제공하거나 또는 샘플링 타임을 제공하여 광대역에 걸친 주파수를 카운트할 수 있도록 한 것이다. 종래의 주파수 측정장치는 제 5 도 및 제 6 도에 도시된 바와 같이 두가지 경우로 구분할 수 있다.The present invention relates to a frequency measuring apparatus and method using the serial port of the microcomputer, in particular, to provide a sampling pulse or a sampling time by using the serial port of the microcomputer to count the frequency over the broadband. Conventional frequency measuring apparatus can be divided into two cases as shown in FIG. 5 and FIG.

먼저, 종래 장치의 실시예 1로 제 5 도에 도시된 주파수 측정장치의 동작을 제 7 도의 (a) 내지 (d)를 참조하여 살펴보면, 기준클록 발생기(101)의 출력이 카운터(102)의 클록으로 공급되며 주파수를 측정할 신호가 입력단(IN)을 통해 타이밍 발생기(103)에 입력됨에 따라 타이밍 발생기(103)의 출력해서 카운터(102)의 클리어신호(CLEAR) 및 배치(104)의 래치신호(LATCH)가 각각 출력된다.First, the operation of the frequency measuring apparatus shown in FIG. 5 according to the first embodiment of the conventional apparatus will be described with reference to FIGS. 7A through 7D, and the output of the reference clock generator 101 is As the signal to be supplied to the clock and to measure the frequency is input to the timing generator 103 through the input terminal IN, the timing generator 103 is outputted so that the clear signal CLEAR of the counter 102 and the latch of the arrangement 104 can be obtained. The signals LATCH are respectively output.

래치신호가 래치(104)에 공급되어 카운터(102)의 출력값이 래치된 이후에 카운터(102)에 클리어신호가 공급되어 카운터(102)가 클리어되는 타이밍 되면 래치된 값이 출력단(OUT)을 통해 프로세서에 공급된다. 프로세서는 이 주파수 측정데이타를 근거로 주파수를 환산하는 연산을 수행하는데 이 경우에 수행되는 연산은 기준클록 주파수를 fs, 입력신호의 주파수를 fi라고 하면 가우스기호 : [ ]를 써서 fs÷fi⇒[fs/fi]=N이 되며 fi에 대한 데이타는 N 또는 N-1의 카운터값이 되고 해상도는 fs가 커질수록 또한 종래 장치의 실시예 2로 제 6 도에 도시된 주파수 측정장치의 동작을 제 8 도의 (a) 내지 (d)를 참조하여 살펴보면, 기준클록발생기(105)에서 출력된 기준클록의 샘플링기간(Ts)동안 주파수를 측정할 입력신호가 앤드게이트(106)를 통해 카운터(107)에 공급되어 카운트되고 이후에 타이밍 발생기(108)에서 래치(109)에 래치신호를 공급하여 카운트값을 래치시키며 이어서 클리어신호를 카운터(107)에 공급하여 카운터(107)를 클리어시키고 래치된 값을 주파수 측정 데이타로 프로세서가 주파수를 환산하는 연산을 수행한다.After the latch signal is supplied to the latch 104 and the output value of the counter 102 is latched, when the clear signal is supplied to the counter 102 and the counter 102 is cleared, the latched value is transmitted through the output terminal OUT. Supplied to the processor. The processor converts the frequency based on the frequency measurement data. In this case, if the reference clock frequency is fs and the input signal is fi, the Gaussian symbol is used to write fs ÷ fi⇒ [ fs / fi] = N and the data for fi becomes a counter value of N or N-1 and the resolution becomes larger as fs increases the operation of the frequency measuring apparatus shown in FIG. Referring to (a) to (d) of FIG. 8, an input signal for measuring a frequency during the sampling period Ts of the reference clock output from the reference clock generator 105 is inputted through the counter gate 107. The timing generator 108 supplies a latch signal to the latch 109 to latch the count value, and then supplies a clear signal to the counter 107 to clear the counter 107 and reset the latched value. Frequency measurement data The processor performs the operation for converting the frequency.

이 경우에 수행되는 연산은 입력신호의 주파수를 fi'라고 하면 가우스신호 : [ ]를 써서 Ts/fi'(-1)=Ts×fi'⇒[Ts]=N이며 fi'에 대한 데이타는 N 또는 N-1의 카운터값이 되고 해상도는 Ts가 클수록 커진다. 상기 실시예 1, 2의 주파수에 대한 에러율의 관계는 제 9 도에서와 같이, 실시예 1인 경우는 저주파 대역에서 양호한 에러율을 나타내고 실시예 2의 경우는 고주파 대역에서 양호한 에러율을 나타내므로 각각 저주파 카운터 또는 고주파 카운터라고 할 수 있다.In this case, if the frequency of the input signal is fi ', the Gaussian signal: [] is used to write Ts / fi' (-1) = Ts × fi'⇒ [Ts] = N and the data for fi 'is N. Alternatively, the counter value becomes N-1, and the resolution becomes larger as Ts increases. The relationship between the error rates with respect to the frequencies of the first and second embodiments is as shown in FIG. 9, in the case of the first embodiment, a good error rate is shown in the low frequency band, and in the second embodiment, the error rate is good in the high frequency band. It can be called a counter or a high frequency counter.

그러나, 이와같은 종래 장치는 프로세서가 명령 싸이클 수행의 지연시간이 필요하여 고주파 처리가 프로그램적으로는 부적합하기 때문에 프로세서는 주파수 측정데이타만을 제공받아 처리하여 표시하는 용도에 국한되므로 주파수 측정부분의 하드웨어적인 부담이 커져서 그 구성이 복잡해지는 문제점이 있고, 하드웨어 타이밍 및 기준클록 발생등을 프로세서가 담당할 경우 지연시간(제 7b, c 도 및 제 8c, d 도 참조)이 증가되어 에러율이 증가되므로 주파수 정밀도와 신뢰도가 저하되는 문제점이 있었다.However, such a conventional apparatus requires a processor to delay the execution of an instruction cycle, so that the high frequency processing is not suitable programmatically, and thus the processor is limited to the purpose of receiving and displaying only frequency measurement data. There is a problem that the configuration becomes complicated due to a large burden, and when the processor is responsible for hardware timing and reference clock generation, the delay time (see FIGS. 7b, c and 8c, d) is increased and the error rate is increased, thereby increasing frequency accuracy. And there was a problem that the reliability is lowered.

또한 이 경우에 프로세서 자체의 프로그램 수행과 상기 타이밍 및 클록발생을 병행하게되어 그 이전의 명령 싸이클의 크기에 따라 에러율이 랜덤하게 발생되므로 주파수 측정의 신회도 저하가 더욱 가중되는 문제점이 있었다. 본 발명은 이와같은 종래의 문제점을 해결하기 위하여 주파수 측정 장치의 하드웨어를 기준의 마이컴에 구분되는 직렬포트를 이용하여 대폭 간소화시키고 소프트웨어적인 기능을 강화하여 고속의 명령사이클 마이컴을 채용한 경우 정밀도를 안정되게 확보할 수 있고 광대역에 걸쳐 신뢰성 있는 주파수 측정이 가능하도록한 마이컴의 직렬포트를 이용한 주파수 측정장치 및 방법을 제공하는데 그 목적이 있는 것으로, 첨부된 도면에 의하여 본 발명을 상세히 설명하면 다음과 같다.In addition, in this case, the program execution of the processor itself is performed in parallel with the timing and clock generation, and the error rate is randomly generated according to the size of the previous instruction cycle. In order to solve the conventional problems, the present invention greatly simplifies the hardware of the frequency measuring device by using a serial port that is divided into a reference microcomputer, and enhances the software function to stabilize the accuracy when employing a high speed command cycle microcomputer. It is an object of the present invention to provide a frequency measuring apparatus and method using a serial port of the microcomputer that can ensure a reliable frequency measurement over a wide band, the present invention will be described in detail by the accompanying drawings as follows. .

본 발명 주파수 측정장치는 제 1 도에 도시된 바와 같이, 직렬포트를 통해 샘플링 펄스 또는 샘플링 기간을 제공하여 고역 및 저역 입력신호(Fh, Fl)의 주파수를 측정하는 마이컴(1) 및 이 마이컴(1)의 제어를 받아 입력신호((Fh, Fl)의 게이트 동작을 수행하는 낸드게이트(2, 3)로 이루어진 타이밍처리부(4)와, 상기 마이컴(1)의 제어를 받아 입력신호(Fh, Fl)의 주파수를 카운트하는 카운터(5) 및 이 카운터(5)의 출력값을 병렬-직렬로 타이밍(1)에 전송하는 명령/직렬 래치(6)로 이루어진 카운터/래치부(7)를 구비하여 구성된 것이다.The frequency measuring device of the present invention, as shown in FIG. 1, provides a sampling pulse or a sampling period through the serial port to measure the frequency of the high and low frequency input signals Fh and Fl, and the microcomputer 1 1) a timing processor 4 comprising NAND gates 2 and 3 for performing the gate operation of the input signals (Fh, Fl) under the control of 1), and an input signal Fh, under the control of the microcomputer 1; A counter / latch portion 7 comprising a counter 5 for counting the frequency of Fl and a command / serial latch 6 for transmitting the output value of the counter 5 to the timing 1 in parallel-serial; It is composed.

이와같이 구성된 본 발명 장치의 작용효과는 제 1 도 및 제 2 도의 (a) 내지 (h)에서와 같이 주파수를 측정할 입력신호(Fh, Fl)에 대하여 고역주파수 입력신호(Fh)와 저역 주파수 입력신호(Fl)의 카운트를 동시에 수행한다. 먼저, 저역주파수 입력신호(Fl)에 대한 주파수 측정의 경우부터 설명하면, 입력신호(Fl)가 마이컴(1)의 인터럽트단에 입력됨에 따라 주파수 측정이 이루어지는 것으로 이 경우에는 제 2a 도에서와 같이 캐리(CA)=0인 구간동안 수행된다.The operation and effect of the apparatus of the present invention configured as described above is a high frequency input signal Fh and a low frequency input with respect to the input signals Fh and Fl to measure the frequency as shown in FIGS. 1 and 2 (a) to (h). The count of the signal Fl is performed simultaneously. First, the frequency measurement of the low frequency input signal Fl will be described. The input signal Fl is an interrupt terminal of the microcomputer 1. In this case, the frequency measurement is performed as described above. In this case, as shown in FIG.

CA=0인 구간에서는 입력신호(Fl)의 다운 엣지 트리거에 따라 마이컴(1)의 저역선택신호(LSEL)가 하이가 되고 다음 다운 엣지에서 마이컴(1)의 저역 선택신호(LSEL)가 로우가 된다. (제 2e 도참조)In the section where CA = 0, the low-frequency selection signal LSEL of the microcomputer 1 becomes high according to the down edge trigger of the input signal Fl, and the low-frequency selection signal LSEL of the microcomputer 1 goes low at the next down edge. do. (See also section 2e.)

저역선택신호(LSEL)가 하이인 기간동안 마이컴(1)에서 출력되는 직렬 샘플링클록이 낸드게이트 (2)를 통해 카운터(5)에 입력되어 카운트되며 이 카운트값은 입력신호(Fl)의 1주기 동안 통과하는 직렬 샘플링클록수가 된다.Serial sampling clock output from microcomputer 1 during low frequency selection signal LSEL This NAND gate is input to the counter 5 through the NAND gate 2 and counted, and the count value is a serial sampling clock which passes for one period of the input signal Fl. It becomes a number.

이때 입력신호(Fl)의 주파수를 Fl, 직렬 샘플링클록의 주파수를 fs(=샘플링 주파수)라고 하면, [fs÷fl]=N이며 카운트수는 N 또는 N-1이 된다.At this time, the frequency of the input signal Fl is Fl and the serial sampling clock If the frequency of fs (= sampling frequency) is [fs ÷ fl] = N, the count number is N or N-1.

단, 이 경우에 다음 조건이 선행되어야 한다.In this case, however, the following conditions must be preceded.

즉, 마이컴(1)을 통해 인터럽트시 저역선택신호(LSEL)가 액티브 하이가 되는 시각과 로우가 되는 시각의 명령수행시간(Tm)이 1/fs보다 작아야 되며 Tm〈1/fs이면 저역 주파수 카운트시 에러발생이 감소되고 이는 카운트수가 N 또는 N-1이 무난하게 이루어짐을 의미한다.That is, the instruction execution time (Tm) of the time when the low frequency selection signal LSEL becomes active high and the time low when interrupting through the microcomputer 1 should be less than 1 / fs, and if Tm <1 / fs, the low frequency count The error occurrence is reduced in time, which means that the number of counts is N or N-1.

이와같이 Tm〈1/fs이 되도록 구현하는 것은 예를 들어 fl=100Hz까지 정밀도 1Hz로 카운트하려면 카운트는 0.5Hz단위로 해야되므로 [fs÷fl]=N, 즉 [fs÷99.5]-[fs÷100]≥2이면 가능하고 fs/99.5-fs/100≥2로 계산한다면 fs≥39.8KHz, 1/fs=25.1μsec가 되므로 Tm〈25.1μsec가 된다.Implementing Tm <1 / fs like this requires that the count must be in units of 0.5 Hz in order to count at 1 Hz with precision up to fl = 100 Hz. ] 2 is possible, and fs / 99.5-fs / 100≥2 yields Tm <25.1μsec since fs≥39.8KHz and 1 / fs = 25.1μsec.

그 이유는 일반적으로 마이컴(1)의 Tm이 수백 nsec에서 수μsec에 이르므로 Tm이 25.1μsec보다 충분하게 작은값을 가지게되어 카운트수에 영향을 미치지 않게 되며 이와같이 마이컴(1)의 직렬포트를 이용하면 저역 주파수의 경우 정확한 샘플링 주파수(fs)를 직렬 샘플링클록으로 출력할 수 있다. 저역 주파수 카운트의 경우에는 fl이 낮을수록, fs가 클수록 정밀도가 커진다.The reason for this is that since the Tm of the microcomputer 1 generally reaches several hundred nsec to several microseconds, the Tm has a value sufficiently smaller than 25.1 microseconds so that it does not affect the number of counts. For low frequencies, set the correct sampling frequency (fs) You can output In the case of the low frequency count, the lower the fl and the larger the fs, the greater the precision.

한편, 고역 주파수의 입력신호(Fh)에 대한 주파수 측정의 경우에는 마이컴(1)에서 제 2c 도에서와 같이 고역선택신호(HSEL)을 샘플링시간(Ts)동안 출력하여 이 시간동안에 낸드게이트(3)를 통해 카운터(5)에 입력되는 입력신호(Fh)의 주파수를 카운트함에 따라 주파수 측정이 이루어지는 것으로 이 경우에는 제 2a 도에서와 같이 CA=1인 구간동안 수행된다. CA=1인 구간에서 고역선택신호(HSEL)가 샘플링 시간(Ts)동안 하이가 되면 이 기간동안 카운터(5)로 카운트된 갑이 마이컴(1)에서 공급되는 로드신호(LD)에 의하여 병렬/직렬 래치(6)에 로드되고(제 2f 도참조)이어서 제 2g 도에서와 같이 클록(CK)에 의하여 병렬/직렬 래치(6)의 데이타가 마이컴(1)의 데이타 입력단(IN)에 입력되므로써 입력신호(Fh)의 주파수(fh)가 측정되며 제 2h 도에서와 같이 마이컴(1)에서 카운터(5)에 클리어 신호가 공급되어 카운터(5)를 클리어시켜서 다음 동작에 대비하게 된다.(카운터 초기화) 고역주파수 입력신호(Fh)의 주파수 측정시에도 마이컴(1)의 직렬포트를 이용하므로써 정확한 샘플링시간(Ts)을 출력할 수 있게 되므로 고역 주파수(fh)의 측정에 정확을 기할 수 있다.On the other hand, in the case of frequency measurement on the input signal Fh of the high frequency, the microcomputer 1 outputs the high frequency selection signal HSEL for the sampling time Ts as shown in FIG. 2C, and the NAND gate 3 during this time. The frequency measurement is performed by counting the frequency of the input signal Fh input to the counter 5 through). In this case, as shown in FIG. When the high frequency selection signal HSEL becomes high during the sampling time Ts in the section where CA = 1, the count counted by the counter 5 during this period is parallel / loaded by the load signal LD supplied from the microcomputer 1. The data of the parallel / serial latch 6 is input to the data input terminal IN of the microcomputer 1 by being loaded into the serial latch 6 (see also FIG. 2F), and as shown in FIG. 2G, by the clock CK. The frequency fh of the input signal Fh is measured and a clear signal is supplied from the microcomputer 1 to the counter 5 as shown in FIG. 2h to clear the counter 5 to prepare for the next operation. Initialization) Even when measuring the frequency of the high frequency input signal Fh, the accurate sampling time Ts can be output by using the serial port of the microcomputer 1, thereby making it possible to accurately measure the high frequency frequency fh.

이와같이 정확한 샘플링시간(Ts)을 출력할 수 있는 것은 제 2d 도에서와 같이 마이컴(1)에서 직렬샘플링클록을 전송하라는 명령(제 3 도의 '전송시작'단계)이후 실제로 직렬 샘플링클록전송이 실행되는 시간(ta)의 시프트 정도에 따라 고역선택신호(HSEL)의 시작시각(tp)만이 달라질뿐 샘플링시간(Ts)은 변함이 없으므로 결과적으로 마이컴(1)의 명령에는 영향이 없게 된다.The accurate sampling time Ts can be output in this manner as shown in FIG. 2D. The serial sampling clock after the command to transmit Only the start time tp of the high-frequency selection signal HSEL varies according to the shifting time ta of the transmission, but the sampling time Ts does not change. As a result, the instruction of the microcomputer 1 has no effect. .

따라서 이 경우의 시간지연은 게이트의 지연 요소뿐이므로 이 지연시간은 입력신호(Fh)의 주파수(fh)에 대하여 충분히 작기 때문에 에러에 영향을 미치지 않게 되면 이와같은 고역 주파수 측정시에는 fh가 높을수록, Ts가 클수록 정밀도가 커진다.Therefore, since the time delay in this case is only the delay factor of the gate, the delay time is sufficiently small with respect to the frequency fh of the input signal Fh, so that if the error is not affected, the higher the fh for such high frequency measurement The larger the Ts, the greater the precision.

한편, 본 발명 주파수측정장치에 의하여 수행되는 본 발명 방법은 제 3 도에서와 같이, 캐리(CA)를 검색하여 CA=1이면 고역 주파수 측정을 위한 샘플링시간(Ts)을 마이컴(1)의 직렬포트에서 고역선택신호(HSEL)로 출력하고 이어서 샘플링시간(Ts)동아 카운터(5)로 카운트된 값을 병렬/직렬 래치(6)를 통해 전송받아 주파수를 측정하는 과정과, 상기 캐리 검색 단계에서 CA=0이면 저역 주파수 측정을 위한 저역선택신호(LSEL)를 저역주파수 입력신호(Fl)의 1주기동안 출력하여 그 기간동안 카운터(5)로 카운드된 직렬 샘플링 클록의 샘플링 주파수(fs)를 병렬/직렬 래치(6)를 통해 전송받아 주파수를 측정하는 과정으로 이루어진 것이다.Meanwhile, in the method of the present invention performed by the frequency measuring device of the present invention, as shown in FIG. 3, when the carry CA is searched and CA = 1, the sampling time Ts for the high frequency measurement is serialized in the microcomputer 1; In the process of outputting the high frequency selection signal (HSEL) from the port and then receiving the value counted by the sampling time (Ts) and the counter (5) through the parallel / serial latch (6) and measuring the frequency, in the carry search step If CA = 0, the low frequency selection signal LSEL for low frequency measurement is output for one period of the low frequency input signal Fl, and the serial sampling clock counted to the counter 5 during that period. The sampling frequency fs is transmitted through the parallel / serial latch 6 to measure the frequency.

이와같이 이루어진 본 발명 방법의 작용효과를 제 1 도 및 제 2 도의 (a) 내지 (e)를 참조하여 설명하면, 캐리(CA)를 검색하여 제 2a 도에서와 같이 CA=1인 구간에 인터럽트(INT)가 걸리면 CA=0으로 설정하고 이어서 저역선택신호(LESL)를 로우(논리 "0")로 출력하여 이전구간(CA=0인 구간)을 종료시킨다.The operation and effect of the method of the present invention thus constructed will be described with reference to FIGS. 1 and 2 (a) to (e). The carry CA is searched for an interrupt (CA = 1) as shown in FIG. If INT is applied, set CA = 0 and then output the low select signal LSL low (logical "0") to terminate the previous section (section CA = 0).

이후에 로드신호(LD)을 출력하여 이전 구간에서 카운터(5)로 카운트된 값을 병렬/직렬 래치(6)에 로드시킨 다음 클록(CK)을 출력하여 병렬/직렬 래치(6)의 데이타를 데이타 입력단(ON)을 통해 전송받는다.Thereafter, the load signal LD is output to load the value counted by the counter 5 in the previous section into the parallel / serial latch 6, and then the clock CK is output to output the data of the parallel / serial latch 6. It is transmitted through the data input terminal (ON).

이어서 클리어신호(CL)를 출력하여 카운터(5)를 클리어시킨후 직렬포트를 전송모드로 설정한 다음 직렬포트의 데이타를 레지스터에 로드시킨다. 이후에 타이머 동작을 시작하여 타이머시간(Ta)은 1비트 데이타의 전송에 소요되는 시간(ta)+Ts〈Ta, 즉 직렬 샘플링클록주파수의 3배보다 큰값이 되도록하여 직렬로 8비트 데이타가 출력되는 시간의 종료 이전 충분한 시간을 확보한다.After clearing the counter (5) by outputting the clear signal (CL), the serial port Set the transfer mode, then load the serial port data into a register. After that, the timer operation starts, and the timer time Ta is the time (ta) + Ts &lt; The value is greater than three times the frequency to ensure sufficient time before the end of the 8-bit data output in series.

이어서 직렬 샘플링클록의 전송속도를 결정하는데 이는 곧 샘플링시간(Ts)의 결정을 의미하여 이와 같이 전송속도가 선택되었으면 전송 명령에 의한 직렬 샘플링클록의 전송을 시작하고 리턴한다.Serial sampling clock This means the determination of the sampling time (Ts), which means that the serial sampling clock by the transfer command is selected when the transmission rate is selected. Initiates and returns a copy of the.

또한 이 경우에 타이머 인터럽트는 제 4 도에서와 같이 샘플링시간(Ts)동안 카운트된 고역 주파수 입력신호(Fh)의 카운트수를 병렬/직렬 래치(6)에 로드시키고 이어서 클록(CK)을 출력하여 데이타 입력단(IN)을 통해 데이타를 입력받은 다음 클리어신호(CL)를 출력하여 카운터(5)를 클리어시킨다.In this case, the timer interrupt loads the count of the high frequency input signal Fh counted during the sampling time Ts to the parallel / serial latch 6 and outputs the clock CK as shown in FIG. The counter 5 is cleared by receiving data through the data input terminal IN and outputting a clear signal CL.

다음 단계로 저역 주파수 입력신호(Fl)의 카운트를 위하여 직렬포트를 직렬 클록만을 출력시키는 모드로 전환시키고 이어서 직렬 샘플링클록의 주파수를 샘플링 주파수(fs)로 선택한 다음 클록 출력을 시작하고 리턴한다. 리턴시 제 3 도의 캐리 검색단계로 복귀하며 이 경우에는 CA=0이므로 저역 선택신호(LSEL)을 하이로 출력시켜 직렬 샘플링클록이 카운터(5)에 공급되도록 하고 다음 단계의 수행을 위하여 CA=1로 설정한후 리턴한다. 이상에서 설명한 바와 같이 본 발명에 의하면 마이컴의 직렬포트를 이용하여 주파수 측정에 부가되는 하드웨어의 양을 줄일 수 있으므로 기기의 소형 경량화를 도모할 수 있고 고속 명령 싸이클의 마이컴을 이용할 경우 다양한 클록(주파수)을 이용하면 정밀도와 신뢰도를 향상시킬수 있으며 광대역의 주파수에 대한 측정이 가능하여 기기의 성능을 높일 수 있는 효과가 있다.The next step is to switch the serial port to a mode that only outputs a serial clock for counting the low-frequency input signal Fl, followed by a serial sampling clock. Select the frequency of as the sampling frequency (fs) and then start and return the clock output. When returning, return to the carry search step of FIG. 3, and in this case, CA = 0, so the low-pass selection signal LSEL is output high and the serial sampling clock It is supplied to this counter 5, and it returns after setting CA = 1 to perform the next step. As described above, according to the present invention, since the amount of hardware added to the frequency measurement can be reduced by using the serial port of the microcomputer, it is possible to reduce the size and weight of the device. When using the microcomputer of the high speed command cycle, various clocks ( Frequency) can improve the accuracy and reliability, and can measure the frequency of broadband to increase the performance of the device.

Claims (2)

직렬포트를 통해 샘플링 펄스 또는 샘플링 기간을 제공하여 고역 및 저역 입력신호(Fh, Fl)의 주파수를 측정하는 마이컴(1) 및 이 마이컴(1)의 제어를 받아 입력신호(Fh, Fl)의 주파수를 처리 수행하는 타이밍처리부(4)와, 상기 마이컴(1)의 제어를 받아 입력신호(Fh, Fl)의 주파수를 카운트하는 카운터(5) 및 이 카운터(5)의 출력값을 병렬/직렬로 마이컴(1)에 전송하는 병렬/직렬 래치(6)로 이루어진 카운터/래치부(7)를 구비하여 구성된 마이컴의 직렬포트를 이용한 주파수 측정장치.The microcomputer 1 measures the frequency of the high and low frequency input signals Fh and Fl by providing a sampling pulse or sampling period through the serial port and the frequency of the input signals Fh and Fl under the control of the microcomputer 1. A timing processor (4) which performs the processing, a counter (5) which counts the frequencies of the input signals (Fh, Fl) under the control of the microcomputer (1), and the output value of the counter (5) (1) A frequency measuring device using a serial port of a microcomputer provided with a counter / latch portion (7) composed of parallel / serial latches (6). 캐리(CA)를 검색하여 CA=1이면 고역 주파수 측정을 위한 샘플링시간(Ts)을 마이컴(1)의 직렬포트에서 고역선택신호(HSEL)로 출력하고 이어서 샘플링시간(Ts)동안 카운터(5)로 카운트된 값을 병렬/직렬 래치(6)를 통해 전송받아 주파수를 측정하는 과정과, 상기 검색 단계에서 CA=0이면 저역 주파수 측정을 위한 저역선택신호(LSEL)를 저역 주파수 입력신호(Fl)의 1주기동안 출력하여 그 기간동안 카운터(5)로 카운트된 직렬 샘플링클록샘플링 주파수(fs)를 병렬/직렬 래치(6)를 통해 전송받아 주파수를 측정하는 과정으로 이루어진 마이컴의 직렬포트를 이용한 주파수 측정방법.If the CA is searched for CA = 1, the sampling time Ts for the high frequency measurement is output from the serial port of the microcomputer 1 to the high frequency selection signal HSEL, and then the counter 5 is applied for the sampling time Ts. Receiving the value counted by the parallel / serial latch 6 and measuring the frequency; if CA = 0 in the search step, the low-frequency selection signal LSEL for low-frequency measurement and the low-frequency input signal Fl Serial sampling clock counted by counter (5) during one period of output Frequency measurement method using the serial port of the microcomputer consisting of a process of measuring the frequency received by the sampling frequency (fs) via the parallel / serial latch (6).
KR1019910011337A 1991-07-04 1991-07-04 Frequency detecting apparatus and method using directport of microcomputer KR940009815B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019910011337A KR940009815B1 (en) 1991-07-04 1991-07-04 Frequency detecting apparatus and method using directport of microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019910011337A KR940009815B1 (en) 1991-07-04 1991-07-04 Frequency detecting apparatus and method using directport of microcomputer

Publications (2)

Publication Number Publication Date
KR930002830A KR930002830A (en) 1993-02-23
KR940009815B1 true KR940009815B1 (en) 1994-10-17

Family

ID=19316767

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019910011337A KR940009815B1 (en) 1991-07-04 1991-07-04 Frequency detecting apparatus and method using directport of microcomputer

Country Status (1)

Country Link
KR (1) KR940009815B1 (en)

Also Published As

Publication number Publication date
KR930002830A (en) 1993-02-23

Similar Documents

Publication Publication Date Title
US5684760A (en) Circuit arrangement for measuring a time interval
JP2819007B2 (en) Logic analyzer
US5122694A (en) Method and electrical circuit for eliminating time jitter caused by metastable conditions in asynchronous logic circuits
EP2026469A1 (en) Circuit device and method of measuring clock jitter
JP2007519005A (en) Method and apparatus for measuring jitter
JPH0129093B2 (en)
JP2001352350A (en) Measurement system and method by statistic eye-diagram of continuous bit stream
EP0133735A2 (en) N-bit counter apparatus
US5097490A (en) Apparatus and method for improving the resolution with which a test signal is counted
US4160154A (en) High speed multiple event timer
US8334716B1 (en) Digital phase detection circuit and method
KR940009815B1 (en) Frequency detecting apparatus and method using directport of microcomputer
US5388225A (en) Time-domain boundary bridge method and apparatus for asynchronous sequential machines
JP2702773B2 (en) Data monitoring device
JP2572734B2 (en) Display circuit for serial data
US6072338A (en) Method of and device for determining pulse width
US4999573A (en) Method and apparatus for measurement gate display
JP2559237Y2 (en) Serial data sampling signal generator
JPS5933079Y2 (en) Data event measurement device
SU1631547A1 (en) Device providing interface between computer and external device
US5511047A (en) High resolution timer using low resolution counter
SU1365087A2 (en) Device for checking logic circuits
KR100206906B1 (en) Timer/counter circuit
KR100393421B1 (en) Counter System for Synchronous AF Converter
SU1481768A1 (en) Signature analyser

Legal Events

Date Code Title Description
A201 Request for examination
G160 Decision to publish patent application
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
LAPS Lapse due to unpaid annual fee