JP3399450B2 - Frequency detection method and frequency detection circuit - Google Patents

Frequency detection method and frequency detection circuit

Info

Publication number
JP3399450B2
JP3399450B2 JP2000215516A JP2000215516A JP3399450B2 JP 3399450 B2 JP3399450 B2 JP 3399450B2 JP 2000215516 A JP2000215516 A JP 2000215516A JP 2000215516 A JP2000215516 A JP 2000215516A JP 3399450 B2 JP3399450 B2 JP 3399450B2
Authority
JP
Japan
Prior art keywords
counter
input
value
frequency
interrupt
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
JP2000215516A
Other languages
Japanese (ja)
Other versions
JP2002031654A (en
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.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2000215516A priority Critical patent/JP3399450B2/en
Publication of JP2002031654A publication Critical patent/JP2002031654A/en
Application granted granted Critical
Publication of JP3399450B2 publication Critical patent/JP3399450B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Measuring Frequencies, Analyzing Spectra (AREA)
  • Synchronizing For Television (AREA)

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、たとえばマルチス
キャンモニターや液晶ディスプレイモニターのマイクロ
コンピュータのソフトウエアに好適な同期信号周波数の
検出方法に関する。また、例えばマルチスキャンモニタ
ーや液晶ディスプレイモニターのマイクロコンピュータ
のソフトウエアに好適なリモコンパルス周期の検出方法
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a synchronizing signal frequency detecting method suitable for software of a microcomputer such as a multi-scan monitor or a liquid crystal display monitor. The present invention also relates to a remote control pulse period detection method suitable for software of a microcomputer such as a multi-scan monitor or a liquid crystal display monitor.

【0002】[0002]

【従来の技術】マルチスキャンディスプレイに接続され
る各種タイプのコンピュータ機器ではディスプレイに出
力される映像信号の水平同期信号および垂直同期信号の
周波数が異なっていることが多い。
2. Description of the Related Art In various types of computer equipment connected to a multi-scan display, the frequencies of the horizontal synchronizing signal and the vertical synchronizing signal of the video signal output to the display are often different.

【0003】したがって、マルチスキャンディスプレイ
においてはそれに接続されるコンピュータ機器からのデ
ータを表示するために、水平同期信号および垂直同期信
号それぞれの周波数を高精度に検出するとともに、検出
した水平と垂直同期信号それぞれの周波数に追従して表
示デバイスであるディスプレイがたとえば陰極線管(以
下、CRTと記す)であれば水平と垂直の偏向回路、た
とえば液晶であれば駆動回路を制御する必要がある。
Therefore, in the multi-scan display, in order to display the data from the computer device connected thereto, the frequencies of the horizontal synchronizing signal and the vertical synchronizing signal are detected with high accuracy, and the detected horizontal and vertical synchronizing signals are detected. If the display, which is a display device, follows each frequency, for example, if it is a cathode ray tube (hereinafter referred to as CRT), it is necessary to control horizontal and vertical deflection circuits, for example, if it is a liquid crystal, it is necessary to control a drive circuit.

【0004】また、近年は組み込み機器用マイクロコン
ピュータを搭載しているディスプレイが多く、同期信号
周波数の検出もコストダウンの効果兼ねてマイクロコ
ンピュータ内蔵のカウンタを用いて行っているのが通常
である。これらのマイクロコンピュータには、基準とな
るクロック信号をカウントするカウンタと、そのカウン
タの値をラッチするレジスタを内蔵しており、入力信号
の立ち上がり、ないしは立ち下がりに同期して、そのカ
ウンタの値を内蔵のレジスタにラッチする機能が組み込
まれている。このラッチ機能は一般的にインプットキャ
プチャと呼ばれている。信号周波数の検出方法として
は、図4に示すように例えば信号の立ち上がりエッジで
カウンタ値をキャプチャした値をA、次の立ち上がりエ
ッジでキャプチャした値をBとすると、信号周期は式B
−Aで求まる。このようにして求めた周期から周波数が
検出できる。
Moreover, is usual that are performed using the detected counter of the microcomputer built doubles the effect of the cost of the display is large and the synchronization signal frequency in recent years that a microcomputer for an embedded device . These microcomputers have a built-in counter that counts a reference clock signal and a register that latches the value of the counter, and synchronizes the value of the counter with the rising or falling of the input signal. The function to latch in the built-in register is built in. This latch function is generally called input capture. As a method of detecting the signal frequency, for example, assuming that a value obtained by capturing the counter value at the rising edge of the signal is A and a value captured at the next rising edge is B as shown in FIG.
-Determined by A. The frequency can be detected from the cycle thus obtained.

【0005】一方、コンピュータディスプレイにおいて
は入力される同期信号の周波数が増大し、UXGAと呼
ばれる高解像度ディスプレイの規格においては、水平1
10kHz以上、垂直90Hz以上の同期周波数を検出
できなければならない。さらに、下限は、VESA(Vi
deo Electronics Standards Association:パソコン向
けグラフィックス機器メーカーの業界団体)のDPMS
(Display Power Management Signaling:ディスプレイ
の電源管理に関する規格)で10Hz以下を無信号と規
定しているため、10Hz以下まで検出が可能でなけれ
ばならない。
On the other hand, in a computer display, the frequency of an input synchronizing signal increases, and in the standard of high resolution display called UXGA, horizontal 1
It must be possible to detect sync frequencies of 10 kHz or more and 90 Hz or more in the vertical direction. Furthermore, the lower limit is VESA (Vi
deo Electronics Standards Association: an industry group of graphics device manufacturers for personal computers) DPMS
(Display Power Management Signaling: a standard related to display power management) specifies that 10 Hz or less is a non-signal, so it must be able to detect up to 10 Hz or less.

【0006】さらに、近年普及してきた液晶ディスプレ
イでマルチスキャンを行おうとすれば解像度変換に高精
度な入力信号周波数(周期)の情報が必要となる。この
ように、高精度な入力信号周波数の検出と広範囲な入力
信号の検出をマイクロコンピュータのソフトウエアを用
いて実現した例としてたとえば特開2000−1313
55号公報に記載された周波数検出方法が知られてい
る。
Further, in order to perform multi-scan on a liquid crystal display which has become widespread in recent years, highly accurate input signal frequency (cycle) information is required for resolution conversion. Thus, as an example in which high-precision input signal frequency detection and wide-range input signal detection are realized using software of a microcomputer, for example, Japanese Patent Laid-Open No. 2000-1313.
The frequency detection method described in Japanese Patent No. 55 is known.

【0007】この例では、広範囲で高精度な周波数の検
出を行うためにカウンタのビット拡張をオーバーフロー
割り込みを用いてソフトウエア的に行っている。その
際、CPUにおける信号入力時の割り込み(インプットキ
ャプチャー割り込み)処理とオーバーフロー時の割り込
み処理の順序が、割り込み処理の優先順位により逆転す
る場合があるため、そのための対策について提案されて
いる。以下にその説明を行う。
In this example, in order to detect the frequency in a wide range and with high accuracy, the bit extension of the counter is performed by software using an overflow interrupt. At that time, the order of interrupt processing at the time of signal input (input capture interrupt) and overflow interrupt processing in the CPU may be reversed depending on the priority order of the interrupt processing. Therefore, measures for that are proposed. The description will be given below.

【0008】図5は2つの割り込み処理(入力割り込み
処理、オーバーフロー割り込み)の発生順序と、その処
理順序が入れ替わる様子を示したタイミング図である。
カウンタが16ビットであると仮定すれば、通常、カウ
ンタ値が「FFFFh」から「0000h」になる際、
オーバーフロー割り込みが生じる。オーバーフロー割り
込み処理によりメモリのソフトカウンタをインクリメン
トし、例えば「A」から「A+1」とする。
FIG. 5 is a timing chart showing the order of occurrence of two interrupt processes (input interrupt process and overflow interrupt) and the order in which the processes are interchanged.
Assuming that the counter is 16 bits, normally, when the counter value changes from "FFFFh" to "0000h",
Overflow interrupt occurs. By the overflow interrupt process, the soft counter of the memory is incremented, for example, from "A" to "A + 1".

【0009】しかし、オーバーフロー割り込み処理を行
う遅延時間内に、同期信号などの入力信号8の立下りエ
ッジが来た場合、その入力を受け、入力割り込み処理を
先に処理することがある。この場合、オーバーフロー割
り込み処理によりソフトウエアカウンタが本来であれば
インクリメントされて「A+1」となっているべきとこ
ろをその前に割り込み処理されるため、ソフトウェアカ
ウンタの値をインクリメント前の「A」として処理され
てしまう。
However, when the falling edge of the input signal 8 such as the synchronizing signal arrives within the delay time for performing the overflow interrupt processing, the input may be received and the input interrupt processing may be processed first. In this case, since the software counter is originally incremented to "A + 1" by the overflow interrupt process, the interrupt process is performed before that. Therefore, the value of the software counter is processed as "A" before the increment. Will be done.

【0010】図6はその不具合に対して解決方法を示し
たフローチャートである。図6(a)はカウンタ3がオ
ーバーフローするときに発生するオーバーフロー割り込
みの処理を示したものである。図6(a)のフローチャ
ートにおいて、ステップ31は同期信号割り込み要求が
あるかないかを調べその結果で分岐を行うステップであ
る。ステップ32はメモリー上に領域を確保した衝突フ
ラグをセットする処理である。オーバーフロー割り込み
処理中に入力信号割り込み処理要求があれば、オーバー
フロー割り込み処理と入力信号割り込み処理の間に衝突
が生じたとみなすことができる。
FIG. 6 is a flowchart showing a solution to the problem. FIG. 6A shows the processing of an overflow interrupt that occurs when the counter 3 overflows. In the flowchart of FIG. 6A, step 31 is a step of checking whether or not there is a synchronization signal interrupt request and branching according to the result. Step 32 is a process of setting a collision flag which secures an area on the memory. If there is an input signal interrupt processing request during the overflow interrupt processing, it can be considered that a collision has occurred between the overflow interrupt processing and the input signal interrupt processing.

【0011】一方、入力信号割り込み処理要求がなけれ
ばステップ33を行う。図6(b)は信号が入力された
ときに発生する入力信号割り込みの処理を示したもので
ある。図6(b)のフローチャートにおいて、ステップ
35は図6(a)でセットした衝突フラグを確認し、そ
の結果によって分岐を行うステップである。衝突フラグ
がセットされているときはメモリ上のソフトカウンタの
変数「A_HIGH」がインクリメントされていないの
で、本信号割り込みの処理中にてインクリメントを行
う。
On the other hand, if there is no input signal interrupt processing request, step 33 is performed. FIG. 6B shows the processing of an input signal interrupt that occurs when a signal is input. In the flowchart of FIG. 6B, step 35 is a step of confirming the collision flag set in FIG. 6A and branching according to the result. When the collision flag is set, the variable "A_HIGH" of the soft counter on the memory has not been incremented, so it is incremented during the processing of this signal interrupt.

【0012】ステップ36において衝突フラグをクリア
の後、ステップ37において入力信号を検出した時のカ
ウンタの値(以下、インプットキャプチャ値と記す)が
ある特定値「B」以下であるかを調べ、その結果で分岐
を行っている。つまり、たとえばインプットキャプチャ
が行われるカウンタ3が16ビットである場合、一例と
して特定値「B」を、カウンタ3の中間値「FFFFh
/2=7FFFh」とすれば、インプットキャプチャ値
が「7FFFh」より大きければオーバーフロー前に信
号が入力されたという判断が可能であるし、小さければ
オーバーフロー後であると判断が可能となる。
After the collision flag is cleared in step 36, it is checked whether or not the value of the counter when the input signal is detected in step 37 (hereinafter referred to as the input capture value) is less than or equal to a specific value "B". The result is branched. That is, for example, when the counter 3 that performs input capture has 16 bits, the specific value “B” is used as an example and the intermediate value “FFFFh” of the counter 3 is used.
By setting "/ 2 = 7FFFh", it is possible to determine that the signal is input before the overflow if the input capture value is larger than "7FFFh", and it is possible to determine that the signal is input after the overflow if the input capture value is smaller than "7FFFh".

【0013】したがって、ステップ37の結果が「いい
え」であれば、ステップ38を先に行ってからステップ
33を行えば良いし、「はい」であればステップ33を
先に行ってからステップ38をあとに行えば良い。
Therefore, if the result of step 37 is "no", step 38 may be performed first and then step 33, and if "yes", step 33 may be performed first and then step 38 is performed. You can do it later.

【0014】以上に説明したように、オーバーフロー割
り込み処理と入力信号割り込み処理の衝突を、オーバー
フロー割り込み処理にて検出したら衝突フラグをセット
し、入力信号割り込み処理中で衝突フラグがセットされ
ていることを確認したらインプットキャプチャ値より衝
突がオーバーフローの前か後かを判断することで、割り
込み発生順序によらない精度の高い、かつ、広範囲
波数検出装置を実現することが可能となる。
As described above, when a collision between the overflow interrupt processing and the input signal interrupt processing is detected by the overflow interrupt processing, the collision flag is set and the collision flag is set during the input signal interrupt processing. after verifying that the collision from the input capture value is determined before or after the overflow, high accuracy without depending on an interrupt occurrence order, and it is possible to achieve a wide range of peripheral <br/> wavenumber detecting device .

【0015】[0015]

【発明が解決しようとする課題】近年マルチメディア時
代を迎えコンピュータディスプレイの入力ソースがコン
ピュータ信号だけでなくAV信号等多彩な信号に対応する
ようになった。例えば、子画面機能を搭載した場合同期
信号の検出が広範囲で高精度に必要でありながら、か
つ、複数系統の検出が同時に必要となる。さらにリモコ
ン対応にすれば同時にリモコンパルスの計測も必要とな
る。
In the recent era of multimedia, the input sources of computer displays have come to support not only computer signals but also various signals such as AV signals. For example, when the child screen function is installed, it is necessary to detect the synchronization signal over a wide range with high accuracy, and at the same time, it is necessary to detect a plurality of systems. Furthermore, if the remote control is enabled, it is necessary to measure the remote control pulse at the same time.

【0016】ところが、従来の方法では、必ずインプッ
トキャプチャー入力が必要であったために、同時に度数
入力の検出をしようとしてもマイコンのインプットキャ
プチャの入力数以上の入力には単一のマイコンだけでは
対応できないという問題があった。
[0016] However, in the conventional method, be sure to Input
For door capture input was necessary, at the same time frequency
The input of the least number of inputs of the input capture of the microcomputer when attempting detection of input only a single microcomputer there is a problem that can not be handled.

【0017】また、リモコンパルス受信のように比較的
検出精度のいらない入力でもインプットキャプチャが必
要であるという問題がある。
Further, there is a problem that input capture is necessary even for an input that requires relatively low detection accuracy such as remote control pulse reception.

【0018】本発明はかかる問題点に鑑み、マイコンの
内蔵ハードウエアであるカウンタを変更する必要がな
く、低コストで広範囲の周波数検出がインプットキャプ
チャ機能がある場合は高い精度で、無い場合でも割込処
理時間のレベルの精度で可能な周波数検出方法を提供す
ることを目的とする。
In view of such a problem, the present invention does not need to change the counter, which is the built-in hardware of the microcomputer, has a high accuracy when the frequency detection of a wide range is provided at a low cost and has a high accuracy even when there is no input capture function. It is an object of the present invention to provide a frequency detection method that can be performed with the accuracy of the level of the embedded processing time.

【0019】[0019]

【課題を解決するための手段】上記課題を解決するため
に本発明の周波数検出方法は、所定の周期で動作するカ
ウンタのオーバーフロー時に発生するオーバーフロー割
り込み処理を用いて計算される前記カウンタのオーバー
フロー回数と、前記カウンタの値とを用いて被測定入力
信号の周期を検出することを特徴とする周波数検出方法
であって、前記カウンターのオーバフロー割り込み処理
とは異なる位相で発生させた割り込み処理にて計算され
る前記カウンタの第2のオーバーフロー回数と、前記オ
ーバーフロー回数とを前記被測定入力信号の入力タイミ
ングによって切り替えて前記周期を検出することを特徴
とする周波数検出方法である。
In order to solve the above-mentioned problems, the frequency detection method of the present invention is the number of overflows of the counter calculated using overflow interrupt processing which occurs when the counter operating in a predetermined cycle overflows. When, the measured input using the value of the counter
A frequency detection method characterized by detecting the period of the signal , the second overflow number of the counter calculated by the interrupt processing generated in a phase different from the overflow interrupt processing of the counter, and the The frequency detection method is characterized in that the number of overflows is switched depending on the input timing of the measured input signal to detect the period.

【0020】上記発明により、入力信号を検出した時の
インプットキャプチャ値を特に用いなくともカウンタの
ビット長の制限を受けず、また、マイコンの内蔵ハード
ウエアであるカウンタを変更する必要がなく、低コスト
で広範囲の周波数検出が可能であり、インプットキャプ
チャ値を用いれば高い精度で実現可能な周波数検出方法
を提供することが可能となる。
According to the above invention, the bit length of the counter is not limited even if the input capture value at the time of detecting the input signal is not particularly used, and the counter which is the built-in hardware of the microcomputer does not need to be changed. It is possible to detect a wide range of frequencies at a cost, and it is possible to provide a frequency detection method that can be realized with high accuracy by using an input capture value.

【0021】[0021]

【発明の実施の形態】(実施の形態1)図1は周波数検
出回路であり、本発明の周波数検出方法を実現する上で
の基本構成を示すブロック図である。図1において、1
は組み込み機器用マイクロコンピュータでありカウンタ
3を内蔵している。2は基準クロック発生器である。3
は基準クロック発生器2が出力するクロックを受け取
り、クロックをカウントするカウンタである。8は被測
定入力信号(以下、入力信号と記す)である。4は入力
信号8の任意の立下りエッジまたは立ち上がりエッジに
より、後述するCPU5に割り込み処理要求を発生し、
また、他に発生した割り込み処理要求に対し優先順位等
のスケジューリングを行い、CPU5に割り込み要求を
発生する割り込み処理受け付け手段である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS (Embodiment 1) FIG. 1 is a block diagram showing a basic structure for realizing a frequency detecting method of the present invention. In FIG. 1, 1
Is a microcomputer for built-in equipment, and has a built-in counter 3. 2 is a reference clock generator. Three
Is a counter that receives the clock output from the reference clock generator 2 and counts the clock. Reference numeral 8 is a measured input signal (hereinafter referred to as an input signal). 4 issues an interrupt processing request to the CPU 5 described later by an arbitrary falling edge or rising edge of the input signal 8,
Further, it is an interrupt processing accepting means for performing scheduling such as a priority order for other interrupt processing requests that have occurred and for generating interrupt requests to the CPU 5.

【0022】5は後述するBUS7に接続されている各
ブロックからデータやプログラムを受け取り、演算処理
を行う中央処理装置(以下、CPUと記す)である。6
はランダムアクセス可能なメモリである。7はデータや
アドレス、コントロール信号を含めたBUSである。
Reference numeral 5 denotes a central processing unit (hereinafter referred to as CPU) that receives data and programs from each block connected to a BUS 7 described later and performs arithmetic processing. 6
Is a randomly accessible memory. Reference numeral 7 is a BUS including data, addresses and control signals.

【0023】以下、本発明の第1の実施の形態について
図2、図3を用いて説明する。図2は本実施の形態にお
けるフローチャートである。図2の(a)はオーバーフ
ロー割り込み処理のフローチャート、(b)はカウンタ
の任意の値で割り込みを発生するタイマー割り込みのフ
ローチャートである。本発明の実施の形態のポイント
は、カウンタ3のオーバーフロー回数を位相の異なるソ
フトカウンタAとソフトカウンタBの2つのカウンタに
よってカウントすることである。
The first embodiment of the present invention will be described below with reference to FIGS. 2 and 3. FIG. 2 is a flowchart in this embodiment. 2A is a flowchart of overflow interrupt processing, and FIG. 2B is a flowchart of a timer interrupt for generating an interrupt with an arbitrary value of the counter. The point of the embodiment of the present invention is that the number of overflows of the counter 3 is counted by two counters, a soft counter A and a soft counter B having different phases.

【0024】図3は本実施の形態の動作を説明するため
のタイミング図である。図3においてソフトカウンタ
A,ソフトカウンタBはそれぞれマイクロコンピュータ
1のRAM上に領域を確保された変数である。上記変数
は仮に16ビットとして説明をすることにする。
FIG. 3 is a timing chart for explaining the operation of this embodiment. In FIG. 3, soft counter A and soft counter B are variables whose areas are secured in the RAM of the microcomputer 1. The above variable will be described as 16 bits.

【0025】本発明のポイントはカウンタ3のオーバー
フロー回数を位相の異なるソフトカウンタAとソフトカ
ウンタBの2つのカウンタによってカウントすることで
ある。
The point of the present invention is to count the number of overflows of the counter 3 by two counters, a soft counter A and a soft counter B having different phases.

【0026】この2つの位相のソフトカウンタを実現す
る為に図2のステップ50において、カウンタ3がオー
バーフローを生じたとき、ソフトカウンタAがカウント
アップ(インクリメント)されるようにしている。
In order to realize the two-phase soft counter, in step 50 of FIG. 2, when the counter 3 overflows, the soft counter A is incremented (incremented).

【0027】同様にカウンタ3が例えば中間値である
「7FFFh」から「8000h」になるときに、図2
(b)のタイマー割り込み処理を発生させると、ステッ
プ51において図3に示したソフトカウンタBがカウン
トアップされ、180度位相の異なる2つのソフトカウ
ンタを得ることができる。
Similarly, when the counter 3 changes from the intermediate value "7FFFh" to "8000h", for example, as shown in FIG.
When the timer interrupt process of (b) is generated, the soft counter B shown in FIG. 3 is counted up in step 51, and two soft counters having 180 ° different phases can be obtained.

【0028】一方、入力信号8が入ると入力信号割込中
では入力時点のカウンタ3の値によって2つのソフトカ
ウンタA,Bのうちどちらを用いて時間計測をおこなう
かを決定する。
On the other hand, when the input signal 8 is inputted, which of the two soft counters A and B is used to measure the time is determined by the value of the counter 3 at the time of the input during the interruption of the input signal.

【0029】図3において、カウンタ3の値が「FFF
Fh」、「0000h」付近において入力信号が入力さ
れたときは、オーバーフロー割り込み処理と入力信号割
り込み処理の順序の逆転がありうるとしてソフトカウン
タBを用いる。その場合、ソフトカウンタBの値がイン
クリメントされることがしばらくないため、入力信号割
り込み処理とカウンタ3のオーバーフロー割り込み処理
が前後した場合であってもソフトカウンタ値Bの値には
影響がないソフトカウンタBを用いるときは位相のズ
レを修正しなければならない為、カウンタ3の値が「8
000h」以上の時は値を「−1」することで対応す
る。この処理は図2(c)のステップ53、ステップ5
5に相当する。
In FIG. 3, the value of the counter 3 is "FFF.
When an input signal is input in the vicinity of "Fh" and "0000h", the soft counter B is used because the order of overflow interrupt processing and input signal interrupt processing may be reversed. In that case, since the value of the soft counter B is not incremented for a while, the value of the soft counter value B is not affected even when the input signal interrupt process and the overflow interrupt process of the counter 3 are mixed . Since the phase shift must be corrected when using the soft counter B, the value of the counter 3 is "8".
When it is 000h or more, it is handled by adding "-1" to the value. This process is performed by step 53 and step 5 in FIG.
Equivalent to 5.

【0030】また、カウンタ3の値が「7FFFh」、
「8000h」付近であればタイマー割り込み処理と入
力信号割り込み処理の順序逆転がありうるとしてソフト
カウンタAを用いる。
The value of the counter 3 is "7FFFh",
The soft counter A is used because it is possible that the order of the timer interrupt processing and the input signal interrupt processing may be reversed in the vicinity of "8000h".

【0031】上記説明で付近というあいまいな言葉を用
いたが、具体的な例としては図3のように例えばカウン
タ3の値が「C000h」から「3FFFh」までをソ
フトカウンタBを用いる区間(区間B)とし、「400
0h」から「BFFFh」までをソフトカウンタAを用
いる区間(区間A)とすればよい。このように切り替え
の区間を十分広くとれるため、正確な信号入力時点のカ
ウンタ3の値が分からなくとも周期測定が可能となる。
以上の処理は図2(c)のステップ52によって行う。
In the above description, the ambiguous word "near" is used, but as a concrete example, as shown in FIG. 3, for example, a section (section) where the value of the counter 3 is from "C000h" to "3FFFh" is the soft counter B is used. B) and select "400
The section from 0h ”to“ BFFFh ”may be the section where the soft counter A is used (section A). Since the switching section can be set sufficiently wide in this manner, the cycle can be measured even if the value of the counter 3 at the time of accurate signal input is unknown.
The above process is performed in step 52 of FIG.

