JPH069331B2 - Timer device - Google Patents

Timer device

Info

Publication number
JPH069331B2
JPH069331B2 JP1527789A JP1527789A JPH069331B2 JP H069331 B2 JPH069331 B2 JP H069331B2 JP 1527789 A JP1527789 A JP 1527789A JP 1527789 A JP1527789 A JP 1527789A JP H069331 B2 JPH069331 B2 JP H069331B2
Authority
JP
Japan
Prior art keywords
value
prescale
bit
circuit
timer
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.)
Expired - Lifetime
Application number
JP1527789A
Other languages
Japanese (ja)
Other versions
JPH02195717A (en
Inventor
良明 末永
共治 丸本
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.)
Rohm Co Ltd
Original Assignee
Rohm Co 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 Rohm Co Ltd filed Critical Rohm Co Ltd
Priority to JP1527789A priority Critical patent/JPH069331B2/en
Publication of JPH02195717A publication Critical patent/JPH02195717A/en
Publication of JPH069331B2 publication Critical patent/JPH069331B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Measurement Of Predetermined Time Intervals (AREA)
  • Electronic Switches (AREA)

Description

【発明の詳細な説明】 <産業上の利用分野> この発明は、nビットのプログラマブルカウンタを具備
するタイマー装置であって、2nビットのプリスケール
値を単純な構成で実現したタイマー装置に関する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a timer device having an n-bit programmable counter, which realizes a 2n-bit prescale value with a simple configuration.

<従来の技術> 従来のnビットのプログラマブルカウンタを具備するタ
イマーにおいて、2nビットのプリスケール値をもつタ
イマー装置は第4図に示すような構成を有する。
<Prior Art> In a conventional timer having an n-bit programmable counter, a timer device having a 2n-bit prescale value has a configuration as shown in FIG.

図において、(15)は2nビットのプリスケール値N1を
初期値として端子(15a)に入力される基本クロックφを
ダウンカウントし、φ/N1なる分周クロックφpを得
る2nビッツトのプリスケールデクリメンタで、(16)は
2nビットのプリスケール値N1を前記プリスケールデ
クリメンタ(15)にプリセットする2nビットのプリスケ
ールレジスタ、(17)はnビットのプリスケール値N2を
初期値として前記分周クロックφpをダウンカウント
し、前記分周クロックφpの1/N2なるタイマーカウ
ントエンド出力φp/N2を出力するnビットのタイマ
ーデクリメンタ、(18)はnビットのプリスケール値N2
を前記タイマーデクリメンタ(17)にプリセットするnビ
ットのタイマーレジスタ、(19)はタイマー動作のスター
ト/ストップ指令等タイマー制御用のレジスタであるタ
イマーコントロールレジスタ、(20)はタイマーコントロ
ールレジスタ(19)で指定されたモードでタイマーが動作
するようにタイマーコントロールレジスタ(19)以外の回
路を制御し、前記プリスケールデクリメンタ(15)、プリ
スケールレジスタ(16)、タイマーデクリメンタ(17)、タ
イマーレジスタ(18)間のデータの交換を制御するタイマ
ーコントロールである。
In the figure, (15) is a 2n-bit prescale decrement that obtains a divided clock φp of φ / N1 by down-counting the basic clock φ input to the terminal (15a) with a 2n-bit prescale value N1 as an initial value. (16) is a 2n-bit prescale register that presets a 2n-bit prescale value N1 in the prescale decrementer (15), and (17) is an n-bit prescale value N2 as an initial value. An n-bit timer decrementer that down-counts the divided clock φp and outputs a timer count end output φp / N2 which is 1 / N2 of the divided clock φp, (18) is an n-bit prescale value N2
To the timer decrementer (17), an n-bit timer register, (19) a timer control register for controlling timer start / stop commands, and (20) a timer control register (19 ) Controls the circuits other than the timer control register (19) so that the timer operates in the mode specified by), and prescale decrementer (15), prescale register (16), timer decrementer (17) , A timer control for controlling the exchange of data between the timer registers (18).

以下、簡単にその動作を説明する。The operation will be briefly described below.

タイマーコントロール(20)からスタート指令信号が出力
されると、プリスケールレジスタ(16)に保持されている
プリスケール値N1がプリスケールデグリメンタ(15)に
プリセットされる。また、タイマーレジスタ(18)に保持
されているプリスケール値N2がタイマーデクリメンタ
(17)にプリセットされる。
When the start command signal is output from the timer control (20), the prescale value N1 held in the prescale register (16) is preset in the prescale degrimmer (15). Also, the prescale value N2 held in the timer register (18) is the timer decrementer.
It is preset to (17).

このプリスケールデクリメンタ(15)はそのプリスケール
値N1を初期値として端子(15a)に入力される基本クロ
ックφをダウンカウントし、φ/N1なる分周クロック
φpを出力する。そして、前記タイマーデクリメンタ(1
7)はそのプリスケール値N2を初期値として前記分周ク
ロックφpでダウンカウントし、その値が[0]になる
とタイマーカウントエンドφp/2を出力する。
The prescale decrementer (15) downcounts the basic clock φ input to the terminal (15a) with the prescale value N1 as an initial value, and outputs a divided clock φp of φ / N1. Then, the timer decrementer (1
In 7), the prescale value N2 is used as an initial value to down-count the divided clock φp, and when the value becomes [0], the timer count end φp / 2 is output.

すなわち、基本クロックφに対して、タイマーカウント
エンド出力は、φ/N1N2となる。
That is, the timer count end output is φ / N1N2 with respect to the basic clock φ.

