JPH076155A - Single chip microcomputer - Google Patents

Single chip microcomputer

Info

Publication number
JPH076155A
JPH076155A JP5143090A JP14309093A JPH076155A JP H076155 A JPH076155 A JP H076155A JP 5143090 A JP5143090 A JP 5143090A JP 14309093 A JP14309093 A JP 14309093A JP H076155 A JPH076155 A JP H076155A
Authority
JP
Japan
Prior art keywords
signal
clock
reset
circuit
clock 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.)
Pending
Application number
JP5143090A
Other languages
Japanese (ja)
Inventor
Shoji Numata
正二 沼田
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 IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer Systems 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 NEC IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP5143090A priority Critical patent/JPH076155A/en
Publication of JPH076155A publication Critical patent/JPH076155A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To prevent a CPU from being stopped due to the failure or the like of an oscillator. CONSTITUTION:This single chip microcomputer is provided with a system clock selecting circuit 9 for selecting a clock signal through a clock switching signal 108 and supplying a system clock signal 109 to a CPU, a timer 4 to be reset by a timer reset signal 105, a timer reset flag 8 for outputting the signal 105, an OR circuit 5 for outputting an OR result between a system reset signal 103 and a time carry signal 106 as a flag reset signal 107, an oscillation control flag 7 capable of outputting an oscillation control signal 104 to a main clock oscillation circuit 3 and allowed to be reset by the signal 107, and a clock switching flag 6 capable of outputting the signal 108 and allowed to be reset by the signal 107. At the time of stopping the operation of the circuit 3, the circuit 3 is switched to a subclock oscillation circuit 2.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はシングルチップ・マイク
ロコンピュータに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a single chip microcomputer.

【0002】[0002]

【従来の技術】近年のシングルチップ・マイクロコンピ
ュータに対して求められる性能の一つに消費電力の低減
が挙げられる。この低消費電力を実現する手段の1例と
して、高速動作用のメイン・システム・クロック信号
と、低速動作用のサブ・システム・クロック信号とを発
生する二つの発振回路を用いる方法がある。この方法に
おいては、高速動作が必要となる場合においてのみメイ
ン・クロック発振回路を起動して、高速クロック信号に
より中央処理装置(以下、CPUと云う)を動作させ、
また、逆に低速のクロック信号でも動作可能な場合に
は、消費電力の大きいメイン・クロック発振回路を停止
させて、消費電力の少ないサブ・クロック発振回路を起
動して、低速クロック信号によりCPUを動作させるよ
うにしている。
2. Description of the Related Art One of the performances required of recent single-chip microcomputers is reduction of power consumption. As one example of means for realizing this low power consumption, there is a method using two oscillation circuits that generate a main system clock signal for high speed operation and a sub system clock signal for low speed operation. In this method, the main clock oscillation circuit is activated only when high speed operation is required, and the central processing unit (hereinafter referred to as CPU) is operated by the high speed clock signal.
On the other hand, when it is possible to operate even with a low-speed clock signal, the main clock oscillation circuit with high power consumption is stopped, the sub clock oscillation circuit with low power consumption is started, and the CPU is driven by the low-speed clock signal. I am trying to make it work.

【0003】図2は、従来のシングルチップ・マイクロ
コンピュータの1例を示すブロック図である。図2に示
されるように、当該シングルチップ・マイクロコンピュ
ータ10は、内部バス201に対応して、クロック発振
回路11と、CPU12と、リセット制御回路13と、
メモリ14と、周辺回路15とを備えて構成される。
FIG. 2 is a block diagram showing an example of a conventional single-chip microcomputer. As shown in FIG. 2, the single-chip microcomputer 10 has a clock oscillator circuit 11, a CPU 12, a reset control circuit 13, and a clock signal corresponding to an internal bus 201.
The memory 14 and the peripheral circuit 15 are provided.

【0004】図2において、クロック発生回路11にお
いては、外部端子31、32、33および34に所定の
発振子を接続することにより、当該発振子の固有周波数
に対応するシステム・クロック108が生成され、当該
システム・クロック信号108は、それぞれCPU1
2、メモリ14および周辺回路15に対して供給され
る。CPU12においては、メモリ14より読出される
プログラムによる命令が実行されるとともに、処理デー
タが出力されて当該メモリ14に格納される。また、リ
セット制御回路13からはシステム・リセット信号10
3が出力されて、クロック発振回路11、CPU12、
メモリ14および周辺回路15に供給され、これによ
り、これらのクロック発振回路11、CPU12、メモ
リ14および周辺回路15におけるシステムの初期状態
が設定される。このシステム・リセット信号103は、
シングルチップ・マイクロコンピュータのシステム起動
時において、一時的に“1”レベルとなり、これによ
り、クロック発振回路11、CPU12、メモリ14お
よび周辺回路15は初期状態にリセットされる。
In FIG. 2, in the clock generation circuit 11, by connecting a predetermined oscillator to the external terminals 31, 32, 33 and 34, the system clock 108 corresponding to the natural frequency of the oscillator is generated. , The system clock signal 108 is sent to the CPU 1 respectively.
2, supplied to the memory 14 and the peripheral circuit 15. In the CPU 12, the instruction by the program read from the memory 14 is executed, and the processed data is output and stored in the memory 14. In addition, the system reset signal 10 from the reset control circuit 13
3 is output, the clock oscillation circuit 11, the CPU 12,
The clock 14 is supplied to the memory 14 and the peripheral circuit 15, whereby the initial state of the system in the clock oscillation circuit 11, the CPU 12, the memory 14 and the peripheral circuit 15 is set. This system reset signal 103 is
When the system of the single-chip microcomputer is activated, the level temporarily becomes "1", whereby the clock oscillation circuit 11, the CPU 12, the memory 14, and the peripheral circuit 15 are reset to the initial state.

