JP2001282384A - Timer unit programmable by software - Google Patents

Timer unit programmable by software

Info

Publication number
JP2001282384A
JP2001282384A JP2000097818A JP2000097818A JP2001282384A JP 2001282384 A JP2001282384 A JP 2001282384A JP 2000097818 A JP2000097818 A JP 2000097818A JP 2000097818 A JP2000097818 A JP 2000097818A JP 2001282384 A JP2001282384 A JP 2001282384A
Authority
JP
Japan
Prior art keywords
timer
timer counter
input
signal
bit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2000097818A
Other languages
Japanese (ja)
Inventor
Nagamasa Imai
長正 今井
Hideki Okamura
秀樹 岡村
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 JP2000097818A priority Critical patent/JP2001282384A/en
Publication of JP2001282384A publication Critical patent/JP2001282384A/en
Pending legal-status Critical Current

Links

Landscapes

  • Microcomputers (AREA)

Abstract

PROBLEM TO BE SOLVED: To solve the problem that it is impossible to flexibly cope with the use of a user since preliminarily decided bit length or the number of timer channels is prepared in a manufacturing process although the generation of various time cycles is requested for a timer to be used for a semiconductor circuit such as a microcomputer. SOLUTION: This timer unit is provided with plural timer counters having various bit length and capable of arbitrarily selecting an input signal from a clock signal supplied from the outside of a timer, and those timer counters are constituted so as to be used as a timer group in which those timer counters are connected according to arbitrary combination or individual independent timer counters. Also, this timer unit is provided with arithmetic parts for performing arbitrary signal processing inside the timer.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、マイクロコンピュ
ータ(以下マイコンと称する)等の半導体集積回路に内
蔵され、半導体回路内の時間制御を行うタイマユニット
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a timer unit which is built in a semiconductor integrated circuit such as a microcomputer (hereinafter referred to as a microcomputer) and controls time in the semiconductor circuit.

【0002】[0002]

【従来の技術】タイマはマイコンチップ内外の時間制御
を行う為の時間生成や時計機能に対し、使用用途により
必要となる時間周期を生成する。そのため、タイマによ
り様々な時間を生成できることは、より精度の高い時間
制御やシステム制御が可能となる。
2. Description of the Related Art A timer generates a time period required for a purpose of use for a time generation and a clock function for controlling time inside and outside a microcomputer chip. For this reason, the fact that various times can be generated by the timer enables more accurate time control and system control.

【0003】タイマの動作を簡単に述べる。タイマはタ
イマカウンタレジスタと呼ばれるレジスタの集合によ
り、クロック信号をカウントしている。タイマカウンタ
レジスタ単体では、クロック信号が入力されると、クロ
ック信号の立ち上がり(設定によっては立ち下がり)で
保持していた論理値を反転させる性質を持つ。論理値と
はレジスタが保持している電位に対応していて、電圧が
高いとき“HIGH”レベルで、電位が低いときは“L
OW”レベルである。この性質により、クロック信号が
入力されると、最初の立ち上がり(立ち下がり)で保持
している論理値が反転し、次の立ち上がり(立ち下が
り)で再度反転し、最初の論理値に戻る。クロック信号
の立ち上がり(立ち下がり)は1周期ごとであるから、
レジスタに保持されている論理値はクロック信号2周期
で元の論理値に戻り、桁上がり信号を出力する。よっ
て、1つのタイマカウンタレジスタは入力されたクロッ
ク信号をカウントする2進数カウンタとなる。また、レ
ジスタの値を出力すると入力クロック信号を2分周した
信号が得られる。
[0003] The operation of the timer will be briefly described. The timer counts a clock signal by a set of registers called a timer counter register. When a clock signal is input, the timer counter register alone has the property of inverting the logic value held at the rising edge (or falling edge depending on the setting) of the clock signal. The logic value corresponds to the potential held by the register. The logic value is “HIGH” when the voltage is high, and “L” when the potential is low.
Due to this property, when a clock signal is input, the logical value held at the first rising (falling) is inverted, and at the next rising (falling), the logical value is inverted again. Since the clock signal rises (falls) every cycle,
The logical value held in the register returns to the original logical value in two cycles of the clock signal, and outputs a carry signal. Therefore, one timer counter register becomes a binary counter for counting the input clock signal. When the value of the register is output, a signal obtained by dividing the input clock signal by two is obtained.

