JPH0773074A - Timer circuit - Google Patents

Timer circuit

Info

Publication number
JPH0773074A
JPH0773074A JP5217141A JP21714193A JPH0773074A JP H0773074 A JPH0773074 A JP H0773074A JP 5217141 A JP5217141 A JP 5217141A JP 21714193 A JP21714193 A JP 21714193A JP H0773074 A JPH0773074 A JP H0773074A
Authority
JP
Japan
Prior art keywords
interrupt
register
time
signal
comparison
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.)
Pending
Application number
JP5217141A
Other languages
Japanese (ja)
Inventor
Katsuto Kawai
克人 河合
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.)
Toyota Motor Corp
Original Assignee
Toyota Motor 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 Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP5217141A priority Critical patent/JPH0773074A/en
Publication of JPH0773074A publication Critical patent/JPH0773074A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide a timer circuit which can measure plural time through the use of a single counter. CONSTITUTION:Differential registers (0-15) and corresponding comparison registers (0-15) are included in a communication controller 20. A bus controller 21 releases the mask bit of an interruption register 27 by an indication from CPU. When interruption corresponding to the bit becomes a permission state, the bus controller 21 adds the values of the corresponding differential registers (0-15) and the output value of a counter 24 in an adder 28, and stores an addition value in the corresponding comparison registers (0-15). When the counter 24 counts up and the value matches with the values of the comparison registers (0-15), a time-up signal is outputted from EX-OR gates 29-0,...29-15 and it is supplied to an interruption controller 22. The interruption controller 22 receives the time-up signal and outputs an interruption signal to an external part.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、通信制御装置に関す
る。特に、複数の制御機器が接続される通信インターフ
ェースに用いられる通信制御装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a communication control device. In particular, it relates to a communication control device used for a communication interface to which a plurality of control devices are connected.

【0002】[0002]

【従来の技術】各種測定装置や、コンピュータなどを接
続するための通信規格として、GPIBや、RS232
Cなどの通信規格が定められている。
2. Description of the Related Art GPIB and RS232 are used as communication standards for connecting various measuring devices and computers.
Communication standards such as C are defined.

【0003】このうち、GPIB(General P
urpose InterfaceBus)は、米国電
気電子学会で1978年に規格として定められたディジ
タルインターフェースで、その規格名からIEEE−4
88とも呼ばれる。
Of these, GPIB (General P
The urpose Interface Bus) is a digital interface defined as a standard by the Institute of Electrical and Electronics Engineers in 1978, and its standard name is IEEE-4.
Also called 88.

【0004】基本となる規格は、米国ヒューレットパッ
カード社(以下、HPと呼ぶ)が、自社の計測器とパー
ソナルコンピュータとのデータの通信を行うために考え
出したパラレルインターフェースである。なお、HPで
は、この規格をHP−IBと呼んでいる。
The basic standard is a parallel interface devised by Hewlett-Packard Company (hereinafter referred to as HP) in the United States in order to communicate data between its measuring instrument and a personal computer. In HP, this standard is called HP-IB.

【0005】図4に、GPIBの接続構成図が示されて
いる。図4に示されているGPIBの接続例において
は、1個の計測・制御装置10に3個の計測機器12−
1、12−2、12−3がGPIBバス14を介して接
続されている。図4において、計測・制御装置10は、
他の計測機器12−1,12−2,12−3に測定の指
示を出したり、測定値を受け取って保存したりする役割
を担っている。図4には、合計4個の装置しか示されて
はいないが、GPIBの規格では最大15台まで装置を
接続することができる。そのため、小・中規模の用途に
おいては、一回線のバスで容易に計測システムを構築可
能である。
FIG. 4 shows a connection configuration diagram of the GPIB. In the GPIB connection example shown in FIG. 4, one measurement / control device 10 has three measurement devices 12-
1, 12-2, 12-3 are connected via the GPIB bus 14. In FIG. 4, the measurement / control device 10 is
It plays a role of issuing a measurement instruction to the other measuring devices 12-1, 12-2, 12-3 and receiving and storing the measured value. Although only four devices are shown in total in FIG. 4, up to 15 devices can be connected in the GPIB standard. Therefore, for small and medium-sized applications, it is possible to easily build a measurement system with a single-line bus.

【0006】[0006]

【発明が解決しようとする課題】従来、GPIBは、接
続機器が少なく、小・中規模の計測システムを構築する
目的で使用され、複数の計測機器を同時に制御するよう
な高機能・高速性を要求される用途には使用されなかっ
た。これは、上述したように、GPIBは、比較的小規
模の計測システムを構築する目的で規定されたものだか
らである。このため、特殊な用途において必要がある場
合には、専用の計測システムが制作されていた。
Conventionally, GPIB has been used for the purpose of constructing a small / medium scale measurement system with few connected devices, and has a high function and high speed to simultaneously control a plurality of measurement devices. It was not used for the required purpose. This is because, as described above, GPIB is defined for the purpose of constructing a relatively small scale measurement system. For this reason, a dedicated measuring system was produced when it was necessary for a special purpose.

【0007】しかし、近年、接続できる機器が豊富で、
安価な装置が多く市場に流布しているGPIBで高機能
・高速化の要求に応えられるシステムの構築が望まれる
ようになった。
However, in recent years, there are many devices that can be connected,
With GPIB, which has been widely distributed in the market for many inexpensive devices, it has become desirable to build a system that can meet the demand for high functionality and high speed.

【0008】ところが、GPIBは、複数の機器を一本
のケーブルで接続するため、トーカ(発信者)は、一度
に一個の機器しかなることはできない。そのため、複数
の計測機器を同時に制御する場合(同時にデータを読み
出しを行う場合等)には、計測・制御装置が、ポーリン
グによって各計測機器のデータ出力のタイミングを常に
監視していなければならない。この結果、ソフトウェア
が複雑となり、処理時間も増大してしまう。
However, since GPIB connects a plurality of devices with one cable, a talker (caller) can have only one device at a time. Therefore, when simultaneously controlling a plurality of measuring devices (when simultaneously reading out data, etc.), the measurement / control device must constantly monitor the timing of data output of each measuring device by polling. As a result, the software becomes complicated and the processing time also increases.

