[go: up one dir, main page]

JPH1165697A - Clock-switching system for cpu - Google Patents

Clock-switching system for cpu

Info

Publication number
JPH1165697A
JPH1165697A JP9225514A JP22551497A JPH1165697A JP H1165697 A JPH1165697 A JP H1165697A JP 9225514 A JP9225514 A JP 9225514A JP 22551497 A JP22551497 A JP 22551497A JP H1165697 A JPH1165697 A JP H1165697A
Authority
JP
Japan
Prior art keywords
clock
cpu
circuit
stop
signal
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.)
Withdrawn
Application number
JP9225514A
Other languages
Japanese (ja)
Inventor
Toru Yamagishi
亨 山岸
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.)
Victor Company of Japan Ltd
Original Assignee
Victor Company of Japan 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 Victor Company of Japan Ltd filed Critical Victor Company of Japan Ltd
Priority to JP9225514A priority Critical patent/JPH1165697A/en
Publication of JPH1165697A publication Critical patent/JPH1165697A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Transmitters (AREA)

Abstract

PROBLEM TO BE SOLVED: To obtain clock-switching system of a CPU for guaranteeing the maximum time since the CPU is set to clock stop until the clock actually stops, and making the time longer than a time to execute all the instructions for setting the CPU to a low power consumption mode. SOLUTION: This system is provided with an oscillation circuit 5 which oscillates a high speed clock to be supplied to a CPU 1, a clock setting circuit 2 which outputs a setting change signal from the high speed clock to stop based on the input of a clock setting signal from the CPU, when the present clock state is the high speed clock, a timer 3 which outputs a timer expiration signal after the lapse of a previously set time since the clock stop of the CPU, until the execution of more than one instruction groups for obtaining a low power consumption mode based on the input of the setting change signal, and a clock switching circuit 6 which supplies a high-speed clock from the oscillation circuit 5 to the CPU at normal times, and switches the high-speed clock to a stop, based on the input of the timer expiration signal from the timer.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、CPUのクロック
切換システムに関するもので、特に、消費電力低減とソ
フトウエアの簡略化を図るものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a clock switching system for a CPU, and more particularly to reducing power consumption and simplifying software.

【0002】[0002]

【従来の技術】近年、ラップトップコンピュータ、携帯
電話などの携帯用機器などが普及している。そのほとん
どのものは電池で駆動されており、そのために如何に電
池の寿命を延ばすかが競争になっている。内部の回路は
ほとんどの場合CMOSでできていて、消費電力は内部
の信号変化が多ければ多いほと大きくなるので、通常処
理すべきことが無いときには内部のクロックなどを止め
ることにより、消費電力の低減を図っている。
2. Description of the Related Art In recent years, portable devices such as laptop computers and mobile phones have become widespread. Most of them are powered by batteries, which is competing on how to extend battery life. Most of the internal circuits are made of CMOS, and the power consumption increases as the internal signal change increases. Therefore, when there is no processing to be performed normally, the internal clock is stopped to reduce the power consumption. We are trying to reduce it.

【0003】特に、このような携帯用機器に必ずといっ
ていいほど入っているCPUは通常消費電力が大きく、
そのクロックを処理が少ないときに停止することは広く
行われている手法である。また、クロック用の発振器と
して速いクロック用と遅いクロック用のものを用意して
おき、処理が少ないときには、速いクロックの発振器を
停止させておき、遅いクロックでCPUを動作させるか
又はクロックを停止し、CPUの動作が必要になった時
点で何らかの割り込み信号によって速いクロックの発振
器を起動することが、例えば特開平7−20964号公
報や特開平5−73176号公報等に開示されている。
このように、CPUとそのクロックを生成する回路は別
に存在することが多い。
In particular, CPUs which are almost always included in such portable devices usually consume large power,
Stopping the clock when there is little processing is a widely practiced technique. In addition, a clock oscillator for a fast clock and a clock oscillator for a slow clock are prepared, and when there is little processing, the oscillator for the fast clock is stopped, and the CPU is operated with the slow clock or the clock is stopped. For example, Japanese Patent Application Laid-Open Nos. 7-20964 and 5-73176 disclose that a high-speed clock oscillator is started by an interrupt signal when the operation of the CPU becomes necessary.
As described above, the CPU and the circuit for generating the clock often exist separately.

【0004】また、CPU自体は停止しており、クロッ
クも停止していても、時計用に遅いクロックを動かして
いることも多い。これはクロックを停止から速いクロッ
クに戻すときに、速いクロックの発振が立ち上がるまで
の時間がかかるためであり、この立ち上がり時間を計測
するのに遅いクロックを使う。
[0004] Further, the CPU itself is stopped, and even if the clock is stopped, a slow clock is often used for a clock. This is because when the clock is returned from the stop to the fast clock, it takes time until the oscillation of the fast clock rises, and a slow clock is used to measure the rise time.

