JPH04287514A - Pulse width modulation circuit - Google Patents

Pulse width modulation circuit

Info

Publication number
JPH04287514A
JPH04287514A JP5211091A JP5211091A JPH04287514A JP H04287514 A JPH04287514 A JP H04287514A JP 5211091 A JP5211091 A JP 5211091A JP 5211091 A JP5211091 A JP 5211091A JP H04287514 A JPH04287514 A JP H04287514A
Authority
JP
Japan
Prior art keywords
pulse width
timer counter
register
output
width modulation
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
JP5211091A
Other languages
Japanese (ja)
Inventor
Eiji Yahou
矢放 栄二
Toshifumi Hamaguchi
濱口 敏文
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP5211091A priority Critical patent/JPH04287514A/en
Publication of JPH04287514A publication Critical patent/JPH04287514A/en
Pending legal-status Critical Current

Links

Landscapes

  • Electronic Switches (AREA)

Abstract

PURPOSE:To minimize logics on an integrated circuit and to widen the scope of general-purpose application without need of an exclusive logic circuit. CONSTITUTION:The circuit employs a programmable timer counter 10 and a 1-bit output register 20 whose content is inverted by an overflow signal 111 of the said timer counter 10 and a pulse width modulation output 200 is realized as an output of the timer counter 10. Moreover, when no pulse width modulation output is required in the circuit configuration above, the timer counter acts like a usual timer counter and number of logic circuits on the integrated circuit is minimized and general-purpose applications are expanded. Furthermore, the load exerted to the software is relieved by having only to add one register able to load a count data to the said circuit constitution.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は集積回路特にマイクロコ
ンピュータ及びマイクロコントローラに内蔵されるパル
ス幅変調回路に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to integrated circuits, and more particularly to pulse width modulation circuits built into microcomputers and microcontrollers.

【0002】0002

【従来の技術】従来のパルス幅変調回路では、集積回路
上において、専用の論理回路で構成されていた。以下、
その一例について、図3を用いて説明する。
2. Description of the Related Art Conventional pulse width modulation circuits are comprised of dedicated logic circuits on integrated circuits. below,
An example thereof will be explained using FIG. 3.

【0003】この回路は、nビットのカウンタ1,nビ
ットのレジスタ2,比較回路3で構成されている。カウ
ンタ1にはクロック100が入力され、比較回路3の一
方の入力となるnビットのカウンタデータ101が出力
される。レジスタ2より比較回路3の一方の入力となる
nビットのレジスタデータ102が出力されている。比
較回路3の出力がパルス幅変調出力103となる。
This circuit is composed of an n-bit counter 1, an n-bit register 2, and a comparison circuit 3. A clock 100 is input to the counter 1, and n-bit counter data 101, which becomes one input of the comparator circuit 3, is output. The register 2 outputs n-bit register data 102, which becomes one input to the comparator circuit 3. The output of the comparator circuit 3 becomes a pulse width modulated output 103.

【0004】このような構成のパルス幅変調回路におい
て、レジスタ2がプログラミング可能である任意の値に
設定される。クロック100でカウントされるカウンタ
1はnビットのカウンタデータ101を出力する。比較
回路では、nビットのカウンタデータ101とnビット
のレジスタデータ102を比較し、nビットのカウンタ
データ101がnビットのレジスタデータ102より小
さいときはローレベルを、大きいときにはハイレベルを
パルス幅変調出力103として出力する。
In the pulse width modulation circuit having such a configuration, the register 2 is set to any programmable value. A counter 1 counted by a clock 100 outputs n-bit counter data 101. The comparison circuit compares n-bit counter data 101 and n-bit register data 102, and when the n-bit counter data 101 is smaller than the n-bit register data 102, the low level is set, and when it is larger, the high level is pulse width modulated. Output as output 103.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、前記従
来の構成では、パルス幅変調回路として専用の論理回路
を必要とし、多ビットの構成になるほど比較回路の論理
が大きくなる。
However, the conventional configuration described above requires a dedicated logic circuit as a pulse width modulation circuit, and the logic of the comparison circuit increases as the number of bits increases.

【0006】以上のことは、集積回路上に構成する場合
、論理が大きくなり、汎用性を失うことを意味している
The above means that when constructed on an integrated circuit, the logic becomes large and versatility is lost.