<発明が解決しようとする課題> このように、従来のnビットのプログラマブルカウンタ
を具備するタイマー装置は、2nビットのプリスケール
値を実現しようとすれば、2nビットのプリスケールデ
クリメンタ(15)および2nビットのプリスケールレジス
タ(16)が必要不可欠であるため、プリスケール値が大き
くなると、その分だけビット数の大きなプログラマブル
カウンタが必要となり、回路規模および回路配置規模が
大きくなる。
<Problems to be Solved by the Invention> As described above, the conventional timer device having the n-bit programmable counter has a 2n-bit prescale decrementer (15) in order to realize a 2n-bit prescale value. ) And a 2n-bit prescale register (16) are indispensable. Therefore, if the prescale value becomes large, a programmable counter having a large number of bits is required, and the circuit scale and the circuit arrangement scale become large.

この発明はこのような課題を解決するもので、nビット
のプログラマブルカウンタを具備するタイマー装置であ
って、2nビットのプリスケール値を単純な構成で実現
したタイマー装置である。
The present invention solves such a problem, and is a timer device provided with an n-bit programmable counter, which realizes a 2n-bit prescale value with a simple configuration.

<課題を解決するための手段> この発明の代表的な実施例を示す第1図を参考にして説
明する。
<Means for Solving the Problems> A description will be given with reference to FIG. 1 showing a typical embodiment of the present invention.

この発明は、 nビットのデクリメンタ手段(デクリメンタ回路(8))
と、 2nビットのプリスケール値の上位nビットを保持する
プリスケール上位ポート手段(プリスケール上位ポート
回路(5))と、 2nビットとプリスケール値の下位nビットを保持する
プリスケール下位ポート手段(プリスケール下位ポート
回路(7))と、 nビットのタイマー値を保持するタイマーポート手段
(タイマーポート回路(1))と、 前記2nビットのプリスケール値の下位nビットを前記
デクリメンタ手段(デクリメンタ回路(8))にプリセット
し、このプリセット値を初期値として基本クロックをカ
ウントして、前記プリスケール値の下位nビットに対応
する第1の分周出力を得る第1のプログラマブルカウン
タ手段と、 前記第1の分周出力に基づいて、前記2nビットのプリ
スケール値の上位nビットの最下位ビットの桁の重みに
対応する補正値を定数で保持しておくレジスタ手段(補
正用レジスタ回路(3),(4))と、この値を前記デクリメ
ンタ手段(デクリメンタ回路(8))にプリセットし、この
プリセット値を初期値として基本クロックをカウントし
て、前記プリスケール値の上位nビットの最下位ビット
の桁の重みに対応する第2の分周出力を得る第2のプロ
グラマブルカウンタ手段と、 前記第2の分周出力に基づいて、前記2nビットのプリ
スケール値の上位nビットを前記デクリメンタ手段(デ
クリメンタ回路(8))にプリセットし、このプリセット値
を初期値として前記第2の分周出力をカウントして、前
記プリスケール値の上位nビットに対応する第3の分周
出力を得る第3のプログラマブルカウンタ手段と、 前記第3の分周出力に基づいて、前記nビットのタイマ
ー値を前記デクリメンタ手段(デクリメンタ回路(8))に
プリセットし、このプリセット値を初期値として前記第
3の分周出力をカウントして、前記タイマー値に対応す
る第4の分周出力を得る第4のプログラマブルカウンタ
手段と、 からなり、この第4の分周出力をタイマー出力とする。
This invention is an n-bit decrementer means (decrementer circuit (8)).
And a prescale upper port means (prescale upper port circuit (5)) for holding the upper n bits of the 2n-bit prescale value and a prescale lower port means for holding the 2n bit and the lower n bits of the prescale value. (Prescale lower port circuit (7)), timer port means (timer port circuit (1)) for holding an n-bit timer value, lower n bits of the 2n-bit prescale value are decrementer means (decrementer) Circuit (8)), and a first programmable counter means for obtaining a first divided output corresponding to the lower n bits of the prescale value by counting the basic clock with the preset value as an initial value, Corresponding to the digit weight of the least significant bit of the upper n bits of the 2n-bit prescale value based on the first frequency division output Register means (correction register circuits (3), (4)) for holding the correction value as a constant and this value are preset in the decrementer means (decrementer circuit (8)), and this preset value is used as an initial value. Second programmable counter means for obtaining a second frequency division output corresponding to the weight of the least significant bit of the upper n bits of the prescale value by counting the basic clock as; On the basis of the above, the upper n bits of the 2n-bit prescale value are preset in the decrementer means (decrementer circuit (8)), and the second divided output is counted by using the preset value as an initial value, Third programmable counter means for obtaining a third divided output corresponding to the upper n bits of the prescale value, and the n-bit timer value based on the third divided output Is preset in the decrementer means (decrementer circuit (8)), the preset frequency value is used as an initial value to count the third frequency division output, and a fourth frequency division output corresponding to the timer value is obtained. The programmable counter means (1) and the fourth frequency division output are used as timer outputs.

<作用> この発明の代表的な実施例の動作を示す第2図(a),(b)
において説明する。
<Operation> FIG. 2 (a), (b) showing the operation of a typical embodiment of the present invention.
Will be explained.

(i)前記2nビットのプリスケール値の下位nビットを
前記デクリメンタ手段(デクリメンタ回路(8))にプリセ
ットし、このプリセット値を初期値として基本クロック
をカウントすることにより、前記プリスケール値の下位
nビットに対応する第1の分周出力を得る。
(i) The lower n bits of the 2n-bit prescale value are preset in the decrementer means (decrementer circuit (8)), and the preset clock is used as an initial value to count the basic clock, thereby lowering the prescale value. Obtain the first divided output corresponding to n bits.

(ii)前記第1の分周出力に基づいて、前記2nビットの
プリスケール値の上位nビットの最下位ビットの桁の重
みに対応する補正値を前記デクリメンタ手段(デクリメ
ンタ回路(8))にプリセットし、このプリセット値を初期
値として基本クロックをカウントして、前記プリスケー
ル値の上位nビットの最下位ビットの桁の重みに対応す
る第2の分周出力を得る。
(ii) A correction value corresponding to the digit weight of the least significant bit of the upper n bits of the 2n-bit prescale value is provided to the decrementer means (decrementer circuit (8)) based on the first frequency division output. The preset clock is preset and the basic clock is counted using this preset value as an initial value to obtain a second frequency division output corresponding to the digit weight of the least significant bit of the upper n bits of the prescale value.