【0004】タイマカウンタとは上記で述べたようなレ
ジスタを、直列に複数個接続した構成を持っている。外
部よりタイマユニットに入力されたクロック信号は、初
段のレジスタにより分周される。分周されたクロック信
号を2段目のレジスタに入力すると、このレジスタは初
段のレジスタの周期を倍にした動作に行う。レジスタ単
体の場合が2進カウンタの動作をすることから、2段目
のレジスタの論理値は2進数の2桁目に相当し、出力は
入力クロックを4分周したものとなる。更に、2段目の
レジスタの出力を3段目のレジスタに入力すると、レジ
スタの論理値は2進数の3桁目、出力は初段に入力した
クロック信号の8分周したものとなる。これらの事か
ら、一般にnビットのタイマカウンタレジスタを持つタ
イマカウンタの場合、2進数n桁のカウンタとなる。こ
の場合2nカウントすると、オーバフロー信号を出力す
る。
A timer counter has a configuration in which a plurality of registers as described above are connected in series. The clock signal externally input to the timer unit is divided by the first stage register. When the frequency-divided clock signal is input to the second-stage register, this register performs an operation in which the cycle of the first-stage register is doubled. Since the register itself operates as a binary counter, the logical value of the register in the second stage corresponds to the second digit of the binary number, and the output is obtained by dividing the input clock by four. Further, when the output of the second-stage register is input to the third-stage register, the logical value of the register is the third digit of the binary number, and the output is the clock signal input to the first stage that is divided by eight. For these reasons, a timer counter having an n-bit timer counter register generally has an n-digit binary counter. In this case, after counting 2 n , an overflow signal is output.

【0005】一般にマイクロコンピュータに内蔵される
タイマは、予め決められた製品仕様に従い製造工程で作
り込まれた固定ビット長である。nビットの固定ビット
長であるタイマは、オーバフロー信号出力までのカウン
ト数は2nで一定であり、必要とする時間周期を生成す
る際の時間幅の調整は、入力するクロック信号の時間周
期幅を選択するか、又は比較器を用いたコンペアマッチ
機能により実現することになる。コンペアマッチ機能を
有したタイマの例は、「日立製作所 H8/3887ハ
ードウェアマニュアル」に詳しく示されており、図8を
用いて以下の通り説明する。
In general, a timer built in a microcomputer has a fixed bit length created in a manufacturing process in accordance with predetermined product specifications. The timer having a fixed bit length of n bits has a constant count of 2 n until the overflow signal is output, and the time width for generating the required time period is adjusted by the time period width of the input clock signal. Or by a compare match function using a comparator. An example of a timer having a compare match function is described in detail in "Hitachi, Ltd. H8 / 3887 Hardware Manual", and will be described below with reference to FIG.

【0006】図8において、タイマモードレジスタ25
の設定値により、マルチプレクサにて入力信号を選択
し、タイマカウンタ27は選択された入力信号のカウン
トを行う。この例では、事前に設定されたアウトプット
コンペアレジスタ29の設定値とタイマカウンタ27の
カウント値を、比較回路28によって常時比較される。
両者の値が一致することにより、比較回路28は一致信
号を出力し、タイマカウンタ27はクリアされるので、
この一致信号はアウトプットコンペアレジスタ29に任
意に設定した値をカウントする周期で出力される。
In FIG. 8, a timer mode register 25
, The multiplexer selects an input signal, and the timer counter 27 counts the selected input signal. In this example, the comparison circuit 28 constantly compares the preset value of the output compare register 29 with the count value of the timer counter 27.
When the two values match, the comparison circuit 28 outputs a match signal, and the timer counter 27 is cleared.
This coincidence signal is output in a cycle for counting a value arbitrarily set in the output compare register 29.

【0007】また、タイマカウンタのオーバフロー信号
を他のタイマカウンタの入力信号として接続されること
を特徴とするタイマの例は、特開平2−54321号公
報に詳しく示されており、図9を用いて以下の通り説明
する。
An example of a timer in which an overflow signal of a timer counter is connected as an input signal of another timer counter is disclosed in detail in Japanese Patent Application Laid-Open No. 2-54321, and FIG. This will be described as follows.

【0008】図9に示されるタイマは中央レジスタ31
と2つの補助レジスタ30,32と、それぞれのレジス
タへの入力信号をコントロールする入力コントロール回
路34,33,35と、比較器36,37から構成され
る。各レジスタ30,31,32はそれぞれ独立にプロ
グラム可能であり、入力コントロール回路によって入力
信号の選択を行う。また、中央レジスタ31の出力端が
補助レジスタ30,32の入力コントロール回路33,
35の入力端に接続されており、補助レジスタとカスケ
ード接続することで、レジスタのビット長を大きくする
ことが可能である。また、比較器36,37によって前
述のコンペアマッチ機能も備えている。
The timer shown in FIG.
And two auxiliary registers 30, 32, input control circuits 34, 33, 35 for controlling input signals to the respective registers, and comparators 36, 37. Each of the registers 30, 31, and 32 is independently programmable and an input control circuit selects an input signal. The output terminal of the central register 31 is connected to the input control circuit 33 of the auxiliary registers 30 and 32,
It is connected to the input terminal of the auxiliary register 35, and by cascading with the auxiliary register, the bit length of the register can be increased. The comparators 36 and 37 also have the above-described compare match function.