【0009】一方、各計測機器のデータ処理時間(計測
する旨のコマンドが出されてから、実際にデータを出力
できるようになるまで等の処理時間)は、多くの場合、
ほぼ一定である。すなわち、図4における温度計(12
−1)や、圧力計(12−2)などは、単一の物理量を
測定する単一の動作しか行わないため、一般に同一の処
理時間となるのである。
On the other hand, the data processing time of each measuring device (the processing time from when a command to measure is issued until the data can be actually output) is often
It is almost constant. That is, the thermometer (12
Since -1), the pressure gauge (12-2), and the like perform only a single operation of measuring a single physical quantity, the processing time is generally the same.

【0010】従って、上述したポーリングによらなくて
も、タイマによる割り込みを使って複数の機器を制御す
る事が可能である。この場合、タイマ割り込みに対する
処理ルーチンを作成するだけでよいので、ソフトウェア
はそれほど複雑にはならない。 このような考えの下、
タイマ14を組み込んだ計測・制御装置10aが、図5
に示されている。図5に示されているように、このタイ
マ14−1,14−2,…14−15の個数は、制御す
るべき計測機器の個数だけ必要になるので、GPIBの
場合には最大15個のタイマが必要となり、ハードウェ
ア量が膨大なものとなってしまった。
Therefore, it is possible to control a plurality of devices by using an interrupt by a timer without using the above-mentioned polling. In this case, the software does not become so complicated because it is only necessary to create a processing routine for the timer interrupt. Under this idea,
The measurement / control device 10a incorporating the timer 14 is shown in FIG.
Is shown in. As shown in FIG. 5, since the number of timers 14-1, 14-2, ... 14-15 is equal to the number of measuring devices to be controlled, in the case of GPIB, the maximum number of timers is 15. A timer was needed, and the amount of hardware became huge.

【0011】本発明は上記課題に対してなされたもので
あり、その目的は、一個のカウンタのみを用いて、複数
個のタイマ回路と同等の働きをするタイマ回路を得るこ
とである。
The present invention has been made to solve the above problem, and an object thereof is to obtain a timer circuit that operates equivalently to a plurality of timer circuits using only one counter.

【0012】[0012]

【課題を解決するための手段】第一の本発明は上記課題
を解決するために、所定のクロック信号をカウントする
カウント手段と、複数個の差分レジスタと、前記差分レ
ジスタごとに設けられた比較レジスタと、前記カウント
手段のカウンタ出力値と、いずれか一個の前記差分レジ
スタの出力値とを加算し、前記対応する比較レジスタに
格納する加算手段と、前記カウント手段の出力値と、前
記比較レジスタの出力値とを比較し、一致している場合
に、前記比較レジスタごとにタイムアップ信号を出力す
るタイムアップ検出手段と、を含むことを特徴とするタ
イマ回路である。
In order to solve the above-mentioned problems, the first aspect of the present invention, counting means for counting a predetermined clock signal, a plurality of difference registers, and a comparison provided for each of the difference registers. A register, an output value of the counting means, an addition means for adding the output value of any one of the difference registers, and storing the result in the corresponding comparison register, an output value of the counting means, and the comparison register. And a time-up detecting means for outputting a time-up signal for each of the comparison registers when they match each other.

【0013】第二の本発明は上記課題を解決するため
に、第一の本発明のタイマ回路において、割り込み信号
を、前記タイムアップ信号が出力された前記比較レジス
タごとに出力する割り込み信号発生手段を含むことを特
徴とするタイマ回路である。
In order to solve the above-mentioned problems, the second aspect of the present invention is, in the timer circuit of the first aspect of the present invention, an interrupt signal generating means for outputting an interrupt signal for each of the comparison registers to which the time-up signal is output. It is a timer circuit characterized by including.

【0014】第三の本発明は上記課題を解決するため
に、第二の本発明のタイマ回路において、前記比較レジ
スタごとの割り込み信号のマスクを行う割り込みマスク
レジスタを含み、前記割り込み信号ごとに有効/無効を
設定することを特徴とするタイマ回路である。
In order to solve the above problems, a third aspect of the present invention is the timer circuit of the second aspect of the present invention, which includes an interrupt mask register for masking an interrupt signal for each comparison register, and is effective for each interrupt signal. / A timer circuit characterized by setting invalidity.

【0015】第四の本発明は上記課題を解決するため
に、第二または第三の本発明のタイマ回路において、い
ずれかの前記割り込み信号が出力された場合に、前記各
割り込み信号をラッチする割り込みレジスタを含み、前
記ラッチした内容を外部に報知することを特徴とするタ
イマ回路である。
According to a fourth aspect of the present invention, in order to solve the above problems, in the timer circuit of the second or third aspect of the present invention, when any one of the interrupt signals is output, the interrupt signal is latched. A timer circuit characterized by including an interrupt register and notifying the latched contents to the outside.

【0016】第五の本発明は上記課題を解決するため
に、複数の被制御装置と、通信回線を介して接続される
通信制御装置であって、前記各被制御装置ごとに処理待
ち時間を設定し、前記各被制御装置ごとの処理待ち時間
が経過した場合に割り込み信号を出力するタイマ割り込
み手段を含む通信制御装置において、前記タイマ割り込
み手段は、前記第二または第三または第四の本発明のタ
イマ回路であり、前記各被制御装置ごとの処理待ち時間
が前記差分レジスタに設定されることを特徴とする通信
制御装置である。
In order to solve the above-mentioned problems, a fifth aspect of the present invention is a communication control device connected to a plurality of controlled devices via a communication line, wherein a processing waiting time is set for each of the controlled devices. In a communication control device including timer interrupt means for setting and outputting an interrupt signal when a processing waiting time for each controlled device has elapsed, the timer interrupt means is the second or third or fourth book. It is a timer circuit of the invention, and is a communication control device characterized in that the processing waiting time for each of the controlled devices is set in the difference register.

【0017】[0017]