【0007】本発明は前記従来の問題点を解決するもの
で、すでに集積回路上に構成された論理回路を使用して
、パルス幅変調出力を可能とする。
[0007] The present invention solves the above-mentioned problems of the prior art and enables pulse width modulated output using logic circuits already constructed on an integrated circuit.

【0008】[0008]

【課題を解決するための手段】本発明のパルス幅変調回
路は、プログラム可能なタイマカウンタと、前記タイマ
カウンタのオーバーフロー信号により値が反転する1ビ
ットの出力レジスタを使用し、タイマカウンタの応用出
力としてパルス幅変調出力を可能としたものである。さ
らにまた、タイマカウンタにカウントデータのロードで
きる1本のレジスタを追加することで、ソフトウェアに
かかる負担を低減したものである。
The pulse width modulation circuit of the present invention uses a programmable timer counter and a 1-bit output register whose value is inverted by an overflow signal of the timer counter, and provides an application output of the timer counter. This enables pulse width modulation output. Furthermore, by adding one register to the timer counter into which count data can be loaded, the burden on the software is reduced.

【0009】[0009]

【作用】この構成により、パルス幅変調出力が不要の場
合には、通常のタイマカウンタとして使用することが可
能で、集積回路上の論理も最小となり、汎用性が大きく
なる。
[Operation] With this configuration, when pulse width modulation output is not required, it can be used as a normal timer counter, the logic on the integrated circuit is also minimized, and versatility is increased.

【0010】0010

【実施例】以下、本発明の一実施例について、図面を参
照しながら説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings.

【0011】図1は本発明の第1の実施例を示すブロッ
ク図である。この回路は、プログラミング可能なnビッ
トのタイマカウンタ10と、前記タイマカウンタ10の
オーバーフロー信号111によって値が反転する1ビッ
トの出力レジスタ20からなる。タイマカウンタ10は
、nビットのカウンタ11とカウントデータを設定する
nビットのレジスタ12とオーバーフロー検出回路14
からなる。出力レジスタ20の出力がパルス幅変調出力
200となる。
FIG. 1 is a block diagram showing a first embodiment of the present invention. This circuit consists of a programmable n-bit timer counter 10 and a 1-bit output register 20 whose value is inverted by an overflow signal 111 of the timer counter 10. The timer counter 10 includes an n-bit counter 11, an n-bit register 12 for setting count data, and an overflow detection circuit 14.
Consisting of The output of the output register 20 becomes the pulse width modulated output 200.

【0012】この構成のパルス幅変調回路において、初
期状態として、レジスタ12にはローレベルの時間を決
める値がプログラミングされ、出力レジスタ20はロー
レベルを出力している。この状態より、カウンタ11は
ローレベルの時間のカウントを開始する。カウンタ11
がハイレベルのカウントをしている間にレジスタ12に
ローレベルの時間を決める値を準備する。カウンタ11
がオーバーフローすると、オーバーフロー信号111が
発生し、出力レジスタ20の値はハイレベルに更新され
る。カウンタ11にはレジスタ12のハイレベルの時間
を決める値がロードされ、カウンタ11はハイレベルの
時間のカウントを開始する。カウンタ11がハイレベル
のカウントをしている間にレジスタ12にローレベルの
時間を決める値を準備する。カウンタ11が再びオーバ
ーフローすると、出力レジスタ20の値はローレベルに
更新される。カウンタ11にはレジスタ12のローレベ
ルの時間を決める値がロードされ、カウンタ11はロー
レベルの時間のカウントを開始する。以上を繰り返し行
うことで、パルス幅変調出力200が得られる。
In the pulse width modulation circuit having this configuration, in the initial state, the register 12 is programmed with a value that determines the low level time, and the output register 20 outputs the low level. From this state, the counter 11 starts counting the low level time. counter 11
While counting high level, the register 12 is prepared with a value that determines the low level time. counter 11
When overflows, an overflow signal 111 is generated and the value of the output register 20 is updated to a high level. The counter 11 is loaded with a value that determines the high level time of the register 12, and the counter 11 starts counting the high level time. While the counter 11 is counting high level, a value determining the low level time is prepared in the register 12. When the counter 11 overflows again, the value of the output register 20 is updated to low level. The counter 11 is loaded with a value determining the low level time of the register 12, and the counter 11 starts counting the low level time. By repeating the above steps, a pulse width modulated output 200 is obtained.