【0032】以上、説明したように本実施例ではカウン
タ3の上位ビットを拡張するソフトウエアカウンタを位
相を異なる状態で2つ用意しビット拡張の為の割込と周
波数測定の為の割込の2つの割込発生順序と割込処理順
序が入れ替わる可能性のある区間をさけるように切り替
えることでカウンタのビット拡張が可能となる。
As described above, in the present embodiment, two software counters for expanding the upper bits of the counter 3 are prepared with different phases, and an interrupt for bit expansion and an interrupt for frequency measurement are provided. Bit extension of the counter is possible by switching so as to avoid a section in which the two interrupt generation orders and the interrupt processing order may be interchanged.

【0033】また、前記区間の切り替えを広い範囲にて
行えるため、インプットキャプチャによるカウンタ値の
キャプチャーを行わなくとも通常の割り込み処理による
ソフトウエアでのカウンタ値のキャプチャで済み、マイ
コンの資源を有効に使うことが可能となる。尚、本実施
例ではカウンタ値を16ビット、ソフトウエアカウンタ
A,Bをそれぞれ16ビットとしたがそれに限定されな
いことは言うまでもない。
Further, since the section can be switched over a wide range, the counter value can be captured by the software by the normal interrupt processing without the capture of the counter value by the input capture, and the resources of the microcomputer can be made effective. It can be used. Although the counter value is 16 bits and the software counters A and B are 16 bits in this embodiment, it is needless to say that they are not limited thereto.

