JPH02195717A - Timer device - Google Patents

Timer device

Info

Publication number
JPH02195717A
JPH02195717A JP1527789A JP1527789A JPH02195717A JP H02195717 A JPH02195717 A JP H02195717A JP 1527789 A JP1527789 A JP 1527789A JP 1527789 A JP1527789 A JP 1527789A JP H02195717 A JPH02195717 A JP H02195717A
Authority
JP
Japan
Prior art keywords
value
circuit
prescale
timer
bits
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
JP1527789A
Other languages
Japanese (ja)
Other versions
JPH069331B2 (en
Inventor
Yoshiaki Suenaga
末永 良明
Tomoji Marumoto
共治 丸本
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)

Abstract

PURPOSE:To set a decrement and a register circuit at (n) bits, to reduce a circuit scale by half, and to simplify the device by realizing a prescale value at 2n bits by means of each programmable counter means, which obtains a frequency divided output corresponding to a timer value based on the frequency divided output corresponding to the prescale value at the 2n bits. CONSTITUTION:The timer value is preset in a timer board circuit 1, and the high-order and low-order (n) bits of the prescale value at the 2n bits are respectively preset in prescale high-order and low-order board circuits 5 and 7. Next the data of the circuit 7 are preset in a decrementor circuit 8 at the time of operating a timer, a subtraction to set the data value at the initial value is executed, and the frequency divided output corresponding to the low-order bit is outputted. Based on the output, the corrected value is preset in the circuit 8 by a first digit weight correcting register circuit 3, the subtracting operations are repeated with the preset value as the initial value, and the frequency divided output corresponding to the corrected value is outputted as a data read signal to a high-order register circuit 6, and when the output of the circuit 8 becomes zero, a timer output INT is generated.

Description

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

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

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

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

タイマーコントロール(20)からスタート指令信号が
出力されると、プリスケールレジスタ(16)に保持さ
れているプリスケール値N1がブリスケールデクリメン
タ(15)にプリセットされる。また、タイマーレジス
タ(18)に保持されているプリスケール値N2がタイ
マーデクリメンタ(17)にプリセットされる。
When a 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 decrementer (15). Further, the prescale value N2 held in the timer register (18) is preset in the timer decrementer (17).

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

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

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

この発明はこのような課題を解決するもので、nビット
のプログラマブルカウンタを具備するタイマー装置であ
って、2nビットのプリスケール値を単純な構成で実現
したタイマー装置である。
The present invention is intended to solve these problems, and is a timer device that is equipped with an n-bit programmable counter and that 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ビットを保持する
プリスケール下位ポート手#′i(ブリスケール下位ポ
ート回路(ア))と、 nビットのタイマー値を保持するタイマーポート手段(
タイマーポート回路(1))と、前記2nビットのプリ
スケール値の下位1ビットを前記デクリメンタ手段(デ
クリメンタ回路(8))にプリセットし、このプリセッ
ト値を初期値としでを基本クロックをカウントして、前
記プリスケール値の下位nビットに対応する第1の分周
出力を得る第1のプログラマブルカウンタ手段と、 前記第1の分周出力に基づいて、前記2nビットのプリ
スケール値の上位nビットの最下位ビットの桁の重みに
対応する補正値を定数で保持しておくレジスタ手段(補
正用レジスタ手段(3)。
This invention provides an n-bit decrementer means (decrementer circuit (8)
), a prescale upper port means (briscale upper port circuit (5)) that holds the upper n bits of the 2n-bit prescale value, and a prescale lower port that holds the lower n bits of the 2n bit prescale value. hand #'i (briscale lower port circuit (a)) and a timer port means for holding an n-bit timer value (
The timer port circuit (1)) and the lower 1 bit of the 2n-bit prescale value are preset in the decrementer means (decrementer circuit (8)), and the basic clock is counted from the beginning with this preset value as the initial value. , first programmable counter means for obtaining a first divided output corresponding to the lower n bits of the prescaled value; and based on the first divided output, the upper n bits of the 2n-bit prescaled value. register means (correction register means (3)) for holding a correction value corresponding to the weight of the least significant bit of the digit as a constant.