【0005】図3は、図2におけるクロック発振回路1
1の内部構成を示すブロック図である。図3に示される
ように、当該クロック発振回路11は、内部バス201
に対応して、サブ・クロック発振回路2と、メイン・ク
ロック発振回路3と、クロック切替フラグ6と、発振制
御フラグ7と、システム・クロック切替回路9とを備え
て構成される。
FIG. 3 shows the clock oscillator circuit 1 shown in FIG.
2 is a block diagram showing the internal configuration of No. 1. As shown in FIG. 3, the clock oscillator circuit 11 includes an internal bus 201.
Corresponding to, the sub clock oscillation circuit 2, the main clock oscillation circuit 3, the clock switching flag 6, the oscillation control flag 7, and the system clock switching circuit 9 are configured.

【0006】図3において、発振制御フラグ7において
は、図2におけるCPU12により実行される命令によ
り、内部バス201を介して入力されるデータが格納さ
れるとともに、発振制御信号104が出力されて、メイ
ン・クロック発振回路3に供給される。また、リセット
制御回路より出力されるシステム・リセット信号103
が“1”レベルになるとリセットされ、発振制御信号1
04は“0”レベルにリセットされる。メイン・クロッ
ク発振回路3においては、外部端子33および34にメ
イン・クロック発振子を接続することにより、当該メイ
ン・クロック発振子の固有周波数に対応するメイン・ク
ロック発振回路が形成され、発振制御フラグ7より供給
される発振制御信号104が“1”レベルになる時点に
おいて発振が開始される。このメイン・クロック発生回
路3より出力されるメイン・クロック信号102は、シ
ステム・クロック切替回路9に供給される。
In FIG. 3, in the oscillation control flag 7, the data input via the internal bus 201 is stored by the instruction executed by the CPU 12 in FIG. 2, and the oscillation control signal 104 is output. It is supplied to the main clock oscillator circuit 3. In addition, the system reset signal 103 output from the reset control circuit
Is reset when the signal goes to "1" level and oscillation control signal 1
04 is reset to "0" level. In the main clock oscillator circuit 3, by connecting the main clock oscillator to the external terminals 33 and 34, a main clock oscillator circuit corresponding to the natural frequency of the main clock oscillator is formed, and the oscillation control flag is set. Oscillation is started at the time when the oscillation control signal 104 supplied from 7 goes to "1" level. The main clock signal 102 output from the main clock generating circuit 3 is supplied to the system clock switching circuit 9.

【0007】クロック切替フラグ6においては、CPU
12において実行される命令により、内部バス201を
介して入力されるデータが格納されるとともに、クロッ
ク切替信号104が出力されて、システム・クロック切
替回路9に供給される。また、クロック切替フラグ6
は、リセット制御回路13より送られてくるシステム・
リセット信号103が“1”レベルになるとリセットさ
れ、これにより、出力されるクロック切替信号107も
“0”レベルにリセットされる。
In the clock switching flag 6, the CPU
The data input via the internal bus 201 is stored by the instruction executed in 12 and the clock switching signal 104 is output and supplied to the system clock switching circuit 9. Also, the clock switching flag 6
Is the system sent from the reset control circuit 13.
When the reset signal 103 becomes "1" level, it is reset, and thereby the output clock switching signal 107 is also reset to "0" level.