【0034】また、本実施例ではオーバーフロー割り込
みを用いているがカウンタ3が所定の値になれば発生す
る割り込みを用いても同様の効果を得られることは言う
までもない。
Further, although the overflow interrupt is used in the present embodiment, it goes without saying that the same effect can be obtained by using the interrupt generated when the counter 3 reaches a predetermined value.

【0035】また、本実施例ではソフトカウンタBをカ
ウンタ3が「7FFFh」から「8000h」になると
きに発生させているが他の値でも良いことは言うまでも
ない。
In this embodiment, the soft counter B is generated when the counter 3 changes from "7FFFh" to "8000h", but it goes without saying that another value may be used.

【0036】また、本実施例では2つのソフトカウンタ
を切り替える区間Bを「C000h」〜「3FFF
h」、区間Aを「4000h」〜「BFFFh」として
いるが割り込み処理時間や割り込み遅延時間などを考慮
していれば他の範囲にしても良いことは言うまでもな
い。
In this embodiment, the section B for switching between the two soft counters is set to "C000h" to "3FFF."
h ”and the section A is set to“ 4000h ”to“ BFFFh ”, but it goes without saying that other ranges may be used if the interrupt processing time, interrupt delay time, etc. are taken into consideration.

【0037】[0037]

【発明の効果】本発明によれば、インプットキャプチャ
を特に用いなくともカウンタのビット長の制限を受け
ず、また、マイコンの内蔵ハードウエアであるカウンタ
を変更しなくとも低コストで広範囲の周波数検出が可能
であり、さらに、インプットキャプチャを用いれば高い
精度で実現可能な周波数検出方法を提供することが可能
となる。
According to the present invention, a wide range of frequency detection can be performed at a low cost without being restricted by the bit length of the counter without particularly using the input capture and without changing the counter which is the hardware built into the microcomputer. Further, it is possible to provide a frequency detection method that can be realized with high accuracy by using input capture.