【0009】以上、固定されたビット長のタイマカウン
タあるいはタイマチャンネル数の範囲内で使用すること
になるので、多チャンネルタイマの要求や、最適な回路
規模での動作要求には対応できないのが現状であった。
As described above, since a timer is used within the range of a fixed-bit-length timer counter or the number of timer channels, it cannot meet the requirements of a multi-channel timer or the operation of an optimal circuit scale. Met.

【0010】[0010]

【発明が解決しようとする課題】従来技術では、製造工
程にて形成されたタイマ回路のビット長が固定であるこ
とから、タイマにて生成しようとする時間周期の長短に
依らずに回路規模が決まり、特に必要とする時間周期が
短い場合などには使用しない回路が冗長となっていた。
In the prior art, since the bit length of the timer circuit formed in the manufacturing process is fixed, the circuit scale is not dependent on the length of the time period to be generated by the timer. In particular, circuits that are not used when the required time period is short are redundant.

【0011】また非常に長い時間周期が必要とされる場
合、特開平2−54321号公報に記載の技術にて、複
数のタイマをカスケード接続してビット長を長くとり対
応可能であるが、いずれにせよ長短さまざまな要求のあ
る時間周期設定には最適な回路規模で対応できない。
When a very long time period is required, a technique disclosed in Japanese Patent Application Laid-Open No. 2-54321 can cascade-connect a plurality of timers to increase the bit length. Anyway, it is not possible to cope with the setting of the time period having various demands with the optimum circuit scale.

【0012】本発明は、タイマ回路のビット長が固定さ
れた状態であっても、必要とする時間周期に最適な、あ
るいは省力化した回路規模で時間生成を可能とするタイ
マユニットを提供する。
The present invention provides a timer unit which is capable of generating a time with a circuit scale optimal for a required time period or a labor-saving circuit even when the bit length of the timer circuit is fixed.

【0013】[0013]

【課題を解決するための手段】本発明は、それぞれ独立
して動作することが可能なタイマカウンタと各タイマカ
ウンタに入力する入力信号をソフトウェア制御する制御
回路と、ソフトウェアの設定により製品完成後であって
も、目的に応じた多様な時間周期の生成や低消費電力で
動作することが可能である。
SUMMARY OF THE INVENTION The present invention provides a timer counter which can operate independently, a control circuit which software controls an input signal to be input to each timer counter, and a software after setting the product by software setting. Even so, it is possible to generate various time periods according to the purpose and operate with low power consumption.

【0014】また、各タイマカウンタの出力信号に対
し、信号処理を行う演算部を介して、更に多様な時間周
期を生成することも可能である。
Further, it is possible to generate more various time periods for the output signals of the respective timer counters via an arithmetic unit for performing signal processing.

【0015】[0015]

【発明の実施の形態】(実施例1)本発明の一実施例を
図1に示す。本実施例は様々なビット長のタイマカウン
タ群と、各タイマカウンタの入力信号を選択する入力選
択回路と、入力選択回路を設定することによりタイマカ
ウンタ群の結合を制御する制御部から成る。制御部はソ
フトウェアによりユーザーが任意に設定する事が可能で
ある。
(Embodiment 1) An embodiment of the present invention is shown in FIG. This embodiment includes a group of timer counters having various bit lengths, an input selection circuit for selecting an input signal of each timer counter, and a control unit for controlling the connection of the group of timer counters by setting the input selection circuit. The control unit can be arbitrarily set by the user by software.

【0016】入力選択回路にはタイマカウンタの外部か
ら複数のクロック信号が入力される。これらのクロック
信号の中から、適当なクロック信号を制御回路の設定に
したがってそれぞれのタイマカウンタへ出力する。タイ
マカウンタはクロック信号を入力しカウントを行い、ビ
ット長に応じて分周したクロック信号と、オーバフロー
信号を出力する。オーバフロー信号はタイマカウンタ外
部に出力され、生成したタイミングを様々なモジュール
に供給する。また、タイマカウンタで分周した信号は入
力選択回路にも接続されており、再びタイマカウンタへ
入力することも可能である。
A plurality of clock signals are input to the input selection circuit from outside the timer counter. Among these clock signals, an appropriate clock signal is output to each timer counter according to the setting of the control circuit. The timer counter receives the clock signal, counts, and outputs a clock signal divided according to the bit length and an overflow signal. The overflow signal is output outside the timer counter and supplies the generated timing to various modules. The signal divided by the timer counter is also connected to the input selection circuit, and can be input to the timer counter again.

【0017】本実施例では、複数の異なるタイマカウン
タ1〜3と、各タイマカウンタに入力する信号を選択す
る入力選択回路としてのマルチプレクサ7〜12と、入
力信号の選択など各タイマの接続を制御する制御部10
を基本構成とする例をあげる。
In this embodiment, a plurality of different timer counters 1-3, multiplexers 7-12 as input selection circuits for selecting signals to be input to each timer counter, and connection of each timer such as selection of input signals are controlled. Control unit 10
Here is an example of a basic configuration.

【0018】タイマカウンタは任意の数で構成でき、ビ
ット長も任意のものを用いることができるが、実施例で
は便宜上タイマカウンタ1は4ビット、タイマカウンタ
2は3ビット、タイマカウンタ3は2ビットとした。各
タイマレジスタ1〜3への入力する信号はマルチプレク
サ4〜9によって、タイマユニット外部から供給される
クロック信号及びタイマ群内のタイマカウンタレジスタ
により出力されたクロック信号より選択することが可能
である。
The timer counter can be composed of an arbitrary number and an arbitrary bit length can be used. In the embodiment, for convenience, the timer counter 1 has 4 bits, the timer counter 2 has 3 bits, and the timer counter 3 has 2 bits. And The signals to be input to each of the timer registers 1 to 3 can be selected by the multiplexers 4 to 9 from the clock signal supplied from outside the timer unit and the clock signal output from the timer counter register in the timer group.

【0019】図1に示す本発明の一実施例の構成例を以
下3点挙げる。
The following are three examples of the configuration of the embodiment of the present invention shown in FIG.

【0020】第1の例では、タイマカウンタ1にCLK
1を入力するようにマルチプレクサ4,5を、タイマカ
ウンタ2にCLK2を入力するようにマルチプレクサ
6,7を、タイマカウンタ3にCLK3を入力するよう
にマルチプレクサ8,9を設定する例である。本設定を
行った場合のブロック図を図2に示す。この使用例では
4ビット,3ビット,2ビットのタイマカウンタを、そ
れぞれクロック信号CLK1,CLK2,CLK3で動
作させており、全く独立の3種類のタイマを使用してい
る場合に等しい。
In the first example, the timer counter 1
In this example, the multiplexers 4 and 5 are set so that 1 is input, the multiplexers 6 and 7 are set so that CLK2 is input to the timer counter 2, and the multiplexers 8 and 9 are set so that CLK3 is input to the timer counter 3. FIG. 2 is a block diagram when this setting is performed. In this use example, 4-bit, 3-bit, and 2-bit timer counters are operated by the clock signals CLK1, CLK2, and CLK3, respectively, which is equivalent to the use of three completely independent timers.

【0021】第2の例は、タイマカウンタ1は前例と同
様にCLK1を入力するようにマルチプレクサ4,5
を、タイマカウンタ2にCLK2を入力するようにマル
チプレクサ6,7を設定するが、タイマカウンタ3はタ
イマカウンタ2で分周されたクロック信号を経路16か
ら入力するようにマルチプレクサ9を設定する例であ
る。この設定の場合のブロック図を図3に示す。この使
用例ではCLK1で動作する4ビットのタイマカウンタ
と、これとは独立のCLK2で動作する3ビットのタイ
マカウンタと5ビットタイマカウンタの3種類のタイマ
を使用している場合に等しい。
In the second example, the timer counter 1 is provided with multiplexers 4 and 5 so as to input CLK1 as in the previous example.
In the example, the multiplexers 6 and 7 are set so that CLK2 is input to the timer counter 2, and the timer counter 3 is set so that the clock signal divided by the timer counter 2 is input from the path 16. is there. FIG. 3 shows a block diagram in the case of this setting. This use example is equivalent to a case where three types of timers are used, that is, a 4-bit timer counter that operates on CLK1 and a 3-bit timer counter and a 5-bit timer counter that operate independently on CLK2.

【0022】第3の例は、タイマカウンタ1にCLK2
を入力するようにマルチプレクサ4,5を設定し、タイ
マカウンタ2には信号を入力させず停止状態にする。タ
イマカウンタ1がオーバフロー信号を出力すると、ソフ
トウェアによりタイマカウンタ1への信号の入力を閉
じ、タイマカウンタ2にCLK2を入力し動作させるよ
うにマルチプレクサ7を設定する。これら2つのタイマ
カウンタレジスタ1,2で分周したクロックはそれぞれ
経路15,16を通じマルチプレクサ9を介しタイマカ
ウンタ3に入力される。この設定の場合のブロック図を
図4に示す。
In a third example, the timer counter 1 outputs CLK2
The multiplexers 4 and 5 are set so as to input a signal, and the timer counter 2 is stopped without receiving a signal. When the timer counter 1 outputs the overflow signal, the signal input to the timer counter 1 is closed by software, and the multiplexer 7 is set so that CLK2 is input to the timer counter 2 to operate. The clocks divided by these two timer counter registers 1 and 2 are input to the timer counter 3 via the multiplexer 9 via the paths 15 and 16, respectively. FIG. 4 shows a block diagram in the case of this setting.