【0008】システム・クロック切替回路9において
は、サブ・クロック信号101およびメイン・クロック
信号102の入力に対応して、クロック切替フラグ6よ
り入力されるクロック切替信号107を介して、その内
の何れか一方のクロック信号が選択されてシステム・ク
ロック信号108として出力され、前述のように、CP
U12、リセット制御回路13、メモリ14および周辺
回路15に供給される。この場合、クロック切替信号1
07が“0”レベルの時にはサブ・クロック信号101
が選択され、またクロック切替信号107が“1”レベ
ルの時にはメイン・クロック信号102が選択される。
なお、通常は、システム・クロック切替回路9において
は、システム・クロック信号の切替時にハザードが生じ
ないように、同期回路が内蔵されている。
In the system clock switching circuit 9, one of the sub clock signal 101 and the main clock signal 102 is inputted via the clock switching signal 107 inputted from the clock switching flag 6 in response to the input. One of the clock signals is selected and output as the system clock signal 108.
It is supplied to the U 12, the reset control circuit 13, the memory 14, and the peripheral circuit 15. In this case, clock switching signal 1
When 07 is at "0" level, the sub clock signal 101
Is selected and the clock switching signal 107 is at "1" level, the main clock signal 102 is selected.
Normally, the system clock switching circuit 9 has a built-in synchronizing circuit so that a hazard does not occur when the system clock signal is switched.

【0009】次に、システム起動時およびシステム・ク
ロック切替時における動作について説明する。
Next, the operation at system startup and system clock switching will be described.

【0010】システム起動時においては、システム・リ
セット信号103が一時的に“1”レベルに設定され
る。これにより、発振制御フラグ7およびクロック切替
フラグ6がリセットされ、発振制御信号104およびク
ロック切替信号107は、それぞれ“0”レベルにな
る。従って、メイン・クロック発振回路3の発振動作は
停止され、システム・クロック切替回路9においては、
サブ・クロック発振回路2より出力されるサブ・クロッ
ク信号101が選択されて、システム・クロック信号1
08として出力され、それぞれCPU12、リセット制
御回路13、メモリ14および周辺回路15に供給され
る。即ち、システムの起動直後においては、メイン・ク
ロック発振回路3の動作は停止状態となり、システム・
クロック信号108としては、サブ・クロック信号10
1が選択されており、消費電力の少ない低速動作状態に
規制されている。
At system startup, the system reset signal 103 is temporarily set to "1" level. As a result, the oscillation control flag 7 and the clock switching flag 6 are reset, and the oscillation control signal 104 and the clock switching signal 107 are set to the "0" level, respectively. Therefore, the oscillation operation of the main clock oscillation circuit 3 is stopped, and in the system clock switching circuit 9,
The sub clock signal 101 output from the sub clock oscillator circuit 2 is selected, and the system clock signal 1 is selected.
It is output as 08 and is supplied to the CPU 12, the reset control circuit 13, the memory 14, and the peripheral circuit 15, respectively. That is, immediately after the system is started, the operation of the main clock oscillation circuit 3 is stopped and the system
As the clock signal 108, the sub clock signal 10
1 is selected, and the low-speed operation state with low power consumption is restricted.

【0011】この動作状態において、システム・クロッ
ク信号108として、サブ・クロック信号101からメ
イン・クロック信号102に切替える場合には、先ずC
PU12において命令が実行され、発振制御フラグ7に
“1”レベルが設定されて、発振制御信号104が
“1”レベルとなり、これにより、メイン・クロック発
振回路3の発振が開始されて、メイン・クロック信号1
02が生成される。次に、CPU12において実行され
る命令により、クロック切替フラグ7に“1”レベルが
設定され、これによりクロック切替信号107は“1”
レベルとなり、システム・クロック切替回路9において
は、メイン・クロック信号102が選択されて、システ
ム・クロック信号108として出力される。このメイン
・クロック信号108によるシステム・クロック信号1
08が、CPU12、リセット制御回路13、メモリ1
4および周辺回路15に供給されることにより、当該シ
ングルチップ・マイクロコンピュータは高速動作状態と
なる。
In this operating state, when switching from the sub clock signal 101 to the main clock signal 102 as the system clock signal 108, first, C
The instruction is executed in the PU 12, the oscillation control flag 7 is set to the “1” level, and the oscillation control signal 104 becomes the “1” level, whereby the oscillation of the main clock oscillation circuit 3 is started and the main clock oscillation circuit 3 starts. Clock signal 1
02 is generated. Next, an instruction executed by the CPU 12 sets the clock switching flag 7 to the "1" level, whereby the clock switching signal 107 is set to "1".
The level becomes high, and the system clock switching circuit 9 selects the main clock signal 102 and outputs it as the system clock signal 108. System clock signal 1 based on this main clock signal 108
08 is the CPU 12, the reset control circuit 13, the memory 1
4 and the peripheral circuit 15, the single chip microcomputer is brought into a high speed operation state.