【0038】また、リモコンパルス測定等の外部パルス
測定を通常の割り込み入力端子を用いることで同期信号
周波数の検出性能を落とさずに可能となる。
Further, by using an ordinary interrupt input terminal, external pulse measurement such as remote control pulse measurement can be performed without degrading the synchronization signal frequency detection performance.

【0039】また、前記効果を実現する為に用いる割込
の優先順位によりオーバーフローと信号入力の2つの事
象の発生順序と対応する割込処理の順序が異なっても信
号周波数の検出結果に狂いが生じることのない周波数検
出方法を提供できるという有利な効果が得られる。
Even if the order of occurrence of two events of overflow and signal input and the order of corresponding interrupt processing are different depending on the priority order of the interrupts used to realize the above-mentioned effect, the detection result of the signal frequency is not correct. The advantageous effect of providing a frequency detection method that does not occur is obtained.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の周波数検出方法を実現する上での基本
構成を示すブロック図
FIG. 1 is a block diagram showing a basic configuration for realizing a frequency detection method of the present invention.

【図2】本実施の形態におけるフローチャートFIG. 2 is a flowchart in the present embodiment.

【図3】本実施の形態の動作を説明するためのタイミン
グ図
FIG. 3 is a timing chart for explaining the operation of the present embodiment.