【0023】具体的にこの設定の場合の動作例を説明す
る。
An operation example in the case of this setting will be specifically described.

【0024】CLK1の周期はCLK2の周期の2倍で
ある例とすると、CLK1により4ビットのタイマカウ
ンタ1を動作させると、CLK1を16カウントすると
オーバフロー信号を出力する。これはCLK2の32カ
ウント分の周期である。タイマカウンタ1のオーバフロ
ー信号により、タイマカウンタ1へのクロック入力は停
止され、タイマカウンタ2にクロック信号CLK2が入
力される。タイマカウンタ2はクロック信号CLK2の
8カウントするとオーバフロー信号を出力する。このオ
ーバフロー信号によって、タイマカウンタ2のクロック
入力は停止され、タイマカウンタ1にクロック信号CL
K1が入力され、以降はこれらの動作の繰り返しとな
る。タイマカウンタ3は2つのタイマカウンタ1,2か
ら交互に出力されるオーバフロー信号を入力するので、
CLK1の2カウント分とCLK2の8カウント分でカ
ウントアップすることになる。従って、タイマカウンタ
3はタイマカウンタ2の2回目のオーバフロー信号で4
カウントになりオーバフローするから、CLK2の40
カウントの時間周期を生成することになる。この40カ
ウントは2n ではないので通常のインターバルタイマで
は生成することはできない。 (実施例2)異なるビット長のタイマを同時に用いる場
合、タイマカウンタの下位側のビットは重複したカウン
ト動作をすることがある。その場合、タイマカウンタの
下位ビット部分を共通化し、タイマカウンタによって分
周されるクロック信号をそれぞれのタイマカウンタに入
力させることで、図1においての複数のタイマ群の重複
した下位側ビット部分を共通化して用いた場合の例を示
す。共通化によって、動作するタイマカウンタのビット
数を削減することができ、消費電力を低減することがで
きる。
Assuming that the cycle of CLK1 is twice as long as the cycle of CLK2, when the 4-bit timer counter 1 is operated by CLK1, an overflow signal is output when CLK1 has counted 16 times. This is a cycle of 32 counts of CLK2. The clock input to the timer counter 1 is stopped by the overflow signal of the timer counter 1, and the clock signal CLK 2 is input to the timer counter 2. The timer counter 2 outputs an overflow signal when eight clock signals CLK2 are counted. Due to this overflow signal, the clock input of the timer counter 2 is stopped, and the clock signal CL is supplied to the timer counter 1.
K1 is input, and thereafter, these operations are repeated. Since the timer counter 3 receives an overflow signal alternately output from the two timer counters 1 and 2,
The count is incremented by two counts of CLK1 and eight counts of CLK2. Therefore, the timer counter 3 outputs 4 by the second overflow signal of the timer counter 2.
Since the count is counted and overflow occurs, 40 of CLK2
A time period of the count will be generated. Since this 40 count is not 2 n , it cannot be generated by a normal interval timer. (Embodiment 2) When timers having different bit lengths are used at the same time, the lower bits of the timer counter may perform duplicate counting operations. In this case, the lower bit portion of the timer counter is shared, and the clock signal divided by the timer counter is input to each timer counter, whereby the overlapping lower bit portions of the plurality of timer groups in FIG. 1 are shared. An example in the case of being used in the following manner is shown. By the common use, the number of bits of the operating timer counter can be reduced, and power consumption can be reduced.

【0025】本例は以下の動作を行うように制御部10
をソフトウェアにより設定する例であり、図5にブロッ
ク図を図示する。タイマユニットに入力されたクロック
信号CLK1をマルチプレクサ4,5の経路で4ビット
のタイマカウンタ1に、タイマカウンタ1により分周さ
れたクロック信号を経路15からマルチプレクサ7を介
し3ビットのタイマカウンタ2に入力する。また、同様
に経路15からマルチプレクサ9を介し、2ビットのタ
イマカウンタ3にも入力する。
In this embodiment, the control unit 10 performs the following operation.
Is set by software, and a block diagram is shown in FIG. The clock signal CLK1 input to the timer unit is supplied to the 4-bit timer counter 1 via the multiplexers 4 and 5, and the clock signal divided by the timer counter 1 is supplied to the 3-bit timer counter 2 via the multiplexer 7 from the path 15. input. Similarly, the signal is input to the 2-bit timer counter 3 from the path 15 via the multiplexer 9.

【0026】タイマカウンタ1にクロック信号CLK1
を入力すると、4ビットのタイマカウンタ1は入力信号
CLK1の16カウント間隔でオーバフロー信号を配線
12に出力し、16分周されたクロック信号を配線15
に出力する。2段目の3ビットのタイマカウンタ2に、
このクロック信号が入力されると、オーバフロー信号は
タイマカウンタ2の入力信号に対して8カウント間隔で
配線16に出力される。また、タイマカウンタ1で分周
されたクロック信号は、2ビットのタイマカウンタ3に
も入力される。オーバフロー信号はタイマカウンタ3の
入力信号に対して4カウントで配線14に出力される。
The clock signal CLK1 is supplied to the timer counter 1.
Is input, the 4-bit timer counter 1 outputs an overflow signal to the wiring 12 at 16 count intervals of the input signal CLK1 and outputs the clock signal divided by 16 to the wiring 15.
Output to In the second stage 3-bit timer counter 2,
When this clock signal is input, the overflow signal is output to the wiring 16 at an interval of 8 counts with respect to the input signal of the timer counter 2. The clock signal divided by the timer counter 1 is also input to the 2-bit timer counter 3. The overflow signal is output to the wiring 14 at 4 counts with respect to the input signal of the timer counter 3.

【0027】従って、この実施例2ではCLK1を入力
し、オーバフロー出力としてCLK1を16カウント,
64カウント,128カウントする時間周期を得ること
ができる。これは通常の4ビット,6ビット,7ビット
のインターバルタイマで得られる時間周期である。6ビ
ットと7ビットのカウンタを同時に動作させる場合、通
常は13ビット分のタイマカウンタが必要であるが、こ
の実施例2では9ビットで必要とする時間周期を得るこ
とができる。
Therefore, in the second embodiment, CLK1 is input, and CLK1 is counted as 16 as overflow output.
A time period of 64 counts and 128 counts can be obtained. This is a time period obtained by a normal 4-bit, 6-bit, and 7-bit interval timer. When simultaneously operating the 6-bit and 7-bit counters, a timer counter for 13 bits is usually required, but in the second embodiment, the required time period can be obtained with 9 bits.

【0028】このように各タイマカウンタにそれぞれの
ビット長を持たせ、それぞれをソフトウェアにより関連
付けることで、多様なビット長や複数のオーバフロー信
号を生成し、要求する仕様に応じて、様々な時間周期を
生成でき、また、動作カウンタを削減することができ
る。
As described above, by giving each timer counter a bit length and associating each with the software, various bit lengths and a plurality of overflow signals are generated, and various time periods are set according to the required specifications. Can be generated, and the number of operation counters can be reduced.

【0029】実施例1も9ビット分のカウンタを動作さ
せているが、4ビット,7ビットのインターバルタイマ
と同様の時間周期も生成できるので、動作するタイマカ
ウンタを削減している。 (実施例3)図6に本発明の一実施例を示す。図2で示
したタイマユニットに加え、各タイマカウンタの出力信
号を演算処理できる演算部24を設ける。演算部24は
入力された各タイマの出力信号を制御部10の設定にし
たがって演算を行う。図7における演算部24はタイマ
の仕様によって、決定すればよい。
Although the first embodiment operates a 9-bit counter, a time period similar to that of the 4-bit or 7-bit interval timer can be generated, so that the number of operating timer counters is reduced. (Embodiment 3) FIG. 6 shows an embodiment of the present invention. In addition to the timer unit shown in FIG. 2, an operation unit 24 capable of performing an operation process on an output signal of each timer counter is provided. The operation unit 24 performs an operation on the input output signals of the timers according to the settings of the control unit 10. The arithmetic unit 24 in FIG. 7 may be determined according to the specifications of the timer.

【0030】CLK1を4ビットのタイマカウンタ1に
入力するように、マルチプレクサ4,5を制御部10に
て設定する。また、CLK2を2ビットのタイマカウン
タ3に入力するように、マルチプレクサ8,9を制御部
10によって設定する。この場合、2つのタイマカウン
タ1,3は互いに独立に動作する。
The multiplexers 4 and 5 are set by the control unit 10 so that CLK1 is input to the 4-bit timer counter 1. Further, the multiplexers 8 and 9 are set by the control unit 10 so that CLK2 is input to the 2-bit timer counter 3. In this case, the two timer counters 1 and 3 operate independently of each other.

