JPH03181817A - Counter apparatus - Google Patents
Counter apparatusInfo
- Publication number
- JPH03181817A JPH03181817A JP32067589A JP32067589A JPH03181817A JP H03181817 A JPH03181817 A JP H03181817A JP 32067589 A JP32067589 A JP 32067589A JP 32067589 A JP32067589 A JP 32067589A JP H03181817 A JPH03181817 A JP H03181817A
- Authority
- JP
- Japan
- Prior art keywords
- signal
- level
- signals
- inputted
- terminal
- 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
Links
- 102100024061 Integrator complex subunit 1 Human genes 0.000 abstract 1
- 101710092857 Integrator complex subunit 1 Proteins 0.000 abstract 1
- 239000003990 capacitor Substances 0.000 abstract 1
- 230000003247 decreasing effect Effects 0.000 abstract 1
Landscapes
- Transmission And Conversion Of Sensor Element Output (AREA)
Abstract
Description
【発明の詳細な説明】
[産業上の利用分野]
この発明は2相位相差計数入力を計数するカウンタ装置
に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a counter device that counts two-phase phase difference count inputs.
[従来の技術]
従来、カウンタ装置には低価格で装置を構成するために
、中央処理装置(以下CPUという)で計数入力制御を
行っているものがある。低価格化を実現するためには、
CPU以外の回路部品を極力少なくしなければならない
。[Prior Art] Conventionally, some counter devices perform count input control using a central processing unit (hereinafter referred to as CPU) in order to configure the device at a low cost. In order to achieve lower prices,
The number of circuit components other than the CPU must be minimized.
第4図は2相位相差計数入力の計数動作を説明するため
のタイミングチャートである。例えば−方の信号I N
−Bの゛立ち下がり時に他方の信号I N−AがHレベ
ルならば加算し、信号IN−Aの立ち下がり時に信号I
N−BがHl/ベルならば減算となるように信号処理
していた。FIG. 4 is a timing chart for explaining the counting operation of the two-phase phase difference counting input. For example, - side signal I N
If the other signal INA is at H level when the signal IN-B falls, it is added, and when the signal IN-A falls, the signal INA is added.
Signal processing was performed so that if N-B was Hl/Bell, it would be a subtraction.
〔発明が解決しようとする課8]
上記のような従来のカウンタ装置では、当初加算処理を
行いその後減算処理を行った場合には、*印の部分の信
号I N−Aの立ち下がりにより計数値「7」が減算さ
れてしまって計数値が「6」になり、誤計数(減算)し
てしまうという問題点があった。[Problem 8 to be solved by the invention] In the conventional counter device as described above, when an addition process is first performed and then a subtraction process is performed, the count is calculated by the fall of the signal INA in the part marked *. There was a problem in that the numerical value "7" was subtracted and the counted value became "6", resulting in erroneous counting (subtraction).
この発明は、かかる問題点を解決するためになされたも
のであり、2相位相差計数入力が加算から減算に変って
も、或いはその逆の場合であっても誤計数することがな
いようにしたカウンタ装置を提供することを目的とする
。This invention was made to solve this problem, and is designed to prevent erroneous counting even when the two-phase phase difference counting input changes from addition to subtraction, or vice versa. The object of the present invention is to provide a counter device.
[課題を解決するための手段]
この発明に係るカウンタ装置は、位相の異なる2つの信
号の内一方の信号をクロック信号として入力し、その反
転信号をリセット信号として入力し、更に他方の信号を
データ信号として入力する第1のフリップフロップ回路
と、位相の異なる2つの信号の内他方の信号をクロック
信号として入力し、その反転信号をリセット信号として
入力し、更に一方の信号をデータ信号として入力する第
2のフリップフロップ回路と、位相の異なる2つの信号
、前記1のフリッププロップ回路の出力信号及び第2の
フリップフロップ回路の出力信号を入力し、これらの信
号の状態に応じて加算処置又は減算処理する中央処理装
置とを有するものである。[Means for Solving the Problems] A counter device according to the present invention inputs one of two signals having different phases as a clock signal, inputs its inverted signal as a reset signal, and further inputs the other signal as a reset signal. A first flip-flop circuit inputs as a data signal, the other of the two signals with different phases is input as a clock signal, its inverted signal is input as a reset signal, and one signal is input as a data signal. A second flip-flop circuit that inputs two signals with different phases, an output signal of the first flip-flop circuit, and an output signal of the second flip-flop circuit, and performs addition or addition depending on the state of these signals. It has a central processing unit that performs subtraction processing.
[作 用]
この発明においては、例えば第1のフリップフロップ回
路が加算計数パルスを出力し、第2のフリツプフロツプ
回路が減算計数パルスを出力する。[Function] In the present invention, for example, the first flip-flop circuit outputs an addition count pulse, and the second flip-flop circuit outputs a subtraction count pulse.
そして、中央処理装置はそれらの加算計数パルス又は減
算計数パルスの入力に応じて加算演算又は減算演算を行
う。Then, the central processing unit performs an addition operation or a subtraction operation in accordance with the input of these addition count pulses or subtraction count pulses.
[実施例]
第1図はこの発明の一実施例を示すカウンタ装置のハー
ド構成を示すブロック図である。図において、(10)
及び(11)はD型フリッププロップ回路(以下単にF
Fという)であり、(20)はCPUである。[Embodiment] FIG. 1 is a block diagram showing the hardware configuration of a counter device showing an embodiment of the present invention. In the figure, (10)
and (11) is a D-type flip-flop circuit (hereinafter simply F
F), and (20) is the CPU.
F F (10)のクロック入力端子CKには、抵抗R
及びコンデンサCからなるフィルタを介して信号IN−
Aが入力し、データ入力端子りには信号I N−Bが入
力し、リセット端子RにはIN−^が入力する。FF(
11〉のクロック入力端子CKには、抵抗R及びコンデ
ンサCからなるフィルタを介して信号IN−Bが入力し
、データ入力端子りには信号I N−Aが入力し、リセ
ット端子RにはlN−8が入力する。A resistor R is connected to the clock input terminal CK of F F (10).
and a signal IN- through a filter consisting of a capacitor C.
A is input, a signal IN-B is input to the data input terminal, and IN-^ is input to the reset terminal R. FF(
A signal IN-B is inputted to the clock input terminal CK of 11> via a filter consisting of a resistor R and a capacitor C, a signal INA is inputted to the data input terminal, and a signal IN-B is inputted to the reset terminal R. -8 is input.
CP U (20)の割り込み入力端子INTO,lN
Tlには信号IN−^、 IN−Bが入力し、入力ボー
ト端子PIG。Interrupt input terminal INTO, lN of CPU (20)
Signals IN-^ and IN-B are input to Tl, and input port terminal PIG.
pHにはF F (to)、 (11)の出力QA、Q
Bが入力する。For pH, F F (to), (11) output QA, Q
B inputs.
第2図はF F (10)、 (11)に入力する90
°位相の異なる2の信号IN−^及びlN−8のタイミ
ングとFF(11)、 (12)の出力QA、QBタ
イミングとを示したタイミングチャートである。Figure 2 shows 90 inputs to F F (10) and (11).
It is a timing chart showing the timing of two signals IN-^ and IN-8 having different phases and the output QA and QB timing of FFs (11) and (12).
次に、動作説明をする。F F (10)は、信号I
N−AがHレベルになってクロック入力端子(Jにクロ
ック信号として入力されると、その信号I N−Aの立
ち上がり時にデータ入力端子りに入力している信号IN
−[3(Hレベル)をラッチして出力信号QA (H
レベル)として出力する。そして、信号IN−AがLレ
ベルになりリセット端子Rは入力すると、出力信号QA
はリセットされてLレベルになる。このようにして、出
力信号QAは信号I N−Aと同期してHレベル及びL
レベルとなり、図のようなパルス波形となる。Next, the operation will be explained. F F (10) is the signal I
When NA becomes H level and is input as a clock signal to the clock input terminal (J), the signal IN input to the data input terminal at the rise of NA
−[3 (H level) is latched and the output signal QA (H level) is latched.
level). Then, when the signal IN-A becomes L level and the reset terminal R is input, the output signal QA
is reset to L level. In this way, the output signal QA goes high and low in synchronization with the signal INA.
level, resulting in a pulse waveform as shown in the figure.
このとき、FF(11)はそのクロック端子CKには信
号I N−Bが入力し、データ入力端子りに信号IN−
^が入力するが、信号I N−Bの立ち上がり時の信号
IN−BのレベルはLレベルであるので、出力信号QB
はLレベルの状態を継続することになる。At this time, the FF (11) receives the signal IN-B at its clock terminal CK, and the signal IN-B at its data input terminal.
^ is input, but since the level of signal IN-B at the rise of signal IN-B is L level, output signal QB
will continue to be at L level.
次に、加算計数から減算計数に移行する場合には、信号
IN−^とIN−Bとの位相の関係が反対、即ち信号I
N−AがIN−Bに対して90度進んだ位相関係にな
る。F F (1G)はそのクロ1り端子CKには信号
IN−Aが入力し、データ入力端子りに信号I N−B
が入力するが、信号IN−Aの立ち上がり時の信号I
N−8のレベルはLレベルであるので、出力信号Q^は
Lレベルの状態を継続することになる。Next, when shifting from addition counting to subtraction counting, the phase relationship between the signals IN-^ and IN-B is opposite, that is, the signal I
The phase relationship is such that NA leads IN-B by 90 degrees. F F (1G) has a signal IN-A input to its black terminal CK, and a signal IN-B to its data input terminal.
is input, but the signal I at the rising edge of the signal IN-A
Since the level of N-8 is L level, the output signal Q^ continues to be at L level.
F F (11)は、信号I N−BがHレベルになっ
てクロック入力端子CKにクロック信号として入力され
ると、その信号I N−Hの立ち上がり時にデータ入力
端子りに入力している信号IN−A(Hレベル)をラッ
チしテ出力信号QB (Hレベル)として出力する。F F (11) is a signal that is input to the data input terminal at the rising edge of the signal I N-B when the signal I N-B becomes H level and is input as a clock signal to the clock input terminal CK. It latches IN-A (H level) and outputs it as an output signal QB (H level).
そして、信号IN−BがLレベルになりリセット端子R
は入力すると、出力信号QBはリセットされてLレベル
になる。このようにして、出力信号QBは信号IN−B
と同期してHレベル及びLレベルとなり、図のようなパ
ルス波形となる。この出力信号QBは後述するように減
算計数のパルス信号となるが、図のように、従来の方法
では誤計数となっった時間域に減算パルスがないので、
誤計数が防止できることが分かる。Then, the signal IN-B becomes L level and the reset terminal R
When input, the output signal QB is reset and becomes L level. In this way, the output signal QB is the signal IN-B
It becomes H level and L level in synchronization with , resulting in a pulse waveform as shown in the figure. This output signal QB becomes a pulse signal for subtraction counting as described later, but as shown in the figure, in the conventional method, there is no subtraction pulse in the time range where erroneous counting occurs.
It can be seen that miscounting can be prevented.
一方、CP U (20)は信号IN−A、 lN−8
が割り込み信号として入力し、また、F F (10)
、 (11)の出力信号Q^、QBが加算パルス又は減
算パルスとして入力し、次のように演算処理される。On the other hand, the CPU (20) receives signals IN-A and IN-8.
is input as an interrupt signal, and F F (10)
, (11) are inputted as addition pulses or subtraction pulses, and are processed as follows.
まず、加算演算について説明する。第3図(A)は加算
演算の動作を示すフローチャートである。First, the addition operation will be explained. FIG. 3(A) is a flowchart showing the operation of the addition operation.
最初に、割り込み入力端子I NTOにHレベルの信号
が入力しているかどうかを判断しく81)、Hレベルに
なっていると判断されると入力ボート端子PlOがHレ
ベルで、かつPILがLレベルであるかどうかを判断す
る(S2)。この条件が満足していると、次にCP U
(20)により構成されているカウンタを加算する(
S3〉。この加算演算処理はステップ(81)。First, it is determined whether an H level signal is input to the interrupt input terminal INTO (81), and if it is determined that the signal is at H level, the input port terminal PlO is at H level and PIL is at L level. It is determined whether or not (S2). If this condition is satisfied, then the CPU
Add the counter configured by (20) (
S3〉. This addition calculation process is performed in step (81).
(S2)の条件が満たされている時に行われるので、第
2図の加算領域において加算演算がなされる。Since the addition operation is performed when the condition (S2) is satisfied, the addition operation is performed in the addition area shown in FIG.
次に、減算演算について説明する。第3図(B)は減算
演算の動作を示すフローチャートである。Next, the subtraction operation will be explained. FIG. 3(B) is a flowchart showing the operation of the subtraction operation.
最初に、割り込み入力端子lNTlにHレベルの信号が
入力しているかどうかを判断しくS4)、Hレベルにな
っていると判断されると入力ボート端子P1゜がLレベ
ルで、かつpHがHレベルであるかどうかを判断する(
S5〉。この条件が満足していると、次にCP U (
20)により構成されているカウンタを減算する(S6
〉。この減算演算はステップ(84)、 (S5)の条
件が満たされている時に行われるので、第2図の減算領
域において減算演算がなされる。減算演算の結果は、加
算演算から減算演算に移行する際に誤計数の原因となる
が減数パルスが従来のように入力しないので、正しいも
のとなる。First, it is determined whether an H level signal is input to the interrupt input terminal lNTl (S4). If it is determined that the signal is at the H level, the input port terminal P1 is at the L level and the pH is at the H level. Determine whether (
S5〉. If this condition is satisfied, then CPU (
20) is subtracted from the counter configured by (S6
〉. Since this subtraction operation is performed when the conditions of steps (84) and (S5) are satisfied, the subtraction operation is performed in the subtraction area shown in FIG. The result of the subtraction operation is correct because the subtraction pulse is not input as in the conventional case, which causes erroneous counting when transitioning from the addition operation to the subtraction operation.
ところで、上述の実施例は加算演算から減算演算に移行
する場合の例について説明したが、減算演算から加算演
算に移行する場合も同様に処理されて、誤計数の原因と
なる減数パルスが入力しないので、その計数結果は正し
いものとなる。By the way, in the above embodiment, an example was explained in which a transition is made from an addition operation to a subtraction operation, but the same process is performed when a transition from a subtraction operation to an addition operation is performed, so that a subtraction pulse that causes an erroneous count is not input. Therefore, the counting result is correct.
[発明の効果]
以上のようにこの発明によれば、2相位相差計数入力の
うち、一方の信号に同期させて他方の信号をラッチさせ
るようにしたので、加算演算から減算処理への移行時又
は減算演算から加算演算への移行時において誤計数の原
因となる計数パルスが発生せず、正確な計数ができる。[Effects of the Invention] As described above, according to the present invention, one of the two-phase phase difference counting inputs is synchronized with one signal and the other signal is latched, so that when transitioning from addition operation to subtraction operation, Alternatively, when transitioning from a subtraction operation to an addition operation, a counting pulse that causes erroneous counting is not generated, and accurate counting can be performed.
ff11図はこの発明の一実施例に係るカウンタ装置の
ハード構成を示すブロック図、第2図は第1図のFFの
動作を示すタイミングチャート、第3図(A)(B)は
加算演算及び減算演算の動作を示すフローチャート、第
4図は従来のカウンタ装置の動作を説明するためのタイ
ミングチャートである。
図において、(10)、 (11)はFF、(20)は
CPUである。ff11 is a block diagram showing the hardware configuration of a counter device according to an embodiment of the present invention, FIG. 2 is a timing chart showing the operation of the FF in FIG. 1, and FIGS. A flowchart showing the operation of the subtraction operation, and FIG. 4 is a timing chart for explaining the operation of the conventional counter device. In the figure, (10) and (11) are FFs, and (20) is a CPU.
Claims (1)
として入力し、その反転信号をリセット信号として入力
し、更に他方の信号をデータ信号として入力する第1の
フリップフロップ回路と、位相の異なる2つの信号の内
他方の信号をクロック信号として入力し、その反転信号
をリセット信号として入力し、更に一方の信号をデータ
信号として入力する第2のフリップフロップ回路と、位
相の異なる2つの信号、前記1のフリップフロップ回路
の出力信号及び第2のフリップフロップ回路の出力信号
を入力し、これらの信号の状態に応じて加算処置又は減
算処理する中央処理装置とを有することを特徴とするカ
ウンタ装置。A first flip-flop circuit receives one of two signals with different phases as a clock signal, inputs its inverted signal as a reset signal, and further inputs the other signal as a data signal; a second flip-flop circuit which inputs the other signal of the two signals as a clock signal, inputs its inverted signal as a reset signal, and further inputs one signal as a data signal; 1. A counter device comprising: a central processing unit that inputs an output signal of a first flip-flop circuit and an output signal of a second flip-flop circuit, and performs addition or subtraction processing according to the states of these signals.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP32067589A JP2791906B2 (en) | 1989-12-12 | 1989-12-12 | Counter device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP32067589A JP2791906B2 (en) | 1989-12-12 | 1989-12-12 | Counter device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH03181817A true JPH03181817A (en) | 1991-08-07 |
| JP2791906B2 JP2791906B2 (en) | 1998-08-27 |
Family
ID=18124078
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP32067589A Expired - Fee Related JP2791906B2 (en) | 1989-12-12 | 1989-12-12 | Counter device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2791906B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005345384A (en) * | 2004-06-04 | 2005-12-15 | Mitsubishi Electric Corp | Rotation state detection device and rotation state detection method |
-
1989
- 1989-12-12 JP JP32067589A patent/JP2791906B2/en not_active Expired - Fee Related
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005345384A (en) * | 2004-06-04 | 2005-12-15 | Mitsubishi Electric Corp | Rotation state detection device and rotation state detection method |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2791906B2 (en) | 1998-08-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5001479A (en) | Gray code converter with error signal | |
| US5305323A (en) | Technique for digitally detecting bit-error densities that occur in a serial bit stream | |
| JPH03181817A (en) | Counter apparatus | |
| JPS63226115A (en) | Zero cross counter | |
| US4669098A (en) | Increased resolution counting circuit | |
| JPS6319106B2 (en) | ||
| JP2606458Y2 (en) | Signal level monitoring circuit | |
| JPS6357970B2 (en) | ||
| JPS62131637A (en) | Timing jitter measuring system | |
| JPH0210915A (en) | Polarity unification circuit for pulse signal | |
| JP2548340B2 (en) | Chattering removal circuit | |
| KR930005610Y1 (en) | Noise reduction circuit | |
| SU1170447A1 (en) | Dicital discriminator | |
| JPH02290323A (en) | Clock disconnection detection circuit | |
| JPH0314315A (en) | Filter | |
| JPH0378586B2 (en) | ||
| JPS6387815A (en) | Noise eliminating circuit | |
| JPH03268513A (en) | Detecting system for off state of clock signal | |
| JPH04307372A (en) | Edge detection circuit device | |
| JPS606143B2 (en) | Input data state change detection circuit | |
| JPH01196636A (en) | Processor runaway detection device | |
| JPS60211372A (en) | Phase difference detection device | |
| JPH01194709A (en) | Phase discrimination circuit | |
| JPS6211333A (en) | Preamble detecting circuit | |
| JPH03160599A (en) | Alarm output protecting circuit |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |