JPS5814626A - Counting device - Google Patents

Counting device

Info

Publication number
JPS5814626A
JPS5814626A JP11215281A JP11215281A JPS5814626A JP S5814626 A JPS5814626 A JP S5814626A JP 11215281 A JP11215281 A JP 11215281A JP 11215281 A JP11215281 A JP 11215281A JP S5814626 A JPS5814626 A JP S5814626A
Authority
JP
Japan
Prior art keywords
counting
signal
counting device
circuit
counter
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
Application number
JP11215281A
Other languages
Japanese (ja)
Other versions
JPH0216058B2 (en
Inventor
Yasuo Matsuzawa
松澤 泰生
Chie Kawashita
川下 智恵
Takusane Nishimura
西村 卓実
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP11215281A priority Critical patent/JPS5814626A/en
Publication of JPS5814626A publication Critical patent/JPS5814626A/en
Publication of JPH0216058B2 publication Critical patent/JPH0216058B2/ja
Granted legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K23/00Pulse counters comprising counting chains; Frequency dividers comprising counting chains
    • H03K23/64Pulse counters comprising counting chains; Frequency dividers comprising counting chains with a base or radix other than a power of two
    • H03K23/66Pulse counters comprising counting chains; Frequency dividers comprising counting chains with a base or radix other than a power of two with a variable counting base, e.g. by presetting or by adding or suppressing pulses
    • H03K23/665Pulse counters comprising counting chains; Frequency dividers comprising counting chains with a base or radix other than a power of two with a variable counting base, e.g. by presetting or by adding or suppressing pulses by presetting

Landscapes

  • Electronic Switches (AREA)

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】 本発明は計数装置、特に所定の繰返し周波数を有する第
1の信号を分周して第2の信号を発生する分周回路と、
値を蓄積し、第2の信号をその蓄積した値まで計数する
と第3の信号を発生する計数回路とを含む計数装置に関
するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention provides a counting device, particularly a frequency dividing circuit that divides a first signal having a predetermined repetition frequency to generate a second signal;
The invention relates to a counting device including a counting circuit that accumulates a value and generates a third signal when a second signal is counted up to the accumulated value.

このような計数装置はマイクロプロセッサのタイマとし
て利用されており、例えば分周回路はマイクロプロセッ
サのシステムクロックを分周するプリスケーラであり、
計数回路は例えばタイマ割込信号を発生するカウンタで
ある。従来、このような計数回路をタイマとして利用す
る場合、カウンタにデータバスよりある値を書き込み、
プリスケーラで分局すなわち逓降されたクロックをカウ
ンタで計数し、その計数値が蓄積値に一致すると割込信
号を発生する。しかしプリスケーラはシステムクロック
によって常に走行しているので、カウンタに値を書込ん
でからプリスケーラより最初の分局クロックが発生する
までの時間にばらつきが生ずる。すなわちこの計数回路
をタイマとして利用する場合、カウンタに所望の時間に
対応する値を書きこむが、このカウンタに書込み信号を
与えた時点と、プリスケーラがシステムクロックを所定
数まで計数して分周クロックのパルスを1個出力するま
での時間には、最大限分動クロックの周期に相当する時
間の範囲内においてばらつきが生ずる。このため、期待
していた時間、すなわちカウンタに書き込んだ値に対し
てこのばらつきは数パーセントの誤差となることがある
。従って従来のこのような計数回路ではマイクロプロセ
ッサにおいて精密な時間制御が出来ない欠点がある。
Such a counting device is used as a timer for a microprocessor. For example, a frequency divider circuit is a prescaler that divides the system clock of a microprocessor.
The counting circuit is, for example, a counter that generates a timer interrupt signal. Conventionally, when using such a counting circuit as a timer, a certain value is written to the counter from the data bus,
A counter counts the divided clocks, that is, downgraded clocks, by the prescaler, and when the counted value matches the accumulated value, an interrupt signal is generated. However, since the prescaler is always running based on the system clock, variations occur in the time from when a value is written to the counter until the first branch clock is generated by the prescaler. In other words, when using this counting circuit as a timer, a value corresponding to a desired time is written to the counter, but at the time when a write signal is given to this counter, and when the prescaler counts the system clock up to a predetermined number and divides the clock The time it takes to output one pulse varies within a time range that corresponds to the maximum period of the divided clock. Therefore, this variation may result in an error of several percent with respect to the expected time, that is, the value written to the counter. Therefore, such a conventional counting circuit has the disadvantage that precise time control cannot be performed in a microprocessor.

本発明はこのような従来技術の欠点を解消し、精密な時
間制御を行うことのできる計数装置を提供することを目
的とする。
SUMMARY OF THE INVENTION An object of the present invention is to eliminate such drawbacks of the prior art and provide a counting device that can perform precise time control.

この目的は本発明によれば、計数回路の値の蓄積に応動
して分局回路を初期設定する手段を含む計数装置によっ
て達成することができる。
This object can be achieved according to the invention by a counting device comprising means for initializing the branch circuit in response to the accumulation of values in the counting circuit.

本発明の一つのSSによれば、このような初期設定手段
は、マイクロプロセッサの計数回路のデータ書込み信号
に応動して分周回路を初期設定するものである。
According to one SS of the present invention, such initial setting means initializes the frequency dividing circuit in response to a data write signal of the counting circuit of the microprocessor.

次に添付図面を参照して本発明による計数装置の実施例
を詳細に説明する。
Next, embodiments of a counting device according to the present invention will be described in detail with reference to the accompanying drawings.

図は本発明による計数装置のマイクロプロセッサにおけ
る実施例を示すブロック図である。同図において、本発
明による計数装置は、マイクロプロセッサのシステムク
ロックCLKをクロック端子10に受信してこれを計数
し、所定の計数値に達すると分周クロックをリード12
に発生するプリスケーラ14と、この分局クロックを計
数するカウンタ16とを有する。カウンタ16は、マイ
クロプロセッサの他の回路からデータバス18を通して
2進値を書き込んだり、またはこれへ読み出したりする
回路で、リード12の分周クロックをアップカウント又
はダウンカウントするいずれの方式のものでもよい。カ
ウンタ16にはマイクロプレセッサの制御(ロ)路から
読出しくR)又は書込み(W)信号を受信するり一ド2
oが接続され、これはプリスケーラ14のクリア(cL
R)11子22にも接続されている。カウンタ16の出
力端子INTは例えばタイマ割込信号としてシステムで
利用できる出力をその端子24に発生する。
The figure is a block diagram showing an embodiment of a microprocessor of a counting device according to the present invention. In the figure, a counting device according to the present invention receives a system clock CLK of a microprocessor at a clock terminal 10, counts it, and when a predetermined count value is reached, reads the divided clock 12.
It has a prescaler 14 that generates a clock, and a counter 16 that counts this branch clock. Counter 16 is a circuit that writes or reads binary values from other circuits of the microprocessor through data bus 18, and may be of any type that counts up or down the divided clock on read 12. good. A counter 16 receives a read (R) or write (W) signal from the control (B) path of the microprocessor.
o is connected, which clears the prescaler 14 (cL
R) 11 is also connected to the child 22. The output terminal INT of the counter 16 produces an output on its terminal 24 which can be used by the system as, for example, a timer interrupt signal.