【0031】CLK1はタイマカウンタ1により16分
周され、CLK2はタイマカウンタ3によって4分周さ
れる。これらのクロック信号を配線21,22により演
算部24の演算素子20に入力する。この演算結果を配
線23を介しマルチプレクサ7によってタイマカウンタ
2に入力するように、制御部10を設定する。演算部は
論理演算、反転出力など任意の信号処理を行うことがで
きるが、本例では便宜上、2つの信号のANDをとる例
を示す。タイマカウンタ1及びタイマカウンタ2が生成
するクロック信号、また演算素子20が出力する信号の
タイミングを図7に示す。
CLK1 is divided by 16 by the timer counter 1 and CLK2 is divided by 4 by the timer counter 3. These clock signals are input to the arithmetic element 20 of the arithmetic unit 24 via the wirings 21 and 22. The control unit 10 is set so that the operation result is input to the timer counter 2 by the multiplexer 7 via the wiring 23. The arithmetic unit can perform any signal processing such as a logical operation and an inverted output. In this example, an example in which two signals are ANDed for convenience is shown. FIG. 7 shows the clock signals generated by the timer counter 1 and the timer counter 2 and the timing of the signal output from the arithmetic element 20.

【0032】4ビットのタイマカウンタ1によりクロッ
ク信号CLK1は16分周され、2ビットタイマを通過
したクロック信号CLK2は4分周されるので、これら
の信号を演算素子20に入力した信号は、2分周のクロ
ック信号の論理値が“HIGH”レベルの場合、4分周
のクロック信号が出力されることになる。論理値が“L
OW”レベルの場合の出力は“LOW”レベルである。
演算部で生成された信号を配線23を介して、別のタイ
マカウンタに入力することで、このクロック信号をカウ
ントすることができる。
Since the clock signal CLK1 is divided by 16 by the 4-bit timer counter 1 and the clock signal CLK2 passed through the 2-bit timer is divided by 4, the signals input to the arithmetic element 20 by these signals are divided by 2 When the logical value of the frequency-divided clock signal is “HIGH” level, a frequency-divided clock signal is output. If the logical value is "L"
The output in the case of the "OW" level is the "LOW" level.
The clock signal can be counted by inputting the signal generated by the arithmetic unit to another timer counter via the wiring 23.

【0033】本発明により、異なるタイマカウンタまた
はタイマカウンタの組み合わせにより生成されるクロッ
ク信号やオーバフロー信号を演算部により、新たな信号
を生成することで、より多様な時間周期に対応すること
ができる。
According to the present invention, a clock signal or overflow signal generated by a different timer counter or a combination of timer counters is generated by the arithmetic unit to generate a new signal, so that more various time periods can be handled.

【0034】[0034]

【発明の効果】各タイマカウンタレジスタの組み合わせ
により、その用途に応じてタイマカウンタの動作を最適
化できる為、消費電力は低減することができる。また、
様々な時間周期を複数生成することもでき、より精度の
良い時間生成が可能となる。
According to the present invention, the operation of the timer counter can be optimized according to the intended use by the combination of the timer counter registers, so that the power consumption can be reduced. Also,
A plurality of various time periods can be generated, and more accurate time generation can be performed.

【0035】また、本発明は非常に汎用性が高いため、
高度な仕様にも対応でき、従来技術との併用により、更
に応用の範囲も拡大される。
Also, since the present invention is very versatile,
Compatible with advanced specifications, and the range of applications can be further expanded by using with conventional technology.

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

【図1】本発明の第1,第2の実施例を示す回路図であ
る。
FIG. 1 is a circuit diagram showing first and second embodiments of the present invention.

【図2】図1の回路図における第1の構成例である。FIG. 2 is a first configuration example in the circuit diagram of FIG. 1;

【図3】図1の回路図における第2の構成例である。FIG. 3 is a second configuration example in the circuit diagram of FIG. 1;

【図4】図1の回路図における第3の構成例である。FIG. 4 is a third configuration example in the circuit diagram of FIG. 1;

【図5】図1の回路図における第4の構成例である。FIG. 5 is a fourth configuration example in the circuit diagram of FIG. 1;

【図6】本発明の第3の実施例を示す回路図である。FIG. 6 is a circuit diagram showing a third embodiment of the present invention.

【図7】本発明の第3の実施例におけるタイミング図で
ある。
FIG. 7 is a timing chart according to a third embodiment of the present invention.

【図8】従来の技術であるコンペアマッチ機能の一例で
ある。
FIG. 8 is an example of a compare match function according to the related art.

【図9】従来の技術であるタイマ回路の一例である。FIG. 9 is an example of a conventional timer circuit.

【符号の説明】[Explanation of symbols]

