JPH05314280A - Microcomputer - Google Patents
MicrocomputerInfo
- Publication number
- JPH05314280A JPH05314280A JP4121902A JP12190292A JPH05314280A JP H05314280 A JPH05314280 A JP H05314280A JP 4121902 A JP4121902 A JP 4121902A JP 12190292 A JP12190292 A JP 12190292A JP H05314280 A JPH05314280 A JP H05314280A
- Authority
- JP
- Japan
- Prior art keywords
- pwm waveform
- output
- data
- circuit
- switch
- 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
Links
Landscapes
- Microcomputers (AREA)
Abstract
(57)【要約】
【目的】 外部への出力を固定した後もCPU がPWM 波形
発生回路の出力データを認識し得るマイクロコンピュー
タを提供する。
【構成】 CPU からの制御信号S1 及びインバータ回路
8により反転された制御信号S1 バーにより作動するス
イッチSW1 , SW2 を入力側と出力側に備えるPWM 波形レ
ベル読み出しレジスタ2は、PWM 波形発生回路1の出力
データを保持し、読み出す場合はこの保持データをデー
タバス3へ与える。
(57) [Abstract] [Purpose] To provide a microcomputer in which the CPU can recognize the output data of the PWM waveform generation circuit even after fixing the output to the outside. [Structure] The PWM waveform level read register 2 is provided with switches SW 1 and SW 2 operated on the control signal S 1 from the CPU and the control signal S 1 bar inverted by the inverter circuit 8 on the input side and the output side. When the output data of the generation circuit 1 is held and read, the held data is given to the data bus 3.
Description
【0001】[0001]
【産業上の利用分野】本発明はパルス幅変調(以下PWM
という)波形を用いて外部回路を制御するマイクロコン
ピュータに関する。The present invention relates to pulse width modulation (hereinafter referred to as PWM
Called) a microcomputer for controlling an external circuit using a waveform.
【0002】[0002]
【従来の技術】マイクロコンピュータには、その内部に
PWM 波形発生回路を備えるものがあり、このPWM 波形発
生回路から出力されるPWM 波形を用いてマイクロコンピ
ュータ外部の回路を制御している場合、外部への出力を
例えば「H」に固定することによって、外部回路のPWM
波形による制御を中断する。この場合、PWM 波形発生回
路のみを用いて外部への出力を「H」に固定するには次
に出力されるPWM 波形のデューティ比を「H」 100%と
設定して出力する方法があるが、それでは次のPWM 波形
の出力からでないと「H」に固定することができず、迅
速にPWM 波形による外部制御を断つことが不可能であ
る。そこでPWM 波形固定レジスタを用いて「H」に固定
している。2. Description of the Related Art Microcomputers have internal
Some have a PWM waveform generation circuit, and when controlling the circuit outside the microcomputer using the PWM waveform output from this PWM waveform generation circuit, by fixing the output to the outside, for example, to "H" , External circuit PWM
Stop the waveform control. In this case, there is a method of setting the duty ratio of the next PWM waveform to be output as "H" 100% and fixing the output to "H" using only the PWM waveform generation circuit. However, it cannot be fixed at "H" unless the output of the next PWM waveform is output, and it is impossible to quickly cut off the external control by the PWM waveform. Therefore, it is fixed at “H” using the PWM waveform fixed register.
【0003】図3は従来のマイクロコンピュータの要部
の回路構成を示すブロック図である。図中1はPWM 波形
を発生するPWM 波形発生回路であり、ある周期のPWM 波
形を出力している間に次周期以降のPWM 波形のデューテ
ィ比を設定することができる。このPWM 波形発生回路1
のデータは、論理和回路5の一入力とされ、この論理和
は出力端子6から制御対象である外部回路へ出力され
る。この論理和回路5の他入力側へはPWM 波形固定レジ
スタ4のデータがスイッチSW4 を介して入力される。PW
M 波形固定レジスタ4が保持するデータはデータバス3
からスイッチSW3を介して入力される。このスイッチSW
3 はCPU(図示せず) が与える制御信号S2によりON/OFF
される。FIG. 3 is a block diagram showing a circuit configuration of a main part of a conventional microcomputer. In the figure, 1 is a PWM waveform generation circuit that generates a PWM waveform, and while outputting a PWM waveform of a certain cycle, the duty ratio of the PWM waveform of the next cycle or later can be set. This PWM waveform generation circuit 1
Is input to one input of the logical sum circuit 5, and this logical sum is output from the output terminal 6 to the external circuit to be controlled. The data of the PWM waveform fixed register 4 is input to the other input side of the OR circuit 5 through the switch SW 4 . PW
The data held by the M waveform fixed register 4 is the data bus 3
It is input via the switch SW 3 from. This switch SW
3 is turned on / off by control signal S 2 given by CPU (not shown)
To be done.
【0004】また前記スイッチSW4 の切換側端子は、一
方はPWM 波形固定レジスタ4に接続され、他方は接地さ
れている。そしてこのスイッチSW4 の共通側端子は論理
和回路5に接続されている。このスイッチSW4 の制御は
CPU が与える制御信号S3 により行われ、スイッチSW4
が前記一方側を選択している場合にPWM 波形固定レジス
タ4のデータは論理和回路5へ入力される。そして前述
の如くこのデータとPWM 波形発生回路1のデータとを入
力とする論理和回路5の論理和が出力端子6へ出力され
る。[0004] switching換側terminal of the switch SW 4 is one is connected to the PWM waveform fixed register 4 and the other is grounded. The common side terminal of the switch SW 4 is connected to the OR circuit 5. The control of this switch SW 4 is
It is performed by the control signal S 3 given by the CPU, and the switch SW 4
When the one side is selected, the data of the PWM waveform fixed register 4 is input to the logical sum circuit 5. Then, as described above, the logical sum of the logical sum circuit 5 which inputs this data and the data of the PWM waveform generating circuit 1 is output to the output terminal 6.
【0005】図4は図3に示す回路の動作を説明するた
めのタイミングチャートである。まず通常状態において
はスイッチSW4 が接地側端子を選択しており、論理和回
路5はPWM 波形発生回路1の出力データとスイッチSW4
からの「L」との論理和を出力する。即ち、PWM 波形発
生回路1の出力データが出力端子6へ出力される。FIG. 4 is a timing chart for explaining the operation of the circuit shown in FIG. First, in the normal state, the switch SW 4 selects the ground side terminal, and the OR circuit 5 outputs the output data of the PWM waveform generation circuit 1 and the switch SW 4
Outputs the logical sum with "L". That is, the output data of the PWM waveform generation circuit 1 is output to the output terminal 6.
【0006】外部への出力を固定する場合はCPU が前記
制御信号S2 によりスイッチSW3 をONすると共に、デー
タバス3に「H」をのせると、この「H」がPWM 波形固
定レジスタ4へ入力される。さらにCPU は前記制御信号
S3 によりスイッチSW4 にPWM 波形固定レジスタ4側端
子を選択させるとPWM 波形固定レジスタ4の「H」が論
理和回路5へ入力される。そして論理和回路5はPWM 波
形発生回路1の出力データとPWM 波形固定レジスタ4の
「H」との論理和である「H」を出力端子6へ出力す
る。即ち、外部への出力は「H」に固定される。When fixing the output to the outside, when the CPU turns on the switch SW 3 by the control signal S 2 and puts "H" on the data bus 3, this "H" is changed to the PWM waveform fixed register 4 Is input to. Further, when the CPU causes the switch SW 4 to select the terminal on the PWM waveform fixed register 4 side by the control signal S 3 , “H” of the PWM waveform fixed register 4 is input to the OR circuit 5. The logical sum circuit 5 outputs "H" which is the logical sum of the output data of the PWM waveform generating circuit 1 and "H" of the PWM waveform fixed register 4 to the output terminal 6. That is, the output to the outside is fixed at "H".
【0007】[0007]
【発明が解決しようとする課題】ところが上述の如くPW
M 波形固定レジスタを用いた場合、外部への出力の固定
を解除して、本来のPWM 波形へ戻す際、CPU はPWM 波形
発生回路の出力データを認識することができないため、
PWM 波形発生回路を初期化する必要があった。本発明は
斯かる事情に鑑みてなされたものであり、外部への出力
の固定を解除する場合にPWM 波形発生回路の出力データ
をCPU が認識し得るマイクロコンピュータの提供を目的
とする。However, as mentioned above, the PW
When the M waveform fixed register is used, the CPU cannot recognize the output data of the PWM waveform generation circuit when releasing the fixed output to the outside and returning to the original PWM waveform.
It was necessary to initialize the PWM waveform generation circuit. The present invention has been made in view of such circumstances, and an object thereof is to provide a microcomputer in which the CPU can recognize the output data of the PWM waveform generation circuit when the fixation of the output to the outside is released.
【0008】[0008]
【課題を解決するための手段】本発明に係るマイクロコ
ンピュータは、PWM 波形発生回路から出力されるデータ
を保持するレジスタを備え、外部への出力の固定を解除
する場合、この保持データをCPU が読み出し得る回路構
成となしてある。A microcomputer according to the present invention is provided with a register for holding data output from a PWM waveform generation circuit, and when releasing the fixation of the output to the outside, the CPU holds this held data. It has a readable circuit configuration.
【0009】[0009]
【作用】本発明のマイクロコンピュータにおいては、PW
M 波形発生回路の出力データを保持することができるの
で、外部への出力の固定を解除する場合、CPU はこの保
持データを読み出すことによりこのデータを認識し得、
PWM 波形発生回路を初期化する必要がない。In the microcomputer of the present invention, the PW
Since the output data of the M waveform generation circuit can be held, the CPU can recognize this data by reading the held data when releasing the fixed output to the outside.
It is not necessary to initialize the PWM waveform generation circuit.
【0010】[0010]
【実施例】以下本発明をその実施例を示す図面に基づい
て説明する。図1は本発明に係るマイクロコンピュータ
の要部の回路構成を示すブロック図である。図中1はPW
M 波形を発生するPWM 波形発生回路であり、このPWM 波
形発生回路1の出力データは論理和回路5へは直接、ま
たこの出力データを保持するPWM 波形レベル読み出しレ
ジスタ2へはスイッチSW1 を介して入力される。そして
このPWM 波形レベル読み出しレジスタ2のデータはスイ
ッチSW2 を介してデータバス3へ出力される。DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to the drawings showing the embodiments thereof. FIG. 1 is a block diagram showing a circuit configuration of a main part of a microcomputer according to the present invention. 1 in the figure is PW
This is a PWM waveform generation circuit that generates M waveforms. The output data of this PWM waveform generation circuit 1 is directly to the OR circuit 5, and to the PWM waveform level read register 2 that holds this output data via switch SW 1 . Is entered. Then, the data of the PWM waveform level read register 2 is output to the data bus 3 via the switch SW 2 .
【0011】このスイッチSW2 へは図示しないCPU から
の制御信号S1 がそのまま入力され、スイッチSW1 へは
インバータ回路8を経て反転された制御信号S1 バーが
入力される。CPU が外部への出力を固定するためのデー
タをデータバス3にのせると、このデータはスイッチSW
3 を介してPWM 波形固定レジスタ4へ入力され保持され
る。[0011] This is to switch SW 2 is control signals S 1 from an unillustrated CPU is directly input, the control signals S 1 bar which is inverted through an inverter circuit 8 is inputted to the switch SW 1. When the CPU puts the data for fixing the output to the outside on the data bus 3, this data is switched SW.
It is input to PWM waveform fixed register 4 via 3 and held.
【0012】このスイッチSW3 はCPU が与える制御信号
S2 によりON/OFF される。そしてこのPWM 波形固定レ
ジスタ4のデータはスイッチSW4 を経て論理和回路5へ
入力される。このスイッチSW4 の切換側端子は一方はPW
M 波形固定レジスタ4に接続され、他方は接地されてお
り、このスイッチSW4 はCPU からの制御信号S3 により
制御される。そしてこのスイッチSW4 からのデータとPW
M 波形発生回路1の出力データとを入力とする論理和回
路5の論理和が出力端子6から制御対象である外部回路
へ出力される。This switch SW 3 is turned on / off by a control signal S 2 provided by the CPU. Then, the data of the PWM waveform fixed register 4 is input to the OR circuit 5 via the switch SW 4 . One of the switching side terminals of this switch SW 4 is PW
The switch SW 4 is connected to the M waveform fixed register 4 and the other is grounded. The switch SW 4 is controlled by the control signal S 3 from the CPU. And the data from this switch SW 4 and PW
The logical sum of the logical sum circuit 5 that receives the output data of the M waveform generation circuit 1 as an input is output from the output terminal 6 to the external circuit that is the control target.
【0013】図2は図1に示す回路の動作を説明するた
めのタイミングチャートである。通常状態においては、
図2(ニ)で示す如くスイッチSW4 は接地側端子を選択
しており、論理和回路5はPWM 波形発生回路1の出力デ
ータとスイッチSW4 の「L」との論理和を出力する。即
ち、図2 (イ) で示すPWM 波形発生回路1の出力データ
が出力端子6へ出力される(図2(ホ))。このとき、
スイッチSW3 はOFF である。またスイッチSW1 はON、ス
イッチSW2 はOFF であり、図2 (ハ) で示す如くPWM 波
形レベル読み出しレジスタ2はPWM 波形発生回路1の出
力データを保持し、この保持データはPWM 波形発生回路
1の出力データの変化と共に変化していく。FIG. 2 is a timing chart for explaining the operation of the circuit shown in FIG. Under normal conditions,
As shown in FIG. 2D, the switch SW 4 selects the ground side terminal, and the OR circuit 5 outputs the OR of the output data of the PWM waveform generating circuit 1 and “L” of the switch SW 4 . That is, the output data of the PWM waveform generation circuit 1 shown in FIG. 2A is output to the output terminal 6 (FIG. 2E). At this time,
Switch SW 3 is off. The switch SW 1 is on and the switch SW 2 is off. As shown in Fig. 2 (c), the PWM waveform level read register 2 holds the output data of the PWM waveform generation circuit 1, and this held data is the PWM waveform generation circuit. It changes as the output data of 1 changes.
【0014】次に外部への出力を固定する場合はCPU が
制御信号S2 によりスイッチSW3 をONすると共に、デー
タバス3に「H」をのせる。そうすると図2(ロ)で示
す如くこの「H」はPWM 波形固定レジスタ4へ入力され
る。さらにCPU は制御信号S3 によりスイッチSW4 にPW
M 波形固定レジスタ4側端子を選択させる。これにより
PWM 波形固定レジスタ4の「H」が論理和回路5へ入力
され、図2(ホ)で示す如く出力端子6の出力は「H」
に固定される。このように外部への出力を固定した後も
PWM 波形レベル読み出しレジスタ2においては図2
(ハ)に示す如くPWM 波形発生回路1の出力データ(図
2(イ))を順次保持していく。Next, when fixing the output to the outside, the CPU turns on the switch SW 3 by the control signal S 2 and puts "H" on the data bus 3. Then, as shown in FIG. 2B, this "H" is input to the PWM waveform fixed register 4. Further, the CPU sends PW to the switch SW 4 by the control signal S 3.
M Selects the waveform fixed register 4 side terminal. This
"H" of the PWM waveform fixed register 4 is input to the logical sum circuit 5, and the output of the output terminal 6 is "H" as shown in FIG.
Fixed to. Even after fixing the output to the outside like this
Figure 2 shows the PWM waveform level read register 2.
As shown in (c), the output data of the PWM waveform generation circuit 1 (Fig. 2 (a)) is held sequentially.
【0015】保持データを読み出す場合は、CPU が制御
信号S1 によりスイッチSW1 をOFFし、スイッチSW2 をO
Nすると、この保持データはデータバス3へ与えられ、C
PUはPWM 波形発生回路1の出力データを認識し得る。こ
のようにして認識したデータをCPU が判断し、固定を解
除することとした場合、CPU は制御信号S3 によりスイ
ッチSW4 に接地側端子を選択させる。そうすると前記通
常状態と同様PWM 波形発生回路1の出力データが出力端
子6より外部へ出力される。When reading the held data, the CPU turns off the switch SW 1 and turns on the switch SW 2 by the control signal S 1.
When N, this held data is given to the data bus 3 and C
The PU can recognize the output data of the PWM waveform generation circuit 1. When the CPU judges the data recognized in this way and decides to release the fixation, the CPU causes the switch SW 4 to select the ground side terminal by the control signal S 3 . Then, as in the normal state, the output data of the PWM waveform generating circuit 1 is output from the output terminal 6 to the outside.
【0016】一方、CPU が予めPWM 波形発生回路1の出
力データを認識することなく固定の解除を行うことも考
えられる。この場合もCPU は固定解除時のPWM 波形発生
回路1の出力データを認識することができる。なお、本
実施例のPWM 波形読み出しレジスタ2の入出力側には作
動状態が逆となるスイッチSW1 , SW2 を備えるので、こ
のデータを読み出し中にデータが変化して読み出しが不
定になることがない。On the other hand, it may be considered that the CPU releases the fixation without recognizing the output data of the PWM waveform generating circuit 1 in advance. In this case as well, the CPU can recognize the output data of the PWM waveform generation circuit 1 when the fixation is released. Since the PWM waveform read register 2 of the present embodiment is provided with switches SW 1 and SW 2 on the input and output sides, the operating states of which are reversed, the data changes during the reading of the data and the reading becomes undefined. There is no.
【0017】[0017]
【発明の効果】以上説明したように本発明に係るマイク
ロコンピュータではPWM 波形レベル読み出しレジスタを
備えているので、外部への出力を固定した後もPWM 波形
発生回路の出力データを保持することができる。そして
この保持データをデータバスへ与えることによりCPU は
このデータを認識し得るのでPWM 波形発生回路を初期化
することなく固定解除が行える等本発明は優れた効果を
奏する。As described above, since the microcomputer according to the present invention is provided with the PWM waveform level read register, the output data of the PWM waveform generation circuit can be held even after the output to the outside is fixed. .. The CPU can recognize this data by giving the held data to the data bus, so that the present invention has an excellent effect such that the fixation can be released without initializing the PWM waveform generating circuit.
【図1】本発明に係るマイクロコンピュータの要部の回
路構成を示すブロック図である。FIG. 1 is a block diagram showing a circuit configuration of a main part of a microcomputer according to the present invention.
【図2】図1に示す回路の動作を説明するためのタイミ
ングチャートである。FIG. 2 is a timing chart for explaining the operation of the circuit shown in FIG.
【図3】従来のマイクロコンピュータの要部の回路構成
を示すブロック図である。FIG. 3 is a block diagram showing a circuit configuration of a main part of a conventional microcomputer.
【図4】図3に示す回路の動作を説明するためのタイミ
ングチャートである。FIG. 4 is a timing chart for explaining the operation of the circuit shown in FIG.
1 PWM 波形発生回路 2 PWM 波形レベル読み出しレジスタ 4 PWM 波形固定レジスタ 5 論理和回路 8 インバータ回路 1 PWM waveform generation circuit 2 PWM waveform level read register 4 PWM waveform fixed register 5 Logical sum circuit 8 Inverter circuit
Claims (1)
路の出力データを一入力とする論理和回路と、該論理和
回路の出力の固定を行うためのデータを保持し、前記論
理和回路の他入力側へ前記データを与えるレジスタとを
備えるマイクロコンピュータにおいて、 前記PWM 波形発生回路の出力データを保持するレジスタ
を備え、該レジスタの保持データをCPU が読み出し得る
回路構成となしてあることを特徴とするマイクロコンピ
ュータ。1. A PWM waveform generation circuit, a logical sum circuit that receives output data of the PWM waveform generation circuit as one input, and data for fixing the output of the logical sum circuit. In a microcomputer provided with a register for giving the data to the other input side, a register for holding the output data of the PWM waveform generation circuit is provided, and the circuit configuration is such that the CPU can read the data held in the register. Characteristic microcomputer.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4121902A JPH05314280A (en) | 1992-05-14 | 1992-05-14 | Microcomputer |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4121902A JPH05314280A (en) | 1992-05-14 | 1992-05-14 | Microcomputer |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH05314280A true JPH05314280A (en) | 1993-11-26 |
Family
ID=14822741
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP4121902A Pending JPH05314280A (en) | 1992-05-14 | 1992-05-14 | Microcomputer |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH05314280A (en) |
-
1992
- 1992-05-14 JP JP4121902A patent/JPH05314280A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0487743B1 (en) | Microcomputer provided with built-in converter | |
| US6421382B1 (en) | Pulse width modulation signal generator | |
| JP2550837B2 (en) | Scan path test control circuit | |
| US20250038742A1 (en) | Pwm circuit, apparatus including the same | |
| JPH05314280A (en) | Microcomputer | |
| EP0481486B1 (en) | Stepping motor control circuit | |
| JPH08179857A (en) | Reset circuit | |
| US7945718B2 (en) | Microcontroller waveform generation | |
| US6384640B1 (en) | Pulse generator for indicating a change in the magnitude of an input signal | |
| JPH0562784B2 (en) | ||
| JP3101491B2 (en) | Display drive circuit | |
| JP2972417B2 (en) | Test circuit | |
| JPH10290142A (en) | Semiconductor integrated circuit flip-flop circuit and clock control circuit | |
| JPS61140876A (en) | Semiconductor integrated circuit device | |
| JP3342044B2 (en) | Pulse generation circuit | |
| JPH05217006A (en) | Semiconductor integrated circuit | |
| KR200360607Y1 (en) | Weight generation circuit | |
| JPH0758891B2 (en) | Pulse width modulator | |
| JPH08195654A (en) | Clock regenerating circuit | |
| JP3160331B2 (en) | Pulse width modulator | |
| JP3137089B2 (en) | Microcomputer | |
| JPH02297683A (en) | Microcomputer | |
| JPH02266408A (en) | Stand-by mode circuit | |
| JPH05324863A (en) | Microcomputer | |
| JPH0548581A (en) | Method for parity attachment |