【作用】第1の本発明における加算手段は、カウント手
段のカウンタ出力値と、差分レジスタの出力値とを加算
する。そして、その差分レジスタに対応する比較レジス
タに格納する。従って、比較レジスタに格納されている
値は、カウンタ出力値より、差分レジスタの出力値分だ
け大きくなる。
The adding means in the first aspect of the present invention adds the counter output value of the counting means and the output value of the difference register. Then, it is stored in the comparison register corresponding to the difference register. Therefore, the value stored in the comparison register is larger than the counter output value by the output value of the difference register.

【0018】第2の本発明における割込信号発生手段
は、各比較レジスタ毎に、そのタイムアップ信号が出力
されたならば、すぐに対応して割込信号を出力する。従
って、複数個の比較レジスタ毎に、異なるタイムアップ
時間をもって割込信号を出力することができる。
The interrupt signal generating means in the second aspect of the present invention outputs the corresponding interrupt signal immediately after the time-up signal is output for each comparison register. Therefore, the interrupt signal can be output with different time-up times for each of the plurality of comparison registers.

【0019】第3の本発明におけるマスクレジスタは、
複数の割込信号毎に、その有効/無効を設定する。従っ
て、複数個の比較レジスタのうち、必要な個数の割込信
号のみを有効にすることが可能である。
The mask register in the third invention is
The validity / invalidity is set for each of a plurality of interrupt signals. Therefore, it is possible to enable only the required number of interrupt signals among the plurality of comparison registers.

【0020】第4の本発明における割込レジスタは、複
数個の割込信号をラッチする。従って、外部からこのラ
ッチされた内容を読み出すことにより、どの割込信号が
発生したのかを知ることが可能である。
The interrupt register according to the fourth aspect of the present invention latches a plurality of interrupt signals. Therefore, it is possible to know which interrupt signal has occurred by reading the latched contents from the outside.

【0021】第5の本発明におけるタイマ割込手段は、
上記第2または第3または第4の本発明のタイマ回路で
あって、その複数個の差分レジスタに、処理すべき各被
制御装置毎の処理待ち時間が設定されているので、それ
ぞれの差分レジスタに設定されている時間の経過後にそ
れぞれ割込信号を発生する。
The timer interrupt means in the fifth aspect of the present invention is
In the timer circuit according to the second, third, or fourth aspect of the present invention, since the processing waiting time for each controlled device to be processed is set in the plurality of difference registers, An interrupt signal is generated after the elapse of the time set to.

【0022】[0022]

【実施例】以下、本発明の好適な実施例を図面に基づい
て説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT A preferred embodiment of the present invention will be described below with reference to the drawings.

【0023】図2には、本発明の好適な実施例である通
信制御装置のブロック構成図が示されている。本実施例
においては、従来の計測・制御装置10a(図5参照)
と異なり、単一のGPIB割込タイマのみで複数個の計
測機器に対応した複数個の期間の経過後に割込信号を出
力する。すなわち、本実施例におけるGPIB割込タイ
マ20は、図5におけるタイマ14−1、14−2、…
14−15、及び割込コントローラと同等の働きを有す
る。
FIG. 2 shows a block diagram of a communication control apparatus according to a preferred embodiment of the present invention. In this embodiment, the conventional measurement / control device 10a (see FIG. 5) is used.
Unlike the above, only a single GPIB interrupt timer outputs an interrupt signal after a lapse of a plurality of periods corresponding to a plurality of measuring devices. That is, the GPIB interrupt timer 20 in this embodiment is the timers 14-1, 14-2, ... In FIG.
14-15 and an interrupt controller.

【0024】本実施例において特徴的なことは、このG
PIB割込タイマ20が、単一のカウンタのみを有して
いる点である。これによって、ハードウェアが増大する
のを防止し、小型の通信制御装置を得ることが可能とな
る。
The characteristic of this embodiment is that this G
The PIB interrupt timer 20 has only a single counter. This makes it possible to prevent an increase in hardware and obtain a small communication control device.

【0025】本実施例におけるGPIB割込タイマ20
の詳細な構成ブロック図が図2に示されている。図1に
示されているように、GPIB割込タイマ20は、バス
・コントローラ21を介してCPUバスに接続されてい
る。すなわち、本実施例においてはGPIB割込タイマ
20は、CPUから見て、メモリまたはI/O回路の一
部として存在している。このバス・コントローラ21
は、CPUからの指令によって、内部レジスタ(差分レ
ジスタ0〜15、割込レジスタ、割込マスクレジスタ)
に保持されている値をCPUへ送出したり、あるいは所
定の値を内部レジスタに設定したりする。また、このバ
ス・コントローラ21はカウンタ24と、いずれか1個
の差分レジスタ(0〜15)との値を加算器28におい
て加算させ、その加算結果を各差分レジスタ(0〜1
5)に対応して設けられている比較レジスタ(0−1
5)のうち対応する比較レジスタに格納する。
GPIB interrupt timer 20 in this embodiment
A detailed configuration block diagram of the above is shown in FIG. As shown in FIG. 1, the GPIB interrupt timer 20 is connected to the CPU bus via a bus controller 21. That is, in this embodiment, the GPIB interrupt timer 20 exists as a part of the memory or the I / O circuit as seen from the CPU. This bus controller 21
Is an internal register (difference register 0 to 15, interrupt register, interrupt mask register) according to a command from the CPU.
The value held in is sent to the CPU, or a predetermined value is set in the internal register. Further, the bus controller 21 causes the adder 28 to add the values of the counter 24 and any one of the difference registers (0 to 15), and the addition result is added to each of the difference registers (0 to 1).
5) corresponding to the comparison register (0-1
Store in the corresponding comparison register in 5).

【0026】カウンタ24は、外部からのクロック信号
φをカウントするカウンタである。このクロック信号φ
としては、CPUのクロック信号や、GPIBのクロッ
ク信号が供給される。本実施例においてはこのカウンタ
24はアップカウンタであり、カウンタ24の保持する
値はクロック信号φに同期してインクリメントされる。
The counter 24 is a counter for counting the clock signal φ from the outside. This clock signal φ
The CPU clock signal and the GPIB clock signal are supplied. In this embodiment, the counter 24 is an up counter, and the value held by the counter 24 is incremented in synchronization with the clock signal φ.