(iii)前記第2の分周出力に基づいて、前記2nビット
のプリスケール値の上位nビットを前記デクリメンタ手
段(デクリメンタ回路(8))にプリセットし、このプリセ
ット値を初期値として前記第2の分周出力をカウントし
て、前記プリスケール値の上位nビットに対応する第3
の分周出力を得る。
(iii) Based on the second frequency division output, the upper n bits of the 2n-bit prescale value are preset in the decrementer means (decrementer circuit (8)), and the preset value is used as an initial value for the second Counting the frequency-divided output of the third prescale value corresponding to the upper n bits
Get the divided output of.

(iv)前記第3の分周出力に基づいて、前記nビットのタ
イマー値を前記デクリメンタ手段(デクリメンタ回路
(8))にプリセットし、このプリセット値を初期値として
前記第3の分周出力をカウントして、前記タイマー値に
対応する第4の分周出力を得る。
(iv) The n-bit timer value is changed to the decrementer means (decrementer circuit) based on the third frequency division output.
(8)) is preset, and the preset frequency is used as an initial value to count the third frequency division output to obtain the fourth frequency division output corresponding to the timer value.

のステップを経て、この第4の分周出力をタイマー出力
とするので、 前記デクリメンタはnビットのもので実現できる。
Since the fourth frequency-divided output is used as the timer output through the step of, the decrementer can be realized by an n-bit decrementer.

<実施例> この発明の代表的な実施例を図面を参照して説明する。<Example> A typical example of the present invention will be described with reference to the drawings.

第1図はこの発明の代表的な実施例を示すブロック図、
第2図(a),(b)は同動作を示すフローチャート、第3図
は同各制御信号のタイミングチャートである。
FIG. 1 is a block diagram showing a typical embodiment of the present invention,
2 (a) and 2 (b) are flowcharts showing the same operation, and FIG. 3 is a timing chart of the respective control signals.

第1図において説明する。This will be described with reference to FIG.

(1)はnビットのタイマー値を保持するタイマーポート
回路(TMR)である。
(1) is a timer port circuit (TMR) that holds an n-bit timer value.

(2)はタイマーレジスタ回路(TMR REG)で、初
期値としてタイマーポート回路(TMR)(1)と同じ値
をもつが、タイマー動作がスタートすると、後述の予め
設定されているクロック数毎にこの値はデクリメンタ回
路(DEC)(8)に入力され、そして、このデクリメン
タ回路(DEC)(8)によって減算(−1)されて、そ
の値がタイマーレジスタ回路(TMR REG)(2)に
戻される。この値は次の動作まで保持される。図中、T
MR→TMRREGはタイマーポート回路(TMR)
(1)からタイマーレジスタ回路(TMR REG)(2)へ
のデータ読み出し信号、TMRREG→DECはタイマ
ーレジスタ回路(TMR REG)(2)からデクリメン
タ回路(DEC)(8)へのデータ送り出し信号、DEC
→TMRREGはデクリメンタ回路(DEC)(8)から
タイマーレジスタ回路(TMR REG)2へのデータ
読み出し信号である。
(2) is a timer register circuit (TMR REG), which has the same value as the timer port circuit (TMR) (1) as an initial value, but when the timer operation starts, this value is set every preset number of clocks described later. The value is input to the decrementer circuit (DEC) (8), subtracted (-1) by this decrementer circuit (DEC) (8), and the value is returned to the timer register circuit (TMRREG) (2). . This value is retained until the next operation. T in the figure
MR → TMRREG is a timer port circuit (TMR)
Data read signal from (1) to timer register circuit (TMRR REG) (2), TMRREG → DEC is data output signal from timer register circuit (TMR REG) (2) to decrementer circuit (DEC) (8), DEC
→ TMRREG is a data read signal from the decrementer circuit (DEC) (8) to the timer register circuit (TMRREG) 2.

(3)は2nビットのプリスケール値の上位nビットの最
下位ビットの桁の重みを補正するためのものであって、
2nビットのプリスケール値の上位nビットの最下位ビ
ットの桁の重み補正値をもつ第1の桁重み補正用レジス
タ回路(OO REG)である。この発明では、2nビ
ットのプリスケール値を上位nビット、下位nビットに
分割し、これらの上位nビット、下位nビットに対応す
るプリスケール値をnビットのデクリメンタ回路(DE
C)(8)で別々に減算(−1)してカウントしている。
したがって、上位nビットをカウントするためには、プ
リスケール値の上位nビットの最下位ビットの桁の重み
分(すなわち、補正値)をカウントしてから上位nビッ
トをカウントする必要がある。この補正値は桁の重みに
対応した定数であるから、第1の桁重み補正用レジスタ
回路(OO REG)(3)は単純な回路構成で実現でき
る。
(3) is for correcting the digit weight of the least significant bit of the upper n bits of the 2n-bit prescale value,
It is a first digit weight correction register circuit (OO REG) having a weight correction value of the digit of the least significant bit of the upper n bits of the 2n-bit prescale value. In the present invention, the 2n-bit prescale value is divided into upper n bits and lower n bits, and the prescale values corresponding to these upper n bits and lower n bits are decremented by an n-bit decrementer circuit (DE).
C) (8) is separately subtracted (-1) and counted.
Therefore, in order to count the upper n bits, it is necessary to count the weight of the digit of the least significant bit of the upper n bits of the prescale value (that is, the correction value) and then count the upper n bits. Since the correction value is a constant corresponding to the digit weight, the first digit weight correction register circuit (OO REG) (3) can be realized with a simple circuit configuration.

図中、OOREG→DECは第1の桁重み補正用レジス
タ回路(OO REG)(3)からデクリメンタ回路(D
EC)(8)へのデータ送り出し信号である。
In the figure, OOREG → DEC is the decrementer circuit (D) from the first digit weight correction register circuit (OOREG) (3).
This is a signal for sending data to EC) (8).

(4)は第2の桁重み補正用レジスタ回路(FFREG)
で、第1の桁重み補正用レジスタ回路(OO REG)
(3)の内容から減算(−1)した補正値をもつレジスタ
である。これは、デクリメンタ回路(DEC)(8)が他
のレジスタの値をカウントしている場合、そのカウント
動作が1回だけ多くされるため、これを補正するもので
ある。この補正値は桁の重みに対応した定数であるか
ら、第2の桁重み補正回路(FF REG)(4)は単純
な回路構成で実現できる。
(4) is the second digit weight correction register circuit (FFREG)
Then, the first digit weight correction register circuit (OO REG)
This is a register having a correction value subtracted (-1) from the contents of (3). This is a correction to be made when the decrementer circuit (DEC) (8) is counting the value of another register because the counting operation is increased only once. Since this correction value is a constant corresponding to the digit weight, the second digit weight correction circuit (FF REG) (4) can be realized with a simple circuit configuration.

図中、FFREG→DECは第2の桁重み補正用レジス
タ回路(FF REG)(4)からデクリメンタ回路(D
EC)(8)へのデータ送り出し信号である。
In the figure, FFREG → DEC is the second digit weight correction register circuit (FF REG) (4) to the decrementer circuit (D
This is a signal for sending data to EC) (8).

(5)は2nビットのプリスケール値の上位nビットを保
持するためのプリスケール上位ポート回路(PRE U
P)である。
(5) is a prescale upper port circuit (PREU) for holding the upper n bits of the 2n-bit prescale value.
P).

(6)は初期値としてプリスケール上位ポート回路(PR
E UP)(5)と同じ値をもつプリスケール上位レジス
タ回路(UP REG)である。タイマー動作がスター
トし、プリスケール値の上位nビットの最下位ビットの
桁の重み分(すなわち、補正値)がカウントされると、
プリスケール上位レジスタ回路(UP REG)(6)の
値はデクリメンタ回路(DEC)(8)に入力され、そし
て、このデクリメンタ回路(DEC)(8)によって減算
(−1)されて、その値がプリスケール上位レジスタ回
路(UP REG)(6)に戻される。この値は次の動作
まで保持される。
(6) is the prescale upper port circuit (PR
E UP) (5) is a prescale upper register circuit (UP REG) having the same value. When the timer operation is started and the weight of the digit of the least significant bit of the upper n bits of the prescale value (that is, the correction value) is counted,
The value of the prescale upper register circuit (UP REG) (6) is input to the decrementer circuit (DEC) (8), and the value is subtracted (-1) by this decrementer circuit (DEC) (8) to obtain the value. It is returned to the prescale upper register circuit (UP REG) (6). This value is retained until the next operation.

図中、PREUP→UPREGはプリスケール上位ポー
ト回路(PRE UP)(5)からプリスケール上位レジ
スタ回路(UP REG)(6)へのデータ読み出し信
号、UPREG→DECはプリスケール上位レジスタ回
路(UP REG)(6)からデクリメンタ回路(DE
C)(8)へのデータ送り出し信号、DEC→UPREG
はデクリメンタ回路(DEC)(8)からプリスケール上
位レジスタ回路(UP REG)(6)へのデータ読み出
し信号である。
In the figure, PREUP → UPREG is a data read signal from the prescale upper port circuit (PRE UP) (5) to the prescale upper register circuit (UP REG) (6), and UPREG → DEC is a prescale upper register circuit (UP REG) ) (6) to the decrementer circuit (DE
C) Data sending signal to (8), DEC → UPREG
Is a data read signal from the decrementer circuit (DEC) (8) to the prescale upper register circuit (UP REG) (6).

(7)は2nビットのプリスケール値の下位nビットを保
持するためのプリスケール下位ポート回路(PRE L
OW)である。
(7) is a prescale lower port circuit (PRE L) for holding the lower n bits of the 2n-bit prescale value.
OW).

(8)はプリセットされた値を初期値として基本クロック
をダウンカウントして、減算(−1)するnビットのデ
クリメンタ回路(DEC)(8)である。
Reference numeral (8) is an n-bit decrementer circuit (DEC) (8) that counts down (-1) the basic clock by using a preset value as an initial value.

図中、DEC1はデクリメンタ回路(DEC)(8)の値
が[1]のときの出力、DEC0はデクリメンタ回路
(DEC)(8)の値が[0]のときの出力、TMRφは
デクリメンタ回路(DEC)(8)へ入力される基本クロ
ックである。
In the figure, DEC1 is the output when the value of the decrementer circuit (DEC) (8) is [1], DEC0 is the output when the value of the decrementer circuit (DEC) (8) is [0], and TMRφ is the decrementer circuit ( This is the basic clock input to the DEC) (8).

(9)はタイマー動作を規定するためのタイマーコントロ
ールレジスタ回路(TMR CONT)で、スタート/
ストップ指令信号のためのビットをもつ。
(9) is a timer control register circuit (TMR CONT) for defining the timer operation.
It has a bit for the stop command signal.

(10)はプリスケール動作モードを規定するためのプリス
ケール上位ゼロフラグ回路(UZ)で、プリスケール上
位ポート回路(PRE UP)(5)が[0]の場合、そ
の出力は[1]となる。
(10) is a prescale upper zero flag circuit (UZ) for defining the prescale operation mode. When the prescale upper port circuit (PRE UP) (5) is [0], its output becomes [1]. .

(11)はプリスケール動作モードを規定するためのプリス
ケール下位ゼロフラグ回路(LZ)で、プリスケール下
位ポート回路(PRE LOW)(7)が[0]の場合、
その出力は[1]となる。
(11) is a prescale lower zero flag circuit (LZ) for defining the prescale operation mode. When the prescale lower port circuit (PRE LOW) (7) is [0],
The output is [1].