(4))と、この値を前記デクリメンタ手段(デクリメ
ンタ回路(8))にプリセットし、このプリセット値を
初期値として基本クロックをカウントして、前記プリス
ケール値の上位nビットの最下位ビットの桁の重みに対
応する第2の分周出力を得る第2のプログラマブルカウ
ンタ手段と、前記第2の分周出力に基づいて、前記2n
ビットのプリスケール値の上位nビットを前記デクリメ
ンタ手段(デクリメンタ回路(8))にプリセットし、
このプリセット値を初期値として前記第2の分周出力を
カウントして、前記プリスケール値の上位nピッ)に対
応する第3の分周出力を得る第3のプログラマブルカウ
ンタ手段と、前記第3の分周出力に基づいて、前記nビ
ットのタイマー値を前記デクリメンタ手段(デクリメン
タ回路(8))にプリセットし、このプリセット値を初
期値として前記$3の分周出力をカウントして、前記タ
イマー値に対応する第4の分周出力を得る第4のプログ
ラマブルカウンタ手段と、 からなり、この第4の分周出力をタイマー出力とする。
(4)), this value is preset in the decrementer means (decrementer circuit (8)), the basic clock is counted with this preset value as the initial value, and the least significant bit of the upper n bits of the prescale value is a second programmable counter means for obtaining a second divided output corresponding to the weight of the digit;
Presetting the upper n bits of the bit prescale value in the decrementer means (decrementer circuit (8)),
a third programmable counter means that counts the second frequency division output using the preset value as an initial value and obtains a third frequency division output corresponding to the top n bits of the prescale value; The n-bit timer value is preset in the decrementer means (decrementer circuit (8)) based on the frequency divided output of and a fourth programmable counter means for obtaining a fourth frequency-divided output corresponding to the value, and this fourth frequency-divided output is used as a timer output.

く作用〉 この発明の代表的な実施例の動作を示す第2図(a)、
(b)において説明する。
2(a) showing the operation of a typical embodiment of the present invention,
This will be explained in (b).

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

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

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

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

のステップを経て、この第4の分周出力をタイマー出力
とするので、 前記デクリメンタはnビットのもので実現できる。
After the steps described above, this fourth frequency-divided output is used as a timer output, so that the decrementer can be realized with n bits.

く実施例〉 この発明の代表的な実施例を図面を参照して説明する0
、 第1図はこの発明の代表的な実施例を示すブロック図、
第2図(a)t(b)は同動作を示す70−チャート、
第3図は同各制御信号のタイミングチャートである。
Embodiments> Representative embodiments of the present invention will be described with reference to the drawings.
, FIG. 1 is a block diagram showing a typical embodiment of this invention,
FIG. 2(a) and t(b) are 70-charts showing the same operation,
FIG. 3 is a timing chart of each control signal.

第1図において説明する。This will be explained in FIG.

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

