JPH04215112A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH04215112A
JPH04215112A JP2401774A JP40177490A JPH04215112A JP H04215112 A JPH04215112 A JP H04215112A JP 2401774 A JP2401774 A JP 2401774A JP 40177490 A JP40177490 A JP 40177490A JP H04215112 A JPH04215112 A JP H04215112A
Authority
JP
Japan
Prior art keywords
clock
microcomputer
terminal
input
stop state
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
JP2401774A
Other languages
Japanese (ja)
Other versions
JP2705311B2 (en
Inventor
Hiroko Mihira
三平 裕子
Tsuyoshi Katayose
片寄 強
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP2401774A priority Critical patent/JP2705311B2/en
Publication of JPH04215112A publication Critical patent/JPH04215112A/en
Application granted granted Critical
Publication of JP2705311B2 publication Critical patent/JP2705311B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To stop or start to supply the operation clock to a microcomputer which is generated externally. CONSTITUTION:A flip flop 110 is set when the microcomputer is set to the stop state, and it is reset when the microcomputer is released from the stop state. In accordance with the output value of this flip flop 110, a transfer gate 115 is turned on and a transfer gate 114 is turned off to stop the generation of an internal clock when the microcomputer is in the stop state. When the microcomputer is released from the stop state, the transfer gate 115 is turned off and the transfer gate 114 is turned on to start the generation of the internal clock. The output value of the flip flop 110 is outputted to the external also to stop or start the supply of the external clock or the clock generation itself.

Description

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

【0001】0001

【産業上の利用分野】本発明は、スタンバイ機能を備え
、さらに外部のクリスタル振動子、あるいは外部のクロ
ック生成回路からの入力に基づき、動作するためのクロ
ックを内部で生成するタイプのマイクロコンピュータに
関する。
[Field of Industrial Application] The present invention relates to a type of microcomputer that has a standby function and further generates a clock for operation based on input from an external crystal oscillator or an external clock generation circuit. .

【0002】0002

【従来の技術】マイクロコンピュータ(以下マイコンと
いう)にはシングルチップ・マイコン(あるいはワンチ
ップ・マイコン等)と呼ばれる、周辺回路を内蔵するタ
イプがある。周辺回路としては、割り込みコントローラ
、DMA(ダイレクト・メモリ・アクセス)コントロー
ラ、タイマ、シリアル・インターフェース等があり、各
種システムの制御を行っている。
2. Description of the Related Art Microcomputers (hereinafter referred to as microcomputers) include a type called a single-chip microcomputer (or one-chip microcomputer, etc.) that has a built-in peripheral circuit. Peripheral circuits include interrupt controllers, DMA (direct memory access) controllers, timers, serial interfaces, etc., and control various systems.

【0003】マイコンには、通常スタンバイ機能と呼ば
れる機能が備えられている。例えば、マイコンを応用し
たシステム装置としてプリンタを想定した場合、パソコ
ン等の外部機器からのデータを受け取り、受け取ったデ
ータをマイコンが処理した後、印字部に受渡し印字処理
を行なうといった制御処理が行われる。こうした場合、
外部機器からデータが送られてきたときのみマイコンは
上記の動作を行ない、それ以外の時には消費電力を削減
するためにマイコン内部に供給されているクロックを止
め内部の動作を停止するスタンバイ機能がマイコンに備
えられている。以下に、上記スタンバイ機能を備えた従
来のマイコンについて詳細に説明する。
[0003] Microcomputers are usually equipped with a function called a standby function. For example, if we assume a printer as a system device that uses a microcomputer, control processing is performed such as receiving data from an external device such as a personal computer, processing the received data by the microcomputer, and then passing it to the printing unit for printing processing. . In these cases,
The microcontroller performs the above operations only when data is sent from an external device, and at other times, the microcontroller has a standby function that stops the clock supplied to the microcontroller and stops internal operations in order to reduce power consumption. It is prepared for. Below, a conventional microcomputer equipped with the above-mentioned standby function will be explained in detail.

【0004】図4は従来のシステム装置300の構成を
示す。システム装置300は、マイコン301と、タイ
マ等の各種周辺装置320,321と、上記マイコン3
01を動作させるためのクロックを上記マイコンが発生
するためのクリスタル振動子305とを含んでいる。
FIG. 4 shows the configuration of a conventional system device 300. The system device 300 includes a microcomputer 301, various peripheral devices 320, 321 such as timers, and the microcomputer 3
01, and a crystal oscillator 305 for the microcomputer to generate a clock for operating the microcomputer.

【0005】マイコン301は、CPU302と、タイ
マ,シリアル・インターフェース等の内蔵周辺回路30
3と、マイコン301全体を動作させるため上記CPU
302および上記内蔵周辺回路303に対して供給され
るシステム・クロックを発生するクロック制御回路30
4とから構成されている。
The microcomputer 301 includes a CPU 302 and built-in peripheral circuits 30 such as a timer and a serial interface.
3, and the above CPU to operate the entire microcomputer 301.
302 and a clock control circuit 30 that generates a system clock supplied to the built-in peripheral circuit 303.
It is composed of 4.

【0006】CPU302および内蔵周辺回路303は
、上記クロック制御回路304から供給されるシステム
クロックを基準として、それぞれ各種命令の実行、また
は各周辺機能特有の制御が行われている。なお、CPU
302と内蔵周辺回路303とは、不図示の内部バスに
より接続されている。
The CPU 302 and built-in peripheral circuit 303 each execute various instructions or perform control specific to each peripheral function based on the system clock supplied from the clock control circuit 304. In addition, the CPU
302 and the built-in peripheral circuit 303 are connected by an internal bus (not shown).

【0007】次に、クロック制御回路304の動作につ
いて説明する。クロック制御回路304は、X1端子3
30,X2端子331にクリスタル振動子305を接続
した場合に、抵抗306およびインバータ307により
信号線308上にクロックを得る構成となっている。こ
の信号線308上に得られたクロックは、CLKOUT
端子332から出力して外部の周辺装置320,321
へ供給されると共に、分周器311で分周されてCPU
302を始めとしてマイコン301全体に供給される。
Next, the operation of clock control circuit 304 will be explained. The clock control circuit 304 has an X1 terminal 3
When the crystal resonator 305 is connected to the 30, The clock obtained on this signal line 308 is CLKOUT
Output from terminal 332 to external peripheral devices 320, 321
The frequency is divided by the frequency divider 311 and the CPU
The signal is supplied to the entire microcomputer 301 starting from 302.

【0008】ここで、セット/リセット型のフリップ・
フロップ310は、マイコン301がマイコン301全
体に対するシステム・クロックの供給を停止する状態(
以下STOP状態という)であることを示すフリップ・
フロップである。CPU302は、STOP命令を実行
するとマイコン301内部の動作状態がSTOP状態に
遷移することが可能な状態になるまで待ち合わせを行な
う。マイコン301内部がSTOP状態に遷移すること
が可能となったとき、CPU302は信号309を活性
化する。信号309が活性化されたことによりフリップ
・フロップ310はセットされる。逆に、RESET端
子334からのリセット信号やNMI端子335からの
ノン・マスカブル割込み要求信号等のSTOP状態を解
除する信号が入力された場合、フリップ・フロップ31
0はリセットされる。マイコン301がSTOP状態に
遷移しようとすると、フリップ・フロップ310がセッ
トされるため、インバータ316の出力が“0”となる
。このため、NANDゲート317の出力値が“1”と
なり、信号線308上に得られていたクロックはマスク
され出力されない。したがって、バッファ318を介し
て出力されるCLKOUT端子332からの出力値は“
1”となる。一方、STOP状態を解除しようとすると
フリップ・フロップ310がリセットされるためインバ
ータ316の出力値が“1”となる。このため、CLK
OUT端子332からは信号線308上に得られていた
クロックがそのまま出力される。
[0008] Here, set/reset type flip
The flop 310 is in a state where the microcomputer 301 stops supplying the system clock to the entire microcomputer 301 (
Flip to indicate the STOP state).
It's a flop. When the CPU 302 executes the STOP command, the CPU 302 waits until the internal operating state of the microcomputer 301 reaches a state where it can transition to the STOP state. When it becomes possible for the inside of the microcomputer 301 to transition to the STOP state, the CPU 302 activates the signal 309. Flip-flop 310 is set by activation of signal 309. Conversely, if a signal to cancel the STOP state, such as a reset signal from the RESET terminal 334 or a non-maskable interrupt request signal from the NMI terminal 335, is input, the flip-flop 31
0 is reset. When the microcomputer 301 attempts to transition to the STOP state, the flip-flop 310 is set, so the output of the inverter 316 becomes "0". Therefore, the output value of the NAND gate 317 becomes "1", and the clock obtained on the signal line 308 is masked and is not output. Therefore, the output value from the CLKOUT terminal 332 via the buffer 318 is “
1". On the other hand, when attempting to release the STOP state, the flip-flop 310 is reset and the output value of the inverter 316 becomes "1". Therefore, the CLK
The clock obtained on the signal line 308 is output as is from the OUT terminal 332.

【0009】また、トランスファ・ゲート314,31
5はマイコン301がSTOP状態になったときに信号
線312,313が中間レベルとなることを防止するた
めに設けられたものである。マイコン301がSTOP
状態に遷移しようとしフリップ・フロップ310の出力
値が“1”となると、トランスファ・ゲート315がO
Nするため、信号線312はロウ・レベルに固定される
。一方、トランスファ・ゲート314はOFFするため
信号線313はハイ・レベルに固定される。
[0009] Also, transfer gates 314, 31
5 is provided to prevent the signal lines 312 and 313 from reaching an intermediate level when the microcomputer 301 enters the STOP state. Microcomputer 301 is STOP
When the output value of the flip-flop 310 becomes "1", the transfer gate 315 becomes O.
Therefore, the signal line 312 is fixed at a low level. On the other hand, since the transfer gate 314 is turned off, the signal line 313 is fixed at a high level.

【0010】上述のようにして、マイコン301が通常
状態である場合にはCLKOUT端子332からはクロ
ックが出力し、マイコン301がSTOP状態になった
場合にはクロック出力を停止するようにクロック制御回
路304は制御を行っている。
As described above, the clock control circuit outputs a clock from the CLKOUT terminal 332 when the microcomputer 301 is in the normal state, and stops the clock output when the microcomputer 301 is in the STOP state. 304 is controlling.

【0011】ここで、クロック制御回路304は図5に
示すように、クリスタル振動子の代わりに、外部のクロ
ック生成回路405からクロックを入力する場合にも適
用できる構成を採っている。この場合、外部クロック生
成回路405で生成したクロックをX1端子330に入
力し、X2端子331にはX1端子330に入力したク
ロックと反転したクロックを入力することが一般的にな
されており、信号線308上にはX2端子331から入
力したクロックと同相のクロックを得ることができる。 また、外部クロック生成回路405を用いた場合にもク
リスタル振動子305と同様、マイコン301がSTO
P状態になった場合にはクロック制御回路304の制御
によりCLKOUT端子332からのクロック出力は停
止する。
Here, as shown in FIG. 5, the clock control circuit 304 has a configuration that can be applied to a case where a clock is input from an external clock generation circuit 405 instead of a crystal resonator. In this case, it is common practice to input the clock generated by the external clock generation circuit 405 to the X1 terminal 330, and input the inverted clock of the clock input to the X1 terminal 330 to the X2 terminal 331. A clock having the same phase as the clock input from the X2 terminal 331 can be obtained on the X2 terminal 308 . Also, when the external clock generation circuit 405 is used, the microcomputer 301 can also
When the P state is reached, the clock output from the CLKOUT terminal 332 is stopped under the control of the clock control circuit 304.

【0012】また、従来の技術においては、命令のエミ
ュレーション機能を備え、マイコンがSTOP状態であ
ることを示すステータスを出力するマイコンもある。こ
ういったマイコンの場合、CPUがSTOP命令を実行
してもマイコン内部のクロック生成部におけるクロック
の発生を停止させず、CPUがSTOP命令を実行した
ときに命令をデコードしてSTOP状態となったことを
示すステータス信号をCPUが活性化していた。また、
RESET端子またはNMI端子から入力信号が入力さ
れたときクロック生成部より動作クロックの供給を開始
した後、STOP状態が解除されたことを示すCPUス
テータス信号を非活性化状態にする方式をとっていた。
Furthermore, in the prior art, some microcomputers are equipped with an instruction emulation function and output a status indicating that the microcomputer is in the STOP state. In the case of such microcontrollers, even when the CPU executes a STOP instruction, the clock generation section inside the microcontroller does not stop generating the clock, and when the CPU executes the STOP instruction, the instruction is decoded and the STOP state is entered. The CPU activated a status signal indicating this. Also,
When an input signal is input from the RESET terminal or the NMI terminal, the clock generation section starts supplying the operating clock and then deactivates the CPU status signal indicating that the STOP state has been released. .

【0013】[0013]

【発明が解決しようとする課題】上述した従来のクロッ
ク制御回路を備えたマイクロコンピュータにおいて、上
述したようにマイコンがSTOP状態に入ると、トラン
スファ・ゲート315がONしトランスファ・ゲート3
14がOFFすることによって、信号線312がロウ・
レベルに、信号線313がハイ・レベルに固定されこれ
らの信号線が中間レベルにならないようにしている。こ
こで、外部クロック生成回路405からクロックを入力
した場合、マイコン301がSTOP状態に入っている
ときにも、外部クロック生成回路405で生成されたク
ロックがX1端子303,X2端子331から入力され
ている。ところが、X1端子330から入力されるクロ
ックのレベルがハイ・レベルとなった場合、トランスフ
ァ・ゲート315がONしているため信号線312に膨
大な電流が流れ、短絡を起こしてしまうといった問題点
がある。
[Problems to be Solved by the Invention] In the microcomputer equipped with the conventional clock control circuit described above, when the microcomputer enters the STOP state as described above, the transfer gate 315 is turned on and the transfer gate 3
14 turns off, the signal line 312 goes low.
The signal line 313 is fixed at a high level to prevent these signal lines from reaching an intermediate level. Here, when the clock is input from the external clock generation circuit 405, the clock generated by the external clock generation circuit 405 is input from the X1 terminal 303 and the X2 terminal 331 even when the microcomputer 301 is in the STOP state. There is. However, when the level of the clock input from the X1 terminal 330 becomes high level, a huge amount of current flows through the signal line 312 because the transfer gate 315 is ON, causing a short circuit. be.

【0014】また、マイコン内部がSTOP状態に入っ
ても外部クロック生成回路405はクロックの生成を停
止しない。そこで、マイコンがSTOP状態に入るとC
LKOUT端子332の出力が“1”になることを利用
して、CLKOUT端子をモニタし、“1”を出力し続
けることを検知したときに外部クロック生成回路を停止
することができる。ところが、外部クロック生成回路4
05を停止することができたとしても、マイコンのST
OP状態が解除されたことをリアルタイムに検知する手
段がないため、外部クロック生成回路405の動作を再
開することができず、結果的に、マイコンがSTOP状
態に入ったときに外部クロック生成回路405を停止す
ることができなかった。
Furthermore, even if the inside of the microcomputer enters the STOP state, the external clock generation circuit 405 does not stop generating clocks. Therefore, when the microcontroller enters the STOP state, C
Using the fact that the output of the LKOUT terminal 332 becomes "1", the CLKOUT terminal can be monitored and the external clock generation circuit can be stopped when it is detected that it continues to output "1". However, the external clock generation circuit 4
Even if it is possible to stop 05, the ST of the microcomputer
Since there is no means to detect in real time that the OP state has been released, the operation of the external clock generation circuit 405 cannot be restarted, and as a result, when the microcontroller enters the STOP state, the external clock generation circuit 405 cannot be restarted. could not be stopped.

【0015】また、命令のエミュレーション機能を備え
、マイコンがSTOP状態であることを示すステータス
を出力するマイコンにおいて、外部クロック生成回路を
用いてシステム・クロックを供給する場合、上記と同様
、STOP状態を示すステータスをマイコン外部で判断
して外部クロック生成回路を停止することはできるが、
マイコンのSTOP状態が解除されたことを外部でリア
ルタイムに検知する手段がないため、この場合にも外部
クロック生成回路の動作を再開することができなかった
。そのため、STOP状態に入っても消費電力を低減す
ることができないといった問題が生じていた。
[0015] Furthermore, in a microcontroller that has an instruction emulation function and outputs a status indicating that the microcontroller is in the STOP state, when an external clock generation circuit is used to supply the system clock, the STOP state is detected as described above. Although it is possible to judge the indicated status externally to the microcontroller and stop the external clock generation circuit,
Since there is no means for externally detecting in real time that the STOP state of the microcomputer has been released, the operation of the external clock generation circuit could not be resumed in this case as well. Therefore, a problem has arisen in that power consumption cannot be reduced even if the STOP state is entered.

【0016】[0016]

【課題を解決するための手段】本発明のマイクロコンピ
ュータは、マイクロコンピュータが動作するためのシス
テム・クロックを該マイクロコンピュータ内部で発生す
る場合と、外部のクロック発生回路からシステム・クロ
ックを入力した場合とのいずれの場合にも、システム・
クロックを供給できる構成をもったクロック発生手段を
備えたマイクロコンピュータにおいて、マイクロコンピ
ュータの命令により上記クロック発生回路がシステム・
クロックの供給を停止する状態になったときにセットさ
れ、外部からの入力信号によりシステム・クロックの供
給を再び開始するときにリセットされる保持手段と、上
記保持手段の内容を外部に出力する出力手段と、上記出
力手段からの出力値を外部で判断することにより、シス
テム・クロックをマイクロコンピュータ内部で発生する
場合と外部のクロック発生回路からシステム・クロック
を入力した場合とのいずれの場合にも、マイクロコンピ
ュータの命令により前記クロック発生手段によるシステ
ム・クロックの発生を停止する手段と、上記出力手段か
らの出力値を外部で判別することにより、システム・ク
ロックをマイクロコンピュータ内部で発生する場合と外
部のクロック発生回路からシステム・クロックを入力し
た場合とのいずれの場合にも、外部からの入力信号によ
り前記クロック発生手段によるシステム・クロックの発
生を再び開始する手段とを有している。
[Means for Solving the Problems] The microcomputer of the present invention can generate a system clock for its operation internally, or input the system clock from an external clock generation circuit. In either case, the system
In a microcomputer equipped with a clock generation means configured to supply a clock, the clock generation circuit is activated by a command from the microcomputer.
Holding means that is set when the clock supply is stopped and reset when the system clock supply is restarted by an external input signal, and an output that outputs the contents of the holding means to the outside. By externally determining the output value from the output means, the system clock can be generated internally in the microcomputer, or the system clock can be input from an external clock generation circuit. , a means for stopping the generation of the system clock by the clock generating means in response to an instruction from the microcomputer, and a means for determining the output value from the output means externally, thereby determining whether the system clock is generated internally in the microcomputer or externally. In either case, the system clock is inputted from the clock generating circuit of the clock generating circuit, and means for restarting the generation of the system clock by the clock generating means in response to an input signal from the outside.

【0017】したがって、外部のクロック発生手段から
クロックを入力した場合に、マイクロコンピュータがS
TOP状態となったこと、あるいはSTOP状態が解除
されたことを外部で検出し、マイクロコンピュータに対
し、外部で生成したクロックの供給を停止、あるいはク
ロックの供給を再開することができる。
Therefore, when a clock is input from an external clock generating means, the microcomputer
It is possible to detect externally that the TOP state has been reached or that the STOP state has been released, and to stop or restart the supply of an externally generated clock to the microcomputer.

【0018】[0018]

【実施例】以下、図面により本発明の実施例を詳述する
Embodiments Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

【0019】本発明のマイクロコンピュータの第1の実
施例について第1図を用いて説明する。システム装置1
00は、マイコン101と、タイマ等の各種周辺装置1
20,121と、上記マイコン101を動作させるため
のクロックを生成しマイコン301に対して供給する外
部クロック生成回路105とを含んでいる。
A first embodiment of the microcomputer of the present invention will be described with reference to FIG. System device 1
00 is a microcomputer 101 and various peripheral devices 1 such as timers.
20, 121, and an external clock generation circuit 105 that generates a clock for operating the microcomputer 101 and supplies it to the microcomputer 301.

【0020】マイコン101は、CPU102と、タイ
マ,シリアル・インターフェース等の内蔵周辺装置10
3と、マイコン101全体を動作させるために上記CP
U102および内蔵周辺回路103に供給してシステム
・クロックを発生するクロック制御回路104とから構
成されている。
The microcomputer 101 includes a CPU 102 and built-in peripheral devices 10 such as a timer and a serial interface.
3, and the above CP in order to operate the entire microcomputer 101.
The clock control circuit 104 supplies a system clock to U102 and built-in peripheral circuit 103 to generate a system clock.

【0021】CPU102は上記クロック制御回路10
4から供給されたシステムクロックを基準として各種命
令の実行を行っている。また、内蔵周辺回路103は、
例えばタイマである場合には上記システムクロックを元
にタイマ・カウンタを計数したり、例えばシリアル・イ
ンターフェースである場合には上記システムクロックを
元にシリアルデータを入出力する等、クロック制御回路
104から供給されるシステムクロックを基準とした制
御が行われている。なお、CPU102と内蔵周辺回路
103とは、不図示の内部バスにより接続されている。
[0021] The CPU 102 is the clock control circuit 10 described above.
Various instructions are executed based on the system clock supplied from 4. Moreover, the built-in peripheral circuit 103 is
For example, in the case of a timer, the timer counter counts based on the system clock, and in the case of a serial interface, for example, serial data is input/output based on the system clock, etc., supplied from the clock control circuit 104. Control is performed based on the system clock. Note that the CPU 102 and the built-in peripheral circuit 103 are connected by an internal bus (not shown).

【0022】次に、クロック制御回路104の動作につ
いて説明する。クロック制御回路104は入力端子であ
るX1端子130,X2端子131にクリスタル振動子
/セラミック発振子を接続した場合に、抵抗106およ
びインバータ107により信号線108上にクロックを
得る構成となっている。この構成は、本実施例のように
外部のクロック生成回路からクロックを入力する場合に
も適用できる。外部クロック生成回路105から出力さ
れるクロックを後述のANDゲート124を介してX1
端子130から入力し、X1端子130から入力された
クロックと反転したクロックをX2端子131から入力
する。クロック制御回路104は、このX1端子130
およびX2端子131から入力されたクロックをもとに
して、X2端子131から入力されるクロックと同相の
クロックを信号線108上に得る。この信号線108上
に得たクロックはバッファ118を介してCLKOUT
端子132から出力して外部の周辺装置120,121
へ供給されると共に、分周器111で分周されてシステ
ム・クロックとしてCPU102を始めとしてマイコン
101全体に供給される。
Next, the operation of the clock control circuit 104 will be explained. The clock control circuit 104 is configured to obtain a clock on a signal line 108 by a resistor 106 and an inverter 107 when a crystal resonator/ceramic oscillator is connected to the input terminals X1 terminal 130 and X2 terminal 131. This configuration can also be applied when a clock is input from an external clock generation circuit as in this embodiment. The clock output from the external clock generation circuit 105 is input to X1 via an AND gate 124, which will be described later.
A clock input from the terminal 130 is input from the X2 terminal 131, and a clock which is inverted from the clock input from the X1 terminal 130 is input from the X2 terminal 131. The clock control circuit 104 uses this X1 terminal 130
Based on the clock input from the X2 terminal 131, a clock having the same phase as the clock input from the X2 terminal 131 is obtained on the signal line 108. The clock obtained on this signal line 108 is CLKOUT via a buffer 118.
Output from terminal 132 to external peripheral devices 120, 121
At the same time, the frequency is divided by a frequency divider 111 and supplied to the entire microcomputer 101 including the CPU 102 as a system clock.

【0023】ここで、セット/リセット型のフリップ・
フロップ110は、マイコン101がSTOP状態であ
ることを示すフリップ・フロップである。CPU102
は、STOP命令を実行するとマイコン101内部の動
作状態がSTOP状態に遷移することが可能な状態にな
るまで待ち合わせを行なう。例えば、SOTP状態に遷
移しようとしたとき、内蔵周辺回路303に含まれるD
MAコントローラがデータ転送を行っている最中である
場合、データ転送が終了するまで待つ等の待ち合わせを
行なう。データ転送が終了する等して、マイコン101
内部がSTOP状態に遷移することが可能となったとき
、CPU102は信号109を活性化し、フリップ・フ
ロップ110をセットする。逆に、RESET端子13
4からのリセット信号やNMI端子135からのノン・
マスカブル割込み要求信号等のSTOP状態を解除する
信号が入力されたとき、フリップ・フロップ110はリ
セットされる。マイコン101がSTOP状態に遷移し
ようとすると、フリップ・フロップ110がセットされ
るため、インバータ116の出力値が“0”となる。 このため、NANDゲート117の出力値が“1”とな
り、信号線108上に得られていたクロックはマスクさ
れ出力されない。したがって、バッファ118を介して
出力されるCLKOUT端子132からの出力値は“1
”となる。一方、上述したリセット信号ノン・マスカブ
ル割込み要求信号によりSTOP状態を解除しようとす
るとフリップ・フロップ110がリセットされるためイ
ンバータ116の出力値が“1”となる。このため、C
LKOUT端子132からは信号線108上に得られて
いたクロックがそのまま出力される。
Here, set/reset type flip
The flop 110 is a flip-flop that indicates that the microcomputer 101 is in the STOP state. CPU102
When the STOP command is executed, the microcomputer 101 waits until the internal operating state of the microcomputer 101 reaches a state where it can transition to the STOP state. For example, when attempting to transition to the SOTP state, the D
If the MA controller is in the process of transferring data, it waits until the data transfer is completed. After the data transfer is completed, the microcomputer 101
When it becomes possible for the internal state to transition to the STOP state, CPU 102 activates signal 109 and sets flip-flop 110. Conversely, RESET terminal 13
4 and the non-reset signal from NMI terminal 135.
When a signal for canceling the STOP state, such as a maskable interrupt request signal, is input, the flip-flop 110 is reset. When the microcomputer 101 attempts to transition to the STOP state, the flip-flop 110 is set, so the output value of the inverter 116 becomes "0". Therefore, the output value of the NAND gate 117 becomes "1", and the clock obtained on the signal line 108 is masked and not output. Therefore, the output value from the CLKOUT terminal 132 via the buffer 118 is “1”.
”. On the other hand, when attempting to release the STOP state by the above-mentioned reset signal non-maskable interrupt request signal, the flip-flop 110 is reset and the output value of the inverter 116 becomes “1”.
The clock obtained on the signal line 108 is output as is from the LKOUT terminal 132.

【0024】一方、フリップ・フロップ110の出力は
インバータ122を介してSTOPS端子133から外
部に出力される。マイコン101がSTOP状態である
とき、フリップ・フロップ110の出力値は“1”であ
るので、STOPS端子133はロウ・レベルを出力す
る。逆に、マイコン101がSTOP状態でないとき、
フリップ・フロップ110の出力値は“0”であるので
、STOPS端子133はハイ・レベルを出力する。 ANDゲート124は、上記STOPS端子133から
の出力値と、外部クロック生成回路105からの出力値
とを入力し、その出力値をマイコン101のX1端子1
30に入力している。マイコン101がSTOP状態で
ない場合、STOPS端子133からの出力値はハイ・
レベルとなるため、外部クロック生成回路105からの
出力であるクロックがそのままX1端子130に入力さ
れる。X2端子131にはX1端子130に入力された
クロックと反転したクロックが入力される。また、マイ
コン101がSTOP状態である場合、STOPS端子
133からの出力値はロウ・レベルとなるため外部クロ
ック生成回路105からのクロック出力はマスクされ、
X1端子130には常にロウ・レベルが入力される。X
2端子131には常にハイ・レベルが入力される。RE
SET端子134からのリセット信号やNMI端子13
5からのノン・マスカブル割込み要求信号等が入力され
たとき、フリップ・フロップ110はリセットされ、S
TOPS端子133が再びハイ・レベルとなる。このた
め、外部クロック生成回路105からの出力であるクロ
ックがそのままX1端子130に入力され、X2端子1
31にはX1端子130に入力されたクロックと反転し
たクロックが入力される。
On the other hand, the output of the flip-flop 110 is outputted to the outside from the STOPS terminal 133 via the inverter 122. When the microcomputer 101 is in the STOP state, the output value of the flip-flop 110 is "1", so the STOPS terminal 133 outputs a low level. Conversely, when the microcomputer 101 is not in the STOP state,
Since the output value of the flip-flop 110 is "0", the STOPS terminal 133 outputs a high level. The AND gate 124 inputs the output value from the STOPS terminal 133 and the output value from the external clock generation circuit 105, and sends the output value to the X1 terminal 1 of the microcomputer 101.
30 is entered. When the microcomputer 101 is not in the STOP state, the output value from the STOPS terminal 133 is high.
Therefore, the clock output from the external clock generation circuit 105 is input to the X1 terminal 130 as it is. The clock input to the X1 terminal 130 and the inverted clock are input to the X2 terminal 131 . Furthermore, when the microcomputer 101 is in the STOP state, the output value from the STOPS terminal 133 is at a low level, so the clock output from the external clock generation circuit 105 is masked.
A low level is always input to the X1 terminal 130. X
A high level is always input to the second terminal 131. R.E.
Reset signal from SET terminal 134 and NMI terminal 13
When a non-maskable interrupt request signal etc. from 5 is input, the flip-flop 110 is reset and the
The TOPS terminal 133 becomes high level again. Therefore, the clock output from the external clock generation circuit 105 is input as is to the X1 terminal 130, and the
A clock input to the X1 terminal 130 and an inverted clock is input to the input terminal 31.

【0025】トランスファ・ゲート114,115はマ
イコン101がSTOP状態になったときに信号線11
2,113が中間レベルとなることを防止するために設
けられたものである。マイコン101がSTOP状態に
遷移しようとしフリップ・フロップ110の出力値が“
1”となると、トランスファ・ゲート115がONし、
トランスファ・ゲート114はOFFする。このとき、
上述したように、X1端子130にはロウ・レベルが入
力され、X2端子131にはハイ・レベルが入力される
ので、信号線112はロウ・レベルに、また信号線11
3はハイ・レベルに固定される。RESET端子134
からのリセット信号やNMI端子135からのノン・マ
スカブル割込み要求信号等が入力されたとき、フリップ
・フロップ110はリセットされるため、トランスファ
・ゲート115がOFFし、トランスファ・ゲート11
4はONする。このとき、上述したようにX1端子13
0およびX2端子131からは、外部クロック生成回路
105からの出力であるクロックが入力されるので、再
び信号線108上にクロックが得られ、マイコン101
へのクロックの供給を開始すると共に、CLKOUT端
子132から外部へクロックを出力する。
Transfer gates 114 and 115 connect signal line 11 when microcomputer 101 is in the STOP state.
This is provided to prevent the number 2,113 from becoming an intermediate level. The microcomputer 101 is about to transition to the STOP state and the output value of the flip-flop 110 is “
1”, the transfer gate 115 turns on,
Transfer gate 114 is turned off. At this time,
As mentioned above, a low level is input to the X1 terminal 130 and a high level is input to the X2 terminal 131, so the signal line 112 is at a low level and the signal line 11 is at a low level.
3 is fixed at high level. RESET terminal 134
When a reset signal from the NMI terminal 135 or a non-maskable interrupt request signal from the NMI terminal 135 is input, the flip-flop 110 is reset, so the transfer gate 115 turns OFF and the transfer gate 11
4 is ON. At this time, as mentioned above, the X1 terminal 13
Since the clock that is the output from the external clock generation circuit 105 is inputted from the 0 and X2 terminals 131, the clock is again obtained on the signal line 108, and the
At the same time, the clock is output from the CLKOUT terminal 132 to the outside.

【0026】図3は上述した動作を示すタイミングチャ
ートである。
FIG. 3 is a timing chart showing the above-mentioned operation.

【0027】このように、マイコン101が外部クロッ
クにより動作する場合において、マイコン101がST
OP状態である場合には、CLKOUT端子132から
のクロック出力を停止すると共に、STOPS端子13
3が非活性化することによって外部クロックの入力を停
止するようにしている。また、STOP状態を解除しよ
うとした場合、上記STOPS端子133が活性化する
ので、X1端子130およびX2端子131からは再び
外部クロックが入力され、CLKOUT端子132から
は信号線108上に得られたクロックが出力される。
In this manner, when the microcomputer 101 is operated by the external clock, the microcomputer 101 operates from the ST
In the OP state, the clock output from the CLKOUT terminal 132 is stopped, and the STOPS terminal 13
3 is inactivated to stop inputting the external clock. Furthermore, when an attempt is made to release the STOP state, the STOPS terminal 133 is activated, so the external clock is input again from the X1 terminal 130 and the Clock is output.

【0028】第2の実施例について図2を用いて説明す
る。なお、本実施例の構成は前実施例とほぼ同様の構成
であるので異なる部分についてのみ説明する。
A second embodiment will be explained using FIG. 2. The configuration of this embodiment is almost the same as that of the previous embodiment, so only the different parts will be explained.

【0029】STOP状態であることを示すSTOPS
端子133の状態は信号線127を介してANDゲート
124に入力される他、外部クロック生成回路105に
も伝えられる。STOPS端子133からの出力がロウ
・レベルとなった場合、すなわちマイコン101がST
OP状態に遷移しようとする場合、外部クロック生成回
路105はクロックの生成を停止する。また、STOP
S端子133からの出力がハイ・レベルとなった場合、
すなわちマイコン101がSTOP状態を解除しようと
する場合、外部クロック生成回路105はクロックの生
成を再開する。
STOPS indicating the STOP state
The state of the terminal 133 is input to the AND gate 124 via the signal line 127 and is also transmitted to the external clock generation circuit 105. When the output from the STOPS terminal 133 becomes low level, that is, the microcomputer 101
When attempting to transition to the OP state, the external clock generation circuit 105 stops generating clocks. Also, STOP
When the output from S terminal 133 becomes high level,
That is, when the microcomputer 101 attempts to release the STOP state, the external clock generation circuit 105 restarts clock generation.

【0030】動作タイミングチャートは図3と同様であ
る。
The operation timing chart is similar to that shown in FIG.

【0031】[0031]

【発明の効果】以上説明したように、本発明のクロック
制御回路を備えたマイクロコンピュータは、マイクロコ
ンピュータ自身がSTOP状態に入っているか否かを外
部で判別することができる。
As described above, a microcomputer equipped with the clock control circuit of the present invention can externally determine whether or not the microcomputer itself is in the STOP state.

【0032】このため、外部でクロックを生成しマイク
ロコンピュータに該クロックを供給する方式を採った場
合に、マイクロコンピュータがSTOP状態に入ったと
しても、上記STOP状態の判別結果により外部から供
給するクロックを停止することができるため、内部のゲ
ートがONすることによって引き起こされる短絡を防止
することができる。
For this reason, when a system is adopted in which a clock is generated externally and the clock is supplied to the microcomputer, even if the microcomputer enters the STOP state, the clock supplied from the outside is determined based on the determination result of the STOP state. This can prevent short circuits caused by internal gates turning on.

【0033】また、STOP状態の判別結果により外部
でのクロック生成そのものを停止することもでき、ST
OP状態に入ったときにマイクロコンピュータを含むシ
ステム全体の消費電力を低減することができる。
Furthermore, it is possible to stop external clock generation itself based on the determination result of the STOP state.
When entering the OP state, the power consumption of the entire system including the microcomputer can be reduced.

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

【図1】本発明の第一の実施例におけるクロック制御回
路を含むマイクロコンピュータを備えたシステム装置の
ブロック図である。
FIG. 1 is a block diagram of a system device including a microcomputer including a clock control circuit according to a first embodiment of the present invention.

【図2】本発明の第二の実施例におけるクロック制御回
路を含むマイクロコンピュータを備えたシステム装置の
ブロック図である。
FIG. 2 is a block diagram of a system device including a microcomputer including a clock control circuit according to a second embodiment of the present invention.

【図3】クロック制御回路の動作タイミングチャートで
ある。
FIG. 3 is an operation timing chart of the clock control circuit.

【図4】従来のクロック制御回路を含むマイクロコンピ
ュータを備えたシステム装置のブロック図である。
FIG. 4 is a block diagram of a system device including a microcomputer including a conventional clock control circuit.

【図5】従来のクロック制御回路を含むマイクロコンピ
ュータを備えたシステム装置のブロック図である。
FIG. 5 is a block diagram of a system device including a microcomputer including a conventional clock control circuit.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  マイクロコンピュータが動作するため
のシステム・クロックを該マイクロコンピュータ内部で
発生する場合と外部のクロック発生回路からシステム・
クロックを入力した場合といずれの場合にもシステム・
クロックを供給できる構成をもったクロック発生手段を
備えたマイクロコンピュータにおいて、命令により上記
クロック発生回路がシステム・クロックの供給を停止す
る状態になったときにセットされ、外部からの入力信号
によりシステム・クロックの供給を再び開始するときに
リセットされる保持手段と、上記保持手段の内容を外部
に出力する出力手段と、上記出力手段からの出力値を外
部で判断することにより、システム・クロックをマイク
ロコンピュータ内部で発生する場合と外部のクロック発
生回路からシステム・クロックを入力した場合とのいず
れの場合にも、マイクロコンピュータの命令により前記
クロック発生手段によるシステム・クロックの発生を停
止する手段と、上記出力手段からの出力値を外部で判別
することにより、システム・クロックをマイクロコンピ
ュータ内部で発生する場合と外部のクロック発生回路か
らシステム・クロックを入力した場合とのいずれの場合
にも、外部からの入力信号により前記クロック発生手段
によるシステム・クロックの発生を再び開始する手段と
を有することを特徴とするマイクロコンピュータ。
Claim 1: A system clock for operating a microcomputer is generated internally, and a system clock is generated from an external clock generation circuit.
The system clock is input in both cases.
In a microcomputer equipped with a clock generation means configured to supply a clock, this is set when the clock generation circuit stops supplying the system clock by an instruction, and is set when the clock generation circuit stops supplying the system clock by an input signal from the outside. The system clock is controlled by a microcontroller by using a holding means that is reset when clock supply is restarted, an output means that outputs the contents of the holding means to the outside, and an external judgment of the output value from the output means. means for stopping the generation of the system clock by the clock generation means according to instructions from a microcomputer, whether the system clock is generated internally in the computer or inputted from an external clock generation circuit; By determining the output value from the output means externally, the system clock can be output from the outside regardless of whether the system clock is generated internally within the microcomputer or when the system clock is input from an external clock generation circuit. A microcomputer comprising means for restarting the generation of a system clock by the clock generation means in response to an input signal.
JP2401774A 1990-12-13 1990-12-13 Microcomputer Expired - Fee Related JP2705311B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2401774A JP2705311B2 (en) 1990-12-13 1990-12-13 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2401774A JP2705311B2 (en) 1990-12-13 1990-12-13 Microcomputer

Publications (2)

Publication Number Publication Date
JPH04215112A true JPH04215112A (en) 1992-08-05
JP2705311B2 JP2705311B2 (en) 1998-01-28

Family

ID=18511604

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2401774A Expired - Fee Related JP2705311B2 (en) 1990-12-13 1990-12-13 Microcomputer

Country Status (1)

Country Link
JP (1) JP2705311B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS54104272A (en) * 1978-02-03 1979-08-16 Oki Electric Ind Co Ltd Complementary mos logic circuit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS54104272A (en) * 1978-02-03 1979-08-16 Oki Electric Ind Co Ltd Complementary mos logic circuit

Also Published As

Publication number Publication date
JP2705311B2 (en) 1998-01-28

Similar Documents

Publication Publication Date Title
KR920002754B1 (en) Microcomputer w/power saving function
US5502689A (en) Clock generator capable of shut-down mode and clock generation method
US5842028A (en) Method for waking up an integrated circuit from low power mode
JPS6349814B2 (en)
JPH0214723B2 (en)
JPH10177563A (en) Microcomputer with built-in flash memory
JP3552213B2 (en) SD memory card host controller and clock control method
JP3460736B2 (en) Clock control circuit
JPH11202968A (en) Microcomputer
JPH1153049A (en) Computer system
JP4467651B2 (en) Method for operating a communication channel via a dynamic blocking and / or initiating operation in a mixed master / slave subscriber environment, and a system configured to implement such a method
JPH04215112A (en) Microcomputer
JPS60218152A (en) Microprocessor
JPH10333790A (en) Information processor equipped with power-saving function and power saving releasing method for the information processor
JP2701752B2 (en) Microprocessor clock supply control circuit
JP2684813B2 (en) Microcomputer
JPH0883133A (en) Computer system and clock control method for the same
JPS6270923A (en) Integrated circuit containing oscillating circuit
JPH06152695A (en) Serial interface circuit
KR100272531B1 (en) Method for prohibitting exhaust of power source in electronic equipment
JPS61245242A (en) Interruption input device
JPH0588775A (en) System for switching clock
JP2002132395A (en) Data processor and data processing system
JPH04140810A (en) Information processor
JPH0588790A (en) Power source control system

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19970909

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081009

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091009

Year of fee payment: 12

LAPS Cancellation because of no payment of annual fees