(12)は現在のタイマー動作をみて次の動作を設定するタ
イマーシーケンサ回路(TIMER SEQUENCE
R)である。
(12) is a timer sequencer circuit (TIMER SEQUENCE) that sets the next operation by checking the current timer operation.
R).

(13)は次のタイマー動作に必要な制御信号(前記各種の
制御信号)を出力するタイマーコントロール回路(TI
MER CONTROL)である。
(13) is a timer control circuit (TI) for outputting control signals (various control signals described above) necessary for the next timer operation.
MER CONTROL).

尚、図中、(14a),(14b)は前記各種データを伝送するた
めの第1、第2のデータバス、STOR→TMRはタイ
マーポート回路(TMR)(1)、タイマーレジスタ回路
(TMR REG)(2)にデータをセットする制御信
号、STOR→PREUPはプリスケール上位ポート回
路(PRE UP)(5)、プリスケール上位レジスタ回
路(UP REG)(6)にデータをセットする制御信
号、STOR→PRELOWはプリスケール下位ポート
回路(PRE LOW)(7)にデータをセットする制御
信号、STOR→CONTはタイマーコントロールレジ
スタ回路(TMR CONT)(9)にスタート/ストッ
プ指令信号を含むコントロールワードをセットする制御
信号、RESETはこれらのタイマーポート回路(TM
R)(1)、タイマーレジスタ回路(TMR REG)
(2)、プリスケール上位ポート回路(PRE UP)
(5)、プリスケール上位レジスタ回路(UP REG)
(6)、プリスケール下位ポート回路(PRE LOW)
(7)およびタイマーコントロールレジスタ回路(TMR
CONT)(9)をリセットする制御信号である。
In the figure, (14a) and (14b) are first and second data buses for transmitting the various data, STOR → TMR is a timer port circuit (TMR) (1), a timer register circuit (TMR REG ) (2) control signal for setting data, STOR → PREUP is a prescale upper port circuit (PRE UP) (5), prescale upper register circuit (UP REG) (6) control signal for setting data, STOR → PRELOW is a control signal that sets data in the prescale lower port circuit (PRE LOW) (7), STOR → CONT is a control word that includes start / stop command signals in the timer control register circuit (TMR CONT) (9) The control signal for resetting, RESET, is the timer port circuit (TM
R) (1), timer register circuit (TMR REG)
(2), prescale upper port circuit (PRE UP)
(5), prescale upper register circuit (UP REG)
(6), prescale lower port circuit (PRE LOW)
(7) and timer control register circuit (TMR
CONT) (9) is a control signal for resetting.

即ち、プリスケール下位ポート回路(PRE LOW)
(7)の出力(前記2nビットのプリスケール値の下位n
ビット)を前記デクリメンタ回路(DEC)(8)にプリ
セットし、このプリセット値を初期値として基本クロッ
クをカウントして、前記プリスケール値の下位nビット
に対応する第1の分周出力を得る第1のプログラマブル
カウンタ手段を構成する。
That is, prescale lower port circuit (PRE LOW)
Output of (7) (lower n of the 2n-bit prescale value
Bit) is preset in the decrementer circuit (DEC) (8), the basic clock is counted with this preset value as an initial value, and a first divided output corresponding to the lower n bits of the prescale value is obtained. 1 programmable counter means.