【0013】また、このままの構成で通常のタイマカウ
ンタとして使用することもできる。以上のように本実施
例によれば、プログラム可能なタイマカウンタと、前記
タイマカウンタのオーバーフロー信号によって反転する
1ビットの出力レジスタを使用し、パルス幅変調回路を
実現している。
[0013] Also, the configuration as is can be used as a normal timer counter. As described above, according to this embodiment, a pulse width modulation circuit is realized using a programmable timer counter and a 1-bit output register that is inverted by the overflow signal of the timer counter.

【0014】以下、本発明の第2の実施例について、図
面を参照しながら説明する。図2は本発明の第2の実施
例を示すブロック図である。
A second embodiment of the present invention will be described below with reference to the drawings. FIG. 2 is a block diagram showing a second embodiment of the invention.

【0015】この回路は、プログラミング可能なnビッ
トのタイマカウンタ10と、前記タイマカウンタ10の
オーバーフロー信号111によって値が反転する1ビッ
トの出力レジスタ20からなる。タイマカウンタ10は
、nビットのカウンタ11とカウントデータを設定する
nビットのレジスタ12とレジスタ13とオーバーフロ
ー検出回路14からなる。出力レジスタ20の出力がパ
ルス幅変調出力200となる。
This circuit consists of a programmable n-bit timer counter 10 and a 1-bit output register 20 whose value is inverted by an overflow signal 111 of the timer counter 10. The timer counter 10 includes an n-bit counter 11, an n-bit register 12 and register 13 for setting count data, and an overflow detection circuit 14. The output of the output register 20 becomes the pulse width modulated output 200.

【0016】この構成のパルス幅変調回路において、初
期状態として、カウントデータレジスタ12にはハイレ
ベルの時間を決定する値が、レジスタ13にはローレベ
ルの時間を決定する値が、それぞれプログラミングされ
、出力レジスタ20はローレベルを出力している。この
状態より、カウンタ11はローレベルの時間のカウント
を開始する。カウンタ11がオーバーフローすると、オ
ーバーフロー信号111が発生し、出力レジスタ20の
値はハイレベルに更新される。カウンタ11にはレジス
タ12のハイレベルの時間を決める値がロードされ、カ
ウンタ11はハイレベルのカウントを開始する。カウン
タ11が再びオーバーフローすると、出力レジスタ20
の値がローレベルに更新される。カウンタ11にレジス
タ13のローレベルの時間を決める値がロードされ、カ
ウンタ11がローレベルのカウントを開始する。以上の
動作を繰り返すことで、パルス幅変調出力200が得ら
れる。
In the pulse width modulation circuit having this configuration, as an initial state, the count data register 12 is programmed with a value that determines the high level time, and the register 13 is programmed with a value that determines the low level time. The output register 20 outputs a low level. From this state, the counter 11 starts counting the low level time. When the counter 11 overflows, an overflow signal 111 is generated and the value of the output register 20 is updated to a high level. The counter 11 is loaded with a value that determines the high level time of the register 12, and the counter 11 starts counting the high level. When counter 11 overflows again, output register 20
The value of is updated to low level. A value determining the low level time of the register 13 is loaded into the counter 11, and the counter 11 starts counting the low level. By repeating the above operations, a pulse width modulated output 200 is obtained.

【0017】また、レジスタ12とレジスタ13の値を
同じ値とすることで、通常のタイマカウンタとして使用
することもできる。
Furthermore, by setting the values of register 12 and register 13 to the same value, it can also be used as a normal timer counter.

【0018】以上のように本実施例によれば、プログラ
ム可能なタイマカウンタに、カウントデータの設定でき
るレジスタをもう1本追加するだけで、ソフトウェアに
かかる負担を低減することが可能となる。
As described above, according to this embodiment, the burden on software can be reduced by simply adding one more register in which count data can be set to the programmable timer counter.

【0019】[0019]