例えばプリスケーラ14及びカウンタ16がダウンカウ
ント方式であれば、プリスケーラ14は、端子22に信
号を受信すると所定の値に初期設定され、端子10に現
われるシステムクロックをその所定数まで計数すると計
数値が0となり、リード12にパルスを1つ発生し、再
び所定の計数値からのダウンカウントな循環的に繰り返
す。従ってリード12には一定の周期の分周クロックが
現われる。カウンタ16はデータバス18から受信した
ディジタル値を蓄積し、リード20から書込み信号を受
信す葛と、リード12に接続されているゲート(図示せ
ず)を開き、その蓄積された計数値からのカウントダウ
ンを開始する。リード12の分周クロックを計数してそ
の計数値がOになると、カウンタ16はリード24にパ
ルスヲ発生する。
For example, if the prescaler 14 and counter 16 are of a down-count type, the prescaler 14 is initialized to a predetermined value when receiving a signal at the terminal 22, and when the system clock appearing at the terminal 10 is counted up to the predetermined number, the counted value becomes 0. Then, one pulse is generated in the lead 12, and the counting down from the predetermined count value is repeated cyclically. Therefore, a divided clock having a constant period appears on lead 12. Counter 16 stores the digital value received from data bus 18 and opens a gate (not shown) connected to lead 12 and a gate that receives a write signal from lead 20 to read the digital value from the stored count. Start countdown. When the frequency-divided clock on the lead 12 is counted and the counted value becomes O, the counter 16 generates a pulse on the lead 24.