【0012】次に、システム・クロック信号108をメ
イン・クロック信号102からサブ・クロック信号10
1に切替える場合には、先ずCPU12において命令が
実行され、クロック切替フラグ6に“0”レベルが設定
されて、これによりクロック切替信号107は“0”レ
ベルとなり、システム・クロック切替回路9において
は、サブ・クロック信号101が選択されて、システム
・クロック信号108として出力される。このサブ・ク
ロック信号101によるシステム・クロック信号108
が、CPU12、リセット制御回路13、メモリ14お
よび周辺回路15に供給されることにより、当該シング
ルチップ・マイクロコンピュータは低速動作状態とな
る。更に、CPU12において命令が実行されて、発振
制御フラグ7に“0”レベルが設定されると、発振制御
信号104は“0”レベルとなり、メイン・クロック発
振回路3の発振動作は停止され、消費電力が低減され
る。
Next, the system clock signal 108 is changed from the main clock signal 102 to the sub clock signal 10.
When switching to 1, the CPU 12 first executes an instruction to set the clock switching flag 6 to "0" level, whereby the clock switching signal 107 becomes "0" level, and in the system clock switching circuit 9, , The sub clock signal 101 is selected and output as the system clock signal 108. The system clock signal 108 based on this sub clock signal 101
Are supplied to the CPU 12, the reset control circuit 13, the memory 14, and the peripheral circuit 15, so that the single-chip microcomputer is brought into a low speed operation state. Further, when an instruction is executed in the CPU 12 and the oscillation control flag 7 is set to the "0" level, the oscillation control signal 104 becomes the "0" level, the oscillation operation of the main clock oscillation circuit 3 is stopped, and the consumption is stopped. Power is reduced.

【0013】[0013]

【発明が解決しようとする課題】上述した従来のシング
ルチップ・マイクロコンピュータにおいては、システム
・クロック信号を、サブ・クロック信号からメイン・ク
ロック信号に切替えた場合に、メイン・クロック発振回
路において、メイン・クロック発振子の故障等の原因に
より、メイン・クロック信号が生成されないという状態
においては、CPUにシステム・クロック信号が供給さ
れない異常事態となり、シングルチップ・マイクロコン
ピュータのシステムが復帰不能状態に陥ってしまうとい
う欠点がある。
In the conventional single-chip microcomputer described above, when the system clock signal is switched from the sub clock signal to the main clock signal, the main clock oscillation circuit is If the main clock signal is not generated due to a failure of the clock oscillator, the system clock signal will not be supplied to the CPU, and the system of the single-chip microcomputer will be unable to recover. There is a drawback that it ends up.

【0014】[0014]

【課題を解決するための手段】本発明のシングルチップ
・マイクロコンピュータは、発振周波数の異なる少なく
とも2個以上の複数のクロック信号供給源と、前記複数
のクロック信号供給源より出力されるクロック信号を受
けて、所定のクロック切替信号を介してその内の一つの
クロック信号を選択し、システム・クロック信号として
CPUに供給するシステム・クロック選択回路と、前記
複数のクロック信号供給源に含まれているクロック信号
供給源の内の、システム起動時において稼働する特定の
クロック信号供給源より出力されるクロック信号をカウ
ントしてタイム・キャリー信号を出力するとともに、所
定のタイマ・リセット信号を介してリセットされるタイ
マと、CPUにおける命令の実行を受けて、前記タイマ
・リセット信号を出力するタイマ・リセット・フラグ
と、所定のシステム・リセット信号ならびに前記タイム
・キャリー信号を受けて、これらの両信号の論理和をフ
ラグ・リセット信号として出力する論理回路と、CPU
における命令の実行を受けて、前記特定のクロック信号
供給源以外のクロック信号供給源に対して発振制御信号
を出力するとともに、前記フラグ・リセット信号により
リセットされる発振制御フラグと、CPUにおける命令
の実行を受けて、前記クロック切替信号を出力するとと
もに、前記フラグ・リセット信号によりリセットされる
クロック切替フラグと、を少なくとも備えて構成される
クロック発生回路を内蔵し、前記特定のクロック供給源
以外のクロック供給源の動作停止時に、前記システム・
クロック選択回路および前記発振制御フラグの動作を介
して、クロック信号供給源を前記特定のクロック信号供
給源に切替えることを特徴としている。
A single-chip microcomputer according to the present invention provides at least two clock signal supply sources having different oscillation frequencies and clock signals output from the clock signal supply sources. It is included in the plurality of clock signal supply sources and a system clock selection circuit which receives and selects one of the clock signals via a predetermined clock switching signal and supplies it to the CPU as a system clock signal. Of the clock signal supply sources, a clock signal output from a specific clock signal supply source that operates at system startup is counted, a time carry signal is output, and the clock signal is reset via a predetermined timer reset signal. And a timer reset signal in response to the execution of an instruction in the CPU. A timer reset flag to force a logic circuit which receives a predetermined system reset signal and the time-carry signal, and outputs the logical sum of these two signals as a flag reset signal, CPU
Output an oscillation control signal to a clock signal supply source other than the specific clock signal supply source in response to the execution of the instruction in 1), and an oscillation control flag reset by the flag reset signal, Upon execution, a clock generation circuit configured to output at least the clock switching signal and at least a clock switching flag reset by the flag / reset signal is built-in, and a clock generator other than the specific clock supply source is provided. When the clock source stops operating, the system
The clock signal supply source is switched to the specific clock signal supply source through the operation of the clock selection circuit and the oscillation control flag.

【0015】[0015]

【実施例】次に、本発明について図面を参照して説明す
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described with reference to the drawings.

【0016】図1は本発明の一実施例におけるクロック
発生回路を示すブロック図である。図1に示されるよう
に、本実施例におけるクロック発生回路1は、内部バス
201に対応して、サブ・クロック発振回路2と、メイ
ン・クロック発振回路3と、タイマ4と、OR回路5
と、クロック切替フラグ6と、発振制御フラグ7と、タ
イマ・リセット・フラグ8と、システム・クロック切替
回路9とを備えて構成される。なお、本発明のシングル
チップ・マイクロコンピュータ全体のブロック図として
は、図2を参照するものとする。
FIG. 1 is a block diagram showing a clock generation circuit according to an embodiment of the present invention. As shown in FIG. 1, the clock generation circuit 1 in the present embodiment corresponds to the internal bus 201, a sub clock oscillation circuit 2, a main clock oscillation circuit 3, a timer 4, and an OR circuit 5.
A clock switching flag 6, an oscillation control flag 7, a timer reset flag 8, and a system clock switching circuit 9. Note that FIG. 2 is referred to as a block diagram of the entire single-chip microcomputer of the present invention.

【0017】図1と図3との対比により明らかなよう
に、本実施例におけるクロック発生回路と、従来例にお
けるクロック発生回路との相違点は、本実施例において
は、新たに、タイマ4、OR回路5およびタイマ・リセ
ット・フラグ8が付加されている点と、発振制御フラグ
7およびクロック切替フラグ6に対して入力されるシス
テム・リセット信号103が、フラグ・リセット信号1
07に変更されている点である。また、図1に示される
ように、タイマ4に対するクロック信号入力としては、
サブ・クロック発振回路2より出力されるサブ・クロッ
ク信号101が入力されており、OR回路5に対する入
力としては、タイマ4より出力されるタイマ・キャリー
信号106と、リセット制御回路13より出力されるシ
ステム・リセット信号103とが入力されている。前述
のフラグ・リセット信号107は、このOR回路5にお
ける、タイマ・キャリー信号106とシステム・リセッ
ト信号103との論理和出力である。
As is clear from the comparison between FIG. 1 and FIG. 3, the difference between the clock generating circuit in the present embodiment and the clock generating circuit in the conventional example is that a timer 4, The OR circuit 5 and the timer reset flag 8 are added, and the system reset signal 103 input to the oscillation control flag 7 and the clock switching flag 6 is the flag reset signal 1.
It is a point that has been changed to 07. Further, as shown in FIG. 1, as a clock signal input to the timer 4,
The sub clock signal 101 output from the sub clock oscillation circuit 2 is input, and the inputs to the OR circuit 5 are the timer carry signal 106 output from the timer 4 and the reset control circuit 13. The system reset signal 103 is input. The flag / reset signal 107 is the logical sum output of the timer carry signal 106 and the system reset signal 103 in the OR circuit 5.

【0018】図1において、サブ・クロック発振回路
2、メイン・クロック発振回路3、クロック切替フラグ
6、発振制御フラグ7およびシステム・クロック切替回
路9等の動作については、前述の従来例の場合と同様で
あり、これらの具体的な動作については、前述の説明と
重複するために説明を省略する。新たに付加されたタイ
マ4は、サブ・クロック信号101のクロック数をカウ
ントするバイナリ・カウンタにより形成されており、C
PU12において命令が実行されて、タイマ・リセット
・フラグ8に“1”レベルが設定されると、タイマ・リ
セット105が“1”レベルとなり、当該タイマ4のカ
ウント値が0にリセットされる。また、サブ・クロック
信号101のクロック数のカウント値がオーバ・フロー
すると、その時点においてタイマ・キャリー信号106
が出力されてOR回路5に入力される。タイマ・リセッ
ト・フラグ8より出力されるタイマ・リセット信号10
5は、CPU12により“1”レベルが設定された時点
においてのみ、一時的に“1”レベルに設定されて出力
されるが、通常の時間帯においては“0”レベルにリセ
ットされている。タイマ4より出力されるタイマ・キャ
リー信号106は、タイマ4がオーバフローした時にお
いてのみ一時的に“1”レベルとなるが、通常く“0”
レベルの状態のままである。
In FIG. 1, the operations of the sub clock oscillation circuit 2, the main clock oscillation circuit 3, the clock switching flag 6, the oscillation control flag 7, the system clock switching circuit 9, etc. are the same as those of the above-mentioned conventional example. The same is true, and their specific operations are omitted because they overlap with the above description. The newly added timer 4 is formed by a binary counter that counts the number of clocks of the sub clock signal 101.
When the instruction is executed in the PU 12 and the timer reset flag 8 is set to the “1” level, the timer reset 105 is set to the “1” level and the count value of the timer 4 is reset to 0. When the count value of the clock number of the sub clock signal 101 overflows, the timer carry signal 106
Is output and input to the OR circuit 5. Timer reset signal 10 output from timer reset flag 8
5 is temporarily set to the "1" level and output only when the "1" level is set by the CPU 12, but is reset to the "0" level in the normal time zone. The timer carry signal 106 output from the timer 4 temporarily becomes "1" level only when the timer 4 overflows, but normally it is "0".
Remains leveled.

【0019】OR回路5においては、リセット制御回路
13より出力されるシステム・リセット信号103が
“1”レベルになるか、またはタイマ・キャリー信号1
06が“1”レベルになると、フラグ・リセット信号1
07として“1”レベルが出力されて、クロック切替フ
ラグ6および発振制御フラグ7に入力される。このフラ
グ・リセット信号107が“1”レベルで出力される
と、発振制御フラグ7およびクロック切替フラグ6は共
にリセットされ、発振制御フラグ7およびクロック切替
フラグ6より、それぞれ出力される発振制御信号104
およびクロック切替信号108は“0”レベルにリセッ
トされる。
In the OR circuit 5, the system reset signal 103 output from the reset control circuit 13 becomes "1" level or the timer carry signal 1
When 06 becomes "1" level, flag reset signal 1
The “1” level is output as 07 and is input to the clock switching flag 6 and the oscillation control flag 7. When the flag / reset signal 107 is output at "1" level, both the oscillation control flag 7 and the clock switching flag 6 are reset, and the oscillation control signal 104 output from the oscillation control flag 7 and the clock switching flag 6 respectively.
And the clock switching signal 108 is reset to "0" level.

【0020】以下において、システム・クロック信号1
09が正常にCPU12に供給されている場合の動作に
ついて説明する。タイマ4は、タイマ4よりタイマ・キ
ャリー信号106が出力される以前の段階において、C
PU12によって、定期的に“1”レベルに設定される
タイマ・リセット・フラグ8より出力されるタイマ・リ
セット信号105を介してリセットされる。従って、シ
ステム・クロック信号109として、サブ・クロック信
号101と、メイン・クロック信号102の何れのクロ
ック信号を選択するかの設定は、CPU12のクロック
切替フラグ6および発振制御フラグ7に対する制御操作
により任意に実行される。
In the following, the system clock signal 1
The operation in the case where 09 is normally supplied to the CPU 12 will be described. The timer 4 is C before the timer carry signal 106 is output from the timer 4.
It is reset by the PU 12 via the timer reset signal 105 output from the timer reset flag 8 which is periodically set to "1" level. Therefore, which of the sub-clock signal 101 and the main clock signal 102 is selected as the system clock signal 109 can be set by the control operation of the clock switching flag 6 and the oscillation control flag 7 of the CPU 12. To be executed.

【0021】次に、システム・クロック信号109とし
て、メイン・クロック信号102が選択された場合に、
メイン・クロック信号102がメイン・クロック発振回
路3より供給されない状態における動作について説明す
る。システム・クロック信号109にメイン・クロック
信号102が選択された場合には、メイン・クロック信
号発振回路3においてメイン・クロック信号102が生
成されない事態においては、CPU12にシステム・ク
ロック信号109が供給されないために、CPU12の
動作は停止される。CPU12の動作が停止されると、
タイマ・リセット・フラグ8よりは、タイマ・リセット
信号105がタイマ5に入力されなくなり、これによ
り、タイマ4はリセットされない状態となる。このため
に、当該タイマ回路4からはタイマ・キャリー信号10
6が随時出力されて、OR回路5に入力される。これに
よりOR回路5から出力されるフラグ・リセット信号1
07は、常時“1”レベルとなって出力され、クロック
切替フラグ6および発振制御フラグ7に入力される。こ
の“1”レベルのフラグ・リセット信号107により、
クロック切替フラグ6および発振制御フラグ7は共にリ
セットされ、これらのフラグより出力されるクロック切
替信号108および発振制御信号104も、それぞれ
“0”レベルにリセットされる。従って、メイン・クロ
ック発振回路3の発振動作は停止され、システム・クロ
ック切替回路9においては、サブ・クロック信号101
が選択されて、システム・クロック信号109として出
力され、CPU12等に供給される。これにより、CP
U12等における動作が再開されて命令処理が継続実行
される。
Next, when the main clock signal 102 is selected as the system clock signal 109,
The operation in the state where the main clock signal 102 is not supplied from the main clock oscillation circuit 3 will be described. When the main clock signal 102 is selected as the system clock signal 109, the system clock signal 109 is not supplied to the CPU 12 when the main clock signal oscillation circuit 3 does not generate the main clock signal 102. Then, the operation of the CPU 12 is stopped. When the operation of the CPU 12 is stopped,
The timer reset signal 105 is not input to the timer 5 from the timer reset flag 8, and thus the timer 4 is not reset. Therefore, the timer carry signal 10 is output from the timer circuit 4.
6 is output at any time and is input to the OR circuit 5. As a result, the flag / reset signal 1 output from the OR circuit 5
07 is always output as “1” level and is input to the clock switching flag 6 and the oscillation control flag 7. By this "1" level flag / reset signal 107,
Both the clock switch flag 6 and the oscillation control flag 7 are reset, and the clock switch signal 108 and the oscillation control signal 104 output from these flags are also reset to "0" level. Therefore, the oscillation operation of the main clock oscillation circuit 3 is stopped, and in the system clock switching circuit 9, the sub clock signal 101
Is selected, is output as the system clock signal 109, and is supplied to the CPU 12 and the like. This makes CP
The operation in U12 or the like is restarted and the instruction processing is continuously executed.

【0022】[0022]

【発明の効果】以上説明したように、本発明は、メイン
・クロック信号をシステム・クロック信号とするシステ
ム稼働時における、メイン・クロック発振回路の動作停
止障害に対応して、CPUの命令によりリセットされ、
サブ・クロック信号のクロック数をカウントするタイマ
を設け、当該タイマより出力されるタイマ・キャリー信
号により、CPUに供給されるシステム・クロック信号
の選択を指定するクロック切替フラグと、メイン・クロ
ック信号発振回路の動作を制御する発振制御フラグとを
リセットすることにより、自動的にシステム・クロック
信号をサブ・クロック信号に切替えて、CPUの復帰不
能状態を回避することができるという効果がある。
As described above, according to the present invention, in response to an operation stop failure of the main clock oscillation circuit during system operation in which the main clock signal is used as the system clock signal, the main clock oscillation circuit is reset by the instruction of the CPU. Is
A timer that counts the number of clocks of the sub clock signal is provided, and a clock switch flag that specifies selection of the system clock signal supplied to the CPU by the timer carry signal output from the timer, and a main clock signal oscillation By resetting the oscillation control flag that controls the operation of the circuit, there is an effect that the system clock signal can be automatically switched to the sub clock signal and the unrecoverable state of the CPU can be avoided.

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

【図1】本発明の一実施例におけるクロック発生回路を
示すブロック図である。
FIG. 1 is a block diagram showing a clock generation circuit in an embodiment of the present invention.

【図2】シングルチップ・マイクロコンピュータを示す
ブロック図である。
FIG. 2 is a block diagram showing a single-chip microcomputer.

【図3】従来例におけるクロック発生回路を示すブロッ
ク図である。
FIG. 3 is a block diagram showing a clock generation circuit in a conventional example.

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

1、11 クロック発生回路 2 サブ・クロック発振回路 3 メイン・クロック発振回路 4 タイマ 5 OR回路 6 クロック切替フラグ 7 発振制御フラグ 8 タイマ・リセット・フラグ 9 システム・クロック切替回路 12 CPU 13 リセット制御回路 14 メモリ 15 周辺回路 1, 11 Clock generation circuit 2 Sub clock oscillation circuit 3 Main clock oscillation circuit 4 Timer 5 OR circuit 6 Clock switching flag 7 Oscillation control flag 8 Timer reset flag 9 System clock switching circuit 12 CPU 13 Reset control circuit 14 Memory 15 peripheral circuit

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 発振周波数の異なる少なくとも2個以上
の複数のクロック信号供給源と、 前記複数のクロック信号供給源より出力されるクロック
信号を受けて、所定のクロック切替信号を介してその内
の一つのクロック信号を選択し、システム・クロック信
号としてCPUに供給するシステム・クロック選択回路
と、 前記複数のクロック信号供給源に含まれているクロック
信号供給源の内の、システム起動時において稼働する特
定のクロック信号供給源より出力されるクロック信号を
カウントしてタイム・キャリー信号を出力するととも
に、所定のタイマ・リセット信号を介してリセットされ
るタイマと、 CPUにおける命令の実行を受けて、前記タイマ・リセ
ット信号を出力するタイマ・リセット・フラグと、 所定のシステム・リセット信号ならびに前記タイム・キ
ャリー信号を受けて、これらの両信号の論理和をフラグ
・リセット信号として出力する論理回路と、 CPUにおける命令の実行を受けて、前記特定のクロッ
ク信号供給源以外のクロック信号供給源に対して発振制
御信号を出力するとともに、前記フラグ・リセット信号
によりリセットされる発振制御フラグと、 CPUにおける命令の実行を受けて、前記クロック切替
信号を出力するとともに、前記フラグ・リセット信号に
よりリセットされるクロック切替フラグと、 を少なくとも備えて構成されるクロック発生回路を内蔵
し、前記特定のクロック供給源以外のクロック供給源の
動作停止時に、前記システム・クロック選択回路および
前記発振制御フラグの動作を介して、クロック信号供給
源を前記特定のクロック信号供給源に切替えることを特
徴とするシングルチップ・マイクロコンピュータ。
1. A plurality of clock signal supply sources having different oscillation frequencies, and a clock signal output from the plurality of clock signal supply sources, and receiving a clock signal from the plurality of clock signal supply sources via a predetermined clock switching signal. A system clock selection circuit that selects one clock signal and supplies it to the CPU as a system clock signal; and a clock signal supply source included in the plurality of clock signal supply sources, which operates at system startup. A clock signal output from a specific clock signal supply source is counted, a time carry signal is output, and a timer reset via a predetermined timer reset signal and an instruction in a CPU are executed, Timer reset flag that outputs a timer reset signal and predetermined system reset Signal and the time carry signal, and a logical circuit that outputs a logical sum of these two signals as a flag reset signal, and a clock signal other than the specific clock signal supply source in response to execution of an instruction in the CPU An oscillation control signal is output to a supply source, and an oscillation control flag reset by the flag reset signal and an instruction in the CPU are executed to output the clock switching signal and the flag reset signal. And a clock switching flag which is reset by the system clock selection circuit and the oscillation control flag when the operation of a clock supply source other than the specific clock supply source is stopped. Through the operation of the clock signal source to the specific clock A single-chip microcomputer characterized by switching to a signal supply source.
JP5143090A 1993-06-15 1993-06-15 Single chip microcomputer Pending JPH076155A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5143090A JPH076155A (en) 1993-06-15 1993-06-15 Single chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5143090A JPH076155A (en) 1993-06-15 1993-06-15 Single chip microcomputer

Publications (1)

Publication Number Publication Date
JPH076155A true JPH076155A (en) 1995-01-10

Family

ID=15330683

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5143090A Pending JPH076155A (en) 1993-06-15 1993-06-15 Single chip microcomputer

Country Status (1)

Country Link
JP (1) JPH076155A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6085319A (en) * 1998-02-03 2000-07-04 Mitsubishi Electric System Lsi Microcomputer reset apparatus and method
US6670839B2 (en) 2001-09-18 2003-12-30 Nec Electronics Corporation Clock monitoring apparatus
US6694452B1 (en) 1998-12-25 2004-02-17 Nec Electronics Corporation Data processor and method of processing data
US7529961B2 (en) 2004-12-16 2009-05-05 Nec Electronics Corporation Semiconductor device with clock failure detection circuitry
WO2023022022A1 (en) * 2021-08-16 2023-02-23 ローム株式会社 Semiconductor device and vehicle-mounted device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6085319A (en) * 1998-02-03 2000-07-04 Mitsubishi Electric System Lsi Microcomputer reset apparatus and method
US6694452B1 (en) 1998-12-25 2004-02-17 Nec Electronics Corporation Data processor and method of processing data
US6670839B2 (en) 2001-09-18 2003-12-30 Nec Electronics Corporation Clock monitoring apparatus
US6943590B2 (en) 2001-09-18 2005-09-13 Nec Corporation Clock monitoring apparatus
US7529961B2 (en) 2004-12-16 2009-05-05 Nec Electronics Corporation Semiconductor device with clock failure detection circuitry
WO2023022022A1 (en) * 2021-08-16 2023-02-23 ローム株式会社 Semiconductor device and vehicle-mounted device

Similar Documents

Publication Publication Date Title
JP2676966B2 (en) Single chip microcomputer
US6600345B1 (en) Glitch free clock select switch
JP2762670B2 (en) Data processing device
US5025387A (en) Power saving arrangement for a clocked digital circuit
KR100301720B1 (en) Clock control device and method
US8375239B2 (en) Clock control signal generation circuit, clock selector, and data processing device
KR960015134A (en) Clock controller to clock multiple clocked circuits in response to power management
US6255882B1 (en) Method and system of switching clock signal
US6163851A (en) Data processor
US5461652A (en) Clock control circuit
KR100367634B1 (en) Memory controller and method of memory control
JPH076155A (en) Single chip microcomputer
JPH04167113A (en) Information processor
JPS60251418A (en) Operating frequency switching control circuit of arithmetic unit
JPH11143574A (en) Clock generation circuit and clock generation method
JPH05259825A (en) Clock generating circuit
JPH11305887A (en) Method for controlling microcontroller and microcontroller
JPH1049248A (en) Microcomputer
JPH05258087A (en) Microcomputer
KR100278272B1 (en) A system for controlling power
JPH11242529A (en) Clock controller
JPH0511877A (en) Microcomputer
JPH01180024A (en) Control system for synchronous logic circuit
JP2015088187A (en) Electronic circuit with sleep mode
JPS59189426A (en) Clock supply controlling system

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20000111