【0005】さらに、CPUの消費電力を減らす方法と
して公知の2つの方法がある。1つは、外部からのクロ
ックを止めてしまう方法である。この場合、外部にクロ
ックを切り換える回路を設け、CPUからの設定に従っ
てクロックを止める方法である。もう1つは、CPU自
身を消費電力の少ないモードに設定する方法である。こ
のモードではCPU内部のクロックを止めたり、一部の
電源を切ったりする。通常、CPUはこのような消費電
力を小さくするモードに入るための命令を備えている。
例えばSTOP命令という名前だとする。この命令を実
行すると、CPU内部のクロックを止めたり、一部の電
源を切ったりすることで消費電力を少なくすることがで
きる。さらに、この命令を実行すると、割り込みなどの
外部イベントが来るまで次の命令の実行を行わなかった
りする。このようにすることで、外部のデバイスヘのア
クセスを行わなくなる。一般的に、外部のデバイス(例
えばRAMとかROMとか)は、アクセスすると急激に
消費電力が大きくなることが多い。なお、STOP命令
を実行するために、特殊なCPUモードに事前に入らな
ければならない場合がある。例えば通常はマイクロプロ
セッサの形で動作させているものを、シングルチップ動
作に変えなければならないなどである。また、外部ポー
トなどを出力状態にしておいたり、周辺回路の設定を必
要とする場合がある。このようなときには低消費電力モ
ードに入るための複数の命令を実行し、その一番最後が
STOP命令になっている。
Further, there are two known methods for reducing the power consumption of the CPU. One method is to stop an external clock. In this case, a method of externally switching a clock is provided, and the clock is stopped according to the setting from the CPU. The other is a method of setting the CPU itself to a mode with low power consumption. In this mode, the clock inside the CPU is stopped or a part of the power is turned off. Normally, the CPU is provided with an instruction to enter such a mode for reducing power consumption.
For example, assume that the name is a STOP instruction. When this command is executed, the power consumption can be reduced by stopping the clock in the CPU or turning off a part of the power. Further, when this instruction is executed, the next instruction is not executed until an external event such as an interrupt comes. By doing so, access to an external device is not performed. In general, the power consumption of an external device (for example, a RAM or a ROM) rapidly increases when accessed. In some cases, it may be necessary to enter a special CPU mode before executing the STOP instruction. For example, what normally operates in the form of a microprocessor must be changed to single-chip operation. Further, there is a case where an external port or the like is in an output state or a setting of a peripheral circuit is required. In such a case, a plurality of instructions for entering the low power consumption mode are executed, and the last one is a STOP instruction.

【0006】[0006]

【発明が解決しようとする課題】前述したように、CP
Uとそのクロックを生成する回路は別に存在することが
多い。このときに、CPUから外部のクロック切換回路
に対して設定を行うのと、CPUの内部で消費電力の小
さいモードに入るのとは独立した事象になる。したがっ
て、CPUがクロックの停止を指令して直ちにクロック
が停止してしまうと、CPUが外部のデバイスにアクセ
スしたままで止まってしまうことがあった。これでは、
CPU自体は消費電力は減るが、外部デバイスがアクセ
ス状態のままとなるので、消費電力が大きくなる。
As described above, the CP
There are often separate circuits for generating U and its clock. At this time, the setting from the CPU to the external clock switching circuit is an independent event from entering the mode with low power consumption inside the CPU. Therefore, if the clock is stopped immediately after the CPU instructs the stop of the clock, the CPU may stop while accessing an external device. In this,
Although the power consumption of the CPU itself decreases, the power consumption increases because the external device remains in the access state.

【0007】逆に、CPUを消費電力の小さいモードに
入れるための命令群を実行すると、通常は、その最後の
STOP命令を実行した時点でCPUの動作は止まる。
これはその後の外部デバイスヘのアクセスを防ぐためで
ある。しかしながら、このときには、外部の速いクロッ
クを発生する発振器は動作状態のままなので、発振器を
動作させるための消費電力が無駄となる。また、命令群
を実行している間に割り込みが入ると、本来割り込みの
後には通常処理を行う必要が出てくるが、割り込みルー
チンから戻った後にクロックを停止してしまうことがあ
った。さらに、ここで割り込み禁止にすると、STOP
命令の後に割り込みが入らないと続きを実行できなくな
ってしまい、永久にSTOP命令の次の命令を実行でき
ないという問題があった。
On the other hand, when an instruction group for putting the CPU into the mode with low power consumption is executed, the operation of the CPU normally stops when the last STOP instruction is executed.
This is to prevent subsequent access to the external device. However, at this time, the oscillator for generating the external fast clock remains operating, so that the power consumption for operating the oscillator is wasted. Also, if an interrupt occurs during execution of an instruction group, it is necessary to perform normal processing after the interrupt, but the clock may be stopped after returning from the interrupt routine. Furthermore, if interrupts are disabled here, STOP
Unless an interrupt occurs after the instruction, the continuation cannot be executed, and the instruction following the STOP instruction cannot be executed forever.

【0008】そこで、本発明は上述した点に鑑みてなさ
れたもので、CPUクロックの停止を設定してから実際
に停止するまでの最低時間を保証することで、その間に
CPUを低消費電力モードにして消費電力低減とソフト
ウエアの簡略化を行うことができるCPUのクロック切
換システムを得ることを目的とする。
Therefore, the present invention has been made in view of the above points, and guarantees a minimum time from when the CPU clock is stopped to when the CPU clock is actually stopped. It is another object of the present invention to provide a CPU clock switching system capable of reducing power consumption and simplifying software.

【0009】[0009]

【課題を解決するための手段】前記目的を達成するため
に、本発明に係るCPUのクロック切換システムは、C
PUに供給するCPUクロックとして高速クロックを発
振する発振回路と、前記CPUの現在のクロック状態が
高速クロックのときに前記CPUから出力されるクロッ
ク停止への設定変更を示すクロック設定信号の入力に基
づいて高速クロックから停止への設定変更信号を出力す
るクロック設定回路と、前記設定変更信号の入力に基づ
いて前記CPUがクロック停止に設定してから低消費電
力モードにするための1つ以上の命令群を実行するより
長いあらかじめ設定された時間経過後にタイマ満了信号
を出力するタイマと、前記CPUに供給するCPUクロ
ックとして、通常は前記発振回路からの高速クロックを
供給するとともに前記タイマからのタイマ満了信号の入
力に基づいて高速クロックから停止に切り換えるクロッ
ク切換回路とを有するものである。
In order to achieve the above object, a clock switching system for a CPU according to the present invention comprises:
An oscillating circuit that oscillates a high-speed clock as a CPU clock supplied to the PU, and a clock setting signal that indicates a setting change to stop the clock output from the CPU when the current clock state of the CPU is the high-speed clock. A clock setting circuit for outputting a setting change signal from a high-speed clock to a stop, and one or more instructions for setting the CPU to stop the clock based on the input of the setting change signal and then setting a low power consumption mode A timer that outputs a timer expiration signal after a preset time longer than the execution of the group, and a CPU clock that is supplied to the CPU, usually supplies a high-speed clock from the oscillation circuit and expires the timer from the timer. Clock switching circuit that switches from high-speed clock to stop based on signal input Is shall.

【0010】また、本発明のCPUのクロック切換シス
テムは前記発振回路による高速クロックの発振をオン/
オフ制御する高速クロック発振制御回路をさらに備え、
前記タイマは、前記クロック設定回路からクロック高速
から停止への設定変更信号の入力を受けたときは、外部
から与えられる前記高速クロックより遅い低速クロック
をカウントして所定のカウント数になったらタイマ満了
信号を前記クロック切換回路の他に前記高速クロック発
振制御回路にも出力して前記発振回路の発振を停止させ
るものである。
Further, the CPU clock switching system of the present invention turns on / off the oscillation of the high-speed clock by the oscillation circuit.
It further includes a high-speed clock oscillation control circuit that controls off,
The timer counts a low-speed clock that is slower than the externally supplied high-speed clock when the timer receives a setting change signal from high-speed clock to stop from the clock setting circuit, and the timer expires when a predetermined count is reached. A signal is output to the high-speed clock oscillation control circuit in addition to the clock switching circuit to stop the oscillation of the oscillation circuit.

【0011】また、本発明のCPUのクロック切換シス
テムの前記CPUでの処理は、前記クロック設定回路に
対してクロック停止を設定するステップと、当該クロッ
ク停止の設定後、前記タイマからタイマ満了信号が出力
されるまでの間に低消費電力モードにするための1つ以
上の命令群を実行するステップとを有するものである。
[0011] The processing of the CPU in the CPU clock switching system of the present invention includes the step of setting a clock stop for the clock setting circuit, and after setting the clock stop, a timer expiration signal from the timer. Executing one or more instructions for setting the mode to the low power consumption mode before being output.

【0012】さらに、本発明のCPUのクロック切換シ
ステムの前記クロック切換回路は、高速クロックから停
止への切り換え時に停止切り換わり信号を出力するとと
もに、クロック停止に前もって外部割り込み源からの前
記CPUへの割り込み信号の入力を禁止し、前記クロッ
ク切換回路から出力される停止切り換わり信号の入力に
基づいて外部割り込み源からの前記CPUへの割り込み
信号の入力禁止を解除する割り込み禁止回路をさらに備
え、かつ、前記CPUでの処理は、前記クロック設定回
路に対してクロック停止を設定するステップの前に、前
記割り込み禁止回路に割り込み禁止設定信号を出力して
外部割り込み源からの割り込み信号の入力を禁止するス
テップをさらに有するものである。
Further, the clock switching circuit of the CPU clock switching system of the present invention outputs a stop switching signal when switching from a high-speed clock to a stop, and outputs an external interrupt source to the CPU from an external interrupt source before stopping the clock. An interrupt inhibiting circuit that inhibits input of an interrupt signal, and releases input inhibition of an interrupt signal from the external interrupt source to the CPU based on input of a stop switching signal output from the clock switching circuit; and In the processing by the CPU, an interrupt disable setting signal is output to the interrupt disable circuit to inhibit input of an interrupt signal from an external interrupt source before the step of setting a clock stop for the clock setting circuit. It further has steps.

【0013】[0013]

【発明の実施の形態】図1は本実施の形態に係るクロッ
ク切換回路の構成図である。図1において、1はCPU
クロック103の供給を受けて動作するCPUであり、
クロック切換回路6は、このCPUクロック103を生
成している。具体的には、CPUクロック103とし
て、例えば20MHzの高速クロック108、例えば3
2.768kHzの低速クロック106、停止109の
いずれかを選択する。このCPUクロック103の切り
換えは、CPUクロック103にグリッジがでないよう
に、クロックの位相を考えて行われる。初期状態では、
高速クロック108になっているものとする。
FIG. 1 is a block diagram of a clock switching circuit according to the present embodiment. In FIG. 1, 1 is a CPU.
A CPU that operates in response to the supply of the clock 103,
The clock switching circuit 6 generates the CPU clock 103. Specifically, as the CPU clock 103, for example, a high-speed clock 108 of 20 MHz, for example, 3
Either the low-speed clock 106 of 2.768 kHz or the stop 109 is selected. The switching of the CPU clock 103 is performed in consideration of the clock phase so that the CPU clock 103 has no glitch. By default,
The high-speed clock 108 is assumed.

【0014】クロック切り換え動作について説明する
と、まず、CPU1は、割り込み禁止回路7に対して割
り込み禁止設定信号113を使って外部割り込み源11
1が来てもCPU1に対して割り込み信号112を発生
しないように設定する。このような状態で、CPU1
は、クロック設定信号100を通じてクロック設定回路
2にクロックの変更を設定する。一般的には、クロック
設定回路2はレジスタの形式になっている。このクロッ
ク設定回路2には、クロック切換回路6から現在のクロ
ック状態102が供給されており、クロック状態102
は、高速クロック108、低速クロック106、停止1
09に対応した3ビットのバスを介して供給され、その
ときのクロックの状態に応して1ビットのみがアサート
されている。
The clock switching operation will be described. First, the CPU 1 sends the external interrupt source 11 to the interrupt prohibiting circuit 7 using the interrupt prohibition setting signal 113.
The CPU 1 is set so that the interrupt signal 112 is not generated even when 1 comes. In such a state, the CPU 1
Sets a clock change in the clock setting circuit 2 through the clock setting signal 100. Generally, the clock setting circuit 2 is in the form of a register. The clock setting circuit 2 is supplied with the current clock state 102 from the clock switching circuit 6, and the clock state 102
Are the high-speed clock 108, the low-speed clock 106, the stop 1
09 is supplied via a 3-bit bus, and only one bit is asserted according to the state of the clock at that time.

【0015】現在のクロック状態102が高速クロック
108である場合に、CPU1がクロック設定信号10
0を通じて停止への変更をクロック設定回路2に設定す
ると、クロック設定回路2からクロック高速→停止信号
101が出力される。タイマ3は、このクロック設定回
路2からのクロック高速→停止信号101を受けると、
低速クロック106をカウントして、所定のカウント数
になったらタイマ満了信号104をクロック切換回路6
に出力する。このカウント数はCPU1が消費電力を小
さくするモードにするための1つ以上の命令を実行する
実行時間より大きいものとする。ここで、低速クロック
106を使うのは、CPU1が低速クロック106で動
作しているときに停止を設定したときは、高速クロック
108の発振はしていないので、低速クロック106し
か使えないからである。
When the current clock state 102 is the high-speed clock 108, the CPU 1
When a change to stop is set in the clock setting circuit 2 through 0, the clock setting circuit 2 outputs a clock high speed → stop signal 101. When the timer 3 receives the clock high speed → stop signal 101 from the clock setting circuit 2,
The low-speed clock 106 is counted, and when the count reaches a predetermined count, the timer expiration signal 104 is output to the clock switching circuit 6.
Output to It is assumed that the count number is longer than the execution time for executing one or more instructions for causing the CPU 1 to enter a mode for reducing power consumption. Here, the reason why the low-speed clock 106 is used is that when the CPU 1 is set to stop while operating at the low-speed clock 106, only the low-speed clock 106 can be used because the high-speed clock 108 does not oscillate. .

【0016】高速クロック発振制御回路4は、タイマ3
からのタイマ満了信号104を受けて、高速クロック発
振ON/OFF信号107をOFFにして発振回路5に
出力する。発振回路5は、これを受けて発振を停止し消
費電力を小さくする。また、クロック切換回路6は、タ
イマ満了信号104を受けて、CPUクロック103と
して高速クロック108から停止109に切り換える。
この切り換えタイミングは、CPUクロック103にグ
リッジが出ないようにする。そして、それと同時に、ク
ロック切換回路6は、割り込み禁止回路7に対し停止切
り換わり信号114を出力し、割り込み禁止回路7に対
して外部割り込み源111がそのまま割り込み信号11
2としてCPU1に入力されるように設定する。このよ
うにして、CPUクロック103は停止する。
The high-speed clock oscillation control circuit 4 includes a timer 3
, The high-speed clock oscillation ON / OFF signal 107 is turned off and output to the oscillation circuit 5. In response to this, the oscillation circuit 5 stops oscillation and reduces power consumption. Further, the clock switching circuit 6 receives the timer expiration signal 104 and switches from the high-speed clock 108 to the stop 109 as the CPU clock 103.
This switching timing prevents glitches from appearing in the CPU clock 103. At the same time, the clock switching circuit 6 outputs a stop switching signal 114 to the interrupt inhibiting circuit 7, and the external interrupt source 111 sends the interrupt signal 11 to the interrupt inhibiting circuit 7 as it is.
2 is set to be input to the CPU 1. Thus, the CPU clock 103 stops.

【0017】一方、これとは逆に、CPUクロック10
3として停止109から高速クロック108に切り換わ
るときは次のような動作になる。キーをおされたり、目
覚まし時計などでCPU1として処理を開始しなければ
ならなくなった場合には、それらの信号が統合されて外
部イベント110として高速クロック発振制御回路4に
入力される。通常、外部イベント110と外部割り込み
源111は同じものであるが、場合により異なる条件の
ときもある。高速クロック発振制御回路4は、これを受
けて高速クロック発振0N/OFF信号107をONに
し、発振回路5で高速クロック108を発振させる。通
常、発振するのには水晶発振器だと数ms時間がかか
る。これは低速クロック106を使って計測する。この
時間が経過した後、高速クロック発振制御回路4は、ク
ロック切換回路6に発振器が立ち上がった信号105を
出力する。
On the other hand, conversely, the CPU clock 10
When switching from the stop 109 to the high-speed clock 108 as 3, the following operation is performed. When the processing must be started as the CPU 1 by pressing a key or by an alarm clock or the like, those signals are integrated and input to the high-speed clock oscillation control circuit 4 as an external event 110. Usually, the external event 110 and the external interrupt source 111 are the same, but there may be different conditions depending on the case. The high-speed clock oscillation control circuit 4 receives this signal, turns on the high-speed clock oscillation 0N / OFF signal 107, and causes the oscillation circuit 5 to oscillate the high-speed clock 108. Normally, a crystal oscillator takes several ms to oscillate. This is measured using the low-speed clock 106. After this time has elapsed, the high-speed clock oscillation control circuit 4 outputs to the clock switching circuit 6 a signal 105 whose oscillator has risen.

【0018】クロック切換回路6は、これを受けてCP
Uクロック103として停止109から高速クロック1
08に切り換える。この際もCPUクロック103にグ
リッジが出ないように、クロックの位相を考えて切り換
える。高速クロック108に切り換わると、クロック切
換回路6から現在のクロックの状態102を停止109
から高速クロック108に対応した状態に切り換える。
このとき、外部イベント110と外部割り込み源111
が同じ信号ならば、外部割り込み源111からの信号は
割り込み信号112としてCPU1に入力されるから、
CPUクロック103が高速クロック108に切り換わ
ると、通常は直ちに割り込みルーチンが実行される。
The clock switching circuit 6 receives this signal and
High-speed clock 1 from stop 109 as U clock 103
Switch to 08. At this time as well, the CPU clock 103 is switched in consideration of the clock phase so that no glitch appears on the CPU clock 103. When switching to the high-speed clock 108, the clock switching circuit 6 stops the current clock state 102 109
From the state corresponding to the high-speed clock 108.
At this time, the external event 110 and the external interrupt source 111
Are the same signal, the signal from the external interrupt source 111 is input to the CPU 1 as the interrupt signal 112.
When the CPU clock 103 switches to the high-speed clock 108, an interrupt routine is usually executed immediately.

【0019】図2にCPU1がCPUクロック103を
高速クロック108から停止109に切り換えるときの
動作フローチャートを示す。まず、CPUクロック10
3を高速クロック108から停止109に切り換えよう
とするときに、ステップ200のSTART(スター
ト)に来る。次に、ステップ201に進み、図1の割り
込み禁止回路7に対して、割り込み禁止設定信号113
により外部割り込み源111から割り込みが来ないよう
にする。これは、通常、特定のレジスタに特定の値を書
き込むような形態となる。次に、ステップ202に進
み、図1のクロック設定回路2に対して、クロック設定
信号100によりCPUクロック103を停止109に
するように設定を行う。通常は、これも特定のレジスタ
に特定の値を書き込むことによって行われる。
FIG. 2 shows an operation flowchart when the CPU 1 switches the CPU clock 103 from the high-speed clock 108 to the stop 109. First, the CPU clock 10
When the user wants to switch 3 from the high-speed clock 108 to the stop 109, the process comes to START in step 200. Next, the process proceeds to step 201, where the interrupt disable setting signal 113 is sent to the interrupt disable circuit 7 of FIG.
To prevent an interrupt from the external interrupt source 111. This usually takes the form of writing a specific value to a specific register. Next, the process proceeds to step 202, in which the clock setting circuit 2 in FIG. Usually, this is also done by writing a specific value to a specific register.

【0020】さらに、ステップ203に進み、CPU1
を低消費電力モードにするための(1つ以上の)命令を
実行する。この内、最後の命令はSTOP命令であり、
この命令を実行すると、CPU1は割り込みなどの外部
イベント110が入るまで、命令の実行を停止し、かつ
CPU1内部の消費電力を小さくする。この最後のST
OP命令の実行が終わった後に、図1のタイマ3からタ
イマ満了信号104が出力され、クロックが停止109
に切り換わる。よって、高速クロック108の発振およ
びそれを使った外部からのクロックが停止するととも
に、CPU1内部も低消費電力モードになるので、非常
に消費電力の低い状態になる。なお、ステップ203の
後には、クロックが高速クロック108に戻ってから実
行される命令が書かれる。
Further, the process proceeds to step 203, where the CPU 1
Execute (one or more) instructions to place the in a low power mode. The last instruction is a STOP instruction,
When this instruction is executed, the CPU 1 stops executing the instruction until an external event 110 such as an interrupt occurs, and reduces the power consumption inside the CPU 1. This last ST
After the execution of the OP instruction is completed, a timer expiration signal 104 is output from the timer 3 in FIG.
Switch to. Therefore, the oscillation of the high-speed clock 108 and the external clock using the high-speed clock 108 are stopped, and the inside of the CPU 1 also enters the low power consumption mode, so that the power consumption becomes extremely low. After step 203, an instruction to be executed after the clock returns to the high-speed clock 108 is written.

【0021】したがって、本実施の形態によれば、CP
Uクロックの停止を設定してから実際に停止するまでの
最低時間を保証することで、その間にCPUを低消費電
力のモードに設定するとともに、その間は割り込みが入
るのを阻止し、クロックが停止に切り換わると同時に自
動的に割り込みが入るのを許すようにして消費電力低減
とソフトウエアの簡略化を行うことができる。
Therefore, according to the present embodiment, the CP
By guaranteeing the minimum time from when the U clock is stopped to when it is actually stopped, the CPU is set to the low power consumption mode during that time, while interrupts are prevented from entering during that time, and the clock is stopped. The power consumption can be reduced and the software can be simplified by automatically allowing an interrupt at the same time as switching to.

【0022】[0022]

【発明の効果】以上のように、本発明によれば、CPU
に供給するCPUクロックとして高速クロックを発振す
る発振回路と、前記CPUの現在のクロック状態が高速
クロックのときに前記CPUから出力されるクロック停
止への設定変更を示すクロック設定信号の入力に基づい
てクロック高速から停止への設定変更信号を出力するク
ロック設定回路と、前記設定変更信号の入力に基づいて
前記CPUがクロック停止に設定してから低消費電力モ
ードにするための1つ以上の命令群を実行するより長い
あらかじめ設定された時間経過後にタイマ満了信号を出
力するタイマと、前記CPUに供給するCPUクロック
として、通常は前記発振回路からの高速クロックを供給
するとともに前記タイマからのタイマ満了信号の入力に
基づいて高速クロックから停止に切り換えるクロック切
換回路とを備えたので、CPUクロックの停止を設定す
ると、CPU内部も低消費電力モードになり、消費電力
を低くすることができるとともに、このような低消費電
力の状態にするのに、CPUからのソフトウエア制御が
簡単で済む。
As described above, according to the present invention, the CPU
An oscillation circuit that oscillates a high-speed clock as a CPU clock supplied to the CPU, and a clock setting signal that indicates a setting change to stop the clock output from the CPU when the current clock state of the CPU is the high-speed clock. A clock setting circuit for outputting a setting change signal from a high-speed clock to a stop, and one or more instructions for causing the CPU to stop the clock based on the input of the setting change signal and then to enter a low power consumption mode And a timer that outputs a timer expiration signal after a preset time longer than that of the timer, and a CPU expiration signal from the timer that normally supplies a high-speed clock from the oscillation circuit as a CPU clock supplied to the CPU. And a clock switching circuit for switching from high-speed clock to stop based on the input of Therefore, when the CPU clock is set to stop, the inside of the CPU is also set to the low power consumption mode, so that the power consumption can be reduced. In addition, software control from the CPU requires such a low power consumption state. It's easy.

【0023】また、前記発振回路による高速クロックの
発振をオン/オフ制御する高速クロック発振制御回路を
さらに備え、前記タイマは、前記クロック設定回路から
クロック高速から停止への設定変更信号の入力を受けた
ときは、外部から与えられる前記高速クロックより遅い
低速クロックをカウントして所定のカウント数になった
らタイマ満了信号を前記クロック切換回路の他に前記高
速クロック発振制御回路にも出力して前記発振回路の発
振を停止させるようにしたので、発振回路の動作を停止
させて消費電力が無駄になることがなくなる。
In addition, the apparatus further comprises a high-speed clock oscillation control circuit for controlling on / off of high-speed clock oscillation by the oscillation circuit, wherein the timer receives an input of a setting change signal from high-speed clock to stop from the clock setting circuit. When a low-speed clock that is slower than the externally applied high-speed clock is counted and a predetermined count is reached, a timer expiration signal is output to the high-speed clock oscillation control circuit in addition to the clock switching circuit and the oscillation is started. Since the oscillation of the circuit is stopped, the operation of the oscillation circuit is stopped so that power consumption is not wasted.

【0024】また、前記CPUは、前記クロック設定回
路に対してクロック停止を設定するステップと、当該ク
ロック停止の設定後、前記タイマからタイマ満了信号が
出力されるまでの間に低消費電力モードにするための1
つ以上の命令群を実行するステップとを有することによ
り、クロックの停止設定時にCPU自体の消費電力を低
減させることができる。
Further, the CPU sets a clock stop for the clock setting circuit, and after the clock stop is set, enters a low power consumption mode until a timer expiration signal is output from the timer. 1 to do
The step of executing one or more instruction groups can reduce the power consumption of the CPU itself when the clock is set to stop.

【0025】さらに、前記クロック切換回路は、高速ク
ロックから停止への切り換え時に停止切り換わり信号を
出力するとともに、クロック停止に前もって外部割り込
み源からの前記CPUへの割り込み信号の入力を禁止
し、前記クロック切換回路から出力される停止切り換わ
り信号の入力に基づいて外部割り込み源からの前記CP
Uへの割り込み信号の入力禁止を解除する割り込み禁止
回路をさらに備え、かつ、前記CPUは、前記クロック
設定回路に対してクロック停止を設定するステップの前
に、前記割り込み禁止回路に割り込み禁止設定信号を出
力して外部割り込み源からの割り込み信号の入力を禁止
するステップをさらに有することにより、クロック停止
に切り換え動作中に割り込みを禁止することでCPUと
して例外処理が減り、制御が簡単になる。
Further, the clock switching circuit outputs a stop switching signal when switching from the high-speed clock to the stop, and inhibits the input of an interrupt signal to the CPU from an external interrupt source before stopping the clock. Based on the input of the stop switching signal output from the clock switching circuit, the CP
An interrupt disabling circuit for canceling the inhibition of the input of an interrupt signal to the U, and wherein the CPU sets an interrupt disabling setting signal to the interrupt disabling circuit before the step of setting a clock stop for the clock setting circuit. Is output to inhibit the input of an interrupt signal from an external interrupt source. By disabling the interrupt during the operation of switching to the clock stop, the exception processing as the CPU is reduced, and the control is simplified.

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

【図1】 本発明の実施の形態に係るCPUのクロック
切換システムを示す構成図である。
FIG. 1 is a configuration diagram showing a clock switching system of a CPU according to an embodiment of the present invention.

【図2】 図1のCPUの動作フローチャートである。FIG. 2 is an operation flowchart of a CPU of FIG. 1;

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