(2)はタイマーレジスタ回路(T M RRE G 
)で、初期値としてタイマーポート回路(T M R)
(1)と同じ値をもつが、タイマー動作がスタートする
と、後述の予め設定されているクロック数毎にこの値は
デクリメンタ回路(DEC)(8)に入力され、そして
、このデクリメンタ回路(DE C>(8)によって滅
B(−1)されて、その値がタイマーレジスタ回路(T
MRREG)(2)に戻される。この値は次の動作まで
保持される。
(2) is a timer register circuit (TM RRE G
), and the timer port circuit (TMR) is set as the initial value.
It has the same value as (1), but when the timer operation starts, this value is input to the decrementer circuit (DEC) (8) every preset number of clocks, which will be described later. >(8), the value is set to B(-1) and the value is sent to the timer register circuit (T
MRREG) (2). This value is retained until the next operation.

図中、TMR−、TMRREGはタイマーポート回路(
T M R)(1)からタイマーレジスタ回路(TMR
REG)(2)へのデータ読み出し信号、TMRREG
→DECはタイマーレジスタ回路(TM RRE G 
)(2)からデクリメンタ回路(DEC)(8)へのデ
ータ送り出し信号、DEC→TMRREGはデクリメン
タ回路(DEC)(8)からタイマーレジスタ回路(T
MRREG)2へのデータ読み出し信号である。
In the figure, TMR- and TMRREG are timer port circuits (
TMR) (1) to the timer register circuit (TMR
REG) (2) data read signal, TMRREG
→DEC is a timer register circuit (TM RRE G
) (2) to the decrementer circuit (DEC) (8), DEC→TMRREG is the data sending signal from the decrementer circuit (DEC) (8) to the timer register circuit (T
This is a data read signal to MRREG)2.

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

図中、0OREG−DECI!第1の桁i1ミ補正用レ
ジスタ回路(00REG)(3)からデクリメンタ回路
(D E C1B)へのデータ送り出し信号である。
In the figure, 0OREG-DECI! This is a data sending signal from the first digit i1 correction register circuit (00REG) (3) to the decrementer circuit (D E C1B).

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

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

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

(6)は初期値としてブリスケール上位ポート回路(P
RE  UP)<5)と同じ値をもつブリスケール上位
レジスタ回路(U P  RE G )である。
(6) is the initial value of the Briscale upper port circuit (P
RE UP ) < 5).

タイマー動作がスタートし、プリスケール値の上位nビ
ットの最下位ビットの桁の重み分(すなわち、補正値)
がカウントされると、プリスケール上位レジスタ回路(
UP  REG)(6)の値はデクリメンタ回路(D 
E C)(8)に入力され、そして、このデクリメンタ
回路(DEC)(8)によって滅K(−1)されて、そ
の値がプリスケール上位レジスタ回路(U P  RE
 G’)(6)に戻される。この値は大の動作まで保持
される。
The timer operation starts, and the weight of the least significant bit of the upper n bits of the prescale value is calculated (i.e., the correction value).
is counted, the prescale upper register circuit (
The value of UP REG) (6) is determined by the decrementer circuit (D
The decrementer circuit (DEC) (8) decremented the value to -1, and the value is input to the prescale upper register circuit (UPRE).
G') is returned to (6). This value is retained until large operation.

図中、PREUP→UPREGはブリスケール上位ポー
ト回路(PRE  UP)<5)からプリスケール上位
レジスタ回路(UP  REG)<6)へのデータ読み
出し信号、UPREG、DECはプリスケール上位レジ
スタ回路(UP  REG)(6)からデクリメンタ回
路(D E C)(8)へのデータ送り出し信号、DE
C−4UPREGはデクリメンタ回路(DEC)(8)
からブリスケール上位レジスタ回路(U P  RE 
G )(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 and DEC are the prescale upper register circuit (UP REG). )(6) to the decrementer circuit (DEC)(8), DE
C-4UPREG is a decrementer circuit (DEC) (8)
From Briscale upper register circuit (UP RE
G) This is a data read signal to (6).

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

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

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

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

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

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

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

(13)は次のタイマー動作に必要な制御信号(前記各
種の制御信号)を出力するタイマーコントロール回路(
TIMERC0NTR0L)である。
(13) is a timer control circuit (
TIMERC0NTR0L).

尚、図中、(14a)、(14b)は前記各種データを
伝送するための第1、第2のデータバス、STOR−4
TMRはタイマーポート回路(T M R)(1)タイ
マーレジスタ回路(T M RRE G )(2)にデ
ータをセットする制御信号、5TOR→PREUPはプ
リスケール上位ポート回路(PRE  U P )(5
)、プリスケール上位レジスタ回路(UP  REG)
(6)にデータをセットする制御信号、5TOR−4P
RELOWはプリスケール下位ポート回路(PRE  
LOW)(7)にデータをセットする制御信号、5TO
R−CONTはタイマーコントロールレジスタ回路(T
MRC0NT)(9)にスタート/スジツブ指令信号を
含むコントロールワードをセットする制御信号、RES
ETはこれらのタイマーポート回路(T M R)(1
)、タイマーレジスタ回路(T M RRE G )(
2)、ブリスケール上位ポート回路(PRE  UP)
(5)、プリスケール上位レジスタ回路(UPRE G
 )(6)、プリスケール下位ポート回路(PRE  
LOW)(7)およびタイマーフントロールレジスタ回
路(TMRC0NT)(9)をリセットする制御信号で
ある。
In the figure, (14a) and (14b) are the first and second data buses, STOR-4, for transmitting the various data mentioned above.
TMR is a control signal that sets data in the timer port circuit (TMR) (1) and timer register circuit (TMRREG) (2), and 5TOR→PREUP is the prescale upper port circuit (PREUP) (5
), prescale upper register circuit (UP REG)
(6) Control signal to set data in 5TOR-4P
RELOW is the prescale lower port circuit (PRE
LOW) Control signal to set data in (7), 5TO
R-CONT is the timer control register circuit (T
MRC0NT) (9) is a control signal that sets a control word containing a start/stop command signal, RES
ET these timer port circuits (TMR) (1
), timer register circuit (T M RRE G ) (
2), Briscale upper port circuit (PRE UP)
(5) Prescale upper register circuit (UPRE G
)(6), Prescale lower port circuit (PRE
This is a control signal that resets the timer control register circuit (TMRC0NT) (9) and the timer control register circuit (TMRC0NT) (9).

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

この第1の分周出力に基づいて、第1の桁重み補正用レ
ジスタ回路(00RE G )(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 (00REG) (3) (weight correction value of the lowest 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 is calculated (i.e., a correction value).
A first programmable counter means is configured to obtain a second frequency-divided output corresponding to .

この第1のプログラマブルカウンタ手段で、デクリメン
タ回路(D E C)(8)に他のレジスタ値が入って
いる場合、1回のカウント誤差を生じるため、それを補
正するために、第2の桁重み補正用レジスタ回路(FF
  REG)(4)の出力を前記デクリメンタ回路(D
 E C)(8)にプリセットし、第2の分周出力を得
る場合もある。
In this first programmable counter means, if the decrementer circuit (D E C) (8) contains other register values, one count error will occur, so in order to correct it, the second digit Weight correction register circuit (FF
REG) (4) to the decrementer circuit (D
E C) (8) may be preset to obtain the second frequency-divided output.

この第2の分周出力に基づいて、プリスケール上位しノ
スタ回路(UP  REG)(6)の出力(前記2nビ
ットのプリスケール値の上位nビット)を前記デクリメ
ンタ回路(D E C)(8)にプリセットし、このプ
リセット値を初期値として前記第2の分周出力をカウン
トして、前記プリスケール値の上位nビットに対応する
第3の分周出力を得る第3のプログラマブルカウンタ手
段を構成する。
Based on this second frequency division output, the output (upper n bits of the 2n-bit prescale value) of the prescale upper nostar circuit (UP REG) (6) is applied to the decrementer circuit (D E C) (8). ) and counts the second frequency division output using this preset value as an initial value to obtain a third frequency division output corresponding to the upper n bits of the prescale value. Configure.

この#3の分周出力に基づいて、前記nビットのタイマ
ー値を保持するタイマーレジスタ回路(TMRREG)
(2)の出力(nビットのタイマー値)を前記デクリメ
ンタ回路(D E C)(8)にプリセットし、このプ
リセット値を初期値として前記PIIJ3の分周出力を
カウントして、前記タイマー値に対応する第4の分周出
力を得る第4のプログラマブルカウンタ手段を構成する
A timer register circuit (TMRREG) that holds the n-bit timer value based on the frequency-divided output of #3.
The output of (2) (n-bit timer value) is preset to the decrementer circuit (D E C) (8), and the divided output of the PIIJ3 is counted using this preset value as an initial value, and the output is set to the timer value. A fourth programmable counter means is configured to obtain a corresponding fourth divided output.

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

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

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

(iii)モード2(UZ=0、LZ=O)ブリスケー
ル上位ゼロフラグ回路(U Z )(10)、プリスケ
ール下位ゼロ7ラグ回路(L Z )(11)の出力が
ともに[0]の場合、tI&1、第2、第3および第4
のプログラマブルカウンタ手段が動作する。
(iii) Mode 2 (UZ=0, LZ=O) When the outputs of the prescale upper zero flag circuit (U Z ) (10) and the prescale lower zero 7 lag circuit (L Z ) (11) are both [0] , tI & 1, 2nd, 3rd and 4th
A programmable counter means is operated.

(iv)モード3(UZ=O,LZ=1)ブリスケール
上位ゼロフラグ回路(U Z )(10)の出力が[0
1、ブリスケール下位ゼロフラグ回路(LZ)の出力が
[1]の場合、第2、第3、第4のプログラマブルカウ
ンタ手段が動作する。
(iv) Mode 3 (UZ=O, LZ=1) The output of the Briscale upper zero flag circuit (U Z ) (10) is [0
1. When the output of the Briscale lower zero flag circuit (LZ) is [1], the second, third, and fourth programmable counter means operate.

すなわち、前記2nビットのプリスケール値の上位nビ
ットに対応するプリスケール動作を行つ。
That is, a prescale operation corresponding to the upper n bits of the 2n-bit prescale value is performed.

以下、この実施例のモード2の動作を第2図(a)、(
b)において説明する。
The operation in mode 2 of this embodiment will be explained below in Figs. 2(a) and 2(a).
This will be explained in b).

基本的な動作はく作用〉の項で説明した通りであり、第
2図(fi>、(b)の70−チャートでは、各ステッ
プでの動作を見るために、この動作に対応するステップ
に番号を入れており、この番号は第3図のタイミングチ
ャートのそれぞれの番号に対応する。
This is as explained in the section ``Basic Actions and Actions'', and in the 70-chart in Figure 2 (fi>, (b)), in order to see the actions at each step, the steps corresponding to this action are shown. Numbers are included, and these numbers correspond to the respective numbers in the timing chart of FIG.

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

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

ステップ2: この分周出力に基づいて、第1の桁重み補正用レジスタ
回路(OORE G )(3)のデータ(I111正値
)をデクリメンタ回路(D E C)(8)にプリセッ
トし、このプリセット値を初期値として減算(−1)し
て、その値が[1](D EC1が発生)になるまで減
jE(−1)動作を繰り返し、その値が[1](DEC
Iが発生)になると、前記補正値に対応する分周出力(
UPREG−DEC)が出力される。
Step 2: Based on this frequency-divided output, preset the data (I111 positive value) of the first digit weight correction register circuit (OORE G) (3) into the decrementer circuit (D E C) (8). Subtract (-1) the preset value as the initial value, repeat the subtraction (-1) operation until the value becomes [1] (DEC1 occurs), and then repeat the subtraction (-1) operation until the value becomes [1] (DEC1 occurs).
When I occurs), the divided output (
UPREG-DEC) is output.

ステップ3: この分周出力に基づいて、プリスケール上位ポート回路
(PRE  UP)(5)のデータ(上位nビット)を
プリスケール上位レジスタ回路(UPRE G )(8
)に移し、このデータをデクリメンタ回路(D E C
)(8)にプリセットし、減t(−1)して、その値を
プリスケール上位しシスタ回路(UP  REG)(6
)に戻すとともに、その値を判定し、以下、ステップ2
以下の動作を#19返して、デクリメンタ回路(D E
 C)(8)の値が【11(DECIが発生)になると
、前記上位nビットに対応する分周出力(FFREG−
4DEC)が出力される。
Step 3: Based on this frequency-divided output, the data (upper n bits) of the prescale upper port circuit (PRE UP) (5) is transferred to the prescale upper register circuit (UPRE G) (8
) and transfer this data to the decrementer circuit (D E C
) (8), subtract it by t(-1), prescale the value to upper position, and select the sister circuit (UP REG) (6
), determine its value, and perform step 2 below.
The following operation is returned to #19, and the decrementer circuit (D E
C) When the value of (8) becomes [11 (DECI occurs), the divided output (FFREG-) corresponding to the upper n bits is
4DEC) is output.

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

ステップ5: この分周出力に基づいて、プリスケール上位レジスタ回
路(UP  REG)(6)のデータをデクリメンタ回
路(DEC)(8)にプリセットし、減算(−1)して
、その値をプリスケール上位レジスタ回路(UP  R
EG)(6)に戻すとともに、その(03(DECO)
値が出力される。
Step 5: Based on this divided output, preset the data of the prescale upper register circuit (UP REG) (6) to the decrementer circuit (DEC) (8), subtract (-1), and preset the value. Scale upper register circuit (UPR
EG) (6) and its (03 (DECO)
The value is output.

この出力により、プリスケール上位ポート回路(P R
E  U P )(5)のデータ(上位nビット)をプ
リスケール上位レジスタ回路(U P  RE G )
(6)に移す。
This output causes the prescale upper port circuit (PR
E U P ) (5) data (upper n bits) is prescaled to the upper register circuit ( U P RE G )
Move to (6).

ステップ6: この出力に基づいて、タイマーレノスタ回路(T M 
RRE G )(2)のデータ(nビットのタイマー値
)をデクリメンタ回路(D E C)(8)にプリセッ
トし、減算(−1)Lで、その値をタイマーレノスタ回
路(T M RRE G )(2)に戻すとともに、そ
の値を判定し、以下、ステップ1以下の動作を繰り返し
て、デクリメンタ回路(DEC)(8)の値が(03(
DECOが発生)になると、タイマー出力(INT)が
得られる。
Step 6: Based on this output, the timer renostar circuit (T M
Preset the data (n-bit timer value) of RRE G )(2), determine its value, and repeat the operations from step 1 onward until the value of the decrementer circuit (DEC) (8) becomes (03(
When DECO occurs), a timer output (INT) is obtained.

以上本発明の代表的と思われる実施例について説明した
が、本発明は必ずしもこれらの実施例に限定されるもの
ではなく、本発明にいう構成要件を備え、かつ、本発明
にいう目的を達成し、以下にいう効果を有する範囲内に
おいて適宜改変して実施する。ことができるものである
Although the embodiments considered to be representative of the present invention have been described above, the present invention is not necessarily limited to these embodiments. However, it is carried out with appropriate modifications within the scope of achieving the effects described below. It is something that can be done.

〈発明の効果〉 この発明は1.2nビットのプリスケール値の上位nビ
ット、下位nビットに対応する分周出力、上位nビット
の最下゛位ビットの桁の重みに対応する分周出力を組み
合わせて、2nビットのブリスケール値に対応する分周
出力を得、さらに、この分周出力に基づいてタイマー値
に対応する分周出力を得る各プログラマブルカウンタ手
段によって2nビットのブリスケール値を実現しなので
、プリスケール用のデクリメンタ回路およびレジスタ回
路がいずれもnピッ(のものでよく、回路規慎および回
路配置規模が1/2とな9、安い価格になる実用的な利
点を有する。
<Effects of the Invention> This invention provides a frequency division output corresponding to the upper n bits and lower n bits of a 1.2n-bit prescale value, and a frequency division output corresponding to the digit weight of the least significant bit of the upper n bits. are combined to obtain a divided output corresponding to a 2n-bit Briscale value, and further, based on this divided output, a divided output corresponding to a timer value is obtained by each programmable counter means to obtain a 2n-bit Briscale value. Since the decrementer circuit and the register circuit for pre-scaling can both be n-pi, the circuit size and circuit arrangement size can be reduced to 1/2 (9), which has the practical advantage of being inexpensive.

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

第1図はこの発明のタイマー装置の代表的な実施例の構
成を示すブロック図、第2図(1)I(b)は同動作を
示す70−チャート、第3図は同タイミングチャート、
第4図は従来のタイマー装置の構成を示すブロック図で
ある。
FIG. 1 is a block diagram showing the configuration of a typical embodiment of the timer device of the present invention, FIG. 2 (1) I(b) is a 70-chart showing the same operation, FIG. 3 is a timing chart of the same,
FIG. 4 is a block diagram showing the 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 the upper n bits of the 2n bit prescale value, and a prescale lower port means for holding the lower n bits of the 2n bit prescale value; a timer port means for holding an n-bit timer value; and a timer port means for presetting the lower n bits of the 2n-bit prescale value in the decrementer means, counting basic clocks with this preset value as an initial value, and calculating the prescale value. a first programmable counter means for obtaining a first divided output corresponding to the lower n bits of the 2n bits of the prescaled value; A correction value corresponding to the digit weight is preset in the decrementer means, the basic clock is counted using this preset value as an initial value, and a correction value corresponding to the digit weight of the least significant bit of the upper n bits of the prescale value is calculated. a second programmable counter means for obtaining a frequency-divided output of 2; and a second programmable counter means for presetting the upper n bits of the 2n-bit prescale value in the decrementer means based on the second frequency-divided output; a third programmable counter means for counting the second frequency division output as a value to obtain a third frequency division output corresponding to the upper n bits of the prescale value, based on the third frequency division output; and presetting the n-bit timer value in the decrementer means, and counting the third frequency division output using this preset value as an initial value to obtain a fourth frequency division output corresponding to the timer value. 4 programmable counter means, and the timer device is characterized in that the fourth divided 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 true JPH02195717A (en) 1990-08-02
JPH069331B2 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015079509A (en) * 2013-10-15 2015-04-23 エルエス産電株式会社Lsis Co., Ltd. Event input module

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015079509A (en) * 2013-10-15 2015-04-23 エルエス産電株式会社Lsis Co., Ltd. Event input module
US9864358B2 (en) 2013-10-15 2018-01-09 Lsis Co., Ltd. Event input module

Also Published As

Publication number Publication date
JPH069331B2 (en) 1994-02-02

Similar Documents

Publication Publication Date Title
JPH02195717A (en) Timer device
US8891302B2 (en) Electronic equipment
JPH10117144A (en) A/d converter
JP3486718B2 (en) Single chip microcomputer
JP2002202829A (en) Microcomputer
JPH08139575A (en) Pulse output circuit
JPS63168578A (en) Test of binary counter
JPH0637606A (en) Pulse signal generating circuit
JPH01158833A (en) Automatic digital equalizer
JP3611788B2 (en) Microcomputer timer calibration system
JPH01280918A (en) Interval timer
JPS581002Y2 (en) Communication control device
JPS6190519A (en) Programmable up-down counter
JPS6128423Y2 (en)
JPH03192820A (en) Pll circuit
JPH05250306A (en) Dma controller
JPH03188514A (en) Counting circuit
JP2000151359A (en) Low-pass filter
JPS6167322A (en) Error correction memory controlling circuit of reed solomon encoding/decoding system
JPH05315964A (en) Analog type set value input circuit
JPH05143519A (en) Dma controller
JPH0288993A (en) Time counter
JPS58200630A (en) Signal generating circuit
JPH0527969A (en) Arithmetic unit
JPH02280259A (en) Multichannel type memory controller