【0027】差分レジスタ(0〜15)は、上述したよ
うにバス・コントローラ21を介して、CPUから所定
の値が格納される。後述するように、この差分レジスタ
(0〜15)に保持されている値は加算器28において
カウンタ24の出力値と加算され、それぞれ対応する比
較レジスタ(0〜15)に格納される。この比較レジス
タ(0〜15)に保持されている値は、後述するように
カウンタ24の出力値と比較され、一致していた場合に
は割込信号が出力される。この点が、本実施例において
特徴的な構成であり、種々の作用効果を奏する点であ
る。すなわち、カウンタ24の出力値と比較される値
を、複数の比較レジスタ(0〜15)に保持させたの
で、複数のインターバルを有する割込タイマを実現する
ことが可能となったのである。これによって、従来複数
のタイマ割込を実現するのにあたって複数個のカウンタ
24が必要であったのが、僅か1個のカウンタ24で実
現されている。
The difference register (0 to 15) stores a predetermined value from the CPU via the bus controller 21 as described above. As will be described later, the value held in the difference register (0 to 15) is added to the output value of the counter 24 in the adder 28 and stored in the corresponding comparison register (0 to 15). The value held in the comparison register (0 to 15) is compared with the output value of the counter 24 as described later, and if they match, an interrupt signal is output. This point is a characteristic configuration of the present embodiment, and has various operational effects. That is, since the value to be compared with the output value of the counter 24 is held in a plurality of comparison registers (0 to 15), it is possible to realize an interrupt timer having a plurality of intervals. As a result, a plurality of counters 24 are conventionally required to realize a plurality of timer interrupts, but only one counter 24 is used.

【0028】すなわち、この差分レジスタ(0〜15)
に格納される値は、割込信号が出力されるまでの時間が
設定されるのである。そして、それぞれ対応する比較レ
ジスタ(0〜15)には、この差分レジスタ(0〜1
5)に設定された時間をカウンタ24の現在の出力値に
加算した値が設定される。従って、比較レジスタ(0〜
15)には、現在のカウンタ24の値にかかわらず、常
にそのカウンタ24の出力値に差分レジスタ(0〜1
5)に保持されている時間を加算した値が設定される。
That is, this difference register (0 to 15)
The value stored in is set to the time until the interrupt signal is output. The difference registers (0 to 1) are stored in the corresponding comparison registers (0 to 15).
A value obtained by adding the time set in 5) to the current output value of the counter 24 is set. Therefore, the comparison register (0
15), regardless of the current value of the counter 24, the difference register (0 to 1) is always added to the output value of the counter 24.
A value obtained by adding the time held in 5) is set.

【0029】なお、この差分レジスタ(0〜15)に格
納する時間を表す値は、GPIBの計測システムが完成
した時に実測によって求めるのが好適である。または、
この計測システムの電源投入時に、全ての計測機器の処
理時間をソフトウェアによって求めても好適である。
The value representing the time to be stored in the difference register (0 to 15) is preferably obtained by actual measurement when the GPIB measurement system is completed. Or
It is also preferable that the processing time of all the measuring devices be obtained by software when the power of the measuring system is turned on.

【0030】比較レジスタ(0〜15)には、上述した
ようにそれぞれ対応する差分レジスタ(0〜15)とカ
ウンタ24の出力値とが加算された値が設定される。従
って、この設定された時点において比較レジスタ(0〜
15)に保持されている値はカウンタ24の出力値より
常に差分レジスタ(0〜15)に保持されている値だけ
大きくなる。その結果、比較レジスタ(0〜15)に値
が設定された時点から、差分レジスタ(0〜15)に保
持されている値(時間)だけ時間が経過した後、比較レ
ジスタ(0〜15)とカウンタ24の出力値とは等しく
なる。各比較レジスタ(0〜15)には、それぞれEX
−ORゲート29−0、…29−15が接続されてい
る。図1においては省略して1本の線で描かれている
が、それぞれのEX−ORゲート29−0、…29−1
5は比較レジスタ(0〜15)及びカウンタ24と同数
のビットを有しており、対応する比較レジスタ(0〜1
5)と、カウンタ24の出力値とを常に比較している。
そして、両者が同一の値である場合にはタイムアップ信
号を割込コントローラ22に供給する。
In the comparison register (0 to 15), a value obtained by adding the corresponding difference register (0 to 15) and the output value of the counter 24 as described above is set. Therefore, the comparison register (0 to
The value held in 15) is always larger than the output value of the counter 24 by the value held in the difference register (0 to 15). As a result, from the time when the value is set in the comparison register (0 to 15), after the time (value) held in the difference register (0 to 15) elapses, It becomes equal to the output value of the counter 24. EX in each comparison register (0 to 15)
-OR gates 29-0, ..., 29-15 are connected. Although not shown in FIG. 1 by one line, each EX-OR gate 29-0, ... 29-1
5 has the same number of bits as the comparison register (0 to 15) and the counter 24, and the corresponding comparison register (0 to 1).
5) and the output value of the counter 24 are constantly compared.
Then, when both have the same value, the time-up signal is supplied to the interrupt controller 22.

【0031】加算器28は、前記バス・コントーラ21
の指示によって、差分レジスタ(0−15)とカウンタ
24の出力値とを加算して、その加算結果を対応する比
較レジスタ(0〜15)に格納する。このように、加算
はバス・コントローラ21の指示によって行われるが、
同時にどの差分レジスタ(0〜15)の値がカウンタ2
4の出力値と加算されて、対応する比較レジスタ(0〜
15)に格納するかもバス・コントローラ21によって
指定される。すなわち、バス・コントローラ21は加算
器28に加算させる際、加算器28の入力に設けられて
いるセレクタ28aと、加算器28の出力に設けられて
いるセレクタ28bとを適宜切り換える。
The adder 28 is connected to the bus controller 21.
The difference register (0-15) and the output value of the counter 24 are added, and the addition result is stored in the corresponding comparison register (0-15). In this way, the addition is performed by the instruction of the bus controller 21,
At the same time, the value of which difference register (0 to 15) is the counter 2
4 is added to the output value of the corresponding comparison register (0 to
The bus controller 21 also specifies whether to store in 15). That is, the bus controller 21 appropriately switches between the selector 28 a provided at the input of the adder 28 and the selector 28 b provided at the output of the adder 28 when the addition is performed by the adder 28.

