JPS6024968B2 - timer device - Google Patents

timer device

Info

Publication number
JPS6024968B2
JPS6024968B2 JP53033414A JP3341478A JPS6024968B2 JP S6024968 B2 JPS6024968 B2 JP S6024968B2 JP 53033414 A JP53033414 A JP 53033414A JP 3341478 A JP3341478 A JP 3341478A JP S6024968 B2 JPS6024968 B2 JP S6024968B2
Authority
JP
Japan
Prior art keywords
carry
counter
program
timer
timer device
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
Application number
JP53033414A
Other languages
Japanese (ja)
Other versions
JPS54124929A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP53033414A priority Critical patent/JPS6024968B2/en
Publication of JPS54124929A publication Critical patent/JPS54124929A/en
Publication of JPS6024968B2 publication Critical patent/JPS6024968B2/en
Expired legal-status Critical Current

Links

Description

【発明の詳細な説明】 本発明は、ハ−ドウェアで構成されるタイマとソフトウ
ェアで実施されるタイマとを粗合せたタイマ装置に関す
るものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a timer device that is a combination of a timer configured in hardware and a timer implemented in software.

中央処理装置あるいは磁気テープ制御装置等の入出力制
御装置内では、各種のタイマが使用されている。
Various timers are used in input/output control devices such as central processing units or magnetic tape control devices.

このタイマ装置としては、従来マイクロ・プログラム自
身でクロックを計数して、ある一定値になるとキャリー
信号を上げて外部に知らせるソフトウェアのタイマと、
マイクロ・プログラムからスタート指令のみを与えるこ
とにより、その後の処理はハードウェアによりクロック
を計数してキャリー信号が上ったことを知らせるハード
ウエアのタイマとがある。プログラムによりすべて処理
するタイマでは、クロツクをカウントして十1していき
、ブランチにより一定値に達したか否かを監視し、達し
ていない場合には元のルーチンに戻す等、種々の条件に
より各ルーチンヘブランチする動作が数多く存在する。
Conventionally, this timer device is a software timer that counts clocks by the micro program itself and raises a carry signal to notify the outside when it reaches a certain value.
By giving only a start command from the microprogram, subsequent processing is performed using a hardware timer that counts clocks and notifies that the carry signal has risen. A timer that is completely processed by a program counts the clock and increments it by 11, monitors whether a certain value has been reached by branching, and if it has not reached a certain value, returns to the original routine, etc., depending on various conditions. There are many operations that branch into each routine.

また、メイン・プログラムで複雑な処理を実行している
期間中にカウント動作を行わせると、プログラム上で種
々の制約がある。また、ハードウェアにより処理するタ
イマは、第1図に示すように、遅い時間を作成するため
にカウンタCTRあるいはデコ−ダを複数個組合せるの
で、かなりのハードウェア量が必要であり、タイマ装置
が大型化する。
Furthermore, if a counting operation is performed during a period in which the main program is executing complex processing, there are various restrictions on the program. In addition, as shown in Figure 1, timers processed by hardware require a considerable amount of hardware because they combine multiple counters CTR or decoders to create a slow time. becomes larger.

中央処理装置あるいは入出力制御装置では、数種類のタ
イマを必要とするので、できるだけタイマ装置を小型化
し」しかも複雑なプログラム処理に対して制約を与える
ことなく、高性能なタイマ装置を得ることが望ましい。
Since the central processing unit or input/output control unit requires several types of timers, it is desirable to make the timer device as small as possible and obtain a high-performance timer device without imposing restrictions on complex program processing. .

本発明の目的は、このような要求を満足するため、ハー
ドウェアの長所とソフトウェアの長所とを取入れた小型
で高一性能、かつ本来のメイン・プログラム処理を制約
しないタイマ装置を提供することにある。本発明は、マ
イクロ・プログラムによりカウントの初期値設定および
クロックの変更をうけるカウンタ、該カウン夕のキャリ
−信号によりセットされ、マイクロ・プログラムにより
リセーントされるキャリー・レジスタおよび該キヤリー
・レジスタのセット出力をマイクロ・プログラムにより
計数するマイクロ・プログラム・カウンタを設けるタイ
マ装置であって、以下、図面により実施例を説明する。
An object of the present invention is to provide a timer device that is compact, has high performance, and does not restrict the original main program processing, incorporating the advantages of hardware and software, in order to satisfy such demands. be. The present invention provides a counter whose initial value is set and whose clock is changed by a microprogram, a carry register which is set by a carry signal of the counter and reset by a microprogram, and a set output of the carry register. This is a timer device provided with a micro program counter for counting by a micro program, and an embodiment thereof will be described below with reference to the drawings.

第2図は、本発明によるタイマ装置のブロック、第3図
は第2図の動作フロー・チャートである。
FIG. 2 is a block diagram of a timer device according to the present invention, and FIG. 3 is an operation flow chart of FIG.

第2図に示すように、本発明では、ハードウェアとして
カウンタCTRとキヤリー・レジスタCR・RGとを設
ける。
As shown in FIG. 2, in the present invention, a counter CTR and carry registers CR and RG are provided as hardware.

カウンタCTRは、マイクロ・プログラムにより起動と
停止の制御をうけるとともに、カウンタCTRに入力す
るクロツクCLKの周期もマイクロ・プログラムにより
変更される。マイクロ・プログラムによりカウンタCT
Rの初期値を設定して、カウント動作をスタートさせる
。カウンタCTR(例えば8ビット・カウンタ)にキャ
リーCRが出ると、次段のキャリー・レジスタCR・R
Gがセットされ、キヤ1」ー・レジスタCR・RGがセ
ット中でもカウンタCTRはカウント・アップ動作を続
ける。
Counter CTR is controlled to start and stop by a microprogram, and the period of clock CLK input to counter CTR is also changed by the microprogram. Counter CT by micro program
Set the initial value of R and start the counting operation. When a carry CR appears in the counter CTR (for example, an 8-bit counter), the next stage carry register CR/R
Counter CTR continues to count up even when G is set and the registers CR and RG are set.

キヤリー・レジス夕CR・RGがセットされると、プロ
グラムに知らせることもできる。
The program can also be notified when the Carry Regis CR/RG is set.

ハードウェアでカウント動作を行っている期間、プログ
ラムはさらに複雑な仕事を実行し、一段落したときキャ
リー・レジスタCR・RGの内容を見ればよい。
While the hardware is performing the counting operation, the program performs more complex work, and when the program is finished, it is enough to look at the contents of the carry registers CR and RG.

すなわち、次のキャリーCRが上るまでに、プログラム
がレジス夕CR・RGの内容を認識すれば原理的に時間
の計数が可能となる。この場合、厳密には遅れ時間が生
じるが、プログラムによるレジスタCR・RGの参照回
数を多くして、キャリーCRの上る回数をカバーすれば
補正できる。マイクロ・プログラムでレジスタCR・R
Gの内容を参照することにより、キャリ−CRの上った
回数をマイクロ・プログラム・カウンタで計数する。マ
イクロ・プログラムがレジスタCR・RGの内容を見て
、キャリーCRが上っていれば、これを認識した後、レ
ジスタCR・RGをリセットする。
That is, if the program recognizes the contents of the register CR/RG before the next carry CR goes up, it is theoretically possible to count the time. In this case, strictly speaking, a delay time occurs, but it can be corrected by increasing the number of times the program refers to the registers CR and RG to cover the number of times the carry CR goes up. Register CR/R in micro program
By referring to the contents of G, the micro program counter counts the number of times Carry-CR has risen. The microprogram looks at the contents of registers CR and RG, and if carry CR is up, it recognizes this and then resets registers CR and RG.

第3図により、動作の流れを説明する。先ず、フリー・
ラン状態のカゥンタCTRに初期値をプリセットし(瓜
LPST)、キャリ−・レジスタCR・RGをリセット
した後、カウンタCTR を ス タ ート さ せ
る(RG RST,CTRSTA)。
The flow of operation will be explained with reference to FIG. First, free
After presetting the initial value to the counter CTR in the run state (LPST) and resetting the carry registers CR and RG, start the counter CTR.
(RG RST, CTRSTA).

他の処理を実行しながら、キヤリー・レジスタCR・R
Gの内容を見る(RG=“1”)。“1”になるまで、
これを繰返す。レジスタCR・RGの内容が“1”にな
ったら、レジスタCR・RGリセットする(RGRST
)。メモリのエリアを使用して、キャリーCRの上った
回数を計数する(i=i+1)。計数値iがある一定値
Nになるまで、動作を繰返し、Nになったときこれを読
出す。なお、プログラムでクロック・モードを変更する
場合、比較的時間の早い箇所、バラッキの少し、箇所で
は、クロックを早くし、マイクロ・プログラムは頻繁に
レジスタCR・RGを参照する。
While performing other processing, carry registers CR/R
Look at the contents of G (RG="1"). Until it becomes “1”,
Repeat this. When the contents of registers CR and RG become “1”, reset registers CR and RG (RGRST
). The memory area is used to count the number of times the carry CR has risen (i=i+1). The operation is repeated until the count value i reaches a certain constant value N, and when it reaches N, it is read out. Note that when changing the clock mode in a program, the clock is made faster in places where the time is relatively fast or where there is a little variation, and the microprogram frequently refers to registers CR and RG.

また、ラフでよく、長時間必要な場合には、クロックも
遅くする。このよに、同一のカウンタCTRでも、クロ
ツクの間隔を変えることにより、計数時間を大幅に変更
できる。
Also, if it is rough and requires a long time, the clock should be slowed down. In this way, even with the same counter CTR, the counting time can be changed significantly by changing the clock interval.

また、時間は、初期値を変更することにより、さらに細
〈振分けることができる。
In addition, the time can be divided into even more finely by changing the initial value.

以上のように、本発明によれば、ハードウェアのタイマ
とソフトウェアのタイマとを組合せることにより、例え
ばmsのオーダまではハードウェアでカウントし、それ
以上をソフトウェアでカウントすれば、簡単な回路構成
により長時間の計数ができる。
As described above, according to the present invention, by combining a hardware timer and a software timer, for example, up to the order of ms can be counted by hardware, and beyond that can be counted by software, and a simple circuit can be realized. Depending on the configuration, long-term counting is possible.

また、プログラムで複雑な処理を実行する間にカウント
することができ、マイクロ・プログラムのカウント領域
は少くてすむから制約を受けない。さらに、タイマ装置
を小型にできるので、多種類のタイマを内蔵する処理装
置に適用すればその効果は大である。
Further, since the counting can be performed while the program executes complex processing, and the counting area of the micro program is small, there are no restrictions. Furthermore, since the timer device can be made smaller, the effect will be great if it is applied to a processing device that incorporates many types of timers.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は従来のハードウェアによるタイマのブロック図
、第2図は本発明の実施例を示すタイマ装置のブロック
図、第3図は第2図の動作フロ−・チャートである。 CTR:カウンタ、CLK:クロック、INL:初期値
設定、CR:キャリー、CR・RG:キャリー・レジス
タ、RST:リセット信号、STA:スタート、PST
:プリセット。 第1図 第2図 第3図
FIG. 1 is a block diagram of a conventional hardware timer, FIG. 2 is a block diagram of a timer device showing an embodiment of the present invention, and FIG. 3 is an operation flow chart of FIG. CTR: Counter, CLK: Clock, INL: Initial value setting, CR: Carry, CR/RG: Carry register, RST: Reset signal, STA: Start, PST
:preset. Figure 1 Figure 2 Figure 3

Claims (1)

【特許請求の範囲】[Claims] 1 マイクロ・プログラムによりカウントの初期値設定
およびクロツクの変更をうけるカウンタ、該カウンタの
キヤリー信号によりセツトされ、マイクロ・プログラム
によりリセツトされるキヤリー・レジスタおよび該キヤ
リー・レジスタのセツト出力をマイクロ・プログラムに
より計数するマイクロ・プログラム・カウンタを設けた
ことを特徴とするタイマ装置。
1. A counter whose initial value is set and whose clock is changed by a micro program, a carry register which is set by the carry signal of the counter and reset by the micro program, and a set output of the carry register by the micro program. A timer device characterized by having a micro program counter for counting.
JP53033414A 1978-03-22 1978-03-22 timer device Expired JPS6024968B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP53033414A JPS6024968B2 (en) 1978-03-22 1978-03-22 timer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP53033414A JPS6024968B2 (en) 1978-03-22 1978-03-22 timer device

Publications (2)

Publication Number Publication Date
JPS54124929A JPS54124929A (en) 1979-09-28
JPS6024968B2 true JPS6024968B2 (en) 1985-06-15

Family

ID=12385911

Family Applications (1)

Application Number Title Priority Date Filing Date
JP53033414A Expired JPS6024968B2 (en) 1978-03-22 1978-03-22 timer device

Country Status (1)

Country Link
JP (1) JPS6024968B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58146944A (en) * 1982-02-26 1983-09-01 Toshiba Corp Processor for information
JPS58214951A (en) * 1982-06-08 1983-12-14 Fujitsu Ten Ltd Time counting system using free running counter
JPS59161716A (en) * 1983-03-04 1984-09-12 Nec Corp Timer control system of information processor
JPS62266624A (en) * 1986-05-14 1987-11-19 Nec Corp Counter device
JPH02193097A (en) * 1989-10-30 1990-07-30 Seiko Epson Corp Real time clock

Also Published As

Publication number Publication date
JPS54124929A (en) 1979-09-28

Similar Documents

Publication Publication Date Title
JPS6024968B2 (en) timer device
JPS55162155A (en) Interrupting circuit of microcomputer
JP2792261B2 (en) Alarm start delay circuit
JPH04209020A (en) Microcomputer
JPS58181154A (en) Microprogram tracing device
SU611208A1 (en) Square root computing device
JPS59123957A (en) Digital signal arithmetic device
JP2743353B2 (en) External synchronization circuit
JP2664109B2 (en) Real-time port
JPS60229531A (en) Counting circuit device
SU620978A1 (en) Arrangement for raising number-pulse code to the second power
JPS5652429A (en) Interface circuit of input/output device
JPS6010355A (en) Measuring system of activity ratio of central processing unit
JP2716203B2 (en) Information processing device
JPS59197920A (en) Address controlling device
JPS62239610A (en) Digital signal noise eliminating circuit
JPH03188514A (en) Counting circuit
JPS6230452B2 (en)
JPS58115513A (en) Frequency variable microcomputer
JPS61107441A (en) Response timer control circuit
JPH0683020B2 (en) Digital filter reset device
JPH0439784A (en) Microcomputer
JPH0476127B2 (en)
JPS62239611A (en) Digital signal noise eliminating circuit
JPH04307622A (en) Maximum/minimum value detecting circuit