1 CPU 2 クロック設定回路 3 タイマ 4 高速クロック発振制御回路 5 発振回路 6 クロック切換回路 7 割り込み禁止回路 1 CPU 2 Clock setting circuit 3 Timer 4 High-speed clock oscillation control circuit 5 Oscillation circuit 6 Clock switching circuit 7 Interrupt disable circuit

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 CPUに供給するCPUクロックとして
高速クロックを発振する発振回路と、 前記CPUの現在のクロック状態が高速クロックのとき
に前記CPUから出力されるクロック停止への設定変更
を示すクロック設定信号の入力に基づいて高速クロック
から停止への設定変更信号を出力するクロック設定回路
と、 前記設定変更信号の入力に基づいて前記CPUがクロッ
ク停止に設定してから低消費電力モードにするための1
つ以上の命令群を実行するより長いあらかじめ設定され
た時間経過後にタイマ満了信号を出力するタイマと、 前記CPUに供給するCPUクロックとして、通常は前
記発振回路からの高速クロックを供給するとともに前記
タイマからのタイマ満了信号の入力に基づいて高速クロ
ックから停止に切り換えるクロック切換回路とを、 有するCPUのクロック切換システム。
1. An oscillation circuit for oscillating a high-speed clock as a CPU clock supplied to a CPU, and a clock setting indicating a setting change to stop the clock output from the CPU when the current clock state of the CPU is the high-speed clock. A clock setting circuit that outputs a setting change signal from a high-speed clock to a stop based on a signal input; and a low power consumption mode after the CPU sets the clock to stop based on the input of the setting change signal. 1
A timer for outputting a timer expiration signal after a lapse of a preset time longer than the execution of one or more instruction groups; and a CPU which supplies a high-speed clock from the oscillation circuit as a CPU clock to be supplied to the CPU. A clock switching circuit for switching from a high-speed clock to a stop based on the input of a timer expiration signal from the CPU.
【請求項2】 前記発振回路による高速クロックの発振
をオン/オフ制御する高速クロック発振制御回路をさら
に備え、前記タイマは、前記クロック設定回路からクロ
ック高速から停止への設定変更信号の入力を受けたとき
は、外部から与えられる前記高速クロックより遅い低速
クロックをカウントして所定のカウント数になったらタ
イマ満了信号を前記クロック切換回路の他に前記高速ク
ロック発振制御回路にも出力して前記発振回路の発振を
停止させる請求項1記載のCPUのクロック切換システ
ム。
2. A high-speed clock oscillation control circuit for controlling ON / OFF of oscillation of a high-speed clock by the oscillation circuit, wherein the timer receives an input of a setting change signal from high-speed clock to stop from the clock setting circuit. When a low-speed clock that is slower than the externally applied high-speed clock is counted and a predetermined count is reached, a timer expiration signal is output to the high-speed clock oscillation control circuit in addition to the clock switching circuit and the oscillation is started. 2. The CPU clock switching system according to claim 1, wherein the oscillation of the circuit is stopped.
【請求項3】 前記CPUでの処理は、前記クロック設
定回路に対してクロック停止を設定するステップと、当
該クロック停止の設定後、前記タイマからタイマ満了信
号が出力されるまでの間に低消費電力モードにするため
の1つ以上の命令群を実行するステップとを有する請求
項1又は2記載のCPUのクロック切換システム。
3. The processing in the CPU includes the steps of: setting a clock stop for the clock setting circuit; and setting a low power consumption after the setting of the clock stop until a timer expiration signal is output from the timer. Executing one or more instructions to enter a power mode.
【請求項4】 前記クロック切換回路は、高速クロック
から停止への切り換え時に停止切り換わり信号を出力す
るとともに、クロック停止に前もって外部割り込み源か
らの前記CPUへの割り込み信号の入力を禁止し、前記
クロック切換回路から出力される停止切り換わり信号の
入力に基づいて外部割り込み源からの前記CPUへの割
り込み信号の入力禁止を解除する割り込み禁止回路をさ
らに備え、かつ、前記CPUでの処理は、前記クロック
設定回路に対してクロック停止を設定するステップの前
に、前記割り込み禁止回路に割り込み禁止設定信号を出
力して外部割り込み源からの割り込み信号の入力を禁止
するステップをさらに有する請求項3記載のCPUのク
ロック切換システム。
4. The clock switching circuit outputs a stop switching signal when switching from a high-speed clock to a stop, and inhibits input of an interrupt signal from an external interrupt source to the CPU before stopping the clock. The apparatus further includes an interrupt prohibition circuit that releases input prohibition of an interrupt signal from the external interrupt source to the CPU based on the input of the stop switching signal output from the clock switching circuit, and the processing in the CPU includes the following. 4. The method according to claim 3, further comprising a step of outputting an interrupt disable setting signal to the interrupt disable circuit to inhibit the input of an interrupt signal from an external interrupt source before the step of setting the clock stop to the clock setting circuit. CPU clock switching system.
JP9225514A 1997-08-08 1997-08-08 Clock-switching system for cpu Withdrawn JPH1165697A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9225514A JPH1165697A (en) 1997-08-08 1997-08-08 Clock-switching system for cpu

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9225514A JPH1165697A (en) 1997-08-08 1997-08-08 Clock-switching system for cpu

Publications (1)

Publication Number Publication Date
JPH1165697A true JPH1165697A (en) 1999-03-09

Family

ID=16830516

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9225514A Withdrawn JPH1165697A (en) 1997-08-08 1997-08-08 Clock-switching system for cpu

Country Status (1)

Country Link
JP (1) JPH1165697A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003070963A (en) * 2001-08-31 2003-03-11 Net:Kk Slot machine and information terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003070963A (en) * 2001-08-31 2003-03-11 Net:Kk Slot machine and information terminal

Similar Documents

Publication Publication Date Title
US5428790A (en) Computer power management system
KR100688102B1 (en) Integrated circuit device
US5502689A (en) Clock generator capable of shut-down mode and clock generation method
KR920002754B1 (en) Microcomputer system with sleep function to save power consumption
US5930516A (en) Real time power conservation for computers
JPH08314587A (en) Power saving power source circuit
JP3475510B2 (en) Integrated circuit with power saving function
US6255882B1 (en) Method and system of switching clock signal
JP3460736B2 (en) Clock control circuit
JP2006180486A (en) Electronic device and power consumption prevention method for preventing power consumption by regulator in power down mode
JPH1165697A (en) Clock-switching system for cpu
JPH04245518A (en) Information processor
KR100272531B1 (en) Method for prohibitting exhaust of power source in electronic equipment
JP2002063150A (en) Microcomputer
JP2002132395A (en) Data processor and data processing system
JPH05259825A (en) Clock generating circuit
JP2828132B2 (en) Mobile telephone terminal and method of controlling mobile telephone terminal
JP2003337634A (en) COMPUTER DEVICE, PROCESSOR CONTROL METHOD, PROGRAM FOR CAUSING COMPUTER TO EXECUTE PROCESSOR CONTROL METHOD, AND COMPUTER-READABLE RECORDING MEDIUM CONTAINING PROGRAM FOR CAUSING COMPUTER TO EXECUTE PROCESSOR CONTROL METHOD
JPS61123916A (en) Microcomputer
JPH0863253A (en) Microprocessor
JPH0750420B2 (en) Power control device for digital circuit
JP2830216B2 (en) Standby circuit
JPH0969052A (en) Interrupt control circuit
JPS5916029A (en) Starting circuit of electronic device
JP2705311B2 (en) Microcomputer

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20041102