【0032】割込コントローラ22は、EX−ORゲー
ト29−0、…29−15からのタイムアップ信号を受
信し、割込信号を外部のCPUへ送出する。割込コント
ローラ22は、いずれかのEX−ORゲート29−0、
…29−15からのタイムアップ信号を受信すると、ま
ず割込マスクレジスタ27を読み出す。そしてこの割込
マスクレジスタ27から読み出した値に基づいてどのタ
イムアップ信号がマスクされているかを知るのである。
この割込マスクレジスタ27は16ビットのレジスタで
あって、各1ビットがそれぞれ対応する比較レジスタ
(0〜15)からEX−ORゲート29−0、…29−
15を介して出力されるタイムアップ信号をマスクする
か否かを表す。例えば、割込マスクレジスタ27の所定
の1ビットが「0」であれば対応するタイムアップ信号
はマスクされずに有効である。しかし、所定のビットが
「1」であれば、対応するタイムアップ信号はいわゆる
マスクされた状態であり、このタイムアップ信号が出力
されても、割込コントローラ22は外部に割込信号を送
出することはない。このようにして、割込コントローラ
22は、割込マスクレジスタ27によってマスクされて
いないタイムアップ信号が出力された場合に外部に割込
信号を出力する。信号を出力するのと同時に、割込コン
トローラ22は割込信号の要因となったタイムアップ信
号に対応する割込レジスタ26の中の所定の位置のビッ
トを「1」にセットする。この割込レジスタ26も、比
較レジスタ(0〜15)と同数個のビットを有してお
り、割込コントローラ22は、外部に割込信号を出力す
ると同時に出力されたタイムアップ信号に対応する位置
のビットを「1」にした値を割込レジスタ26に格納す
る。割込レジスタ26は、このように割込の原因となっ
たタイムアップ信号を保持しているため、CPUがバス
・コントローラ21を通じて割込レジスタ26の値を読
むことによりどの種類の割込が生じたかを知ることが可
能である。
The interrupt controller 22 receives the time-up signal from the EX-OR gates 29-0, ... 29-15 and sends the interrupt signal to the external CPU. The interrupt controller 22 uses one of the EX-OR gates 29-0,
When the time-up signal from 29-15 is received, the interrupt mask register 27 is first read. Then, it is possible to know which time-up signal is masked based on the value read from the interrupt mask register 27.
This interrupt mask register 27 is a 16-bit register, and each 1-bit corresponds to a corresponding comparison register (0 to 15) to an EX-OR gate 29-0, ... 29-.
It indicates whether or not the time-up signal output via 15 is masked. For example, if a predetermined 1 bit of the interrupt mask register 27 is "0", the corresponding time-up signal is valid without being masked. However, if the predetermined bit is "1", the corresponding time-up signal is in a so-called masked state, and even if this time-up signal is output, the interrupt controller 22 sends the interrupt signal to the outside. There is no such thing. In this way, the interrupt controller 22 outputs the interrupt signal to the outside when the time-up signal not masked by the interrupt mask register 27 is output. At the same time as outputting the signal, the interrupt controller 22 sets a bit at a predetermined position in the interrupt register 26 corresponding to the time-up signal which is a factor of the interrupt signal to "1". The interrupt register 26 also has the same number of bits as the comparison registers (0 to 15), and the interrupt controller 22 outputs the interrupt signal to the outside and, at the same time, the position corresponding to the time-up signal output. The value in which the bit of is set to “1” is stored in the interrupt register 26. Since the interrupt register 26 holds the time-up signal that caused the interrupt in this way, the CPU reads the value of the interrupt register 26 through the bus controller 21 to generate any kind of interrupt. It is possible to know how.

【0033】割込レジスタ26で「1」にセットされた
位置に対応した割込マスクレジスタ27のビットは
「1」となり、次の割り込みを禁止する。
The bit of the interrupt mask register 27 corresponding to the position set to "1" in the interrupt register 26 becomes "1", and the next interrupt is prohibited.

【0034】また、CPUは、バス・コントローラ21
を通じて割込マスクレジスタ27に所定の値を書き込む
ことができる。ここに書き込む値の所定のビットを
「1」にすることにより、そこに対応する比較レジスタ
(0〜15)に格納されている値がカウンタ24の出力
値と一致したことを要因とする割込をマスクすることが
可能である。なお、本実施例におけるバス・コントロー
ラ21は、割込レジスタ27に書込みがあるか否かを常
に監視しており、書込みがあった場合には書き込まれる
前の値と、新たに書き込まれた値とを比較しマスクが解
除された比較レジスタ(0〜15)があるか否かについ
て判断をする。
Further, the CPU is the bus controller 21.
A predetermined value can be written in the interrupt mask register 27 through. By setting a predetermined bit of the value to be written here to "1", an interrupt caused by the fact that the value stored in the corresponding comparison register (0 to 15) matches the output value of the counter 24 Can be masked. Note that the bus controller 21 in this embodiment constantly monitors whether or not there is a write in the interrupt register 27. If there is a write, the value before the write and the newly written value are written. Are compared to determine whether or not there is a comparison register (0 to 15) whose mask has been released.

