JPH01236817A - Pulse counter - Google Patents
Pulse counterInfo
- Publication number
- JPH01236817A JPH01236817A JP6415588A JP6415588A JPH01236817A JP H01236817 A JPH01236817 A JP H01236817A JP 6415588 A JP6415588 A JP 6415588A JP 6415588 A JP6415588 A JP 6415588A JP H01236817 A JPH01236817 A JP H01236817A
- Authority
- JP
- Japan
- Prior art keywords
- counter
- value
- read
- processor
- register
- 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
Links
Landscapes
- Executing Machine-Instructions (AREA)
Abstract
Description
【発明の詳細な説明】
〔概要〕
カウンタのビット艮がプロセッサのデータバス長よりも
長い場合で、ブロセッVがカウンタの値を上位、下位に
分割して読出す方式のパルスカウント装置に関し、
プロセッサのカウンタリード期間にパルス入力があって
カウンタ値が変化した場合でも、比較的小さなソフトウ
ェア負荷でカウンタ値を正確にリードできることを目的
とし、カウンタとブ[1セツサとの間に、複数のビット
群の数に対応して設けられた複数のレジスタと、カウン
タ値を複数のレジスタに転送する際、レジスタ転送中に
カウンタ値が変化しないようにレジスタ転送タイミング
とカウンタへのカウンタ入力パルスタイミングとを同期
させるパルス同期化回路と、プロセッサが複数のレジス
タのレジスタ値をレジスタ転送終了後からリードしてい
る期間、複数のレジスタのレジスタ値更新を禁止するレ
ジスタ更新制御回路とから構成する。[Detailed Description of the Invention] [Summary] A pulse counting device in which a processor V divides the value of the counter into upper and lower parts and reads it out when the bit length of the counter is longer than the data bus length of the processor. Even if there is a pulse input during the counter read period and the counter value changes, the purpose is to read the counter value accurately with a relatively small software load. When transferring the counter value to multiple registers, the register transfer timing and the counter input pulse timing to the counter are synchronized so that the counter value does not change during register transfer. and a register update control circuit that prohibits updating of the register values of the plurality of registers during the period when the processor is reading the register values of the plurality of registers after register transfer is completed.
本発明は、カウンタのビット艮がプロセッサのデータバ
ス艮よりも良い場合で、ブ[1セツサがカウンタの値を
上位、下位等′f2数に分37J L、て読出す方式の
パルスカウント装置に関する。The present invention relates to a pulse counting device in which the bit distribution of the counter is better than that of the data bus of the processor, and a setter divides the value of the counter into f2 numbers such as upper and lower. .
本発明になるパルスカウント装置は、例えば流量81や
温度計等の観測装置がデータ化をパルス数で伝送し、プ
ロセッサでパルスカウント値をgInしであるタイミン
グでカウンタ値をリードし、前回の値と今回の値とを比
較することによりデータ量変化を監視するシステム等に
用いられる。このようなプロセッサでカウンタ値をリー
ドするシステムでは、なるべく小ざなソフトウェア負荷
で、しかbカウンタ値を正確にリードすることが必要で
ある。In the pulse counting device of the present invention, for example, an observation device such as a flow rate 81 or a thermometer transmits data in the form of a pulse number, and a processor reads the pulse count value gIn and reads the counter value at a certain timing. This is used in systems that monitor changes in data volume by comparing the current value with the current value. In a system that uses such a processor to read the counter value, it is necessary to read the b counter value accurately with as little software load as possible.
従来、流量計や温度計等の観測装置からの変化データを
パルス数として伝送し、プロセッサで集中監視するシス
テムがある。このシス゛jムを第6図に示す。Conventionally, there is a system that transmits change data from observation devices such as flowmeters and thermometers as pulse numbers, and centrally monitors the data using a processor. This system is shown in FIG.
入力パルスはカウンタ3に入力される。カウンタ3はデ
ータバスの幅の出力バッフ?(レジスタン4I〜43に
mき込みを行う。プロセッサ5はアドレスデコーダ6を
動作させ、各出カバソファ41〜43の順番に読み出す
。The input pulse is input to the counter 3. Is counter 3 an output buffer with the width of the data bus? (The registers 4I to 43 are written in m. The processor 5 operates the address decoder 6 and reads out each output buffer sofa 41 to 43 in order.
第7図はブロセッ4)の読み出しを行うフローヂャート
を示す。各出hバッファを読み出したプロセッサ5は、
ステップ■で、レジスタに入力されたデータをプロセッ
サ5内のメモリに記憶する(MAI〜MCI)。FIG. 7 shows a flowchart for reading out the processor 4). The processor 5 that read each output h buffer,
In step (2), the data input to the register is stored in the memory within the processor 5 (MAI to MCI).
ステップ■で前回の記憶値MA2〜MC2の有無を判断
することで、1回目の読み出しがどうかを判断する。ス
゛テップ■〜■で今回の読み出しデータ値MA1〜MC
1と前回の読み出しデータ値MA2〜MC2を比較する
。ステップ■で比較結果が一致しない場合は、今回の読
み出し値MAI〜MCIを前回の読み出し値MA2〜M
C2としてブロセッリ°5内のメモリに記憶する。ステ
ップ■で比較結果が一致した場合は、プロセッサ内のメ
モリの前回の読み出し値MA2〜MC2をクリアにする
。In step (2), it is determined whether the previous stored values MA2 to MC2 are present or not, thereby determining whether or not the first reading has been performed. In steps ■~■, the current read data values MA1~MC
1 and the previous read data values MA2 to MC2. If the comparison results do not match in step ■, replace the current read values MAI~MCI with the previous read values MA2~M.
It is stored in the memory in Broselli°5 as C2. If the comparison results match in step (2), the previous read values MA2 to MC2 in the memory in the processor are cleared.
パルス入力の度にカウンタ値がflnされ、プロセッサ
においであるタイミングでリンブリングすることにより
カウンタ値をリードし、前回の値と今回の値とを比較す
ることによりデータ量変化を監視する。 このようなシ
ステムにおいて、カウンタの状態か変化している期間い
わゆる状態遷移JI!I聞とプロセッサがカウンタ値を
リードするタイミングとが重なると、プロセッサのリー
ドした値は実際のカウンタ値と異なった値であり、正確
な値をリードしたことにならない。The counter value is fln every time a pulse is input, the processor reads the counter value by limbling at a certain timing, and monitors changes in the amount of data by comparing the previous value and the current value. In such a system, the period during which the state of the counter is changing is the so-called state transition JI! If the timing at which the processor reads the counter value coincides with the timing at which the processor reads the counter value, the value read by the processor will be a different value from the actual counter value, and will not mean that an accurate value has been read.
即ち、第4図に示す如く、パルス入力発生時にカウンタ
値がrollLlであると、1桁目の−Vヤリ発生時(
カウンタにパルス入力時)にはカウンタ値はrollo
、Iになり、次に2桁目の1179発生時にはカウンタ
値はrolooJになり、最終的にカウンタ値はrio
oo−+となり、このようにカウンタ値1[111Jが
らI 1000Jまでの門にカウンタ値ro110.l
rolooJの状態遷移期間を経、この状態遷移期間
にプロセッサがリードしてしまうと本来リードしたいカ
ウンタ値はrloooJであるにも拘らず。カウンタ値
r0110.I又はroioo、+をリードしてしまう
。That is, as shown in FIG. 4, if the counter value is rollLl when the pulse input occurs, when the -V error occurs in the first digit (
When a pulse is input to the counter), the counter value is rollo
, I, and then when the second digit 1179 occurs, the counter value becomes rolooJ, and finally the counter value becomes rio.
oo-+, and in this way, from the counter value 1[111J to I1000J, the counter value ro110. l
After the state transition period of rolooJ, if the processor reads during this state transition period, the counter value that it originally wants to read is rloooJ. Counter value r0110. It leads to I or roioo, +.
そこで、従来、正確なカウンタ値を得るために、カウン
タ値を2度リードする方法をとり、1回目にリードした
値と2回目にリードした値とを比較して不一致の場合(
iIAえば1回11’0110J。Conventionally, in order to obtain an accurate counter value, the counter value is read twice, and the value read the first time and the value read the second time are compared and if they do not match (
iIA is 11'0110J once.
2回目r0100.I)はこのカウンタ値を取込まず、
一致した場合(1回目r1000.l、2回目rloo
OJ )はこのカウンタ値を真の値として取込むいわゆ
るr2’[ff読み」処理を行なっている。2nd time r0100. I) does not capture this counter value,
If they match (first r1000.l, second rlooo
OJ) performs so-called r2'[ff reading] processing to take in this counter value as a true value.
このようにすれば、プロセッサがカウンタの状態遷移期
間にリードすることがあってもこの時のカウンタ値は取
込まず、正確な値のみを取込むことができる。In this way, even if the processor reads during the state transition period of the counter, the counter value at this time is not taken in, but only the accurate value can be taken in.
一方、従来、カウンタのピット長(例えば16ビツト)
がプロセッサのデータバス長(PAえば8ビツト)より
も長いシステムでは、プロセッサはカウンタ値を例えば
1位及び下位に分割してリードする必要がある。例えば
、カウンタ値が16ビツトのroooooool 11
111111 Jをリードする場合、プロセッサは先T
fR初に例えば下位のrllllllllJをリードし
、次に上位のroooooool、lをリードする如く
、16ビツトを8ビツトずつ分割リードする。このよう
な1回目のリードが終了したら、2回目のリードを行な
う。前述のように、1回目にリードした16ビツトカウ
ンタ値と2回目にリードした16ビツトカウンタ値とが
一致した場合にそのカウンタ値を真の値として取込む。On the other hand, conventionally, the pit length of the counter (for example, 16 bits)
In a system where the counter value is longer than the data bus length of the processor (for example, PA is 8 bits), the processor needs to read the counter value by dividing it into, for example, the first and lower parts. For example, rooooooool 11 where the counter value is 16 bits.
111111 When reading J, the processor reads T
fR first reads the lower rllllllllllJ, then reads the upper roooooool, l, and reads the 16 bits in 8-bit units. When such a first read is completed, a second read is performed. As described above, if the 16-bit counter value read the first time and the 16-bit counter value read the second time match, that counter value is taken in as the true value.
(発明が解決しようとする課題)
前述の従来装置は、プロセッサのカウンタ誤リードを防
止するためにいわゆる[2度読み、I処理を行なってい
るので、その分だけソフトウェア負荷が大きくなり、プ
ログラムが?!2雄化する問題点があった。(Problems to be Solved by the Invention) The conventional device described above performs so-called [read twice and I processing] in order to prevent the processor from reading the counter incorrectly, so the software load increases accordingly and the program is ? ! There was a problem with having two males.
又、眞述のように、カウンタ値を上位及び下位に分割し
てリードする方式に「2度読みJfI!ll!J!を適
用すると、その分だけプロセッサのリードタイミングと
カウンタの状R遷移期間とが重なる確率が増大すること
になり、「2度読み1処理に失敗する確率も増加する。Also, as stated above, if you apply "Read twice JfI!ll!J!" to the method of dividing the counter value into upper and lower parts and reading it, the read timing of the processor and the counter state R transition period will be reduced by that amount. This increases the probability that the two will overlap, and the probability that the "read twice and process once" will fail also increases.
例えば第5図に示す如く、カウンタのピット長を16ビ
ツト、プロセッサのデータバス長を8ビツトとした場合
、カウンタ値がroooooo。For example, as shown in FIG. 5, when the pit length of the counter is 16 bits and the data bus length of the processor is 8 bits, the counter value is rooooooo.
111111111Jでプロセッサがその下位バイトr
11111111.1をリードして次の上位バイトを
リードする迄の間にパルス入力があってカウンタ値がr
ooooool 000000000.1に変化したと
する。この場合、プロセッサのカウンタリード期間にカ
ウンタ値が変化しなければ何ら問題はないが、上記のよ
うにプロセッサのカウンタリード期間にカウンタ値が変
化すると、ブロセッ勺は下位バイトをN1111111
Jとリードする一方、上位バイトをrooooo。At 111111111J, the processor
There is a pulse input between reading 11111111.1 and reading the next upper byte, and the counter value is r.
Suppose that it changes to oooooool 000000000.1. In this case, there is no problem if the counter value does not change during the processor's counter read period, but if the counter value changes during the processor's counter read period as described above, the processor stores the lower byte as N1111111.
While leading with J, the upper byte is roooooo.
10Jとリードしてしまいカウンタ値を正しくリードし
たことにならない。10J is read, which does not mean that the counter value was read correctly.
1回目のリードがこのように誤リードであっても、「2
度読み」処理を行なえばカウンタ値が変化しない限りで
は2回目は正しくリードでき、それ以後bカウンタ値が
変化しなければ1回目と2回目とのカウンタ値が一致し
て最終的には正しいカウンタ値を取込むことができる。Even if the first lead is a false lead like this, “2
If you perform the "counter reading" process, the second reading will be correct as long as the counter value does not change, and if the b counter value does not change after that, the first and second counter values will match and the counter will eventually be correct. Values can be imported.
このような従来装置では、[2度読み1処理を行なって
いることもあってカウンタ値が変化してからカウンタ値
を正しくリードする迄に時間がかかり、短時間の処理を
行ない得ない問題点があった。With such conventional devices, [Due to reading twice and processing once, it takes time to read the counter value correctly after the counter value changes, which makes it impossible to perform processing in a short time.] was there.
本発明は、ブ[1セツリのカウンタリード期間にパルス
入力があってカウンタ値が変化した場合でも、比較的小
さなソフトウェア負荷でカウンタ値を正確にリードでき
るパルスカウンタ装置を提供することを目的とする。SUMMARY OF THE INVENTION An object of the present invention is to provide a pulse counter device that can accurately read a counter value with a relatively small software load even if a pulse input occurs during one set of counter read periods and the counter value changes. .
本発明は、カウンタとプロセラυとの間に、複数のビッ
ト群の数に対応して設けられた複数のレジスタと、カウ
ンタ値を複数のレジスタに転送する際、レジスタ転送中
にカウンタ値が変化しないようにレジスタ転送タイミン
グとカウンタへのカウンタ入力パルスタイミングとを同
期させるパルス同期化回路と、プロセッサが複数のレジ
スタのレジスタ値をレジスタ転送終了後からリードして
いる期間、複数めレジスタのレジスタ値更新を禁止する
レジスタ更新11111回路とよりなる。The present invention has a plurality of registers provided between a counter and a processor υ corresponding to the number of a plurality of bit groups, and when a counter value is transferred to a plurality of registers, the counter value changes during register transfer. A pulse synchronization circuit synchronizes the register transfer timing and the counter input pulse timing to the counter so that the register transfer timing and the counter input pulse timing to the counter do not change. It consists of a register update 11111 circuit that prohibits updating.
本発明では、プロセッサがレジスタ値を分t1す−ドし
ている期花、レジスタ値更新を禁止している。このため
、分割リード中にカウンタ値が変更されてもプロセッサ
はカウンタ値変更前の値を正しく分割リードし得、従来
例のような誤リードを生じることはない。又、レジスタ
値リード開始をレジスタ転送終了後に行なっているので
、安定なカウンタ値をリードでき、従来例のような「2
度読み」を必要としない。In the present invention, updating of the register value is prohibited while the processor is reading the register value for t1. Therefore, even if the counter value is changed during divided reading, the processor can correctly divide and read the value before the counter value change, and erroneous reading as in the conventional example does not occur. In addition, since register value reading starts after the register transfer is completed, stable counter values can be read, and "2
No need to read twice.
第1図は本発明のブロック図を示す1.同図中、1はパ
ルス入力端子で、カウンタ値を順次変化させるためのパ
ルスを入来する。、2はパルス同期化回路で、カウンタ
値をレジスタに転送するタイミングではカウンタにパル
スを入力させないようにし、カウンタ値をレジスタに転
送し終った後で次のレジスタ転送までの岡にカウンタに
パルスを入力させるように、パルス入力とレジスタ転送
との同期をとるラッチ回路である。3は例えば24ビツ
トのカウンタで、同期化回路2の出力をクロックとじて
パルス入力毎にカウンタ値が変化される。FIG. 1 shows a block diagram of the present invention.1. In the figure, reference numeral 1 denotes a pulse input terminal through which pulses for sequentially changing the counter value are input. , 2 is a pulse synchronization circuit that prevents pulses from being input to the counter at the timing when the counter value is transferred to the register, and after the counter value has been transferred to the register, it inputs pulses to the counter until the next register transfer. This is a latch circuit that synchronizes pulse input and register transfer. 3 is a 24-bit counter, for example, and the counter value is changed every time a pulse is input using the output of the synchronization circuit 2 as a clock.
41 、42.4gは夫々例えば8ビツトのレジスタで
、カウンタ3の出力データパスを介してプロセッサ5に
供給する。プロセッサ5は、レジスタ41〜43に夫々
対応づけされたアドレスを順次指定してそのレジスタの
値を順次リードし、後述のようにこれら3個のレジスタ
41〜43の値を全てリードし終るまでカウンタ3の出
力を各レジスタ41〜43に転送しないようにレジスタ
更新$り御回路7を介して制御する。6はアドレスデコ
ーダで、プロセッサ5にて指定された各レジスタのアド
レスコードをデコードして各レジスタ41〜41のリー
ドタイミングを制御する一方、プロセッサ5の1lJI
Ilによりレジスタ41のリードからレジスタ43のリ
ードまでのいわゆるカウンタリード期間レジスタ41〜
43のデータ転送を停止する制御信号をレジスタ更新制
御回路7に供給する。41 and 42.4g are, for example, 8-bit registers, which are supplied to the processor 5 via the output data path of the counter 3. The processor 5 sequentially specifies the addresses associated with the registers 41 to 43, sequentially reads the values of the registers, and keeps the counter running until all the values of these three registers 41 to 43 have been read, as will be described later. It is controlled via the register update $ control circuit 7 so that the output of No. 3 is not transferred to each register 41 to 43. 6 is an address decoder, which decodes the address code of each register designated by the processor 5 and controls the read timing of each register 41 to 41;
Due to Il, the so-called counter read period from reading the register 41 to reading the register 43 registers 41~
A control signal for stopping the data transfer of 43 is supplied to the register update control circuit 7.
レジスタ更新制御回路7はクロック発生器8の出力クロ
ックに同期してレジスタ41〜43を転送動作させ、上
記カウンタリード期間アドレスデコーダ6からの制御信
号によってレジスタ41〜43のデータ転送動作を停止
する。クロック発生器8はパルス同期化回路2、プロセ
ッサ5、レジスタ更新制御回路7の各動作の同期をとる
ためのりOツクを出力する回路である。The register update control circuit 7 causes the registers 41 to 43 to perform a transfer operation in synchronization with the output clock of the clock generator 8, and stops the data transfer operation of the registers 41 to 43 in response to a control signal from the address decoder 6 during the counter read period. The clock generator 8 is a circuit that outputs a clock for synchronizing the operations of the pulse synchronization circuit 2, the processor 5, and the register update control circuit 7.
次に、上記構成になる装置の動作について第2図に示す
動作タイミングチャートと01せて説明する。Next, the operation of the apparatus having the above configuration will be explained with reference to the operation timing chart shown in FIG.
りOツク発生器8から取出されたクロックaはパルス同
期化回路2に供給され、一方、端子1にり0ツクaのタ
イミングとは無関係のタイミングで入来してくるパルス
bもパルス同期化回路2に供給される。パルス同期化回
路2において、パルスbの立上りタイミングはりOツク
aの立上りタイミング(即ち、後述のレジスタ41・〜
43のデータ転送終了から次のデータ転送までの間のタ
イミング)に対応するように同期がとられ、カウンタ入
力パルスCとして取出され、カウンタ3に供給される。The clock a taken out from the output clock generator 8 is supplied to the pulse synchronization circuit 2, and on the other hand, the pulse b that comes into the terminal 1 at a timing unrelated to the timing of the output clock a is also pulse synchronized. Supplied to circuit 2. In the pulse synchronization circuit 2, the rising timing of the pulse b and the rising timing of the pulse a (that is, registers 41 to 41 to be described later)
43), and is taken out as a counter input pulse C and supplied to the counter 3.
カウンタ3はカウンタ入力パルスCの立上りタイミング
でそのカウンタ値dを変更され、この場合は例えばNか
ら<N−11)、更に(N+1)から(N+2)に順次
変更される。The counter value d of the counter 3 is changed at the rising timing of the counter input pulse C, and in this case, for example, it is changed sequentially from N to <N-11) and then from (N+1) to (N+2).
一方、クロックaはレジスタ更新制御回路7にも供給さ
れ、クロックaの立上りタイミング及び立下りタイミン
グが夫々逆の関係に対応するようなデータラッチ信号e
が取出される。データラッチ信号eはその立上りタイミ
ングでカウンタ値がレジスタ41〜43にデータ転送動
作を行なう信号である。ここで、カウンタ入力パルスC
が発生する前はカウンタ値dはNであるので、レジスタ
41〜43にはデータラッチ信号eの立上りタイミング
でカウンタ値Nが転送されており、カウンタ入力パルス
Cが発生するとカウンタ値dは(N+1)になるので、
レジスタ41〜43にはカウンタ入力パルスCの立上り
タイミング直後のデータラッチ信Meの立上りタイミン
グでカウンタ値(N + 1 )が転送される。On the other hand, the clock a is also supplied to the register update control circuit 7, and a data latch signal e is generated such that the rising timing and falling timing of the clock a correspond to the opposite relationship.
is taken out. The data latch signal e is a signal whose counter value performs a data transfer operation to the registers 41 to 43 at its rising timing. Here, counter input pulse C
Before the occurrence of the counter value d, the counter value d is N, so the counter value N is transferred to the registers 41 to 43 at the rising timing of the data latch signal e, and when the counter input pulse C occurs, the counter value d becomes (N+1 ), so
The counter value (N + 1) is transferred to the registers 41 to 43 at the rising timing of the data latch signal Me immediately after the rising timing of the counter input pulse C.
このように、パルス同期化回路2でパルスbのタイミン
グをレジスタ転送と同期をとってカウンタ入力パルスC
にしてカウンタ3に供給しているので、カウンタ値をレ
ジスタ41〜43に転送しているタイミング(データラ
ップ信@eの立上りタイミング)ではカウンタ3にパル
スが入力されず、カウンタ値をレジスタに転送し終った
後でカウンタ3にパルスが人力される(カウンタ入カバ
ルスC)。従って、カウンタ3の値が遷移しているタイ
ミング(パルスCの立上りタイミング)でレジスタ41
〜/43に転送を行なうと、カウンタ3の正しいカウン
タ値がレジスタ41〜43にコピーできないが、本発明
のようにすればカウンタ3の正しいカウンタ値をレジス
タ41〜43にコピーできる。In this way, the pulse synchronization circuit 2 synchronizes the timing of pulse b with the register transfer and synchronizes the timing of pulse b with the counter input pulse C.
Since the counter value is transferred to the registers 41 to 43 (at the rising edge of the data wrap signal @e), no pulse is input to the counter 3, and the counter value is transferred to the register. After this is completed, a pulse is manually input to the counter 3 (counter input cabal C). Therefore, at the timing when the value of the counter 3 is transitioning (the rising timing of the pulse C), the register 41
.about./43, the correct counter value of the counter 3 cannot be copied to the registers 41-43, but according to the present invention, the correct counter value of the counter 3 can be copied to the registers 41-43.
次に、プロセッサ5によるレジスタ41〜43の出力リ
ードについて説明する。いま、カウンタ3のカウンタ値
が(N−+i)のとき、プロセッサ5に7ドレス指定に
よってアドレスデコーダ6から制御信号A1が取出され
、レジスタ4Iの出力8ピッ1−がデータバスを介して
プロセッサ5に供給されてリードされたとする。この場
合、レジスタ41のリードの開始タイミングは、プロセ
ッサ5にはクロック発生器8の出力クロックaが供給さ
れているのでレジスタ4!〜43のデータラッチ信号e
と同期がとられ、データラッチ信号eの立下りタイミン
グに対応されている。Next, the output reading of the registers 41 to 43 by the processor 5 will be explained. Now, when the counter value of the counter 3 is (N-+i), the control signal A1 is taken out from the address decoder 6 by the 7 address specification to the processor 5, and the output 8 pin 1- of the register 4I is sent to the processor 5 via the data bus. Suppose that it is supplied to and read. In this case, since the processor 5 is supplied with the output clock a of the clock generator 8, the start timing of reading the register 41 is the register 4! ~43 data latch signal e
It is synchronized with the falling timing of the data latch signal e.
一方、制御信@A+はレジスタ更新制御回路7にも供給
されており、これにより、レジスタ更新v1wJ回路7
からはデータラップ信号eは取出されなくなる。従って
、レジスタ41〜43のデータ転送動作は停止され、レ
ジスタ値は(N−+l)のままになる。プロセッサ5の
アドレス指定による制御fU号A2 、A3によって夫
々レジスタ42゜43の出力8ビツトがデータバスを介
してプロセッサ5に供給されてリードされる。このとき
、レジスタ41〜43のレジスタ値(N+1)のままで
あるので1、プロセラ+J5はレジスタ41〜43のカ
ウンタ値(N+1)を分割リードすることになる。On the other hand, the control signal @A+ is also supplied to the register update control circuit 7, so that the register update v1wJ circuit 7
From then on, the data wrap signal e is no longer extracted. Therefore, the data transfer operation of registers 41 to 43 is stopped, and the register value remains (N-+l). The 8 bits output from the registers 42 and 43 are supplied to the processor 5 via the data bus and read by the control fU numbers A2 and A3 based on address designation of the processor 5, respectively. At this time, since the register values (N+1) of the registers 41 to 43 remain, the processor +J5 divides and reads the counter values (N+1) of the registers 41 to 43.
ここで、この分割リード中にパルス人力すが入ってカウ
ンタ3のカウンタ値が(N13)から(N + 2 )
に変更されたとする。然るに、カウンタ3の値は変更さ
れてもレジスタ41〜43はレジスタ更新制御回路7の
データラッヂ4n@eの禁止によってそのレジスタ値は
(N+1)のままとされているので、レジスタ41〜4
3からはレジスタ値(N+2)が出力されることはない
。従って、第4図で説明したように、分割リード中にカ
ウンタ値が変更されてもプロセッサは誤リードすること
はなく、各8ピツトとb(N(l)の正しいカウンタ値
をリードできる。Here, the pulse input is applied during this split read, and the counter value of counter 3 changes from (N13) to (N + 2).
Suppose that it is changed to . However, even if the value of the counter 3 is changed, the register values of the registers 41 to 43 remain as (N+1) due to the prohibition of the data latch 4n@e of the register update control circuit 7.
3, the register value (N+2) is never output. Therefore, as explained with reference to FIG. 4, even if the counter value is changed during divided reading, the processor will not read incorrectly, and can read the correct counter values for each of the 8 pits and b(N(l)).
又、本発明では、レジスタ41〜43のデータ転送が終
了してから、つまり、カウンタ値が安定してからプロセ
ツイj5がレジスタ41〜43の値をリードするように
しているので、従来例のようないわゆる「2度読み」を
行なう必要はなく、ハードウェアの負荷も従来例より小
さくでき、プログラムも簡単にできる。Furthermore, in the present invention, the processor j5 reads the values of the registers 41 to 43 after the data transfer of the registers 41 to 43 is completed, that is, after the counter value has stabilized. There is no need to perform so-called "reading twice," the hardware load can be reduced compared to the conventional example, and programming can be simplified.
本発明のプロセッサ5のフローヂャートを第3図に示す
。A flowchart of the processor 5 of the present invention is shown in FIG.
第3図のステップ■はレジスタよりデータRA〜RCを
たんにプロセッサ5内のメモリに書き込みMA−MCと
して記憶を行うだけで、従来の様にデータの比較は行な
われない。In step (2) in FIG. 3, data RA to RC are simply written from the registers to the memory in the processor 5 and stored as MA to MC, and the data are not compared as in the conventional case.
即ち、レジスタ43のリードが終了すると、制御信号A
3によってレジスタ更新制御回路7からのデータラップ
信号eの禁止が解除され、カウンタ値(N+2>がレジ
スタ41・〜43に転送され、材上、前述の動作と同様
の動作が繰返される。この場合、カウンタ3の値が(N
+2)の時に上記のような分割リードが行なわれれば、
本発明では「2度読み」を行なっていないので、変更直
後のカウンタ値(N+2)をリードでき、従来例に比し
て短時門の処理を行ない得る。That is, when reading of the register 43 is completed, the control signal A
3, the inhibition of the data wrap signal e from the register update control circuit 7 is canceled, the counter value (N+2> is transferred to the registers 41 to 43, and the same operation as described above is repeated. In this case , the value of counter 3 is (N
+2) If the above split read is performed,
In the present invention, since "reading twice" is not performed, the counter value (N+2) immediately after the change can be read, and processing can be performed in a shorter time than in the conventional example.
なお、分割リードを行なう周期がカウンタ値変更の周期
よりも長い場合、カウンタ値(N+1)を分割リードし
た後、カウンタ値(N −1−2)をリードしないで次
のカウンタ値(N+3)分割り一ドすることになる。こ
れは、カウンタ値をその変更の都度監視しているのでは
なり、屓定周期でその変更を監視するようなシステムに
用いられる。Note that if the period of dividing read is longer than the period of changing the counter value, after dividing reading the counter value (N+1), reading the next counter value (N+3) without reading the counter value (N - 1-2). You'll end up paying a discount. This is used in a system that monitors changes at regular intervals, rather than monitoring the counter value each time it changes.
以上説明した如く、本発明によれば、プロセッサがレジ
スタ値を分割リードしている期間、レジスタ値更新を禁
止しているので、分割リード中にカウンタ値が変更され
てもプロセッサはカウンタ値変更前の値を正しく分割リ
ードし得、従来例のような誤リードを生じることはなく
、又、レジスタ値リード開始をレジスタ転送終了後に行
なっているので、安定なカウンタ値をリードでき、従来
例のような[2度読み、1を必要とせず、これにより、
従来例より比較的小さなソフトウェア負荷で済み、プロ
グラムのt!J里なもので済む。As explained above, according to the present invention, updating of the register value is prohibited while the processor is dividing and reading the register value, so even if the counter value is changed during the dividing read, the processor updates the register value before changing the counter value. It is possible to correctly divide and read the value of the counter without causing erroneous reading as in the conventional example. Also, since reading of the register value is started after register transfer is completed, stable counter values can be read, unlike in the conventional example. [Read twice, no need for step 1, this allows
The software load is relatively smaller than the conventional example, and the program's t! Only J-ri will suffice.
第1図は本発明のブロック図、
第2図は本発明の動作タイミングチャート、第3図は本
発明のプロセッサ動作フローチャート、
第4図はカウンタ値の状!遷移を示す図、第5図は分割
リードにおいてリード期間中にカウンタ値変更を生じた
場合のタイミングチャート第6図は従来のブロック図、
第7図は従来のプロセッサ動作フローチャー1−である
。
図において、
1はパルス入力端子、
2はパルス同期化回路、
3はカウンタ、
41〜43はレジスタ、
5はプロセッサ、
6はアドレスデコーダ、
7はレジスタ更新制御回路、
8はクロック発生器
を示す。
特許出願人 富 士 通 株式会社
χべ
本発明のプロセッサ動作フローチャート第3図Fig. 1 is a block diagram of the present invention, Fig. 2 is an operation timing chart of the invention, Fig. 3 is a processor operation flowchart of the invention, and Fig. 4 is the state of the counter value! FIG. 5 is a timing chart when a counter value change occurs during a read period in split read. FIG. 6 is a conventional block diagram. FIG. 7 is a conventional processor operation flowchart 1-. In the figure, 1 is a pulse input terminal, 2 is a pulse synchronization circuit, 3 is a counter, 41 to 43 are registers, 5 is a processor, 6 is an address decoder, 7 is a register update control circuit, and 8 is a clock generator. Patent Applicant Fujitsu Ltd. Processor Operation Flow Chart of the Invention Figure 3
Claims (1)
(d)を複数のビット群に分割してプロセッサ(5)で
リードする方式のパルスカウント装置において、 上記カウンタ(3)と上記プロセッサ(5)との間に、
上記複数のビット群の数に対応して設けられた複数のレ
ジスタ(4_1〜4_3)と、上記カウンタ(3)のカ
ウンタ値(d)を上記複数のレジスタ(4_1〜4_3
)に転送する際、レジスタ(4_1〜4_3)の転送中
に上記カウンタ(3)のカウンタ値(d)が変化しない
ように上記レジスタ(4_1〜4_3)の転送タイミン
グと上記カウンタ(3)へのカウンタ入力パルス(c)
タイミングとを周期させるパルス同期化回路(2)と、 上記プロセッサ(5)が上記複数のレジスタ(4_1〜
4_3)のレジスタ値(f)をレジスタ転送終了後から
リードしている期間、上記複数のレジスタ(4_1〜4
_3)のレジスタ値更新を禁止するレジスタ更新制御回
路(7)とよりなることを特徴とするパルスカウント装
置。[Claims] In a pulse counting device of a type in which a value (d) of a counter (3) whose value is changed every time a pulse is input is divided into a plurality of bit groups and read by a processor (5), the above-mentioned counter (3) and the processor (5),
A plurality of registers (4_1 to 4_3) provided corresponding to the number of the plurality of bit groups and a counter value (d) of the counter (3) are stored in the plurality of registers (4_1 to 4_3).
), the transfer timing of the registers (4_1 to 4_3) and the transfer timing to the counter (3) are adjusted so that the counter value (d) of the counter (3) does not change during the transfer of the registers (4_1 to 4_3). Counter input pulse (c)
A pulse synchronization circuit (2) that cycles the timing; and the processor (5) are connected to the plurality of registers (4_1 to 4_1).
During the period when the register value (f) of 4_3) is being read from the end of the register transfer, the above registers (4_1 to 4) are being read.
A pulse counting device comprising: a register update control circuit (7) that prohibits updating of register values in _3).
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP6415588A JPH01236817A (en) | 1988-03-17 | 1988-03-17 | Pulse counter |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP6415588A JPH01236817A (en) | 1988-03-17 | 1988-03-17 | Pulse counter |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH01236817A true JPH01236817A (en) | 1989-09-21 |
Family
ID=13249904
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP6415588A Pending JPH01236817A (en) | 1988-03-17 | 1988-03-17 | Pulse counter |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH01236817A (en) |
-
1988
- 1988-03-17 JP JP6415588A patent/JPH01236817A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4402081A (en) | Semiconductor memory test pattern generating apparatus | |
| JP2755581B2 (en) | Digital data processing system | |
| US4176394A (en) | Apparatus for maintaining a history of the most recently executed instructions in a digital computer | |
| US6657977B1 (en) | Radio with burst event execution apparatus and method therefore | |
| EP0661708A2 (en) | Self-timed real-time data transfer in video-ram | |
| JPH09500751A (en) | Dynamic random access memory system | |
| JPS6235949A (en) | memory device | |
| JPH1083303A (en) | Electronic circuits and methods for using coprocessors | |
| US6449193B1 (en) | Burst access memory system | |
| EP0401763B1 (en) | Timing signal generating system | |
| JPS63182729A (en) | Input circuit | |
| JPH01236817A (en) | Pulse counter | |
| JPH0140432B2 (en) | ||
| US6850561B1 (en) | Predictable updating of a baud divisor of an asynchronous serial port during data reception | |
| JPH08328995A (en) | System and method for dma transfer | |
| JPH0713818B2 (en) | Microprocessor | |
| JP3246252B2 (en) | DMA device with data check function | |
| JPS6246023B2 (en) | ||
| JPS62219142A (en) | Loop detecting system in program tracing | |
| JPH0736819A (en) | Dma data transfer device | |
| JPH1063569A (en) | Main memory data writing device | |
| JPH0335334A (en) | Information processor | |
| JPS6220448A (en) | Bit sampling system | |
| JPH01228026A (en) | Sequence control circuit | |
| JPH038036B2 (en) |