ところで本発明によれば、リード20の書込み信号はプ
リスケーラ14のクリア端子22に接続されているので
、カウンタ16にデータバス18を通してディジタル値
が書き込まれて蓄積され、リード20に書き込み信号が
現われると同時にプリスケーラ14も所定の値に初期設
定される。従ってマイクロプロセッサの制御回路から端
子20に書込み信号が現われた時点からプリスケーラ1
4の出やリード12に分周クロックの最初のパルスが現
われるまでの時間は、プリスケーラ14を初期設定する
所定の値に対応しており、この値は常に一定であるので
、カウンタ16がり−5,ド20に制御回路より書込み
信号を受信してから、リード24に出力信号を発生する
までの時間はカウンタ16にデータバス18から書き込
んだ値に常に正確に対応する。従って本計数装置を時間
制御タイマとして使用してもその時間制御にばらつきが
生ずることはない。
According to the present invention, the write signal on the lead 20 is connected to the clear terminal 22 of the prescaler 14, so that a digital value is written and accumulated in the counter 16 through the data bus 18, and when the write signal appears on the lead 20, At the same time, the prescaler 14 is also initialized to a predetermined value. Therefore, from the time when a write signal appears at terminal 20 from the control circuit of the microprocessor, the prescaler 1
4 or the first pulse of the divided clock appears on lead 12 corresponds to a predetermined value that initializes prescaler 14, and since this value is always constant, counter 16 increases by -5. , the time from receiving a write signal from the control circuit on lead 20 to generating an output signal on lead 24 always corresponds exactly to the value written to counter 16 from data bus 18. Therefore, even if this counting device is used as a time control timer, there will be no variation in the time control.

本発明による計数装置は以上のように構成したことによ
り、誤差のない精密な時間制御を行うことができる。こ
れは特にマイクロプロセッサの時間測定タイマとして有
効に利用することができ、数マイクロ秒のオーダの時間
制御も誤差を生ずることなく可能となる。
By configuring the counting device according to the present invention as described above, precise time control without error can be performed. This can be particularly effectively used as a time measurement timer for a microprocessor, making it possible to control time on the order of several microseconds without causing errors.

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

図は本発明による計数装置のマイクロプロセッサにおけ
る実施例を示すブロック図である。 14・・・プリスケーラ、16・・・カウンタ、22・
・・初期設定手段。 代理人 弁理士  薄 1)利 幸
The figure is a block diagram showing an embodiment of a microprocessor of a counting device according to the present invention. 14... Prescaler, 16... Counter, 22...
...Initial setting means. Agent Patent Attorney Susuki 1) Toshiyuki

Claims (1)

【特許請求の範囲】 1、所定の繰返し周波数を有する第1の信号を分周して
第2の信号を発生する分周回路と、値を蓄積し、該第2
の信号を該蓄積した値まで計数すると第3の信号を発生
する計数回路とを含む計数装置において、該計数装置は
、 前記計数回路の値の蓄積に応動して前記分周回路を初期
設定する手段を含むことを特徴とする計数装置。 2、  II許請求の範囲第1項記載の計数装置におい
て、前記第1の信号はマイクロプロセッサのシステムク
ロックであり、前記初期設定手段は前記計数回路のデー
タ書込み信号に応動して前記分周回路i初期設定するこ
とを特徴とする計数装置。
[Claims] 1. A frequency dividing circuit that divides a first signal having a predetermined repetition frequency to generate a second signal;
a counting circuit that generates a third signal when counting the signals up to the accumulated value, the counting device initializing the frequency dividing circuit in response to the accumulation of the values of the counting circuit. A counting device characterized in that it includes means. 2. II. In the counting device according to claim 1, the first signal is a system clock of a microprocessor, and the initial setting means operates the frequency dividing circuit in response to a data write signal of the counting circuit. A counting device characterized by initializing i.
JP11215281A 1981-07-20 1981-07-20 Counting device Granted JPS5814626A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11215281A JPS5814626A (en) 1981-07-20 1981-07-20 Counting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11215281A JPS5814626A (en) 1981-07-20 1981-07-20 Counting device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP3064350A Division JPH04211814A (en) 1991-03-28 1991-03-28 Microprocessor

Publications (2)

Publication Number Publication Date
JPS5814626A true JPS5814626A (en) 1983-01-27
JPH0216058B2 JPH0216058B2 (en) 1990-04-16

Family

ID=14579533

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11215281A Granted JPS5814626A (en) 1981-07-20 1981-07-20 Counting device

Country Status (1)

Country Link
JP (1) JPS5814626A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6356121A (en) * 1986-08-27 1988-03-10 株式会社日立製作所 Ratio differential relay
JPS63103515A (en) * 1986-10-21 1988-05-09 Fujitsu Ten Ltd Electronic engine controller

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5010950A (en) * 1973-05-28 1975-02-04
JPS5011361A (en) * 1973-05-30 1975-02-05
JPS50120247A (en) * 1974-03-04 1975-09-20
JPS51163848U (en) * 1975-06-20 1976-12-27
JPS53135255A (en) * 1977-04-28 1978-11-25 Toshiba Corp Pulse counting system
JPS5460547A (en) * 1977-10-24 1979-05-16 Hitachi Ltd Programable divider
JPS54105952A (en) * 1978-02-07 1979-08-20 Nec Corp Programable divider circuit

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5010950A (en) * 1973-05-28 1975-02-04
JPS5011361A (en) * 1973-05-30 1975-02-05
JPS50120247A (en) * 1974-03-04 1975-09-20
JPS51163848U (en) * 1975-06-20 1976-12-27
JPS53135255A (en) * 1977-04-28 1978-11-25 Toshiba Corp Pulse counting system
JPS5460547A (en) * 1977-10-24 1979-05-16 Hitachi Ltd Programable divider
JPS54105952A (en) * 1978-02-07 1979-08-20 Nec Corp Programable divider circuit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6356121A (en) * 1986-08-27 1988-03-10 株式会社日立製作所 Ratio differential relay
JPS63103515A (en) * 1986-10-21 1988-05-09 Fujitsu Ten Ltd Electronic engine controller

Also Published As

Publication number Publication date
JPH0216058B2 (en) 1990-04-16

Similar Documents

Publication Publication Date Title
US4375084A (en) Digital input apparatus
JPS5814626A (en) Counting device
US5414307A (en) Power reset circuit
JPH04211814A (en) Microprocessor
JPS62276925A (en) Digital counter circuit
US4801875A (en) Integrated circuit with frequency dividing test function
US4164712A (en) Continuous counting system
JP2775822B2 (en) Inverter on-delay circuit
JPS6233394Y2 (en)
JPS62280656A (en) Pulse generator
SU1083181A1 (en) Device for comparing numbers
JPS6347083Y2 (en)
JPH05143199A (en) Resetting circuit
RU1802403C (en) Digital device for pulse delay
JPH07101845B2 (en) Digital phase lock loop device
JP2606262B2 (en) Pulse generation circuit
RU1798901C (en) Single-pulse frequency multiplier
JPH02192313A (en) Waveform shaping circuit
KR900004178Y1 (en) Reseting circuit for micro processer
SU1495774A1 (en) Device for production of time intervals
JP2775821B2 (en) Inverter on-delay circuit
JPH0234052B2 (en)
JPS61288574A (en) Synchronous separation circuit
JPS647350B2 (en)
JPS639686B2 (en)