1〜3…タイマカウンタ、4〜9…マルチプレクサ、1
0…制御部、11,19…レジスタ、12〜14…オー
バフロー信号出力、15〜17…分周したクロック出
力、18…CPU、20…演算素子、21,22…演算
素子へ入力されるクロック信号出力、23…演算素子出
力、24…演算部、タイマモードレジスタ、27…タイ
マカウンタ、28…比較回路、29…アウトプットコン
ペアレジスタ、30,32…補助レジスタ、31…中央
レジスタ、33〜35…入力コントロール回路、36,
37…比較器。
1-3: timer counter, 4-9: multiplexer, 1
0: control unit, 11, 19: register, 12 to 14: overflow signal output, 15 to 17: divided clock output, 18: CPU, 20: arithmetic element, 21, 22: clock signal input to the arithmetic element Output, 23: arithmetic element output, 24: arithmetic unit, timer mode register, 27: timer counter, 28: comparison circuit, 29: output compare register, 30, 32: auxiliary register, 31: central register, 33 to 35 ... Input control circuit, 36,
37 ... Comparator.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】半導体集積回路において使用されるタイマ
ユニットであって、複数のタイマカウンタと、各タイマ
カウンタに入力する入力信号をソフトウェア制御する制
御部とを有し、任意の組み合わせで構成したタイマ群あ
るいは個々の独立したタイマカウンタとして動作させる
タイマユニット。
1. A timer unit used in a semiconductor integrated circuit, comprising: a plurality of timer counters; and a control unit for software-controlling an input signal to be input to each of the timer counters; Timer unit that operates as a group or individual timer counter.
【請求項2】請求項1において、複数の時間周期生成の
目的に応じて構成した各タイマ群あるいはタイマカウン
タで、重複するカウント動作部分を共通化して用いるこ
とができる機能を有するタイマユニット。
2. The timer unit according to claim 1, wherein each timer group or timer counter configured for the purpose of generating a plurality of time periods has a function of sharing an overlapping count operation part.
【請求項3】請求項1において、ある時間周期生成のた
めに構成されたタイマ群あるいはタイマカウンタの出力
信号と、これとは別の構成からなるタイマ群あるいはタ
イマカウンタにより生成した別の出力信号と、これらと
は別に生成されたクロック信号に対し、任意の組み合わ
せで信号処理を行う演算部を設けるタイマユニット。
3. An output signal of a timer group or a timer counter configured for generating a certain time period and another output signal generated by a timer group or a timer counter having a different configuration. And a timer unit provided with an arithmetic unit that performs signal processing on a clock signal generated separately from the above in any combination.
JP2000097818A 2000-03-30 2000-03-30 Timer unit programmable by software Pending JP2001282384A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000097818A JP2001282384A (en) 2000-03-30 2000-03-30 Timer unit programmable by software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000097818A JP2001282384A (en) 2000-03-30 2000-03-30 Timer unit programmable by software

Publications (1)

Publication Number Publication Date
JP2001282384A true JP2001282384A (en) 2001-10-12

Family

ID=18612390

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000097818A Pending JP2001282384A (en) 2000-03-30 2000-03-30 Timer unit programmable by software

Country Status (1)

Country Link
JP (1) JP2001282384A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010118981A (en) * 2008-11-14 2010-05-27 Omron Corp Count device
JP2013117923A (en) * 2011-12-05 2013-06-13 Seiko Epson Corp Timer device and electronic apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010118981A (en) * 2008-11-14 2010-05-27 Omron Corp Count device
JP2013117923A (en) * 2011-12-05 2013-06-13 Seiko Epson Corp Timer device and electronic apparatus

Similar Documents

Publication Publication Date Title
JP2004517542A (en) Digital frequency multiplier
US6489817B1 (en) Clock divider using positive and negative edge triggered state machines
US20020186808A1 (en) Fully programmable multimodulus prescaler
US3992635A (en) N scale counter
JPH01256223A (en) Loadable ripple counter
US5793234A (en) Pulse width modulation circuit
US7149275B1 (en) Integrated circuit and method of implementing a counter in an integrated circuit
CN107888166B (en) Multi-phase non-overlapping clock signal generation circuit and corresponding method
JP2001282384A (en) Timer unit programmable by software
JP3183494B2 (en) Timing signal generation circuit
CN108777575B (en) Frequency divider
JPH01220913A (en) Digital event generator
JPH10261952A (en) Clock frequency divider
US6567494B2 (en) Method for dividing the frequency of a clock signal and frequency divider circuit for implementing the method
JP2659186B2 (en) Digital variable frequency divider
JPH08162946A (en) Counter circuit
US7519090B2 (en) Very high speed arbitrary number of multiple signal multiplexer
JPH04361426A (en) Johnson counter
JPH03171820A (en) 2n-1 frequency dividing circuit
JP3789448B2 (en) Microcontroller with system resource prescaler
JPH0646708B2 (en) Clock selection circuit
JPH06120842A (en) Serial/parallel conversion circuit
JPH05275989A (en) Control pulse generating circuit
JP2003223237A (en) Clock switching circuit
JPH0444415A (en) Pulse generating circuit