【図4】マイクロコンピュータを用いたソフトウエアに
よる周波数検出方法の概念図
FIG. 4 is a conceptual diagram of a frequency detection method by software using a microcomputer.

【図5】2つの割り込みの発生順序と処理順序が入れ替
わる様子を示したタイミング図
FIG. 5 is a timing chart showing a state in which the generation order and the processing order of two interrupts are exchanged.

【図6】従来の周波数検出方法のフローチャートFIG. 6 is a flowchart of a conventional frequency detection method.

【符号の説明】[Explanation of symbols]

1 マイクロコンピュータ 2 基準クロック発生器 3 カウンタ 4 割り込み受け付け手段 5 CPU 6 メモリ 7 BUS 8 入力信号 1 microcomputer 2 Reference clock generator 3 counter 4 Interrupt acceptance means 5 CPU 6 memory 7 BUS 8 input signals

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G01R 23/10 G01P 3/489 ─────────────────────────────────────────────────── ─── Continuation of the front page (58) Fields surveyed (Int.Cl. 7 , DB name) G01R 23/10 G01P 3/489

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 所定の周期で動作するカウンタのオーバ
ーフロー時に発生するオーバーフロー割り込み処理を用
いて計算される前記カウンタのオーバーフロー回数と、
前記カウンタの値とを用いて被測定入力信号の周期を検
出することを特徴とする周波数検出方法であって、 前記カウンターのオーバフロー割り込みとは異なる位相
で発生させた割り込み処理にて計算される前記カウンタ
の第2のオーバーフロー回数と、前記オーバーフロー回
数とを前記被測定入力信号の入力タイミングによって切
り替えて前記周期を検出することを特徴とする周波数検
出方法。
1. The number of overflows of the counter calculated using overflow interrupt processing that occurs when the counter operating in a predetermined cycle overflows,
A frequency detection method characterized by detecting the period of an input signal under test using the value of the counter, wherein the counter is calculated by an interrupt process generated at a phase different from that of the overflow interrupt of the counter. A frequency detecting method characterized in that the cycle is detected by switching between a second overflow frequency of the counter and the overflow frequency according to the input timing of the measured input signal .
【請求項2】 カウンタを備えたマイクロコンピュータ
と前記マイクロコンピュータのソフトウエアに、前記カ
ウンタのオーバーフロー割込にて変数をカウントアップ
する処理と、被測定入力信号が入力したときに発生する
割込処理にて前記変数を上位データ、入力時点での前記
カウンタの値を下位データとして信号周波数検出を行な
う処理とを備えたことを特徴とする周波数検出回路であ
って、 前記カウンタのオーバーフローとは異なる位相の割り込
み処理によってカウントアップされる第2の変数と、前
記変数と前記第2の変数の値とを、前記被測定入力信号
の入力タイミングによって選択する選択手段と、前記選
択手段の結果と前記カウンタの値より前記入力信号の周
波数を演算し求める演算手段とを備えたことを特徴とす
る周波数検出回路。
2. A microcomputer having a counter and a software for the microcomputer, a process of counting up a variable by an overflow interrupt of the counter, and an interrupt process generated when an input signal to be measured is input. In the frequency detection circuit, the variable is used as upper data, and the value of the counter at the time of input is used as lower data to perform signal frequency detection. Of the second variable that is counted up by the interrupt process of (1), the value of the variable and the value of the second variable according to the input timing of the measured input signal, and the selecting means of the selecting means. A frequency comprising a calculation means for calculating the frequency of the input signal from the result and the value of the counter. Out circuit.
JP2000215516A 2000-07-17 2000-07-17 Frequency detection method and frequency detection circuit Expired - Fee Related JP3399450B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000215516A JP3399450B2 (en) 2000-07-17 2000-07-17 Frequency detection method and frequency detection circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000215516A JP3399450B2 (en) 2000-07-17 2000-07-17 Frequency detection method and frequency detection circuit

