JPH0580089A - Timer device - Google Patents

Timer device

Info

Publication number
JPH0580089A
JPH0580089A JP3242995A JP24299591A JPH0580089A JP H0580089 A JPH0580089 A JP H0580089A JP 3242995 A JP3242995 A JP 3242995A JP 24299591 A JP24299591 A JP 24299591A JP H0580089 A JPH0580089 A JP H0580089A
Authority
JP
Japan
Prior art keywords
reload
count
counter
signal
registers
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.)
Granted
Application number
JP3242995A
Other languages
Japanese (ja)
Other versions
JP2692444B2 (en
Inventor
Akihiko Wakimoto
昭彦 脇本
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP3242995A priority Critical patent/JP2692444B2/en
Publication of JPH0580089A publication Critical patent/JPH0580089A/en
Application granted granted Critical
Publication of JP2692444B2 publication Critical patent/JP2692444B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To obtain a timer device which can change a set count value variously and realize the change by a minimal interrupt processing and thereby to improve an executive processing speed of a microcomputer and the like. CONSTITUTION:Set count values different from each other are stored in a plurality of reload registers 2A and 2B by a writing means 1. At the time point of receiving an overflow signal 5 as an input from a counter 3, a reload control circuit 8 specifies the register storing the set count value to be counted subsequently and reloads this value on the counter 3.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、マイクロコンピュー
タ等に内蔵されるタイマ装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a timer device incorporated in a microcomputer or the like.

【0002】[0002]

【従来の技術】図3は、従来のタイマ装置を示す構成図
である。図において、1は書き込み信号WRを入力した
時にリロードレジスタ2にカウント設定値を書き込む書
き込み手段、3はリロードレジスタ2に格納されている
カウント設定値までカウントするカウンタ、4はカウン
タ3からカウント完了信号としてのオーバフロー信号5
を入力した時にリロード信号6を出力するリロード信号
発生回路、7はリロードレジスタ2に格納されているカ
ウント設定値をカウンタ3へリロードするスイッチであ
り、リロード信号6を入力した時にONとなる。
2. Description of the Related Art FIG. 3 is a block diagram showing a conventional timer device. In the figure, 1 is a writing means for writing a count set value to the reload register 2 when a write signal WR is input, 3 is a counter for counting up to the count set value stored in the reload register 2, and 4 is a count completion signal from the counter 3. Overflow signal 5 as
Is a reload signal generation circuit that outputs a reload signal 6 and 7 is a switch that reloads the count set value stored in the reload register 2 into the counter 3. The switch 7 is turned on when the reload signal 6 is input.

【0003】次に動作について説明する。マイクロコン
ピュータ等でプログラムを実行中にタイマを設定したい
場合、マイクロコンピュータの割り込み処理機能等を用
いて、書き込み信号WRの発生により書き込み手段1か
らカウント設定値をリロードレジスタ2に書き込む。カ
ウンタ3は、リロード信号6発生と同時にリロードレジ
スタ2からリロードされたカウント設定値を読み込み、
その値までカウントクロックをカウントする。続いて、
カウントを完了するとオーバフロー信号5を出力する。
このオーバフロー信号5は、上記マイクロコンピュータ
内の割り込み処理や他装置への信号として使用される。
リロード信号発生回路4はオーバフロー信号5を入力す
るとリロード信号6を出力し、そのタイミングでスイッ
チ7がONとなり、リロードレジスタ2に格納されてい
るカウント設定値がカウンタ3にリロードされる。カウ
ンタ3は再びリロードされたカウント設定値までカウン
トを開始し、以上の動作がくり返されることとなる。
Next, the operation will be described. When it is desired to set the timer while the program is being executed by the microcomputer or the like, the count setting value is written from the writing means 1 to the reload register 2 by the generation of the write signal WR by using the interrupt processing function of the microcomputer or the like. The counter 3 reads the reloaded count setting value from the reload register 2 at the same time when the reload signal 6 is generated,
The count clock is counted up to that value. continue,
When the counting is completed, the overflow signal 5 is output.
The overflow signal 5 is used as an interrupt process in the microcomputer and as a signal to other devices.
The reload signal generation circuit 4 outputs the reload signal 6 when the overflow signal 5 is input, the switch 7 is turned ON at that timing, and the count set value stored in the reload register 2 is reloaded into the counter 3. The counter 3 starts counting up to the reloaded count set value again, and the above operation is repeated.

【0004】[0004]

【発明が解決しようとする課題】従来のタイマ装置は以
上のように構成されているので、タイマを設定する時
は、マイクロコンピュータの割り込み処理時間が必要で
ある。したがって、カウント設定値を変更したい場合
は、その都度割り込み処理時間が必要となるため、マイ
クロコンピュータで実行中の主たるプログラムの処理が
遅くなるという問題点があった。
Since the conventional timer device is constructed as described above, the interrupt processing time of the microcomputer is required when setting the timer. Therefore, when it is desired to change the count set value, the interrupt processing time is required each time, which causes a problem that the processing of the main program being executed by the microcomputer becomes slow.

【0005】この発明は上記のような問題点を解消する
ためになされたもので、カウント設定値を変更しても、
マイクロコンピュータ等の主たるプログラムの高速処理
を可能とするタイマ装置を得ることを目的とする。
The present invention has been made to solve the above problems, and even if the count set value is changed,
An object of the present invention is to obtain a timer device that enables high-speed processing of a main program such as a microcomputer.

【0006】[0006]

【課題を解決するための手段】この発明に係るタイマ装
置は、互いに異なるカウント設定値を格納する複数のリ
ロードレジスタ、上記複数のリロードレジスタにカウン
ト設定値を書き込む書き込み手段、指定されたリロード
レジスタに書かれたカウント設定値までカウントし、カ
ウント完了信号を出力するカウンタ、および上記カウン
ト完了信号を入力した時、上記複数のリロードレジスタ
のうちの一つを指定して上記カウンタへリロードするリ
ロード制御回路を備えたものである。
A timer device according to the present invention includes a plurality of reload registers for storing different count setting values, a writing means for writing the count setting values in the plurality of reload registers, and a specified reload register. A counter that counts up to the written count setting value and outputs a count completion signal, and a reload control circuit that, when the count completion signal is input, specifies one of the plurality of reload registers to reload the counter. It is equipped with.

【0007】[0007]

【作用】この発明におけるリロードレジスタは複数あ
り、互いに異なるカウント設定値が一度で設定される。
またリロード制御回路が指定するリロードレジスタを変
更することによりカウンタへリロードするカウント設定
値が変更される。
There are a plurality of reload registers in the present invention, and different count set values are set at one time.
Further, by changing the reload register designated by the reload control circuit, the count set value to be reloaded to the counter is changed.

【0008】[0008]

【実施例】【Example】

実施例1.以下、この発明の一実施例を図について説明
する。図1において1、3、5は従来装置のものと全く
同一のものである。2A、2Bは互いに異なるカウント設定
値を格納するリロードレジスタ、6A、6Bはリロード信号
で、リロードレジスタ2A、2Bに格納されている値をカウ
ンタ3にリロードするスイッチ7A、7Bにそれぞれ出力さ
れる。8はリロードレジスタ2A、2Bのうちの1つを指定
しそれに対応するスイッチをONにするリロード信号を
出力するリロード制御回路である。
Example 1. An embodiment of the present invention will be described below with reference to the drawings. In FIG. 1, 1, 3 and 5 are exactly the same as those of the conventional device. 2A and 2B are reload registers for storing different count setting values, and 6A and 6B are reload signals, which are output to switches 7A and 7B for reloading the values stored in the reload registers 2A and 2B into the counter 3, respectively. Reference numeral 8 is a reload control circuit for designating one of the reload registers 2A and 2B and outputting a reload signal for turning on the corresponding switch.

【0009】次にカウンタがオーバフローするたびにカ
ウント設定値を変更する場合の動作について説明する。
予め、設定すべき異なる2つのカウント設定値を書き込
み手段1を用いて2本のリロードレジスタ2Aおよび2Bに
それぞれ格納しておく。カウンタ3は2本のリロードレ
ジスタ2A、2Bのいずれか一方、例えば、リロードレジス
タ2Aからリロードされてきたカウント設定値を読み込
み、その値までカウントクロックをカウントする。続い
て、カウントを完了するとオーバフロー信号5を出力す
る。リロード制御回路8はオーバフロー信号5を入力す
るとリロード信号6A、6Bを出力するが、この時、前回カ
ウントしたカウント設定値と異なる方のカウント設定
値、例えばリロードレジスタ2Bに格納されているカウン
ト設定値がリロードされるようにリロード信号6Bを有効
とし、スイッチ7BをONとする。これにより、リロード
レジスタ2Bに格納されているカウント設定値がカウンタ
3にリロードされる。即ちカウンタ3は今度はリロード
レジスタ2Bからリロードされたカウント設定値までカウ
ントすることとなる。
Next, the operation of changing the count set value each time the counter overflows will be described.
In advance, two different count setting values to be set are stored in the two reload registers 2A and 2B by using the writing means 1. The counter 3 reads either one of the two reload registers 2A and 2B, for example, the count set value reloaded from the reload register 2A, and counts the count clock to that value. Then, when the counting is completed, the overflow signal 5 is output. The reload control circuit 8 outputs the reload signals 6A and 6B when the overflow signal 5 is input, but at this time, the count setting value different from the count setting value previously counted, for example, the count setting value stored in the reload register 2B. Reload signal 6B is made effective so that is reloaded, and switch 7B is turned on. As a result, the count set value stored in the reload register 2B is reloaded into the counter 3. That is, the counter 3 now counts up to the reload set count value from the reload register 2B.

【0010】初めに設定した2つのカウント設定値のど
ちらもが使用されたあと、再び異なる値でカウントする
場合は、2回目のカウントのオーバフロー信号5の出力
のタイミングで、書き込み手段1を用いて、新たな2つ
の異なる値を2本のリロードレジスタ2A、2Bにそれぞれ
書き込むこととなる。この処理はマイクロコンピュータ
の割り込み処理となるが、2回の設定値の変更が1回の
割り込み処理で行え、割り込み処理時間が半分となる。
また、異なる2つのカウント設定値をオーバフロー信号
5の発生ごとに交互に使用する場合は、リロード制御回
路8がリロード信号6Aとリロード信号6Bとを交互に有効
となるように制御するだけでよく、割り込み処理は発生
しない。さらに、2つのカウント設定値を交互ではなく
任意の回数ごとに使用する場合も、またどちらか一方だ
けを使用する場合も、リロード制御回路8の制御だけで
可能となる。
When both of the initially set two count set values are used and then counting is performed again with different values, the writing means 1 is used at the timing of outputting the overflow signal 5 of the second count. , And two new different values are written to the two reload registers 2A and 2B, respectively. This process is an interrupt process of the microcomputer, but the setting value can be changed twice, and the interrupt process time can be halved.
When two different count setting values are alternately used each time the overflow signal 5 is generated, the reload control circuit 8 only needs to control the reload signal 6A and the reload signal 6B to be alternately valid. No interrupt processing occurs. Further, when the two count setting values are used not every time but every arbitrary number of times, or only one of them is used, it is possible only by the control of the reload control circuit 8.

【0011】実施例2.なお、上記実施例ではリロード
レジスタを2本備えたものを示したが、n本(nは任
意)備えたものでもよい。図2は実施例2によるタイマ
装置を示す構成図であり、図において1、3、5〜8は
実施例1と全く同一のものである。9はリロードレジス
タでn本あり、10はn本のうちのどのリロードレジスタ
の値をリロードするかを指定するレジスタ指定信号であ
る。本実施例では、予めn個のカウント設定値をn本の
リロードレジスタ9に格納しておく。リロード制御回路
8がカウンタ3からオーバフロー信号5を入力した時点
で再びカウンタへ値をリロードする必要があれば、リロ
ード信号6を出力するとともに、レジスタ指定信号10を
出力することにより、指定したリロードレジスタに格納
されたカウント設定値がカウンタ3へリロードされる。
新たな値を設定したい場合は、n個のカウント設定値を
一度の割り込み処理で変更することができる。また、上
記リロードレジスタの指定を任意の順でできるようにす
れば、リロード制御回路8の制御だけでn個の互いに異
なるカウント設定値を有効に使用することができる。
Embodiment 2. It should be noted that, in the above embodiment, the one provided with two reload registers is shown, but the one provided with n (n is arbitrary) may be provided. FIG. 2 is a block diagram showing a timer device according to the second embodiment. In the figure, reference numerals 1, 3, 5 to 8 are exactly the same as those of the first embodiment. Reference numeral 9 is a reload register, and n is a register, and 10 is a register designating signal for designating which of the n reload registers is to be reloaded. In this embodiment, n count set values are stored in advance in the n reload registers 9. If the reload control circuit 8 needs to reload the value to the counter again when the overflow signal 5 is input from the counter 3, the reload signal 6 and the register designation signal 10 are output to output the designated reload register. The count set value stored in is reloaded into the counter 3.
When it is desired to set a new value, the n count setting values can be changed by one interrupt process. Further, if the reload registers can be designated in any order, n different count set values can be effectively used only by the control of the reload control circuit 8.

【0012】実施例3.なお、上記実施例1、2のいず
れもカウンタ3はカウント完了信号としてオーバフロー
信号5を出力するものとして示したが、設定値から0へ
のカウント完了時に発するアンダフロー信号を出力する
ものとしても全く同様の効果を奏する。
Embodiment 3. In each of the first and second embodiments, the counter 3 is shown as outputting the overflow signal 5 as the count completion signal. Has the same effect.

【0013】[0013]

【発明の効果】以上のように、この発明によればリロー
ドレジスタを複数設け、リロード制御回路によって複数
のリロードレジスタ内のカウント設定値を任意に使用で
きるようにしたので、多様なタイマ動作が可能となるう
えカウンタにリロードするカウント設定値を変更するた
めの割り込み処理の回数が減少し、マイクロコンピュー
タの主たるプログラムの処理を高速化することが可能と
なる。
As described above, according to the present invention, since a plurality of reload registers are provided and the count setting values in the plurality of reload registers can be arbitrarily used by the reload control circuit, various timer operations are possible. In addition, the number of interrupt processes for changing the count set value to be reloaded in the counter is reduced, and the process of the main program of the microcomputer can be speeded up.

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

【図1】この発明の実施例1によるタイマ装置を示す構
成図である。
FIG. 1 is a configuration diagram showing a timer device according to a first embodiment of the present invention.

【図2】この発明の実施例2によるタイマ装置を示す構
成図である。
FIG. 2 is a configuration diagram showing a timer device according to a second embodiment of the present invention.

【図3】従来のタイマ装置を示す構成図である。FIG. 3 is a configuration diagram showing a conventional timer device.

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

1 書き込み手段 2A、2B リロードレジスタ 3 カウンタ 5 カウント完了信号としてのオーバフロー信号 6A、6B リロード信号 8 リロード制御回路 1 writing means 2A, 2B reload register 3 counter 5 overflow signal as count completion signal 6A, 6B reload signal 8 reload control circuit

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 マイクロコンピュータ等に内蔵され、リ
ロードレジスタに書かれたカウント設定値までカウント
するタイマ装置において、 互いに異なるカウント設定値を格納する複数のリロード
レジスタ、上記複数のリロードレジスタにカウント設定
値を書き込む書き込み手段、指定されたリロードレジス
タに書かれたカウント設定値までカウントし、カウント
完了信号を出力するカウンタ、および上記カウント完了
信号を入力した時、上記複数のリロードレジスタのうち
の一つを指定して上記カウンタへリロードするリロード
制御回路を備えたことを特徴とするタイマ装置。
1. A timer device built in a microcomputer or the like for counting up to a count set value written in a reload register, wherein a plurality of reload registers storing different count set values, and the count set values in the plurality of reload registers are provided. Writing means, a counter that counts up to the count set value written in the specified reload register and outputs a count completion signal, and when one of the plurality of reload registers is input when the count completion signal is input. A timer device comprising a reload control circuit for specifying and reloading to the counter.
JP3242995A 1991-09-24 1991-09-24 Timer device Expired - Lifetime JP2692444B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3242995A JP2692444B2 (en) 1991-09-24 1991-09-24 Timer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3242995A JP2692444B2 (en) 1991-09-24 1991-09-24 Timer device

Publications (2)

Publication Number Publication Date
JPH0580089A true JPH0580089A (en) 1993-03-30
JP2692444B2 JP2692444B2 (en) 1997-12-17

Family

ID=17097329

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3242995A Expired - Lifetime JP2692444B2 (en) 1991-09-24 1991-09-24 Timer device

Country Status (1)

Country Link
JP (1) JP2692444B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05134068A (en) * 1991-11-11 1993-05-28 Toshiba Corp Timing controller
US6016521A (en) * 1997-12-01 2000-01-18 Mitsubishi Electric Semiconductor Systems Corporation Communication control device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05134068A (en) * 1991-11-11 1993-05-28 Toshiba Corp Timing controller
US6016521A (en) * 1997-12-01 2000-01-18 Mitsubishi Electric Semiconductor Systems Corporation Communication control device

Also Published As

Publication number Publication date
JP2692444B2 (en) 1997-12-17

Similar Documents

Publication Publication Date Title
JPH0580089A (en) Timer device
JPH06348507A (en) Microcomputer
JPH027616A (en) Timer circuit
JPH04209020A (en) Microcomputer
KR0152224B1 (en) Ready state generating apparatus capable of varying state number
JPH01137315A (en) Timer circuit
JPS61136115A (en) Basic clock generating circuit of microcomputer system
JPH04192037A (en) Semiconductor integrated circuit
JP2508291B2 (en) Serial input / output circuit
JPS63287109A (en) Timing generating circuit
JP2517943B2 (en) Timer device
JPH10171654A (en) Fast data arithmetic processor
JPH01280918A (en) Interval timer
JPH0422220A (en) Synchronous output circuit
JPH0555883A (en) Timer circuit
SU728125A1 (en) Device for determining the position of number on numeric axis
SU600558A1 (en) Priority device
JPS605356A (en) Self-monitoring timer system
JPH0474799B2 (en)
JPH05258082A (en) Microcomputer
JPS62224112A (en) Multi-function timer
JPH02171812A (en) Operating speed increasing circuit for processor having no wait state function
JPH03282821A (en) Asynchronous operation circuit
JPS628822B2 (en)
JPH05100867A (en) Micro controller

Legal Events

Date Code Title Description
S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070905

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080905

Year of fee payment: 11

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080905

Year of fee payment: 11

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090905

Year of fee payment: 12

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090905

Year of fee payment: 12

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100905

Year of fee payment: 13

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110905

Year of fee payment: 14

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110905

Year of fee payment: 14

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110905

Year of fee payment: 14

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110905

Year of fee payment: 14

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120905

Year of fee payment: 15

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120905

Year of fee payment: 15