JPH08292822A - Intelligent timer - Google Patents

Intelligent timer

Info

Publication number
JPH08292822A
JPH08292822A JP7094744A JP9474495A JPH08292822A JP H08292822 A JPH08292822 A JP H08292822A JP 7094744 A JP7094744 A JP 7094744A JP 9474495 A JP9474495 A JP 9474495A JP H08292822 A JPH08292822 A JP H08292822A
Authority
JP
Japan
Prior art keywords
timer
signal
frequency
clock
intelligent
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.)
Withdrawn
Application number
JP7094744A
Other languages
Japanese (ja)
Inventor
Takahisa Araiya
孝久 新井谷
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.)
NEC Engineering Ltd
Original Assignee
NEC Engineering 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 NEC Engineering Ltd filed Critical NEC Engineering Ltd
Priority to JP7094744A priority Critical patent/JPH08292822A/en
Publication of JPH08292822A publication Critical patent/JPH08292822A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE: To provide an intelligent timer which can be set to a proper software timer value each time a clock frequency is changed. CONSTITUTION: A CPU 2 sets a constant time according to the reference signal S1 supplied from a reference signal generator 4 and counts how many times the count-up signal S2 is inputted from the timer 1 in the constant time. Then the CPU 2 finds B/A from the frequency A and frequency B of the count-up signal S2 before and after the clock frequency of a clock generation source 3 is changed and multiplies it by a constant C to set the timer value T after the change.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はインテリジェントタイマ
に関し、特にタイマ値の変更機能を有するインテリジェ
ントタイマに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an intelligent timer, and more particularly to an intelligent timer having a timer value changing function.

【0002】[0002]

【従来の技術】処理速度を上げるためクロック周波数を
上げると、ソフトウェアタイマがカウントアップするま
での時間、すなわちソフトウェアタイマタイマの周期
(タイマ値)が短くなり不都合が生じる場合がある。た
とえば、パソコン等のフロッピーディスクの読み込み
時、インデックスホールを検出してからソフトウェアタ
イマによりある期間後にフロッピーディスクドライブの
ヘッドをロードする等の技法を用いてコピープロテクト
をかけているが、クロック周波数が上げられるとソフト
ウェアタイマの時間が短くなるため、以前のフロッピー
ディスクの内容を全く読み込めなくなってしまうという
不都合があった。
2. Description of the Related Art If the clock frequency is increased to increase the processing speed, the time until the software timer counts up, that is, the period (timer value) of the software timer is shortened, which may cause inconvenience. For example, when reading a floppy disk such as a personal computer, copy protection is applied by using a technique such as loading the head of the floppy disk drive after a certain period of time with a software timer after detecting an index hole. If so, the time of the software timer becomes short, and there is an inconvenience that the contents of the previous floppy disk cannot be read at all.

【0003】そこで、クロック周波数を変更した場合、
その都度ソフトウエアタイマ値を適切な値に再設定して
いた。
Therefore, when the clock frequency is changed,
Each time, the software timer value was reset to an appropriate value.

【0004】また、クロック周波数を変更するに際し、
変更後のクロック周波数を正確に知るための発明が特開
昭64−38814号公報に開示されている。
When changing the clock frequency,
An invention for accurately knowing the changed clock frequency is disclosed in JP-A-64-38814.

【0005】この発明は、周波数比較部を設け、CPU
に与えられる水晶発振子の発振周波数と基準周波数を比
較することで水晶発振子の発振周波数を知るというもの
である。
According to the present invention, a CPU is provided with a frequency comparison unit.
It is to know the oscillation frequency of the crystal oscillator by comparing the oscillation frequency of the crystal oscillator and the reference frequency.

【0006】[0006]

【発明が解決しようとする課題】しかし、特開昭64−
38814号公報の発明は水晶発振子の発振周波数を知
る、ということに止まり、依然としてソフトウェアタイ
マ値をその都度適切な値に再設定しなければならなかっ
た。
However, JP-A-64-64
The invention of Japanese Patent No. 38814 stops at knowing the oscillation frequency of the crystal oscillator, and the software timer value still has to be reset to an appropriate value each time.

【0007】そこで本発明の目的は、クロック周波数の
変更に伴ってその都度適切なソフトウェアタイマ値に設
定することができるインテリジェントタイマを提供する
ことにある。
Therefore, an object of the present invention is to provide an intelligent timer capable of setting an appropriate software timer value each time the clock frequency is changed.

【0008】[0008]

【課題を解決するための手段】前記課題を解決するため
に本発明は、クロック信号に従って所定周期をもって起
動信号を発生するインテリジェントタイマであって、単
位時間における前記起動信号の発生回数を計数する計数
手段と、前記クロック信号の周波数を変更した場合に前
記起動信号の発生回数の変化に比例させてタイマの周期
を演算する演算手段とを含むことを特徴とする。
In order to solve the above-mentioned problems, the present invention is an intelligent timer for generating a start signal in a predetermined cycle according to a clock signal, and a counting for counting the number of times the start signal is generated in a unit time. Means and means for calculating the period of the timer in proportion to the change in the number of times the activation signal is generated when the frequency of the clock signal is changed.

【0009】[0009]

【作用】クロック信号の周波数が上がって単位時間にお
ける起動信号の発生回数が増加した場合はタイマの周期
を長くし、逆にクロック信号の周波数が下がって単位時
間における起動信号の発生回数が減少した場合はタイマ
の周期を短くするよう演算手段が演算する。
When the frequency of the clock signal increases and the number of times the start signal is generated per unit time increases, the timer period is lengthened, and conversely, the frequency of the clock signal decreases and the number of times the start signal occurs per unit time decreases. In this case, the calculation means calculates so as to shorten the period of the timer.

【0010】[0010]

【実施例】以下、本発明の実施例について添付図面を参
照しながら説明する。図1は本発明に係るインテリジェ
ントタイマの構成図である。インテリジェントタイマ
は、タイマ1と、このタイマ1よりカウントアップ信号
(起動信号)が入力されるCPU(Central P
rocessing Unit;中央処理装置)2と、
タイマ1およびCPU2を駆動するクロック発生源(C
lock Generater;CG)3と、CPU2
に基準信号を供給する基準信号発生器4とからなる。
Embodiments of the present invention will be described below with reference to the accompanying drawings. FIG. 1 is a block diagram of an intelligent timer according to the present invention. The intelligent timer includes a timer 1 and a CPU (Central P) to which a count-up signal (start signal) is input from the timer 1.
processing unit; central processing unit 2),
A clock generation source (C that drives the timer 1 and the CPU 2
lock Generator; CG) 3 and CPU2
And a reference signal generator 4 for supplying a reference signal to the.

【0011】この構成によりCPU2は、基準信号発生
器4から供給される基準信号S1に基づく一定時間に、
タイマ1から入力されるカウントアップ信号S2の回数
を計数し、この回数に基づいてタイマ1のタイマ値、す
なわちタイマ1の周期を決定する。
With this configuration, the CPU 2 causes the reference signal S1 supplied from the reference signal generator 4 to perform a predetermined period of time.
The number of count-up signals S2 input from the timer 1 is counted, and the timer value of the timer 1, that is, the cycle of the timer 1 is determined based on this number.

【0012】また、CPU2からタイマ1に対してタイ
マの初期設定信号S3およびクロック発生源3の周波数
を変更した場合のタイマ設定信号S4が入力され、クロ
ック発生源3からタイマ1に対してタイマ動作用クロッ
ク信号S5が、CPU2に対してCPU動作用クロック
信号S6が夫々入力される。
Further, the CPU 2 inputs the timer initial setting signal S3 to the timer 1 and the timer setting signal S4 when the frequency of the clock generation source 3 is changed, and the clock generation source 3 operates the timer 1 to the timer 1. The clock signal S5 for CPU is input to the CPU 2 as the clock signal S6 for CPU operation.

【0013】次に、CPU2におけるタイマ値の演算処
理過程について図2を参照しながら説明する。図2はC
PUにおけるタイマ値の演算処理過程を示すフローチャ
ートである。
Next, the process of calculating the timer value in the CPU 2 will be described with reference to FIG. Figure 2 is C
6 is a flowchart showing a process of calculating a timer value in PU.

【0014】まず、N1にてCPU2は偏差測定用タイ
マ値、すなわちタイマの初期設定値を初期設定信号S3
によりタイマ1に設定する。
First, at N1, the CPU 2 sets the deviation measurement timer value, that is, the timer initial setting value to the initial setting signal S3.
To set timer 1.

【0015】次にN2に進み、CPU2は基準信号S1
に基づき一定時間を設定し、この一定時間にタイマ1か
ら入力されるカウントアップ信号S2の回数Aを計数す
る。そして、この回数AをCPU2内のレジスタ(不図
示)等に保持する。次に、クロック発生源3のクロック
周波数を変更した後のカウントアップ信号S2の回数B
をCPU2内の別のレジスタ(不図示)等に保持する。
Next, proceeding to N2, the CPU 2 makes the reference signal S1.
Based on the above, a fixed time is set, and the number A of the count-up signal S2 input from the timer 1 is counted during this fixed time. Then, this number of times A is held in a register (not shown) in the CPU 2. Next, the count B of the count-up signal S2 after changing the clock frequency of the clock generation source 3
Is held in another register (not shown) in the CPU 2.

【0016】次にN3に進み、CPU2はその2個のレ
ジスタから変更前のカウントアップ信号S2の回数Aと
変更後のカウントアップ信号S2の回数Bを取り出し、
回数AとBとの偏差を算出する。この偏差を本実施例で
はB/Aとする。すなわち、回数Aに対する回数Bの比
を偏差とする。
Next, proceeding to N3, the CPU 2 takes out the count A of the count-up signal S2 before change and the count B of the count-up signal S2 after change from the two registers,
The deviation between the number of times A and B is calculated. This deviation is B / A in this embodiment. That is, the ratio of the number B to the number A is the deviation.

【0017】つぎにN4に進み、CPU2はこの偏差B
/Aを基に所望のタイマ値、すなわち変更後のタイマ値
Tを次の計算式により計算する。
Next, in N4, the CPU 2 determines the deviation B
Based on / A, a desired timer value, that is, the changed timer value T is calculated by the following calculation formula.

【0018】T=C×(B/A) ここに、Cは正の定数で使用するソフトウェアに従って
その値が決定される数である。この式によれば、Bの値
がAの値より大きくなればTの値も大きくなる。すなわ
ち、TはBの値に比例する。これは、クロック周波数が
上がりカウントアップ数の回数が増加した場合、その増
加分に比例してタイマ1のタイマ値Tも増加することを
意味する。逆に、クロック周波数が下がりカウントアッ
プ数の回数が減少した場合、その減少分に比例してタイ
マ1のタイマ値Tも減少することを意味する。
T = C × (B / A) where C is a positive constant whose number is determined according to the software used. According to this equation, if the value of B becomes larger than the value of A, the value of T also becomes larger. That is, T is proportional to the value of B. This means that when the clock frequency rises and the number of count-ups increases, the timer value T of the timer 1 also increases in proportion to the increase. On the contrary, when the clock frequency decreases and the number of count-ups decreases, the timer value T of the timer 1 also decreases in proportion to the decrease.

【0019】次にN5に進み、CPU2はタイマ値Tを
タイマ設定信号S4によりタイマ1に設定する。これで
演算処理は終了する。
Next, proceeding to N5, the CPU 2 sets the timer value T to the timer 1 by the timer setting signal S4. This completes the arithmetic processing.

【0020】なお、偏差をたとえばB−Aで算出すると
すると、 T=A+D(B−A) でTを求めることもできる。ここに、Dは正の定数であ
る。
If the deviation is calculated by BA, for example, T can be obtained by T = A + D (BA). Here, D is a positive constant.

【0021】[0021]

【発明の効果】本発明によれば、単位時間における起動
信号の発生回数を計数する計数手段を備え、クロック信
号の周波数を変更した場合に起動信号の発生回数の変化
に比例させてタイマの周期を演算手段に演算させるよう
構成したため、クロック周波数を変更してもその都度適
切なタイマ値にタイマを設定することができる。
According to the present invention, there is provided counting means for counting the number of times a start signal is generated in a unit time, and when the frequency of the clock signal is changed, the period of the timer is proportional to the change in the number of times the start signal is generated. Is configured to be calculated by the calculation means, the timer can be set to an appropriate timer value each time the clock frequency is changed.

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

【図1】本発明に係るインテリジェントタイマの構成図
である。
FIG. 1 is a configuration diagram of an intelligent timer according to the present invention.

【図2】CPUにおけるタイマ値の演算処理過程を示す
フローチャートである。
FIG. 2 is a flowchart showing a process of calculating a timer value in a CPU.

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

1 タイマ 2 CPU 3 クロック発生源 4 基準信号発生器 S1 基準信号 S2 カウントアップ信号 S3 タイマ初期設定信号 S4 タイマ設定信号 S5 タイマ動作用クロック信号 S6 CPU動作用クロック信号 1 timer 2 CPU 3 clock generation source 4 reference signal generator S1 reference signal S2 count up signal S3 timer initial setting signal S4 timer setting signal S5 timer operating clock signal S6 CPU operating clock signal

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 クロック信号に従って所定周期をもって
起動信号を発生するインテリジェントタイマであって、
単位時間における前記起動信号の発生回数を計数する計
数手段と、前記クロック信号の周波数を変更した場合に
前記起動信号の発生回数の変化に比例させてタイマの周
期を演算する演算手段とを含むことを特徴とするインテ
リジェントタイマ。
1. An intelligent timer for generating a start signal at a predetermined cycle according to a clock signal,
And counting means for counting the number of times the start signal is generated in a unit time; and calculating means for calculating the period of the timer in proportion to the change in the number of times the start signal is generated when the frequency of the clock signal is changed. Intelligent timer featuring.
【請求項2】 前記演算手段は、前回の起動信号の発生
回数に対する今回の起動信号の発生回数の比を演算し、
この演算結果を前回のタイマの周期に乗算して今回のタ
イマの周期を演算する手段であることを特徴とする請求
項1記載のインテリジェントタイマ。
2. The calculating means calculates a ratio of the number of times of generation of a current start signal to the number of times of generation of a previous start signal,
The intelligent timer according to claim 1, wherein the intelligent timer is a means for calculating a cycle of a current timer by multiplying a cycle of the previous timer by the calculation result.
【請求項3】 クロック発生源と、このクロック発生源
からのクロック信号に従って所定周期をもって起動信号
を発生するタイマと、基準信号発生器と、この基準信号
発生器から得られる基準信号に基づき単位時間を設定
し、前記クロック信号の周波数を変更した場合に前記単
位時間における前記起動信号の発生回数の変化を検出
し、この発生回数の変化に比例させてタイマの周期を演
算する中央処理装置とを含むことを特徴とするインテリ
ジェントタイマ。
3. A clock generation source, a timer for generating a start signal at a predetermined cycle according to a clock signal from the clock generation source, a reference signal generator, and a unit time based on a reference signal obtained from the reference signal generator. And a change in the frequency of the clock signal when the frequency of the clock signal is changed, a change in the number of times the activation signal is generated in the unit time is detected, and a central processing unit that calculates the period of the timer in proportion to the change in the number of times is generated. An intelligent timer characterized by including.
【請求項4】 前記中央処理装置は、前回の起動信号の
発生回数に対する今回の起動信号の発生回数の比を演算
し、この演算結果を前回のタイマの周期に乗算して今回
のタイマの周期を演算する手段であることを特徴とする
請求項3記載のインテリジェントタイマ。
4. The central processing unit calculates a ratio of the number of times the present activation signal is generated to the number of times the last activation signal is generated, and multiplies the calculation result by the period of the last timer to calculate the period of the present timer. 4. The intelligent timer according to claim 3, which is a means for calculating
JP7094744A 1995-04-20 1995-04-20 Intelligent timer Withdrawn JPH08292822A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7094744A JPH08292822A (en) 1995-04-20 1995-04-20 Intelligent timer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7094744A JPH08292822A (en) 1995-04-20 1995-04-20 Intelligent timer

Publications (1)

Publication Number Publication Date
JPH08292822A true JPH08292822A (en) 1996-11-05

Family

ID=14118642

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7094744A Withdrawn JPH08292822A (en) 1995-04-20 1995-04-20 Intelligent timer

Country Status (1)

Country Link
JP (1) JPH08292822A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016184366A (en) * 2015-03-27 2016-10-20 日本電気株式会社 Timer correction device, timer correction method, and timer correction program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016184366A (en) * 2015-03-27 2016-10-20 日本電気株式会社 Timer correction device, timer correction method, and timer correction program

Similar Documents

Publication Publication Date Title
JP3322893B2 (en) Microcomputer
US4985640A (en) Apparatus for generating computer clock pulses
JP2001013179A (en) Measurement method for ring oscillator clock frequency, measurement circuit for ring oscillator clock frequency, and microcomputer
KR100347557B1 (en) Pulse signal generating apparatus and pulse signal generating method
JPH08292822A (en) Intelligent timer
JPH0844594A (en) Data processor
JPH10170564A (en) Clock frequency measurement circuit, and method therefor
JPH02165055A (en) Speed detector
JPS61105629A (en) Clock controlling system
JP2776772B2 (en) Oscillation control circuit
EP0152094A2 (en) Multiple clock pulse generator
JP2893753B2 (en) Pulse width modulation inverter controller
JPH04233467A (en) Method and apparatus for measuring speed of motor
JPH10255489A (en) Microcomputer
JPS62289012A (en) Duty control pulse generating circuit
JPH0933579A (en) Frequency measuring circuit
JPH03129529A (en) Microcomputer
JPH0854956A (en) Processor with throughput varying function
JPH0535359A (en) Clock oscillator
JPH0923159A (en) Counting device
JP2819973B2 (en) Noise removal circuit
JPH08179849A (en) Clock output circuit
JP3144811B2 (en) Monitoring timer circuit
JPH04143816A (en) Time counting system
JPS6313192B2 (en)

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20020702