Publications (2)

Publication Number Publication Date
JP2002031654A JP2002031654A (en) 2002-01-31
JP3399450B2 true JP3399450B2 (en) 2003-04-21

Family

ID=18710926

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000215516A Expired - Fee Related JP3399450B2 (en) 2000-07-17 2000-07-17 Frequency detection method and frequency detection circuit

Country Status (1)

Country Link
JP (1) JP3399450B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4932193B2 (en) * 2005-08-26 2012-05-16 富士通テン株式会社 Pulse signal measuring apparatus and method
CN104090830B (en) * 2014-07-02 2017-02-22 西安航空动力控制科技有限公司 Processing method for solving problem of time interleaving of timer during frequency measurement through cycle measuring method

Also Published As

Publication number Publication date
JP2002031654A (en) 2002-01-31

Similar Documents

Publication Publication Date Title
US6577322B1 (en) Method and apparatus for converting video signal resolution
JP3399450B2 (en) Frequency detection method and frequency detection circuit
JP2000131355A (en) Frequency detecting method
JP3821913B2 (en) Horizontal frequency detection circuit
EP1664812B1 (en) Integrated circuit with signature computation
JP3523059B2 (en) Horizontal synchronization signal frequency detection method and horizontal synchronization signal frequency detection circuit
US5243321A (en) Display control apparatus enabling clear display of operation performance of an arithmetic processor
JP4510274B2 (en) Frequency detection method, frequency detection apparatus, and recording medium
JPS5824220Y2 (en) glitch detector
TW546949B (en) Apparatus and method for processing synchronizing signal of monitor
KR100321726B1 (en) Horizontal synchronous signal detection circuit for display
JP3827047B2 (en) Sync signal measuring device, display device, and sync signal measuring method
KR100278356B1 (en) Video signal starting point detection circuit of flat panel display device
JPH0989607A (en) Measurement period signal-generator for measuring instrument
JP3054498B2 (en) Image display device and input signal determination circuit
SU744580A1 (en) Logic circuit testing device
JP2001092401A (en) Input video mode discriminating circuit
KR100203057B1 (en) Vertical synchronous signal generation circuit
SU1173415A1 (en) Apparatus for static control of logical units
JP2829429B2 (en) Data interpolation circuit
JP3536619B2 (en) Scanning line number discriminator
KR930005811B1 (en) Display control apparatus and iced apparatus therefor
JPH0894660A (en) Pulse measuring apparatus
JPH11220677A (en) Frequency detecting circuit
JPH0933579A (en) Frequency measuring circuit

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees