JPS63202128A - Counter control circuit - Google Patents
Counter control circuitInfo
- Publication number
- JPS63202128A JPS63202128A JP3401987A JP3401987A JPS63202128A JP S63202128 A JPS63202128 A JP S63202128A JP 3401987 A JP3401987 A JP 3401987A JP 3401987 A JP3401987 A JP 3401987A JP S63202128 A JPS63202128 A JP S63202128A
- Authority
- JP
- Japan
- Prior art keywords
- counter
- pulse
- input
- count
- count value
- 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
- Communication Control (AREA)
Abstract
Description
【発明の詳細な説明】
〔概 要〕
本発明は、外部カウンターのカウント値を読み込んだ後
、そのカウント値をリセットするカウンター制御回路に
おいて、読み込み動作前とリセット動作前に、外部カウ
ンターへのカウンターパルス入力を監視し、読み込み動
作とりセント動作の制御を行い、読み込み動作と、リセ
ット動作を確実に行い、正確なカウント値を与えるもの
である。[Detailed Description of the Invention] [Summary] The present invention provides a counter control circuit that resets the count value of an external counter after reading the count value of the external counter. It monitors pulse input, controls read and reset operations, ensures read and reset operations, and provides accurate count values.
本発明は、カウンター制御回路に関し、特に外部カウン
ターのカウント値の読み出し動作とリセット動作の制御
回路に関する。The present invention relates to a counter control circuit, and more particularly to a control circuit for reading and resetting count values of an external counter.
外部カウンターのカウント値は常に正確に読み出されな
ければならないが、カウンターパルスが定期的に入力す
るとは限らないのでカウント値の読み出し動作のみなら
ず、その直後に実行されるリセット動作も誤りなく行う
必要がある。The count value of the external counter must always be read accurately, but since counter pulses are not always input regularly, not only the count value read operation but also the reset operation that is executed immediately after it must be performed without error. There is a need.
従来の外部カウンターの読み出し・リセットを行うカウ
ンター制御回路を第3図に示す0図中、1は外部カウン
ター、10はMPU(マイクロプロセッサユニット)
20はカウンターパルス、30はカウント値、及び32
はリセットパルスを示している。Figure 3 shows a conventional counter control circuit that reads and resets an external counter. In Figure 0, 1 is an external counter, and 10 is an MPU (microprocessor unit).
20 is a counter pulse, 30 is a count value, and 32
indicates a reset pulse.
第4図は、第3図のカウンター制御回路の基本動作のフ
ローチャートを示し、第5図は、外部カウンター1のリ
セットパルス、カウンターパルス、及びカウント値のタ
イミングチャートを示している。FIG. 4 shows a flowchart of the basic operation of the counter control circuit of FIG. 3, and FIG. 5 shows a timing chart of the reset pulse, counter pulse, and count value of the external counter 1.
次に第3〜5図を用いて従来例の動作を説明すると、ま
ずカウンターパルス20が無制約に外部カウンター1に
入力して来る。これに応答してカウンター1はカウント
動作を行い、例えば一定の時間間隔で外部カウンター1
のカウント値をMPUl0が読み出して前回のカウント
値に加算し、その後、外部カウンター1をリセットパル
スにより無制約にリセットする。Next, the operation of the conventional example will be explained using FIGS. 3 to 5. First, the counter pulse 20 is inputted to the external counter 1 without any restrictions. In response to this, the counter 1 performs a counting operation, for example, the external counter 1
The MPU10 reads out the count value of , adds it to the previous count value, and then resets the external counter 1 without restrictions with a reset pulse.
従来の外部カウンターの制御回路は、カウント値を無制
約に読み込んだ後、無制約にリセットしていた。そのた
め、読み込み又はリセットのタイミングにより、カウン
ターパルス入力信号を無視してしまう可能性があった。Conventional external counter control circuits read count values without restrictions and then reset them without restrictions. Therefore, there is a possibility that the counter pulse input signal may be ignored depending on the timing of reading or resetting.
即ち、第5図に示すようにカウンターパルス人力20が
あったにもかかわらず、リセット動作によりカウント値
に加算されず、この例では1パルス少ない誤ったカウン
ト値になっていた。このことは、読み込み時に入力パル
スがあるときにおいても同様、誤ったカウント値を読み
込むことになっていた。That is, as shown in FIG. 5, even though there was a counter pulse 20, it was not added to the count value due to the reset operation, and in this example, the count value was incorrect because it was one pulse less. This also causes an incorrect count value to be read even when there is an input pulse during reading.
本発明に係るカウンター制御回路2は、第1図に示す如
く、外部カウンター1のカウント値を読み込む前に入力
パルス20を監視し、入力パルス20が無いときだけカ
ウント値を読み込むとともに、その後のカウント値のリ
セット前においても入力パルス20を監視し、入力パル
ス20があるときのみ、既に読み込んだカウント値を補
正するようにしている。As shown in FIG. 1, the counter control circuit 2 according to the present invention monitors the input pulse 20 before reading the count value of the external counter 1, reads the count value only when there is no input pulse 20, and performs the subsequent count value. The input pulse 20 is monitored even before the value is reset, and the already read count value is corrected only when the input pulse 20 is present.
第1図において、本発明のカウンター制御回路は、外部
カウンターlのカウント値を読み込む前とリセットする
前にカウンター1への入力パルスを必ず監視し、入力パ
ルスがな(なるまでカウント値の読み込みを待機させる
とともに、リセット時に入力パルスがあるときは、既に
読み込んだカウント値に一定の値を加算してカウント値
を正確な値に補正している。In FIG. 1, the counter control circuit of the present invention always monitors the input pulse to counter 1 before reading the count value of external counter l and before resetting it, and continues reading the count value until there is no input pulse. In addition to making it standby, when there is an input pulse at the time of reset, a certain value is added to the already read count value to correct the count value to an accurate value.
第2図は、第1図に示した本発明のカウンター制御回路
2における実施例動作のフローチャートを示すものであ
る。FIG. 2 shows a flow chart of the operation of the embodiment of the counter control circuit 2 of the present invention shown in FIG.
外部カウンター1には、カウンタ−パルス20動作を行
う(第2図のステップ31)。次に、例えば一定の時間
が経過してカウンター1のカウント値を読み込む時期が
来るとMPU2はカウンターパルス20の入力が有るか
否かを監視する(同S2)、入力パルスが有るなら読み
出し動作を待機させ、入力パルスが無いなら読み込みを
行う(同33)、MPU2は読み込んだカウント値を前
回のカウント値に加算する(同34)。The external counter 1 is subjected to a counter pulse 20 operation (step 31 in FIG. 2). Next, for example, when a certain period of time has passed and it is time to read the count value of the counter 1, the MPU 2 monitors whether or not there is an input of the counter pulse 20 (S2), and if there is an input pulse, performs a read operation. The MPU 2 waits, and if there is no input pulse, reads it (33), and the MPU 2 adds the read count value to the previous count value (34).
カウント値を読み込んだ後は、カウンター1をリセット
することになるが、このリセット動作前においてもカウ
ンターパルス20が入力中で有るか否か監視しく同S5
)、入力中でない場合にはそのままリセット動作を行う
(同S6)が、入力中であればカウント価に「1」を加
算する補正を行う(同S7)。尚、この加算値が「1」
であるのは、通常、MPU2のプログラム走行周期がカ
ウンターパルスの入力周期より非常に短いからである。After reading the count value, the counter 1 will be reset, but even before this reset operation, it is necessary to monitor whether or not the counter pulse 20 is being input.
), if input is not in progress, the reset operation is performed as is (S6), but if input is in progress, correction is performed to add "1" to the count value (S7). In addition, this additional value is "1"
This is because the program running cycle of the MPU 2 is usually much shorter than the input cycle of the counter pulse.
本発明によれば、外部カウンターのカウント値の読み込
み時とリセット時に先立ってカウンターパルスの入力の
有無を監視し、読み込みは入力パルスがないときだけ行
い、リセットは入力パルスがあればカウント値を補正し
てから行うように構成したので、常に高信転度の外部カ
ウンターのカウント値が得られる効果がある。According to the present invention, the presence or absence of counter pulse input is monitored prior to reading and resetting the count value of the external counter, reading is performed only when there is no input pulse, and reset is performed by correcting the count value if there is an input pulse. Since the configuration is such that the count value of the external counter is always obtained with high reliability, it is possible to obtain the count value of the external counter with high reliability.
第1図は本発明に係るカウンター制御回路を示すブロッ
ク図、
第2図は第1図のカウンター制御回路で実行されるプロ
グラムのフローチャート図、
第3図は従来のカウンター制御回路を示すブロック図・
第4図は第3図の従来例で実行されるプログラムのフロ
ーチャート図、
第5図はリセットパルス、カウンターパルス、及びカウ
ント値の関係を説明する図、である。
第1図において、
1はカウンター、
2はMPU。
20はカウンターパルス、
30はカウント値、
32はリセットパルス、をそれぞれ示す。
尚、図中、同一符号は同−又は相当部分を示す。FIG. 1 is a block diagram showing a counter control circuit according to the present invention, FIG. 2 is a flowchart of a program executed by the counter control circuit of FIG. 1, and FIG. 3 is a block diagram showing a conventional counter control circuit. FIG. 4 is a flowchart of a program executed in the conventional example of FIG. 3, and FIG. 5 is a diagram illustrating the relationship among reset pulses, counter pulses, and count values. In Figure 1, 1 is a counter and 2 is an MPU. 20 represents a counter pulse, 30 represents a count value, and 32 represents a reset pulse. In the drawings, the same reference numerals indicate the same or corresponding parts.
Claims (2)
後、該カウント値(30)をリセットパルス(32)に
よりリセットするカウンター制御回路(2)において、 前記カウント値を読み込む前に入力パルス(20)を監
視して入力パルス(20)がないときのみ読み込みを行
うとともに、その後の該カウント値(30)のリセット
前にも入力パルス(20)を監視し入力パルス(20)
があるときのみ既に読み込んだカウント値(30)を補
正することを特徴としたカウンター制御回路。(1) In a counter control circuit (2) that resets the count value (30) by a reset pulse (32) after reading the count value of the external counter (1), an input pulse (20 ) and reads only when there is no input pulse (20), and also monitors the input pulse (20) and reads the input pulse (20) before resetting the count value (30).
A counter control circuit that corrects an already read count value (30) only when there is.
よって行われることを特徴とした特許請求の範囲第1項
に記載のカウンター制御回路。(2) The counter control circuit according to claim 1, wherein the count value is corrected by adding 1.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP3401987A JPS63202128A (en) | 1987-02-17 | 1987-02-17 | Counter control circuit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP3401987A JPS63202128A (en) | 1987-02-17 | 1987-02-17 | Counter control circuit |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPS63202128A true JPS63202128A (en) | 1988-08-22 |
Family
ID=12402674
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP3401987A Pending JPS63202128A (en) | 1987-02-17 | 1987-02-17 | Counter control circuit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS63202128A (en) |
-
1987
- 1987-02-17 JP JP3401987A patent/JPS63202128A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPS63202128A (en) | Counter control circuit | |
| JPS62245833A (en) | Protecting stage number switching circuit | |
| JPH04205152A (en) | Monitor device for controller | |
| JP2530040Y2 (en) | Full-duplex communication method by serial communication | |
| JPH01291546A (en) | Loop synchronization circuit | |
| JPS638962Y2 (en) | ||
| JPS61232944A (en) | Watch dog timer of computer controlling system carried on car | |
| JPS6054054A (en) | Detection for program runaway | |
| JP3154538B2 (en) | Data input / output device | |
| JP2896478B2 (en) | Remote control pulse receiving circuit | |
| JP2631541B2 (en) | Programmable controller | |
| JPH0785209B2 (en) | Timer monitoring method | |
| JPH0474228A (en) | Interruption circuit | |
| JPS62100838A (en) | program control device | |
| JPS63233418A (en) | Digital data processor | |
| JPH01200442A (en) | Cpu resetting circuit with protection | |
| JPH01296838A (en) | Noise detecting system for external input | |
| JPS60122437A (en) | Programmable watchdog timer | |
| JPH01216626A (en) | Pulse count circuit | |
| JPH0277854A (en) | Resetting system for microprocessor | |
| JPH01263740A (en) | Micro-computer | |
| JPS62271008A (en) | Digital signal processor | |
| JPS62137664A (en) | Logic simulation machine | |
| JPH03105280A (en) | Time signal generating circuit | |
| JPH0120393B2 (en) |