この第1の分周出力に基づいて、第1の桁重み補正用レ
ジスタ回路(OO REG)(3)の出力(2nビットの
プリスケール値の上位nビットの最下位ビットの桁の重
み補正値)を前記デクリメンタ回路(DEC)(8)にプ
リセットし、このプリセット値を初期値として基本クロ
ックをカウントして、前記プリスケール値の上位nビッ
トの最下位ビットの桁の重み分(すなわち、補正値)に
対応する第2の分周出力を得る第1のプログラマブルカ
ウンタ手段を構成する。
Based on this first frequency division output, the output of the first digit weight correction register circuit (OO REG) (3) (the weight correction value of the least significant bit of the upper n bits of the 2n-bit prescale value) ) Is preset in the decrementer circuit (DEC) (8), the basic clock is counted using this preset value as an initial value, and the weight of the digit of the least significant bit of the upper n bits of the prescale value (that is, correction And a first programmable counter means for obtaining a second frequency division output corresponding to (value).

この第1のプログラマブルカウンタ手段で、デクリメン
タ回路(DEC)(8)に他のレジスタ値が入っている場
合、1回のカウント誤差を生じるため、それを補正する
ために、第2の桁重み補正用レジスタ回路(FF RE
G)(4)の出力を前記デクリメンタ回路(DEC)(8)に
プリセットし、第2の分周出力を得る場合もある。
In the first programmable counter means, when another register value is contained in the decrementer circuit (DEC) (8), a one-time counting error occurs, so in order to correct it, the second digit weight correction Register circuit (FF RE
The output of G) (4) may be preset in the decrementer circuit (DEC) (8) to obtain the second frequency division output.

この第2の分周出力に基づいて、プリスケール上位レジ
スタ回路(UP REG)(6)の主力(前記2nビット
のプリスケール値の上位nビット)を前記デクリメンタ
回路(DEC)(8)にプリセットし、このプリセット値
を初期値として前記第2の分周出力をカウントして、前
記プリスケール値の上位nビットに対応する第3の分周
出力を得る第3のプログラマブルカウンタ手段を構成す
る。
Based on this second frequency division output, the main force of the prescale upper register circuit (UP REG) (6) (upper n bits of the 2n-bit prescale value) is preset in the decrementer circuit (DEC) (8). The preset value is used as an initial value to count the second frequency-divided output to form a third programmable counter means for obtaining a third frequency-divided output corresponding to the upper n bits of the prescale value.

この第3の分周出力に基づいて、前記nビットのタイマ
ー値を保持するタイマーレジスタ回路(TMR RE
G)(2)の出力(nビットのタイマー値)を前記デクリ
メンタ回路(DEC)(8)にプリセットし、このプリセ
ット値を初期値として前記第3の分周出力をカウントし
て、前記タイマー値に対応する第4の分周出力を得る第
4のプログラマブルカウンタ手段を構成する。
A timer register circuit (TMR RE that holds the n-bit timer value is based on the third frequency division output.
G) (2) output (n-bit timer value) is preset in the decrementer circuit (DEC) (8), the preset value is used as an initial value to count the third frequency division output, and the timer value And fourth programmable counter means for obtaining a fourth frequency-divided output corresponding to.

そして、この実施例では以下の3つの動作モードがあ
る。
Then, in this embodiment, there are the following three operation modes.

(i)モード0(UZ=1、LZ=1) プリスケール上位ゼロフラグ回路(UZ)(10)、プリス
ケール下位ゼロフラグ回路(LZ)(11)の出力がともに
[1]の場合、第4のプログラマブルカウンタ手段のみ
が動作する。
(i) Mode 0 (UZ = 1, LZ = 1) When the outputs of the prescale upper zero flag circuit (UZ) (10) and the prescale lower zero flag circuit (LZ) (11) are both [1], the fourth Only the programmable counter means operates.

(ii)モード1(UZ=1、LZ=0) プリスケール上位ゼロフラグ回路(UZ)(10)の出力が
[1]、プリスケール下位セロフラグ回路(LZ)(11)
の出力が[0]の場合、第1、第4のプログラマブルカ
ウンタ手段が動作する。すなわち、前記2nビットのプ
リスケール値の下位nビットに対応するプリスケール動
作を行う。
(ii) Mode 1 (UZ = 1, LZ = 0) Prescale upper zero flag circuit (UZ) (10) output is [1], prescale lower zero cell flag circuit (LZ) (11)
, The first and fourth programmable counter means operate. That is, the prescale operation corresponding to the lower n bits of the 2n-bit prescale value is performed.

(iii)モード2(UZ=0、LZ=0) プリスケール上位ゼロフラグ回路(UZ)(10)、プリス
ケール下位ゼロフラグ回路(LZ)(11)の出力がともに
[0]の場合、第1、第2、第3および第4のプログラ
マブルカウンタ手段が動作する。
(iii) Mode 2 (UZ = 0, LZ = 0) When the outputs of the prescale upper zero flag circuit (UZ) (10) and the prescale lower zero flag circuit (LZ) (11) are both [0], the first, The second, third and fourth programmable counter means operate.

(iv)モード3(UZ=0、LZ=1) プリスケール上位ゼロフラグ回路(UZ)(10)の出力が
[0]、プリスケール下位ゼロフラグ回路(LZ)の出
力が[1]の場合、第2、第3、第4のプログラマブル
カウンタ手段が動作する。すなわち、前記2nビットの
プリスケール値の上位nビットに対応するプリスケール
動作を行う。
(iv) Mode 3 (UZ = 0, LZ = 1) When the output of the prescale upper zero flag circuit (UZ) (10) is [0] and the output of the prescale lower zero flag circuit (LZ) is [1], The second, third and fourth programmable counter means operate. That is, the prescale operation corresponding to the upper n bits of the 2n-bit prescale value is performed.

以下、この実施例のモード2の動作を第2図(a),(b)に
おいて説明する。
The operation of the mode 2 of this embodiment will be described below with reference to FIGS. 2 (a) and 2 (b).

基本的な動作は<作用>の項で説明した通りであり、第
2図(a),(b)のフローチャートでは、各ステップでの動
作を見るために、この動作に対応するステップに番号を
入れており、この番号は第3図のタイミングチヤートの
それぞれの番号に対応する。
The basic operation is as described in the section of <Operation>. In order to see the operation at each step in the flowchart of FIGS. 2 (a) and 2 (b), the step corresponding to this operation is numbered. The numbers correspond to the respective numbers in the timing chart of FIG.

最初、タイマーポート回路(TMR)(1)にタイマー値
を、プリスケール上位ポート回路(PRE UP)
(5)、プリスケール下位ポート回路(PRE LOW)
(7)に2nビットのプリスケール値の上位nビット、下
位nビットをそれぞれプリセットする。そして、タイマ
ー動作を開始させる。
First, the timer value is set in the timer port circuit (TMR) (1), and the prescale upper port circuit (PRE UP)
(5), prescale lower port circuit (PRE LOW)
In (7), the upper n bits and lower n bits of the 2n-bit prescale value are preset. Then, the timer operation is started.

ステップ1: プリスケール下位ポート回路(PRE LOW)7のデ
ータ(下位nビット)をデクリメンタ回路(DEC)
(8)にプリセットし、このプリセット値を初期値として
減算(−1)して、その値が[0](DEC0が発生)
になるまで減算(−1)動作を繰り返し、その値が
[0](DEC0が発生)になると、前記下位ビットに
対応する分周出力(OOREG→DEC)が出力され
る。
Step 1: Prescale lower port circuit (PRE LOW) 7 data (lower n bits) is decrementer circuit (DEC)
Preset to (8), subtract this preset value as the initial value (-1), and the value is [0] (DEC0 occurs)
When the value becomes [0] (DEC0 is generated), the frequency division output (OOREG → DEC) corresponding to the lower bit is output.

ステップ2: この分周出力に基づいて、第1の桁重み補正用レジスタ
回路(OO REG)(3)のデータ(補正値)をデクリ
メンタ回路(DEC)(8)にプリセットし、このプリセ
ット値を初期値として減算(−1)して、その値が
[1](DEC1が発生)になるまで減算(−1)動作
を繰り返し、その値が[1](DEC1が発生)になる
と、前記補正値に対応する分周出力(UPREG→DE
C)が出力される。
Step 2: Based on this frequency division output, the data (correction value) of the first digit weight correction register circuit (OO REG) (3) is preset in the decrementer circuit (DEC) (8), and this preset value is set. The subtraction (-1) is performed as an initial value, and the subtraction (-1) operation is repeated until the value becomes [1] (DEC1 is generated). When the value becomes [1] (DEC1 is generated), the correction is performed. Frequency division output corresponding to the value (UPREG → DE
C) is output.

ステップ3: この分周出力に基づいて、プリスケール上位ポート回路
(PRE UP)(5)のデータ(上位nビット)をプリ
スケール上位レジスタ回路(UP REG)(6)に移
し、このデータをデクリメンタ回路(DEC)(8にプリ
セットし、減算(−1)して、その値をプリスケール上
位レジスタ回路(UP REG)(6)に戻すとともに、
その値を判定し、以下、ステップ2以下の動作を繰り返
して、デクリメンタ回路(DEC)(8)の値が[1]
(DEC1が発生)になると、前記上位nビットに対応
する分周出力(FFREG→DEC)が出力される。
Step 3: Based on this divided output, the data (upper n bits) of the prescale upper port circuit (PRE UP) (5) is moved to the prescale upper register circuit (UP REG) (6), and this data is decremented. The circuit (DEC) (8 is preset, the subtraction (-1) is performed, and the value is returned to the prescale upper register circuit (UP REG) (6).
The value is determined, and the operation from step 2 onward is repeated until the value of the decrementer circuit (DEC) (8) is [1].
When (DEC1 is generated), the frequency division output (FFREG → DEC) corresponding to the upper n bits is output.

ステップ4: この分周出力に基づいて、第2の桁重み補正用レジスタ
回路(FF REG)(4)のデータ(補正値)をデクリ
メンタ回路(DEC)(8)にプリセットし、このプリセ
ット値を初期値として減算(−1)して、その値が
[1](DEC1が発生)になるまで減算(−1)動作
を繰り返し、その値が[1](DEC1が発生)になる
と、前記補正値に対応する分周出力(UPREG→DE
C)が出力される。
Step 4: Based on the frequency division output, the data (correction value) of the second digit weight correction register circuit (FF REG) (4) is preset in the decrementer circuit (DEC) (8), and this preset value is set. The subtraction (-1) is performed as an initial value, and the subtraction (-1) operation is repeated until the value becomes [1] (DEC1 is generated). When the value becomes [1] (DEC1 is generated), the correction is performed. Frequency division output corresponding to the value (UPREG → DE
C) is output.

ステップ5: この分周出力に基づいて、プリスケール上位レジスタ回
路(UP REG)(6)のデータをデクリメンタ回路
(DEC)(8)にプリセットし、減算(−1)して、そ
の値をプリスケール上位レジスタ回路(UP REG)
(6)に戻すとともに、その[0](DEC0)値が出力
される。
Step 5: Based on this frequency division output, the data of the prescale upper register circuit (UP REG) (6) is preset in the decrementer circuit (DEC) (8) and subtracted (-1) to pre-set the value. Scale upper register circuit (UP REG)
While returning to (6), the [0] (DEC0) value is output.

この出力により、プリスケール上位ポート回路(PRE
UP)(5)のデータ(上位nビット)をプリスケール
上位レジスタ回路(UP REG)(6)に移す。
By this output, the prescale upper port circuit (PRE
UP) (5) data (upper n bits) is transferred to the prescale upper register circuit (UP REG) (6).

ステップ6: この出力に基づいて、タイマーレジスタ回路(TMR
REG)(2)のデータ(nビットのタイマー値)をデク
リメンタ回路(DEC)(8)にプリセットし、減算(−
1)して、その値をタイマーレジスタ回路(TMR R
EG)(2)に戻すとともに、その値を判定し、以下、ス
テップ1以下の動作を繰り返して、デクリメンタ回路
(DEC)(8)の値が[0](DEC0が発生)になる
と、タイマー出力(INT)が得られる。
Step 6: Based on this output, the timer register circuit (TMR
REG) (2) data (n-bit timer value) is preset in the decrementer circuit (DEC) (8) and subtracted (-
1) and set the value to the timer register circuit (TMR R
EG) (2), determine the value, and repeat the operation from step 1 onwards, and when the value of the decrementer circuit (DEC) (8) becomes [0] (DEC0 occurs), the timer output (INT) is obtained.

以上本発明の代表的と思われる実施例について説明した
が、本発明は必ずしもこれらの実施例に限定されるもの
ではなく、本発明にいう構成要件を備え、かつ、本発明
にいう目的を達成し、以下にいう効果を有する範囲内に
おいて適宜改変して実施することができるものである。
Although the examples considered to be typical of the present invention have been described above, the present invention is not necessarily limited to these examples, and has the constitutional requirements referred to in the present invention, and achieves the object referred to in the present invention. However, it can be appropriately modified and implemented within a range having the following effects.

<発明の効果> この発明は、2nビットのプリスケール値の上位nビッ
ト、下位nビットに対応する分周出力、上位nビットの
最下位ビットの桁の重みに対応する分周出力を組み合わ
せて、2nビットのプリスケール値に対応する分周出力
を得、さらに、この分周出力に基づいてタイマー値に対
応する分周出力を得る各プログラマブルカウンタ手段に
よって2nビットのプリスケール値を実現したので、プ
リスケール用のデクリメンタ回路およびレジスタ回路が
いずれもnビットのものでよく、回路規模および回路配
置規模が1/2となり、安い価格になる実用的な利点を
有する。
<Effects of the Invention> The present invention combines the frequency division output corresponding to the upper n bits and the lower order n bits of the 2n-bit prescale value and the frequency division output corresponding to the digit weight of the least significant bit of the upper n bits. The 2n-bit prescale value is realized by each programmable counter means that obtains the frequency-divided output corresponding to the 2n-bit prescale value and further obtains the frequency-divided output corresponding to the timer value based on the frequency-divided output. The prescaler decrementer circuit and the register circuit may be n-bit ones, and the circuit scale and the circuit layout scale are halved, which has a practical advantage of being inexpensive.

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

第1図はこの発明のタイマー装置の代表的な実施例の構
成を示すブロック図、第2図(a),(b)は同動作を示すフ
ローチャート、第3図は同タイミングチャート、第4図
は従来のタイマー装置の構成を示すブロック図である。
FIG. 1 is a block diagram showing the configuration of a typical embodiment of the timer device of the present invention, FIGS. 2 (a) and 2 (b) are flow charts showing the same operation, FIG. 3 is the same timing chart, and FIG. FIG. 4 is a block diagram showing a configuration of a conventional timer device.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】nビットのデクリメンタ手段と、 2nビットのプリスケール値の上位nビットを保持する
プリスケール上位ポート手段と、 2nビットのプリスケール値の下位nビットを保持する
プリスケール下位ポート手段と、 nビットのタイマー値を保持するタイマーポート手段
と、 前記2nビットのプリスケール値の下位nビットを前記
デクリメンタ手段にプリセットし、このプリセット値を
初期値として基本クロックをカウントして、前記プリス
ケール値の下位nビットに対応する第1の分周出力を得
る第1のプログラマブルカウンタ手段と、 前記第1の分周出力に基づいて、前記2nビットのプリ
スケール値の上位nビットの最下位ビットの桁の重みに
対応する補正値を前記デクリメンタ手段にプリセット
し、このプリセット値を初期値として基本クロックをカ
ウントして、前記プリスケール値の上位nビットの最下
位ビットの桁の重みに対応する第2の分周出力を得る第
2のプログラマブルカウンタ手段と、 前記第2の分周出力に基づいて、前記2nビットのプリ
スケール値の上位nビットを前記デクリメンタ手段にプ
リセットし、このプリセット値を初期値として前記第2
の分周出力をカウントして、前記プリスケール値の上位
nビットに対応する第3の分周出力を得る第3のプログ
ラマブルカウンタ手段と、 前記第3の分周出力に基づいて、前記nビットのタイマ
ー値を前記デクリメンタ手段にプリセットし、このプリ
セット値を初期値として前記第3の分周出力をカウント
して、前記タイマー値に対応する第4の分周出力を得る
第4のプログラマブルカウンタ手段と、 からなり、この第4の分周出力をタイマー出力とするこ
とを特徴とするタイマー装置。
1. An n-bit decrementer means, a prescale upper port means for holding upper n bits of a 2n-bit prescale value, and a prescale lower port means for holding lower n bits of a 2n-bit prescale value. Timer port means for holding an n-bit timer value, lower n bits of the 2n-bit prescale value are preset in the decrementer means, and the preset clock is used as an initial value to count the basic clock, First programmable counter means for obtaining a first divided output corresponding to the lower n bits of the scale value, and the lowermost n bits of the upper n bits of the 2n-bit prescale value based on the first divided output A correction value corresponding to the weight of the digit of the bit is preset in the decrementer means, and the preset value is Second programmable counter means for counting the basic clock as the period value to obtain a second divided output corresponding to the digit weight of the least significant bit of the high order n bits of the prescale value; Based on the circular output, the upper n bits of the 2n-bit prescale value are preset in the decrementer means, and the preset value is used as an initial value for the second
Third programmable counter means for obtaining the third frequency division output corresponding to the upper n bits of the prescale value by counting the frequency division output of the prescale value; and the n bits based on the third frequency division output. Fourth programmable counter means for presetting the timer value of No. 1 to the decrementer means, counting the third divided output with this preset value as an initial value, and obtaining a fourth divided output corresponding to the timer value. And a timer device characterized in that the fourth frequency division output is used as a timer output.
JP1527789A 1989-01-25 1989-01-25 Timer device Expired - Lifetime JPH069331B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1527789A JPH069331B2 (en) 1989-01-25 1989-01-25 Timer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1527789A JPH069331B2 (en) 1989-01-25 1989-01-25 Timer device

Publications (2)

Publication Number Publication Date
JPH02195717A JPH02195717A (en) 1990-08-02
JPH069331B2 true JPH069331B2 (en) 1994-02-02

Family

ID=11884368

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1527789A Expired - Lifetime JPH069331B2 (en) 1989-01-25 1989-01-25 Timer device

Country Status (1)

Country Link
JP (1) JPH069331B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101480642B1 (en) * 2013-10-15 2015-01-09 엘에스산전 주식회사 Event input module

Also Published As

Publication number Publication date
JPH02195717A (en) 1990-08-02

Similar Documents

Publication Publication Date Title
JPH069331B2 (en) Timer device
JP2000066995A (en) Method and device for bus arbitration, its application device and system
JPH1155084A (en) Output delay circuit
JPH06188872A (en) Synchronization protective circuit
JPH05347651A (en) Pause time setting circuit between data frames
JPS581002Y2 (en) Communication control device
JP3079808B2 (en) Phase comparison device
JPS61243527A (en) Bit buffer circuit
JPS5922980B2 (en) Increment/Decrement Circuit for Circular Shift Register
JPS58215567A (en) Rectangular wave control circuit
JPH05113467A (en) Edge generation circuit
JP3251244B2 (en) Digital filter
JPH0831792B2 (en) PLL circuit
JPH01158833A (en) Automatic digital equalizer
JP3128802B2 (en) Delay device
JPH0116194Y2 (en)
JPH05122198A (en) Error rate alarm circuit with hysteresis
JPH03188514A (en) Counting circuit
JPH0216058B2 (en)
JPH0240754A (en) Dma unit
JPH0555883A (en) Timer circuit
JPH08292828A (en) Noise preventing circuit for interface
JPS6167322A (en) Error correction memory controlling circuit of reed solomon encoding/decoding system
JPS62118658A (en) Serial-parallel conversion circuit
JPS63168578A (en) Test of binary counter