【発明の効果】本発明は、集積回路上に既に構成された
タイマカウンタに対して、前記タイマカウンタのオーバ
ーフロー信号により値が反転する1ビットのレジスタを
付加するだけで、パルス幅変調出力を可能としている。 また前記構成に対して、カウントデータの設定できるレ
ジスタをもう1本追加するだけで、ソフトウェアにかか
る負担を低減できるパルス幅変調出力を可能としている
[Effects of the Invention] The present invention enables pulse width modulation output by simply adding a 1-bit register whose value is inverted by the overflow signal of the timer counter to a timer counter already configured on an integrated circuit. It is said that Moreover, by simply adding one more register that can set count data to the above configuration, pulse width modulation output that can reduce the burden on software is made possible.

【0020】さらに、パルス幅変調出力を必要としない
ユーザにはプログラム可能なタイマカウンタとして使用
できるため、汎用性が大きい。
Furthermore, it can be used as a programmable timer counter for users who do not require pulse width modulation output, so it has great versatility.

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

【図1】本発明の第1の実施例のパルス幅変調回路を示
すブロック図
FIG. 1 is a block diagram showing a pulse width modulation circuit according to a first embodiment of the present invention.

【図2】本発明の第2の実施例のパルス幅変調回路を示
すブロック図
FIG. 2 is a block diagram showing a pulse width modulation circuit according to a second embodiment of the present invention.

【図3】従来のパルス幅変調回路を示すブロック図[Figure 3] Block diagram showing a conventional pulse width modulation circuit

【符
号の説明】 10  タイマカウンタ 11  カウンタ 12  レジスタ 14  オーバーフロー検出回路 20  出力レジスタ 100  入力クロック 110  カウンタ出力 111  オーバーフロー信号 200  パルス幅変調出力
[Description of symbols] 10 Timer counter 11 Counter 12 Register 14 Overflow detection circuit 20 Output register 100 Input clock 110 Counter output 111 Overflow signal 200 Pulse width modulation output

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】プログラム可能なタイマカウンタと、前記
タイマカウンタのオーバーフロー信号で値が反転する1
ビットの出力レジスタを使用し、前記タイマカウンタの
応用出力としてパルス幅変調出力を可能としたパルス幅
変調回路。
1. A programmable timer counter, and a value inverted by an overflow signal of the timer counter.
A pulse width modulation circuit that uses a bit output register to enable pulse width modulation output as an applied output of the timer counter.
【請求項2】タイマカウンタに、交互にカウントデータ
をロードする2本のレジスタが付加された請求項1記載
のパルス幅変調回路。
2. The pulse width modulation circuit according to claim 1, wherein the timer counter is provided with two registers for alternately loading count data.
JP5211091A 1991-03-18 1991-03-18 Pulse width modulation circuit Pending JPH04287514A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5211091A JPH04287514A (en) 1991-03-18 1991-03-18 Pulse width modulation circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5211091A JPH04287514A (en) 1991-03-18 1991-03-18 Pulse width modulation circuit

Publications (1)

Publication Number Publication Date
JPH04287514A true JPH04287514A (en) 1992-10-13

Family

ID=12905727

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5211091A Pending JPH04287514A (en) 1991-03-18 1991-03-18 Pulse width modulation circuit

Country Status (1)

Country Link
JP (1) JPH04287514A (en)

Similar Documents

Publication Publication Date Title
US6434588B1 (en) Binary counter with low power consumption
JPH04287514A (en) Pulse width modulation circuit
JP2659186B2 (en) Digital variable frequency divider
JPS605097B2 (en) Gray code generation circuit
JPH0514186A (en) Pulse width modulation circuit
JPH03162121A (en) Pulse width modulating circuit
JPH04101535A (en) Interface circuit
KR0115033Y1 (en) Double pulse width modulator
KR0153112B1 (en) Counter enable to program
JPH0779247B2 (en) Decode circuit
JPH0331015B2 (en)
US6670823B2 (en) Detecting counter contents for time-critical applications
JPH0417489B2 (en)
JPH04271535A (en) Error rate alarm circuit with hysteresis
JPS6333805B2 (en)
JPH0831797B2 (en) Data pulse width conversion circuit
JPH07106954A (en) Pulse generating device
JPS61212112A (en) Timing generating circuit
JPH0422220A (en) Synchronous output circuit
JPH0795047A (en) Frequency divider circuit
JPH02201538A (en) Counter
JPH048015A (en) Counter circuit
JPH05343986A (en) Counter circuit
JPH04235619A (en) Information processor
JPH0481124A (en) Count number setting changeover system