【0035】そして、マスクが解除された比較レジスタ
(0〜15)があった場合には、それに対応する差分レ
ジスタ(0〜15)とカウンタ24の出力値とを加算器
28において加算させ、その値を対応する(すなわち、
マスク解除された)比較レジスタ(0〜15)に格納す
る。勿論、マスク解除された比較レジスタ(0〜15)
が複数個あった場合には、係る加算は複数回行われる。
すなわち、スタートが指示された(マスク解除された)
比較レジスタ(0〜15)には、新たに比較値が格納さ
れるのである。
When there is a comparison register (0 to 15) whose mask has been released, the difference register (0 to 15) corresponding to it and the output value of the counter 24 are added in the adder 28, Corresponds to a value (ie
Store in unregistered compare register (0-15). Of course, the masked comparison register (0 to 15)
If there are a plurality of items, the addition is performed a plurality of times.
That is, start was instructed (mask released)
The comparison value is newly stored in the comparison register (0 to 15).

【0036】そして、この場合の加算器28の入力と出
力の切替は、加算器28の入力及び出力に備えられてい
るセレクタ28a,28bをバス・コントローラ21が
制御することにより自動的に行われる。つまり、CPU
は、各差分レジスタ(0〜15)に所定の値を書き込ん
だ後、利用したいタイマに対応したビット以外のビット
を全て「1」にした値を割込レジスタ27に格納するだ
けで、自動的に比較レジスタ(0〜15)に所定の値が
設定されるのである。
In this case, switching between the input and the output of the adder 28 is automatically performed by the bus controller 21 controlling the selectors 28a and 28b provided at the input and the output of the adder 28. . That is, CPU
After writing a predetermined value to each difference register (0 to 15), all the bits except the bit corresponding to the timer you want to use are set to "1" and stored in the interrupt register 27. A predetermined value is set in the comparison register (0 to 15).

【0037】本実施例における通信制御装置20内部の
CPUが実行すべきプログラムの例が図3のフローチャ
ートに示されている。図3に示されているように、電源
投入後の初期設定においてはステップS3−1に示され
ているように差分レジスタ(0〜15)に所定のカウン
ト値を設定する。このカウント値は、上述したようにタ
イマ割込の際のインターバルの時間を表す。
An example of a program to be executed by the CPU inside the communication control device 20 in this embodiment is shown in the flowchart of FIG. As shown in FIG. 3, in the initialization after the power is turned on, a predetermined count value is set in the difference register (0 to 15) as shown in step S3-1. This count value represents the time of the interval at the time of timer interruption as described above.

【0038】そして、GPIB処理においては、ステッ
プS3−2に示されているようにまず計測機1にデータ
読出しを指示する。ここで、例えば計測機1は図4に示
されているように温度計などの測定機器である。
In the GPIB processing, first, the measuring instrument 1 is instructed to read data as shown in step S3-2. Here, for example, the measuring instrument 1 is a measuring instrument such as a thermometer as shown in FIG.

【0039】次に、ステップS3−3において、割込マ
スクレジスタ27のビット0がクリア「0」に設定され
る。なお、割込マスクレジスタ27は、電源投入時のパ
ワーオンリセットによって全てビットが「1」に設定さ
れている。すなわち、このステップS3−3において割
込マスクレジスタ27の値はビット0のみが「0」とな
り、その他のビットは全て「1」のままである。
Next, in step S3-3, bit 0 of the interrupt mask register 27 is set to clear "0". All bits of the interrupt mask register 27 are set to "1" by power-on reset when the power is turned on. That is, in this step S3-3, only the bit 0 of the value of the interrupt mask register 27 becomes "0", and all other bits remain "1".

【0040】なお、上述したように、本実施例における
バス・コントローラ21は割込マスクレジスタ27のい
ずれかのビットがマスク解除される(すなわち、ビット
が「1」から「0」となる)のを監視しており、マスク
が解除されたと判断したならば、対応する差分レジスタ
0の値とカウンタ24の出力値とを加算器28において
加算する。この際加算器28の入力側のセレクタ28a
が差分レジスタ0に切り替えられていることは上述した
通りである。さらに、加算器28の出力側に設けられて
いるセレクタ28bも比較レジスタ0に切り替えられて
おり、加算器28の加算出力値が比較レジスタ0に格納
される。これらの、一連の加算・格納はバス・コントロ
ーラ21によって自動的に行われ、CPUのプログラム
としては現れてはこない。すなわちCPUからはステッ
プS3−3において行われるように割込マスクレジスタ
27のビット0がクリアされるだけである。
As described above, in the bus controller 21 of this embodiment, any bit of the interrupt mask register 27 is unmasked (that is, the bit is changed from "1" to "0"). When it is determined that the mask is released, the adder 28 adds the corresponding value of the difference register 0 and the output value of the counter 24. At this time, the selector 28a on the input side of the adder 28
Is switched to the difference register 0 as described above. Further, the selector 28b provided on the output side of the adder 28 is also switched to the comparison register 0, and the addition output value of the adder 28 is stored in the comparison register 0. These series of addition / storing are automatically performed by the bus controller 21 and do not appear as a program of the CPU. That is, the CPU simply clears bit 0 of the interrupt mask register 27 as is done in step S3-3.

【0041】所定の時間が経過して、割込レジスタ0に
保持されている値と、カウンタ24の出力値とが一致し
たならばEX−ORゲート29−0がタイムカップ信号
を出力し、その結果割込コントローラ22が割込信号を
CPUに対して出力する。そして、このタイマ割込の処
理ルーチンにおいてはステップS3−4において割込レ
ジスタ26がまず読み出される。この割込レジスタ26
を読み出すことにより、割込の要因となった比較レジス
タ(0〜15)が特定される。
If the value held in the interrupt register 0 matches the output value of the counter 24 after a predetermined time has passed, the EX-OR gate 29-0 outputs a time cup signal, Result The interrupt controller 22 outputs an interrupt signal to the CPU. Then, in this timer interrupt processing routine, the interrupt register 26 is first read in step S3-4. This interrupt register 26
By reading out, the comparison register (0 to 15) that caused the interrupt is specified.

【0042】ステップS3−5において、特定したもの
がタイマ0か否かが判断される。
In step S3-5, it is determined whether the specified one is the timer 0.

【0043】上記ステップS3−5においてタイマ0で
あると判断された場合には、ステップS3−6において
計測器1からデータ読出しが可能か否かが検査される。
その結果、計測器1からデータが読み出せた場合には、
ステップS3−7に移行し、実際にデータが読み出さ
れ、割込処理が終了する。
When it is determined that the timer is 0 in step S3-5, it is checked in step S3-6 whether data can be read from the measuring instrument 1.
As a result, when the data can be read from the measuring instrument 1,
The process moves to step S3-7, the data is actually read, and the interrupt process ends.

【0044】上記ステップS3−6において計測器1か
らデータが読み出せない場合には、初期設定において差
分レジスタ(0〜15)に格納したカウント値が小さ過
ぎたものと判断し、ステップS3−8において差分レジ
スタ0の値が補正される。このステップS3−8の処理
の後、再びステップS3−6において計測器1からデー
タが読み出せるか否かについて検査が行われる。そし
て、計測器1からデータが読み出せるようになるまで差
分レジスタ0の値を補正する処理が繰り返される。この
ようにして、差分レジスタの値は、実際の処理の最中に
適宜補正され、もっとも適当な値が設定される。
If the data cannot be read from the measuring instrument 1 in step S3-6, it is determined that the count value stored in the difference register (0 to 15) is too small in the initial setting, and step S3-8 At, the value of the difference register 0 is corrected. After the processing of step S3-8, an inspection is performed again in step S3-6 as to whether or not the data can be read from the measuring instrument 1. Then, the process of correcting the value of the difference register 0 is repeated until the data can be read from the measuring instrument 1. In this way, the value of the difference register is appropriately corrected during the actual processing, and the most appropriate value is set.

【0045】なお、上記ステップS3−5においてタイ
マ0ではなかった場合には他のタイマからの割込である
と判断し他のタイマであるか否かについての検査が行わ
れる。この検査は図3に示されているステップS3−5
からステップS3−8までの処理と基本的に同一である
ので、図3には省略して示さない。
If the timer is not 0 in step S3-5, it is determined that the interrupt is from another timer, and a check is made as to whether or not the timer is another timer. This inspection is step S3-5 shown in FIG.
Since it is basically the same as the processing from steps S3 to S3-8, it is not shown in FIG.

【0046】以上述べたように、本実施例によれば1つ
のカウンタのみを用いて複数の種類のタイマ割込を生じ
させることができる。そのため、本実施例に係る通信制
御装置が同時に複数個の測定機器を制御する場合におい
ても、ハードウェアの量を増加させることなく、かつ、
プログラムが複雑なものとなってしまうのを防止するこ
とが可能である。従って、安価で小型の通信制御装置が
得られ、性能の良い計測システムが構築可能である。
As described above, according to this embodiment, it is possible to generate a plurality of types of timer interrupts using only one counter. Therefore, even when the communication control device according to the present embodiment controls a plurality of measuring devices at the same time, without increasing the amount of hardware, and
It is possible to prevent the program from becoming complicated. Therefore, an inexpensive and small communication control device can be obtained, and a measurement system with good performance can be constructed.

【0047】[0047]

【発明の効果】以上述べたように、第1の本発明によれ
ば、単一のカウント手段のみを用いつつ、複数の時間経
過後にタイマアップ信号をそれぞれ出力することが可能
なタイマ回路が得られる。
As described above, according to the first aspect of the present invention, it is possible to obtain the timer circuit which can output the timer-up signal after a plurality of times have elapsed while using only the single counting means. To be

【0048】また、第2の本発明によれば第1の本発明
のタイマ回路に割込信号発生手段を適用したので、単一
のカウント手段を用いつつ、複数の時間経過後にタイマ
割込を起すことが可能なタイマ回路が得られる。
Further, according to the second aspect of the present invention, the interrupt signal generating means is applied to the timer circuit of the first aspect of the present invention. Therefore, while using a single counting means, the timer interrupt is generated after a plurality of times have elapsed. A timer circuit that can be activated is obtained.

【0049】第3の本発明によれば、上記第3の本発明
におけるタイマ回路に、複数の割込信号のそれぞれに対
してその有効/無効を設定することができるマスクレジ
スタをさらに備え付けたので、割込信号を出力させるタ
イマの種類を任意の個数に設定することが可能である。
According to the third aspect of the present invention, the timer circuit of the third aspect of the present invention is further provided with a mask register capable of setting valid / invalid of each of a plurality of interrupt signals. It is possible to set an arbitrary number of timers for outputting an interrupt signal.

【0050】第4の本発明によれば、上記第2または第
3の本発明のタイマ回路に割込信号をラッチする割込レ
ジスタをさらに備え付けたので、外部の上位制御装置は
このラッチした内容を読み出すことにより、複数個のタ
イマのうちどのタイマから割込信号が生じたのかを知る
ことが可能である。
According to the fourth aspect of the present invention, the timer circuit of the second or third aspect of the present invention further includes an interrupt register for latching an interrupt signal. It is possible to know from which of a plurality of timers the interrupt signal has occurred by reading out.

【0051】第5の本発明によれば、上記第2または第
3または第4の本発明のタイマ回路をタイマ割込手段と
して用いた通信制御装置において、そのタイマ回路に、
各被制御装置毎の処理待ち時間を設定した。そのため、
各被制御装置が処理が完了した時点を検知するため、常
にポーリング等によって通信回線を常に監視する必要が
ない。
According to the fifth aspect of the present invention, in the communication control device using the timer circuit of the second, third or fourth aspect of the present invention as timer interrupt means,
The processing waiting time was set for each controlled device. for that reason,
Since each controlled device detects the time when the processing is completed, it is not necessary to constantly monitor the communication line by polling or the like.

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

【図1】図2に示されているGPIB割込タイマ20の
詳細な構成を示す構成ブロック図である。
1 is a configuration block diagram showing a detailed configuration of a GPIB interrupt timer 20 shown in FIG.

【図2】本発明の好適な実施例に係る通信制御装置の構
成ブロック図である。
FIG. 2 is a configuration block diagram of a communication control device according to a preferred embodiment of the present invention.

【図3】本実施例において、CPUが実行すべきソフト
ウェアの動作を表すフローチャートである。
FIG. 3 is a flowchart showing an operation of software to be executed by a CPU in the present embodiment.

【図4】従来のGPIBの接続を表す構成図である。FIG. 4 is a configuration diagram showing a connection of a conventional GPIB.

【図5】図4における計測・制御装置10が複数のタイ
マ割込を発生する場合の構成図である。
5 is a configuration diagram when the measurement / control device 10 in FIG. 4 generates a plurality of timer interrupts. FIG.

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

21 バス・コントローラ 22 割込コントローラ 24 カウンタ 26 割込レジスタ 27 割込マスクレジスタ 28 加算器 28a,28b セレクタ 29−0、…29−15 EX−ORゲート 21 bus controller 22 interrupt controller 24 counter 26 interrupt register 27 interrupt mask register 28 adder 28a, 28b selector 29-0, ... 29-15 EX-OR gate

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 所定のクロック信号をカウントするカウ
ント手段と、 複数個の差分レジスタと、 前記差分レジスタごとに設けられた比較レジスタと、 前記カウント手段のカウンタ出力値と、いずれか一個の
前記差分レジスタの出力値とを加算し、前記対応する比
較レジスタに格納する加算手段と、 前記カウント手段の出力値と、前記比較レジスタの出力
値とを比較し、一致している場合に、前記比較レジスタ
ごとにタイムアップ信号を出力するタイムアップ検出手
段と、 を含むことを特徴とするタイマ回路。
1. A counting means for counting a predetermined clock signal, a plurality of difference registers, a comparison register provided for each difference register, a counter output value of the counting means, and any one of the differences. Adder means for adding the output value of the register and storing in the corresponding comparison register, the output value of the counting means and the output value of the comparison register are compared, and if they match, the comparison register A timer circuit comprising: a time-up detecting means for outputting a time-up signal for each time.
【請求項2】 請求項1記載のタイマ回路において、 割り込み信号を、前記タイムアップ信号が出力された前
記比較レジスタごとに出力する割り込み信号発生手段を
含むことを特徴とするタイマ回路。
2. The timer circuit according to claim 1, further comprising: an interrupt signal generating unit that outputs an interrupt signal for each of the comparison registers to which the time-up signal is output.
【請求項3】 請求項2記載のタイマ回路において、 前記比較レジスタごとの割り込み信号のマスクを行う割
り込みマスクレジスタを含み、前記割り込み信号ごとに
有効/無効を設定することを特徴とするタイマ回路。
3. The timer circuit according to claim 2, further comprising an interrupt mask register for masking an interrupt signal for each of the comparison registers, and setting valid / invalid for each of the interrupt signals.
【請求項4】 請求項2または3記載のタイマ回路にお
いて、 いずれかの前記割り込み信号が出力された場合に、前記
各割り込み信号をラッチする割り込みレジスタを含み、
前記ラッチした内容を外部に報知することを特徴とする
タイマ回路。
4. The timer circuit according to claim 2, further comprising an interrupt register that latches each of the interrupt signals when any of the interrupt signals is output.
A timer circuit for notifying the latched content to the outside.
【請求項5】 複数の被制御装置と、通信回線を介して
接続される通信制御装置であって、 前記各被制御装置ごとに処理待ち時間を設定し、前記各
被制御装置ごとの処理待ち時間が経過した場合に割り込
み信号を出力するタイマ割り込み手段を含む通信制御装
置において、 前記タイマ割り込み手段は、前記請求項2または3また
は4記載のタイマ回路であり、前記各被制御装置ごとの
処理待ち時間が前記差分レジスタに設定されることを特
徴とする通信制御装置。
5. A communication control device connected to a plurality of controlled devices via a communication line, wherein a processing waiting time is set for each of the controlled devices, and a processing waiting time is set for each of the controlled devices. In a communication control device including a timer interrupt unit that outputs an interrupt signal when time has elapsed, the timer interrupt unit is the timer circuit according to claim 2, 3 or 4, and the process for each controlled device A communication control device, wherein a waiting time is set in the difference register.
JP5217141A 1993-09-01 1993-09-01 Timer circuit Pending JPH0773074A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5217141A JPH0773074A (en) 1993-09-01 1993-09-01 Timer circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5217141A JPH0773074A (en) 1993-09-01 1993-09-01 Timer circuit

Publications (1)

Publication Number Publication Date
JPH0773074A true JPH0773074A (en) 1995-03-17

Family

ID=16699503

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5217141A Pending JPH0773074A (en) 1993-09-01 1993-09-01 Timer circuit

Country Status (1)

Country Link
JP (1) JPH0773074A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100462736B1 (en) * 2003-04-30 2004-12-23 삼성전자주식회사 Timer capable of generating a plural time interrupt signal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100462736B1 (en) * 2003-04-30 2004-12-23 삼성전자주식회사 Timer capable of generating a plural time interrupt signal

Similar Documents

Publication Publication Date Title
US5729678A (en) Bus monitor system
EP0592165B1 (en) Pulse generation/sensing arrangement for use in a microprocessor system
JPS5829197A (en) Dynamic memory refleshing circuit
JPH0773074A (en) Timer circuit
US5235699A (en) Timing calibrate and track control circuit
US4802089A (en) Status flag handling in a digital data processing system
JP3082721B2 (en) Timer device
US5761482A (en) Emulation apparatus
US6266626B1 (en) ROM data verification circuit
JPS61267858A (en) Microcomputer
JP3887059B2 (en) Data writing method, data reading method, and memory circuit
JP3158425B2 (en) Microcomputer
JPS5965356A (en) Single-chip microcomputer
US5497481A (en) Microcomputer computer system having plural programmable timers and preventing memory access operations from interfering with timer start requests
WO2002001363A1 (en) Memory control device, and memory control method
JPS6362776B2 (en)
JP2789906B2 (en) MPU peripheral device
JP2530040Y2 (en) Full-duplex communication method by serial communication
JPH07146814A (en) Memory device
KR100446722B1 (en) Timer circuit, specially enabling a stable operation by generating a counter enable signal, and effectively conducting a test function by predicting a counting value of a timer
JPS60142433A (en) Generating device of false error signal
JPH02157957A (en) Microprocessor
JPS5933079Y2 (en) Data event measurement device
JP2709201B2 (en) Microcomputer
KR0174512B1 (en) Refresh Timing Generation Circuit