JPH11305887A - Method for controlling microcontroller and microcontroller - Google Patents

Method for controlling microcontroller and microcontroller

Info

Publication number
JPH11305887A
JPH11305887A JP10113657A JP11365798A JPH11305887A JP H11305887 A JPH11305887 A JP H11305887A JP 10113657 A JP10113657 A JP 10113657A JP 11365798 A JP11365798 A JP 11365798A JP H11305887 A JPH11305887 A JP H11305887A
Authority
JP
Japan
Prior art keywords
clock
peripheral
peripheral circuit
circuit
power consumption
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
JP10113657A
Other languages
Japanese (ja)
Inventor
Kiyoutaro Nakamura
恭太郎 中村
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP10113657A priority Critical patent/JPH11305887A/en
Publication of JPH11305887A publication Critical patent/JPH11305887A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Power Sources (AREA)
  • Microcomputers (AREA)

Abstract

PROBLEM TO BE SOLVED: To prevent the processing of a peripheral circuit from being made invalid at the time of transition to a low power consumption mode. SOLUTION: A method for controlling a microcontroller 100 equipped with a CPU 110, peripheral circuit 120, and clock supply controlling part 130 for individually outputting a clock C2 for a CPU for driving the CPU and a peripheral clock C3 for driving the peripheral circuit includes a process for judging whether or not the peripheral circuit is operated and a process for switching the CPU clock and the peripheral clock to a low power consumption mode when it is judged that the peripheral circuit is not operated in the process. The method includes also a process for switching the CPU clock to the low power consumption mode when it is judged that the peripheral circuit is operated in the process, and for switching the peripheral clock to the low power consumption mode after the operation of the peripheral circuit is ended. Therefore, the processing of the peripheral circuit can be prevented from being made invalid.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は,マイクロコントロ
ーラの制御方法及びマイクロコントローラにかかり,特
に,ワンチップに中央演算装置(以下「CPU」と称す
る。),ROMやRAM等の記憶装置,シリアルIOや
ADコンバータ等の周辺回路,及びクロック供給回路が
内蔵されているマイクロコントローラの制御方法及びマ
イクロコントローラに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control method for a microcontroller and a microcontroller. In particular, the present invention relates to a central processing unit (hereinafter referred to as a "CPU"), a storage device such as a ROM or a RAM, and a serial IO on a single chip. The present invention relates to a control method and a microcontroller for a microcontroller having a built-in peripheral circuit such as an A / D converter and a clock supply circuit.

【0002】[0002]

【従来の技術】マイクロコントローラは,作成するプロ
グラムにより様々な制御を行うことができるので,様々
な分野の制御用途に使用されている。かかる制御用途の
中で,携帯端末やノートパソコンのように電池駆動によ
り低消費電力が要求される制御用途が存在する。かかる
制御用途では,電池による動作時間を長くするために,
消費電力は大きいが高速に動作させるモードや,低速に
動作させて消費電力が小さくなるモードなどに段階的に
動作状態を変化させて,高速に処理を行いつつ,低消費
電力にすることが必要とされている。
2. Description of the Related Art Since a microcontroller can perform various controls by a program to be created, it is used for control applications in various fields. Among such control applications, there are control applications such as portable terminals and notebook personal computers that require low power consumption by battery operation. In such a control application, in order to extend the operation time by the battery,
It is necessary to reduce power consumption while performing high-speed processing by gradually changing the operation state to a mode that operates at high power but operates at high speed or a mode that operates at low speed and consumes low power. It has been.

【0003】マイクロコントローラには,中央演算装置
(以下,「CPU」と称する。),ROM,RAM等の
記憶装置,及びシリアルIOやADコンバータ等の周辺
回路を内蔵しているものがある。このようなマイクロコ
ントローラでは,動作していない機能ブロックのクロッ
クを停止させたり,低速モード時に,CPU及び周辺回
路の動作クロックとして入力クロックを分周したクロッ
クを供給することで低速に動作させたりして,低消費電
力になるようにしていた。
Some microcontrollers include a central processing unit (hereinafter referred to as a “CPU”), a storage device such as a ROM and a RAM, and peripheral circuits such as a serial IO and an AD converter. In such a microcontroller, the clock of a functional block that is not operating is stopped, or the microcontroller is operated at a low speed in a low-speed mode by supplying a clock obtained by dividing the input clock as the operating clock of the CPU and peripheral circuits. Therefore, the power consumption was reduced.

【0004】マイクロコントローラでは,低速モードに
設定すると,動作クロックとして入力クロックを分周し
たクロックをCPU及び周辺回路に供給しているが,分
周することによりクロック周波数が変化するため,周辺
回路のタイマの時定数やシリアル転送の転送レートが変
動してしまう。このため,分周により動作クロックを切
り換えるごとに,タイマの時定数やシリアル転送レート
の設定値を変更する必要があり,処理が複雑になるとい
う問題があった。また,低速モードにしてCPUを低速
動作させる場合には,周辺回路も低速動作することとな
り,消費電力の大きいCPUのみを低速動作させること
ができないという問題があった。
In the microcontroller, when the low-speed mode is set, a clock obtained by dividing the input clock is supplied to the CPU and peripheral circuits as an operating clock. The time constant of the timer and the transfer rate of serial transfer fluctuate. For this reason, every time the operation clock is switched by the frequency division, it is necessary to change the time constant of the timer and the set value of the serial transfer rate, which causes a problem that the processing becomes complicated. Further, when the CPU is operated at a low speed in the low-speed mode, the peripheral circuits also operate at a low speed, and there is a problem that only a CPU with large power consumption cannot be operated at a low speed.

【0005】また,上記問題の生じないマイクロコント
ローラの構成として,CPUへのクロックと,シリアル
IOやADコンバータ等の周辺回路へのクロックを独立
に生成して供給するものがある。しかし,この構成で
は,CPUクロックと周辺クロックの同期が必要であ
り,クロックのぶれを考慮しても同期が取れる回路とす
るために,回路規模が大きくなってしまうという問題が
あった。
As a configuration of a microcontroller that does not cause the above problem, there is a configuration in which a clock to a CPU and a clock to peripheral circuits such as a serial IO and an AD converter are generated and supplied independently. However, in this configuration, synchronization between the CPU clock and the peripheral clock is required, and there is a problem that the circuit scale becomes large because the circuit can be synchronized even when the fluctuation of the clock is considered.

【0006】以上の問題を解決するために,周辺回路と
独立にCPUの動作処理を設定でき,かつ,回路規模を
抑えることができるマイクロコントローラが知られてお
り,例えば,特開平7−295956号公報に示された
ものがある。公報に示されたような従来のマイクロコン
トローラ300の構成を,図7を参照しながら説明す
る。
[0006] In order to solve the above problems, a microcontroller capable of setting operation processing of a CPU independently of peripheral circuits and suppressing the circuit scale is known. Some are shown in the gazette. The configuration of a conventional microcontroller 300 as disclosed in the publication will be described with reference to FIG.

【0007】マイクロコントローラ300の内部には,
CPU310と,シリアルIO321やADコンバータ
322等からなる周辺回路320と,クロック供給制御
部330と,ROM341やRAM342等からなるメ
モリ部340と,が内部バス350を介して接続されて
いる。
[0007] Inside the microcontroller 300,
A CPU 310, a peripheral circuit 320 including a serial IO 321 and an AD converter 322, a clock supply control unit 330, and a memory unit 340 including a ROM 341 and a RAM 342 are connected via an internal bus 350.

【0008】CPU310は,メモリ部340に格納さ
れたデータをもとに演算を行い,さらに,周辺回路32
0及びクロック供給制御部330を制御する。シリアル
IO321は,外部回路とシリアルデータで通信する回
路であり,ADコンバータ322は,外部から入力され
るアナログデータをデジタルデータに変換する回路であ
る。
The CPU 310 performs an operation based on the data stored in the memory unit 340, and further performs
0 and the clock supply control unit 330 are controlled. The serial IO 321 is a circuit that communicates with an external circuit using serial data, and the AD converter 322 is a circuit that converts analog data input from the outside into digital data.

【0009】クロック供給制御部330は,マイクロコ
ントローラ300の外部から供給される外部クロックC
0を基にして,CPU310用のクロックであるCPU
クロックC2,及び,周辺回路320用のクロックであ
る周辺クロックC3を生成する。CPUクロックC2
は,CPU310に供給され,周辺クロックC3は,シ
リアルIO321,ADコンバータ322等の周辺回路
320に供給される。
[0009] The clock supply control unit 330 includes an external clock C supplied from outside the microcontroller 300.
CPU which is a clock for CPU 310 based on 0
A clock C2 and a peripheral clock C3 for the peripheral circuit 320 are generated. CPU clock C2
Is supplied to the CPU 310, and the peripheral clock C3 is supplied to the peripheral circuits 320 such as the serial IO 321 and the AD converter 322.

【0010】クロック供給制御部330の構成を,図8
を参照しながら説明する。クロック供給制御部330
は,外部クロックを制御する外部クロック制御部331
と,外部クロック制御部331と接続されるCPUクロ
ック制御部332及び周辺クロック制御部333と,外
部クロック制御部331及びCPUクロック制御部33
2を制御するクロック停止モード制御回路334と,か
ら主に構成される。
The structure of the clock supply control unit 330 is shown in FIG.
This will be described with reference to FIG. Clock supply control unit 330
Is an external clock control unit 331 that controls an external clock.
The CPU clock control unit 332 and the peripheral clock control unit 333 connected to the external clock control unit 331; the external clock control unit 331 and the CPU clock control unit 33
And a clock stop mode control circuit 334 for controlling the clock stop mode control circuit 2.

【0011】外部クロック制御部331は,マイクロコ
ントローラ300の外部から供給される外部クロックC
0を基にして,クロック供給制御部330の基準となる
内部クロックC1を生成する。CPUクロック制御部3
32は,動作クロック生成部331から供給される内部
クロックC1と同期したCPUクロックC2を生成す
る。なお,後述するクロック停止モード制御回路334
からCPUクロック停止指示信号ST2が供給されたと
きは,CPUクロックC2の生成を停止する。周辺クロ
ック制御部333は,外部クロック生成部331から供
給される内部クロックC1と同期した周辺クロックC3
を生成する。
The external clock control unit 331 includes an external clock C supplied from outside the microcontroller 300.
Based on 0, an internal clock C1 serving as a reference for the clock supply control unit 330 is generated. CPU clock controller 3
32 generates a CPU clock C2 synchronized with the internal clock C1 supplied from the operation clock generator 331. The clock stop mode control circuit 334 described later
When the CPU clock stop instruction signal ST2 is supplied from the CPU, the generation of the CPU clock C2 is stopped. The peripheral clock control unit 333 includes a peripheral clock C3 synchronized with the internal clock C1 supplied from the external clock generation unit 331.
Generate

【0012】クロック停止モード制御回路334は,外
部クロック制御部331及びCPUクロック制御部33
2を制御する回路である。クロック停止モード制御回路
334は,クロックの供給モードを,CPUクロック停
止モード,待機モード,及びクロック停止解除モードの
いずれかに決定する制御レジスタを持つ。この制御レジ
スタは,CPU310等により内部バス350を介して
設定される。
The clock stop mode control circuit 334 includes an external clock control unit 331 and a CPU clock control unit 33.
2 is a circuit for controlling the control circuit 2. The clock stop mode control circuit 334 has a control register that determines the clock supply mode to one of a CPU clock stop mode, a standby mode, and a clock stop release mode. This control register is set via the internal bus 350 by the CPU 310 or the like.

【0013】CPU310により,CPUクロック停止
モードを指定する値が制御レジスタに設定されたとき
は,クロック停止モード制御回路334は,CPUクロ
ック停止指示信号ST2をCPUクロック制御部332
に供給する。CPUクロック制御部332は,クロック
停止モード制御回路334からCPUクロック停止指示
信号ST2を供給されると,CPUクロックC2の生成
を停止する。このようにして,クロック供給回路330
は,CPUクロック停止モードに設定される。CPUク
ロック停止モードでは,周辺クロックC3は停止され
ず,周辺回路320は動作しており,CPU310が動
作を停止する。
When a value specifying the CPU clock stop mode is set in the control register by the CPU 310, the clock stop mode control circuit 334 sends the CPU clock stop instruction signal ST2 to the CPU clock control unit 332.
To supply. When being supplied with the CPU clock stop instruction signal ST2 from the clock stop mode control circuit 334, the CPU clock control unit 332 stops generating the CPU clock C2. Thus, the clock supply circuit 330
Is set to the CPU clock stop mode. In the CPU clock stop mode, the peripheral clock C3 is not stopped, the peripheral circuit 320 is operating, and the CPU 310 stops operating.

【0014】一方,CPU310により待機モードを指
示する値が制御レジスタに設定されたときは,クロック
停止モード制御回路334は,内部クロック停止指示信
号ST1を動作クロック生成部331に供給する。動作
クロック生成部331は,クロック停止モード制御回路
334から内部クロック停止指示信号ST1を供給され
ると,内部クロックC1の生成を停止する。これによ
り,CPUクロック制御部332はCPUクロックC2
の生成を停止し,周辺クロック制御部333は周辺クロ
ックC3の生成を停止して,クロック供給制御部330
は,待機モードに設定される。この待機モードでは,C
PUクロックC2と周辺クロックC3が共に停止するた
め,マイクロコントローラ300は,動作を完全に停止
した,待機状態となる。
On the other hand, when the value indicating the standby mode is set in the control register by the CPU 310, the clock stop mode control circuit 334 supplies the internal clock stop instruction signal ST 1 to the operation clock generator 331. When receiving the internal clock stop instruction signal ST1 from the clock stop mode control circuit 334, the operation clock generator 331 stops generating the internal clock C1. Thereby, the CPU clock control unit 332 sets the CPU clock C2
And the peripheral clock control unit 333 stops the generation of the peripheral clock C3, and the clock supply control unit 330
Is set to the standby mode. In this standby mode, C
Since both the PU clock C2 and the peripheral clock C3 stop, the microcontroller 300 enters a standby state in which the operation is completely stopped.

【0015】上述したCPUクロック停止モードまたは
待機モードの状態で,外部からの信号により,クロック
停止モード制御回路334の制御レジスタが,クロック
停止解除を指定する値に設定されると,クロック停止解
除状態となり,クロック停止モード制御回路334は,
全クロック停止指示信号ST1,または,CPUクロッ
ク停止指示信号ST2の生成を停止する。この場合,動
作クロック生成部331は内部クロックC1を生成し,
CPUクロック制御部332はCPUクロックC2を生
成し,周辺クロック制御部333は周辺クロックC3を
生成する。
When the control register of the clock stop mode control circuit 334 is set to a value designating clock stop release by an external signal in the above-described CPU clock stop mode or standby mode, the clock stop release state is set. And the clock stop mode control circuit 334
The generation of the all-clock stop instruction signal ST1 or the CPU clock stop instruction signal ST2 is stopped. In this case, the operation clock generator 331 generates the internal clock C1,
The CPU clock controller 332 generates a CPU clock C2, and the peripheral clock controller 333 generates a peripheral clock C3.

【0016】以上説明したマイクロコントローラ300
によれば,基準となる内部クロックC1を変えることな
く,周辺クロックC3と独立に,CPUクロックC2の
速度を変えることができる。このため,周辺クロックC
3を一定速度にして,周辺回路320を一定速度で動作
させた状態で,CPUクロックC2のみを低速にして,
CPU310のみを低速動作させて低消費電力化するこ
とを可能とする。
The microcontroller 300 described above
According to this, the speed of the CPU clock C2 can be changed independently of the peripheral clock C3 without changing the reference internal clock C1. Therefore, the peripheral clock C
3 while the peripheral circuit 320 is operated at a constant speed, and only the CPU clock C2 is reduced to a low speed.
It is possible to reduce the power consumption by operating only the CPU 310 at low speed.

【0017】[0017]

【発明が解決しようとする課題】ところで,マイクロコ
ントローラ300では,最大の低消費電流化を図る待機
モードにおいては,クロック停止モード制御回路334
が生成する全クロック停止指示信号ST1で内部クロッ
クC1を停止させることにより,CPUクロックC2と
周辺クロックC3を停止させる。しかしながら,シリア
ルIO321またはADコンバータ322等の周辺回路
320が動作中に待機モードに移行すると,移行前の処
理データが無効になり,待機モード状態への移行におい
てはプログラムによるソフト的な判断が必要になるとい
う問題があった。
By the way, in the microcontroller 300, in the standby mode for maximizing low current consumption, the clock stop mode control circuit 334 is used.
The CPU clock C2 and the peripheral clock C3 are stopped by stopping the internal clock C1 with the all clock stop instruction signal ST1 generated by the CPU. However, when the peripheral circuit 320 such as the serial IO 321 or the AD converter 322 shifts to the standby mode while operating, the processing data before the shift becomes invalid, and the software shift to the standby mode state requires software judgment by the program. There was a problem of becoming.

【0018】本発明は,従来のマイクロコントローラ制
御方法及びマイクロコントローラが有する上記問題点に
鑑みてなされたものであり,本発明の目的は,最大の低
消費電力化を図る待機モードにおいてもCPUクロック
と周辺クロックを制御することが可能な,新規かつ改良
されたマイクロコントローラの制御方法及びマイクロコ
ントローラを提供することである。
The present invention has been made in view of the above problems of the conventional microcontroller control method and microcontroller, and an object of the present invention is to provide a CPU clock even in a standby mode for maximizing low power consumption. To provide a new and improved microcontroller control method and microcontroller capable of controlling a peripheral clock.

【0019】[0019]

【課題を解決するための手段】上記課題を解決するた
め,請求項1の記載によれば,演算処理部と,周辺回路
と,演算処理部を駆動する演算処理部用クロック及び周
辺回路を駆動する周辺回路用クロックとを個別に出力可
能なクロック供給制御部とを備えたマイクロコントロー
ラの制御方法であって,低消費電力モードへのモード変
更信号が発生すると,周辺回路が動作しているかどうか
を判断する工程と,前記工程において周辺回路が動作し
ていないと判断された場合には,演算処理部用クロック
および周辺回路用クロックを低消費電力モードに切り替
え,前記工程において周辺回路が動作していると判断さ
れた場合には,演算処理部用クロックは低消費電力モー
ドに切り替えるが,周辺回路用クロックは周辺回路の動
作が終了した後に低消費電力モードに切り替える工程と
を含むことを特徴とするマイクロコントローラの制御方
法が提供される。なお,低消費電力モードへの移行につ
いては,周辺回路が,その動作終了時に,周辺動作終了
信号を,クロック供給制御部に出力するようにしてもよ
い。
According to the first aspect of the present invention, there is provided an arithmetic processing unit, a peripheral circuit, an arithmetic processing unit clock for driving the arithmetic processing unit, and a peripheral circuit. A method for controlling a microcontroller comprising a clock supply control unit capable of individually outputting a clock for a peripheral circuit to be changed, and determining whether the peripheral circuit is operating when a mode change signal to a low power consumption mode is generated And, if it is determined in the step that the peripheral circuit is not operating, the operation processing unit clock and the peripheral circuit clock are switched to the low power consumption mode, and the peripheral circuit operates in the step. If it is determined that the operation is performed, the operation processing clock is switched to the low power consumption mode. Control method for a microcontroller, which comprises a step of switching the cost power mode is provided. In the transition to the low power consumption mode, the peripheral circuit may output a peripheral operation end signal to the clock supply control unit when the operation ends.

【0020】かかる構成によれば,周辺回路が動作中に
マイクロコントローラ全体を低消費電力モードに移行さ
せる場合,クロック供給制御部は,周辺回路が動作中で
あるか否かを判断できるので,周辺回路が動作中である
場合には,動作中の周辺回路へはクロックの供給を保持
することが可能である。従って,マイクロコントローラ
全体を低消費電力モードに移行させるときに周辺回路が
動作中である場合であっても,その動作が終了するまで
周辺クロックの供給が保持され,動作が終了すると同時
にマイクロコントローラ全体が低消費電力モードに移行
するため,シリアルIOやADコンバータ等の周辺回路
の処理データを無効にしないですむ。
With this configuration, when the entire microcontroller is shifted to the low power consumption mode while the peripheral circuit is operating, the clock supply control unit can determine whether the peripheral circuit is operating. When the circuit is operating, it is possible to hold the clock supply to the operating peripheral circuit. Therefore, even if the peripheral circuit is operating when the entire microcontroller is shifted to the low power consumption mode, the supply of the peripheral clock is maintained until the operation is completed, and the operation of the entire microcontroller is completed simultaneously. Since this shifts to the low power consumption mode, it is not necessary to invalidate processing data of peripheral circuits such as a serial IO and an AD converter.

【0021】さらに,低消費電力モードに移行させると
きに,プログラムによるソフト的な判断を必要とせず
に,マイクロコントローラ全体を低消費電力モードに移
行させることが可能である。
Further, when shifting to the low power consumption mode, it is possible to shift the entire microcontroller to the low power consumption mode without requiring software judgment by a program.

【0022】なお,低消費電力モードは,演算処理部用
クロックおよび/または周辺回路用クロックを低速クロ
ックにする低速モードであってもよいが,演算処理部用
クロックおよび/または周辺回路用クロックを停止する
待機モードであることがさらに好ましい。待機モードに
よれば,クロックの供給を停止することにより,最大の
低消費電力化を図ることが可能である。
The low power consumption mode may be a low-speed mode in which the clock for the processing unit and / or the clock for the peripheral circuit is set to a low-speed clock. It is more preferable to be in a standby mode for stopping. According to the standby mode, the maximum power consumption can be reduced by stopping the supply of the clock.

【0023】また,請求項2の記載によれば,演算処理
部と,周辺回路と,演算処理部を駆動する演算処理部用
クロック及び周辺回路を駆動する周辺回路用クロックと
を個別に出力可能なクロック供給制御部とを備えたマイ
クロコントローラの制御方法であって,低消費電力モー
ドへのモード変更信号が発生すると,周辺回路が動作し
ているかどうかを判断する工程と,前記工程において周
辺回路が動作していないと判断された場合には,演算処
理部用クロックおよび周辺回路用クロックを低消費電力
モードに切り替え,前記工程において周辺回路が動作し
ていると判断された場合には,演算処理部は演算処理を
停止し,演算処理部用クロックおよび周辺回路用クロッ
クは周辺回路の動作が終了した後に低消費電力モードに
切り替える工程とを含むことを特徴とするマイクロコン
トローラの制御方法が提供される。なお,低消費電力モ
ードへの移行については,周辺回路が,その動作終了時
に,周辺動作終了信号を,演算処理部に出力するように
してもよい。
According to the second aspect of the present invention, the arithmetic processing unit, the peripheral circuit, and the clock for the arithmetic processing unit for driving the arithmetic processing unit and the clock for the peripheral circuit for driving the peripheral circuit can be individually output. A control method for a microcontroller having a clock supply control unit, the method comprising: when a mode change signal to a low power consumption mode is generated, determining whether a peripheral circuit is operating; If it is determined that the peripheral circuit is not operating, the operation processing unit clock and the peripheral circuit clock are switched to the low power consumption mode. The processing unit stops the arithmetic processing, and switches the operation processing unit clock and the peripheral circuit clock to the low power consumption mode after the operation of the peripheral circuit is completed. Control method for a microcontroller, characterized in that it comprises is provided. In the transition to the low power consumption mode, the peripheral circuit may output a peripheral operation end signal to the arithmetic processing unit when the operation is completed.

【0024】かかる構成によれば,周辺回路が動作中に
マイクロコントローラ全体を低消費電力モードに移行さ
せる場合,中央演算処理部は,周辺回路が動作中である
か否かを判断できるので,周辺回路が動作中である場合
には,中央演算装置は演算処理を行わず,動作中の周辺
回路へはクロックの供給を保持することが可能である。
従って,マイクロコントローラ全体を低消費電力モード
に移行させるときに周辺回路が動作中である場合であっ
ても,その動作が終了するまで周辺クロックの供給が保
持され,動作が終了すると同時にマイクロコントローラ
全体が低消費電力モードに移行するため,シリアルIO
やADコンバータ等の周辺回路の処理データを無効にし
ないですむ。
With this configuration, when the entire microcontroller is shifted to the low power consumption mode while the peripheral circuit is operating, the central processing unit can determine whether the peripheral circuit is operating. When the circuit is operating, the central processing unit does not perform the arithmetic processing, and can maintain the supply of the clock to the operating peripheral circuit.
Therefore, even if the peripheral circuit is operating when the entire microcontroller is shifted to the low power consumption mode, the supply of the peripheral clock is maintained until the operation is completed, and the operation of the entire microcontroller is completed simultaneously. Shifts to the low power consumption mode.
It is not necessary to invalidate the processing data of peripheral circuits such as the A / D converter.

【0025】さらに,低消費電力モードに移行させると
きに,プログラムによるソフト的な判断を必要とせず
に,マイクロコントローラ全体を低消費電力モードに移
行させることが可能である。
Further, when shifting to the low power consumption mode, it is possible to shift the entire microcontroller to the low power consumption mode without requiring software judgment by a program.

【0026】また,低消費電力モードは,演算処理部用
クロックおよび/または周辺回路用クロックを低速クロ
ックにする低速モードであってもよいが,演算処理部用
クロックおよび/または周辺回路用クロックを停止する
待機モードであることがさらに好ましい。待機モードに
よれば,クロックの供給を停止することにより,最大の
低消費電力化を図ることが可能である。
The low power consumption mode may be a low-speed mode in which the processing unit clock and / or peripheral circuit clock is set to a low-speed clock. It is more preferable to be in a standby mode for stopping. According to the standby mode, the maximum power consumption can be reduced by stopping the supply of the clock.

【0027】また,請求項3の記載によれば,演算処理
部用クロックにより駆動される演算処理部と,周辺回路
用クロックにより駆動される周辺回路とを備えたマイク
ロコントローラであって,低消費電力モードへのモード
変更信号を発生するモード変更装置と,モード変更信号
が入力されて周辺動作回路が動作しているかどうかを判
断する判断装置と,判断装置において周辺動作回路が動
作していないと判断された場合には,演算処理部用クロ
ックと周辺回路用クロックを低消費電力モードに切り替
え,判断装置において周辺動作回路が動作していると判
断された場合には,演算処理部用クロックは低消費電力
モードに切り替えるが,周辺回路用クロックは周辺回路
の動作が終了した後に低消費電力モードに切り替えるク
ロック供給制御部とを含むことを特徴とするマイクロコ
ントローラが提供される。なお,判断装置は,周辺回路
がその動作終了時に発生する周辺動作終了信号に応じて
周辺回路が動作しているかどうかを判断するようにして
もよい。
According to the third aspect of the present invention, there is provided a microcontroller including an arithmetic processing unit driven by a clock for an arithmetic processing unit and a peripheral circuit driven by a clock for a peripheral circuit. A mode change device for generating a mode change signal to a power mode, a judgment device for judging whether or not the peripheral operation circuit is operating upon input of the mode change signal, and a judgment that the peripheral operation circuit is not operating in the judgment device If it is determined, the operation processing unit clock and the peripheral circuit clock are switched to the low power consumption mode. If the determination unit determines that the peripheral operation circuit is operating, the operation processing unit clock is changed to the low power consumption mode. A clock supply control unit that switches to the low power consumption mode, but switches to the low power consumption mode after peripheral circuit operation is completed. Microcontroller comprising a are provided. The determining device may determine whether the peripheral circuit is operating according to a peripheral operation end signal generated when the peripheral circuit ends its operation.

【0028】かかる構成によれば,周辺回路が動作中に
マイクロコントローラ全体を低消費電力モードに移行さ
せる場合,クロック供給制御部は,周辺回路が動作中で
あるか否かを判断できるので,周辺回路が動作中である
場合には,動作中の周辺回路へはクロックの供給を保持
することが可能である。従って,マイクロコントローラ
全体を低消費電力モードに移行させるときに周辺回路が
動作中である場合であっても,その動作が終了するまで
周辺クロックの供給が保持され,動作が終了すると同時
にマイクロコントローラ全体が低消費電力モードに移行
するため,シリアルIOやADコンバータ等の周辺回路
の処理データを無効にしないですむ。
According to this configuration, when the entire microcontroller is shifted to the low power consumption mode while the peripheral circuit is operating, the clock supply control unit can determine whether the peripheral circuit is operating or not. When the circuit is operating, it is possible to hold the clock supply to the operating peripheral circuit. Therefore, even if the peripheral circuit is operating when the entire microcontroller is shifted to the low power consumption mode, the supply of the peripheral clock is maintained until the operation is completed, and the operation of the entire microcontroller is completed simultaneously. Since this shifts to the low power consumption mode, it is not necessary to invalidate processing data of peripheral circuits such as a serial IO and an AD converter.

【0029】さらに,低消費電力モードに移行させると
きに,プログラムによるソフト的な判断を必要とせず
に,マイクロコントローラ全体を低消費電力モードに移
行させることが可能である。
Further, when shifting to the low power consumption mode, it is possible to shift the entire microcontroller to the low power consumption mode without requiring software judgment by a program.

【0030】また,低消費電力モードは,演算処理部用
クロックおよび/または周辺回路用クロックを低速クロ
ックにする低速モードであってもよいが,演算処理部用
クロックおよび/または周辺回路用クロックを停止する
待機モードであることがさらに好ましい。待機モードに
よれば,クロックの供給を停止することにより,最大の
低消費電力化を図ることが可能である。
The low power consumption mode may be a low-speed mode in which the clock for the processing unit and / or the clock for the peripheral circuit is set to a low-speed clock. It is more preferable to be in a standby mode for stopping. According to the standby mode, the maximum power consumption can be reduced by stopping the supply of the clock.

【0031】また,請求項4の記載によれば,演算処理
部用クロックにより駆動される演算処理部と,周辺回路
用クロックにより駆動される周辺回路とを備えたマイク
ロコントローラであって,低消費電力モードへのモード
変更信号を発生するモード変更装置と,モード変更信号
が入力されて周辺動作回路が動作しているかどうかを判
断する判断装置と,判断装置において周辺動作回路が動
作していないと判断された場合には,演算処理部用クロ
ックと周辺回路用クロックを低消費電力モードに切り替
え,判断装置において周辺動作回路が動作していると判
断された場合には,演算処理部は演算処理を停止し,演
算処理部用クロックおよび周辺回路用クロックは周辺回
路の動作が終了した後に低消費電力モードに切り替える
クロック供給制御部とを含むことを特徴とするマイクロ
コントローラが提供される。なお,判断装置は,周辺回
路がその動作終了時に発生する周辺動作終了信号に応じ
て周辺回路が動作しているかどうかを判断するようにし
てもよい。
According to a fourth aspect of the present invention, there is provided a microcontroller including an arithmetic processing unit driven by a clock for an arithmetic processing unit and a peripheral circuit driven by a clock for a peripheral circuit. A mode change device for generating a mode change signal to a power mode, a judgment device for judging whether or not the peripheral operation circuit is operating upon input of the mode change signal, and a judgment that the peripheral operation circuit is not operating in the judgment device If it is determined, the arithmetic processing unit clock and the peripheral circuit clock are switched to the low power consumption mode. If the determination unit determines that the peripheral operation circuit is operating, the arithmetic processing unit executes the arithmetic processing. Supply control for stopping the operation and switching to the low power consumption mode after the operation of the peripheral circuit is completed Microcontroller comprising bets is provided. The determining device may determine whether the peripheral circuit is operating according to a peripheral operation end signal generated when the peripheral circuit ends its operation.

【0032】かかる構成によれば,周辺回路が動作中に
マイクロコントローラ全体を低消費電力モードに移行さ
せる場合,中央演算処理部は,周辺回路が動作中である
か否かを判断できるので,周辺回路が動作中である場合
には,中央演算装置は演算処理を行わず,動作中の周辺
回路へはクロックの供給を保持することが可能である。
従って,マイクロコントローラ全体を低消費電力モード
に移行させるときに周辺回路が動作中である場合であっ
ても,その動作が終了するまで周辺クロックの供給が保
持され,動作が終了すると同時にマイクロコントローラ
全体が低消費電力モードに移行するため,シリアルIO
やADコンバータ等の周辺回路の処理データを無効にし
ないですむ。
With this configuration, when the entire microcontroller is shifted to the low power consumption mode while the peripheral circuit is operating, the central processing unit can determine whether the peripheral circuit is operating. When the circuit is operating, the central processing unit does not perform the arithmetic processing, and can maintain the supply of the clock to the operating peripheral circuit.
Therefore, even if the peripheral circuit is operating when the entire microcontroller is shifted to the low power consumption mode, the supply of the peripheral clock is maintained until the operation is completed, and the operation of the entire microcontroller is completed simultaneously. Shifts to the low power consumption mode.
It is not necessary to invalidate the processing data of peripheral circuits such as the A / D converter.

【0033】さらに,低消費電力モードに移行させると
きに,プログラムによるソフト的な判断を必要とせず
に,マイクロコントローラ全体を低消費電力モードに移
行させることが可能である。
Further, when shifting to the low power consumption mode, it is possible to shift the entire microcontroller to the low power consumption mode without requiring software judgment by a program.

【0034】また,低消費電力モードは,演算処理部用
クロックおよび/または周辺回路用クロックを低速クロ
ックにする低速モードであってもよいが,演算処理部用
クロックおよび/または周辺回路用クロックを停止する
待機モードであることがさらに好ましい。待機モードに
よれば,クロックの供給を停止することにより,最大の
低消費電力化を図ることが可能である。
The low power consumption mode may be a low-speed mode in which the clock for the processing unit and / or the clock for the peripheral circuit is set to a low-speed clock. It is more preferable to be in a standby mode for stopping. According to the standby mode, the maximum power consumption can be reduced by stopping the supply of the clock.

【0035】[0035]

【発明の実施の形態】以下に添付図面を参照しながら,
本発明にかかるマイクロコントローラの制御方法及びマ
イクロコントローラの好適な実施の形態について詳細に
説明する。なお,本明細書及び図面において,実質的に
同一の機能構成を有する構成要素については,同一の符
号を付することにより重複説明を省略する。
BRIEF DESCRIPTION OF THE DRAWINGS FIG.
A preferred embodiment of a control method of a microcontroller and a microcontroller according to the present invention will be described in detail. In this specification and the drawings, components having substantially the same function and configuration are denoted by the same reference numerals, and redundant description is omitted.

【0036】(第1の実施の形態)第1の実施の形態に
かかるマイクロコントローラ100は,図1及び図2に
示した通りである。以下,図1及び図2を参照しなが
ら,マイクロコントローラ100の構成を説明する。
(First Embodiment) A microcontroller 100 according to a first embodiment is as shown in FIG. 1 and FIG. Hereinafter, the configuration of the microcontroller 100 will be described with reference to FIGS.

【0037】マイクロコントローラ100の内部には,
CPU110と,シリアルIO121やADコンバータ
122等からなる周辺回路120と,クロック供給制御
部130と,ROM141やRAM142等からなるメ
モリ部140と,が内部バス150を介して接続されて
いる。
Inside the microcontroller 100,
The CPU 110, the peripheral circuit 120 including the serial IO 121 and the AD converter 122, the clock supply control unit 130, and the memory unit 140 including the ROM 141 and the RAM 142 are connected via the internal bus 150.

【0038】CPU110は,メモリ部140に格納さ
れたデータをもとに演算を行い,さらに,周辺回路12
0及びクロック供給制御部130を制御する。CPU1
10は,待機モードに移行する命令がメモリ部140に
より発せされると,クロック供給制御部130に対し待
機モード信号S1を出力する。なお,CPU110より
待機モード信号S1が出力され,待機モードに移行する
際の動作については後述する。
The CPU 110 performs an operation based on the data stored in the memory unit 140,
0 and the clock supply control unit 130 are controlled. CPU1
10 outputs a standby mode signal S1 to the clock supply control unit 130 when an instruction to shift to the standby mode is issued by the memory unit 140. The operation when the standby mode signal S1 is output from the CPU 110 to shift to the standby mode will be described later.

【0039】周辺回路120は,シリアルIO121や
ADコンバータ122等からなる。シリアルIO121
は,外部回路とシリアルデータで通信する回路であり,
ADコンバータ122は,外部から入力されるアナログ
データをデジタルデータに変換する回路である。周辺回
路120は,周辺回路120を構成する各構成要素の動
作が終了すると,クロック供給制御部130に対し周辺
動作終了信号S2を出力する。なお,周辺回路120よ
り周辺動作終了信号S2が出力された際の動作について
は後述する。
The peripheral circuit 120 includes a serial IO 121, an AD converter 122, and the like. Serial IO121
Is a circuit that communicates with an external circuit using serial data.
The AD converter 122 is a circuit that converts analog data input from the outside into digital data. The peripheral circuit 120 outputs a peripheral operation end signal S2 to the clock supply control unit 130 when the operation of each component configuring the peripheral circuit 120 ends. The operation when the peripheral circuit 120 outputs the peripheral operation end signal S2 will be described later.

【0040】クロック供給制御部130は,マイクロコ
ントローラ100の外部から供給される外部クロックC
0を基にして,CPU110用のクロックであるCPU
クロックC2,及び,周辺回路120用のクロックであ
る周辺クロックC3を生成する。CPUクロックC2
は,CPU110に供給され,周辺クロックC3は,シ
リアルIO121,ADコンバータ122等の周辺回路
120に供給される。
The clock supply control unit 130 controls an external clock C supplied from outside the microcontroller 100.
CPU which is a clock for CPU 110 based on 0
A clock C2 and a peripheral clock C3 which is a clock for the peripheral circuit 120 are generated. CPU clock C2
Is supplied to the CPU 110, and the peripheral clock C3 is supplied to the peripheral circuits 120 such as the serial IO 121 and the AD converter 122.

【0041】クロック供給制御部130の構成を,図2
を参照しながら説明する。クロック供給制御部130
は,外部クロックを制御する外部クロック制御部131
と,外部クロック制御部131と接続されるCPUクロ
ック制御部132及び周辺クロック制御部133と,か
ら構成される。
The structure of the clock supply control unit 130 is shown in FIG.
This will be described with reference to FIG. Clock supply control unit 130
Is an external clock control unit 131 that controls an external clock.
And a CPU clock control unit 132 and a peripheral clock control unit 133 connected to the external clock control unit 131.

【0042】外部クロック制御部131は,マイクロコ
ントローラ100の外部から供給される外部クロックC
0を基にして,クロック供給制御部130の基準となる
内部クロックC1を生成する。CPUクロック制御部1
32は,動作クロック生成部131から供給される内部
クロックC1と同期したCPUクロックC2を生成す
る。周辺クロック制御部133は,外部クロック生成部
131から供給される内部クロックC1と同期した周辺
クロックC3を生成する。
The external clock control section 131 receives an external clock C supplied from outside the microcontroller 100.
Based on 0, an internal clock C1 serving as a reference for the clock supply control unit 130 is generated. CPU clock control unit 1
32 generates a CPU clock C2 synchronized with the internal clock C1 supplied from the operation clock generator 131. The peripheral clock control unit 133 generates a peripheral clock C3 synchronized with the internal clock C1 supplied from the external clock generation unit 131.

【0043】以上のように構成されるマイクロコントロ
ーラ100の動作を,図3に示したタイミングチャート
を参照しながら説明する。なお,図3に示した時刻を表
す符号T1,T2に従い,時系列的に説明する。
The operation of the microcontroller 100 configured as described above will be described with reference to the timing chart shown in FIG. The description will be given in chronological order according to the symbols T1 and T2 indicating the time shown in FIG.

【0044】時刻T1で,メモリ部140より待機モー
ドに移行する命令が内部バス150を介してCPU11
0に発せられ,CPU110はこの命令をデコードし
て,待機モード信号S1をクロック供給制御部130に
出力する。待機モード信号S1を受けた外部クロック制
御部131は,CPUクロック制御部132に対してC
PUクロックC2を停止する信号を出力し,CPUクロ
ック制御部132はCPUクロックC2を停止し,CP
U110は待機モードに移行する。
At time T 1, an instruction to shift to the standby mode is issued from the memory unit 140 to the CPU 11 via the internal bus 150.
0, the CPU 110 decodes this instruction and outputs the standby mode signal S1 to the clock supply control unit 130. The external clock control unit 131 that has received the standby mode signal S1
A signal for stopping the PU clock C2 is output, and the CPU clock control unit 132 stops the CPU clock C2,
U110 shifts to the standby mode.

【0045】このとき周辺回路120の動作が終了して
いる場合には,周辺回路120より出力された周辺動作
終了信号S2がクロック供給制御部130に入力されて
いることにより,外部クロック制御部131は内部クロ
ックC1を停止し,マイクロコントローラ100全体が
待機モードに移行する。
At this time, when the operation of the peripheral circuit 120 has been completed, the external clock control section 131 is input because the peripheral operation end signal S2 output from the peripheral circuit 120 is input to the clock supply control section 130. Stops the internal clock C1, and the entire microcontroller 100 shifts to the standby mode.

【0046】一方,周辺回路120の動作が終了してい
ない場合は,周辺クロック制御部133は周辺クロック
C3を周辺回路120に供給し続け,CPU110は待
機状態,周辺回路120は動作状態という状態になる。
その後,時刻T2で,周辺回路120の動作が終了する
と,周辺回路120はクロック供給制御部130に対し
周辺動作終了信号S2を出力する。外部クロック制御部
131は内部クロックC1を停止し,内部クロックC1
が停止することで,周辺クロック供給制御部133から
出力される周辺クロックC3も停止され,マイクロコン
トローラ100全体が待機モードに移行する。
On the other hand, when the operation of the peripheral circuit 120 is not completed, the peripheral clock control unit 133 continues to supply the peripheral clock C3 to the peripheral circuit 120, and the CPU 110 enters a standby state and the peripheral circuit 120 operates. Become.
Thereafter, when the operation of the peripheral circuit 120 ends at time T2, the peripheral circuit 120 outputs a peripheral operation end signal S2 to the clock supply control unit 130. The external clock control unit 131 stops the internal clock C1, and
Stops, the peripheral clock C3 output from the peripheral clock supply control unit 133 also stops, and the entire microcontroller 100 shifts to the standby mode.

【0047】本実施の形態にかかるマイクロコントロー
ラ100は上記のように構成され,動作することによ
り,以下のような優れた効果を奏することが可能であ
る。すなわち,待機モードに移行するときに,周辺回路
120が動作中である場合,動作が終了するまで周辺ク
ロックC3を供給する。そして,周辺回路120の動作
が終了すると同時にマイクロコントローラ100全体が
待機モードに移行する。従って,シリアルIO121や
ADコンバータ122の処理データが有効になる。
The microcontroller 100 according to the present embodiment is configured and operated as described above, so that the following excellent effects can be obtained. In other words, when the peripheral circuit 120 is operating when shifting to the standby mode, the peripheral clock C3 is supplied until the operation is completed. Then, at the same time when the operation of the peripheral circuit 120 ends, the entire microcontroller 100 shifts to the standby mode. Therefore, the processing data of the serial IO 121 and the AD converter 122 becomes valid.

【0048】さらに,待機モードに移行するときに,プ
ログラムによるソフト的な判断を必要とせずに,マイク
ロコントローラ100全体が待機モードに移行できる。
Further, when shifting to the standby mode, the entire microcontroller 100 can shift to the standby mode without requiring software judgment by a program.

【0049】(第2の実施の形態)第2の実施の形態に
かかるマイクロコントローラ200は,図4及び図5に
示した通りである。以下,図4及び図5を参照しなが
ら,マイクロコントローラ200の構成を説明する。な
お,マイクロコントローラ200は,図1及び図2に示
した第1の実施の形態にかかるマイクロコントローラ1
00を改良したものであり,周辺回路220からの周辺
動作終了信号がクロック供給制御部230ではなく,直
接CPU210に出力される点に特徴がある。
(Second Embodiment) A microcontroller 200 according to a second embodiment is as shown in FIGS. Hereinafter, the configuration of the microcontroller 200 will be described with reference to FIGS. The microcontroller 200 is a microcontroller 1 according to the first embodiment shown in FIGS.
This is a modification of the first embodiment, and is characterized in that a peripheral operation end signal from the peripheral circuit 220 is directly output to the CPU 210 instead of the clock supply control unit 230.

【0050】マイクロコントローラ200の内部には,
CPU210と,シリアルIO221やADコンバータ
222等からなる周辺回路220と,クロック供給制御
部230と,ROM241やRAM242等からなるメ
モリ部240と,が内部バス250を介して接続されて
いる。
Inside the microcontroller 200,
A CPU 210, a peripheral circuit 220 including a serial IO 221 and an AD converter 222, a clock supply control unit 230, and a memory unit 240 including a ROM 241 and a RAM 242 are connected via an internal bus 250.

【0051】CPU210は,メモリ部240に格納さ
れたデータをもとに演算を行い,さらに,周辺回路22
0及びクロック供給制御部230を制御する。CPU2
10は,待機モードに移行する命令がメモリ部240に
より発せされると,クロック供給制御部230に対し待
機モード信号S1を出力する。なお,CPU210より
待機モード信号S1が出力され,待機モードに移行する
際の動作については後述する。
The CPU 210 performs an operation based on the data stored in the memory unit 240,
0 and the clock supply control unit 230. CPU2
10 outputs a standby mode signal S1 to the clock supply control unit 230 when an instruction to shift to the standby mode is issued by the memory unit 240. The operation when the standby mode signal S1 is output from the CPU 210 to shift to the standby mode will be described later.

【0052】周辺回路220は,シリアルIO221や
ADコンバータ222等からなる。シリアルIO221
は,外部回路とシリアルデータで通信する回路であり,
ADコンバータ222は,外部から入力されるアナログ
データをデジタルデータに変換する回路である。周辺回
路220は,周辺回路220を構成する各構成要素の動
作が終了すると,第1の実施の形態の場合と異なり,ク
ロック供給制御部230ではなくCPU210に対し周
辺動作終了信号S2を出力する。なお,周辺回路220
より周辺動作終了信号S2が出力された際の動作につい
ては後述する。
The peripheral circuit 220 includes a serial IO 221 and an AD converter 222. Serial IO221
Is a circuit that communicates with an external circuit using serial data.
The AD converter 222 is a circuit that converts analog data input from the outside into digital data. When the operation of each component configuring the peripheral circuit 220 ends, the peripheral circuit 220 outputs a peripheral operation end signal S2 to the CPU 210 instead of the clock supply control unit 230, unlike the first embodiment. The peripheral circuit 220
The operation when the peripheral operation end signal S2 is output will be described later.

【0053】クロック供給制御部230は,マイクロコ
ントローラ200の外部から供給される外部クロックC
0を基にして,CPU210用のクロックであるCPU
クロックC2,及び,周辺回路220用のクロックであ
る周辺クロックC3を生成する。CPUクロックC2
は,CPU210に供給され,周辺クロックC3は,シ
リアルIO221,ADコンバータ222等の周辺回路
220に供給される。
The clock supply control unit 230 controls the external clock C supplied from outside the microcontroller 200.
CPU which is a clock for CPU 210 based on 0
A clock C2 and a peripheral clock C3 for the peripheral circuit 220 are generated. CPU clock C2
Is supplied to the CPU 210, and the peripheral clock C3 is supplied to the peripheral circuits 220 such as the serial IO 221 and the AD converter 222.

【0054】クロック供給制御部230の構成を,図5
を参照しながら説明する。クロック供給制御部230
は,外部クロックを制御する外部クロック制御部231
と,外部クロック制御部231と接続されるCPUクロ
ック制御部232及び周辺クロック制御部233と,か
ら構成される。
The configuration of the clock supply control unit 230 is shown in FIG.
This will be described with reference to FIG. Clock supply control unit 230
Is an external clock control unit 231 that controls an external clock.
And a CPU clock controller 232 and a peripheral clock controller 233 connected to the external clock controller 231.

【0055】外部クロック制御部231は,マイクロコ
ントローラ200の外部から供給される外部クロックC
0を基にして,クロック供給制御部230の基準となる
内部クロックC1を生成する。CPUクロック制御部2
32は,動作クロック生成部231から供給される内部
クロックC1と同期したCPUクロックC2を生成す
る。周辺クロック制御部233は,外部クロック生成部
231から供給される内部クロックC1と同期した周辺
クロックC3を生成する。
The external clock control unit 231 controls the external clock C supplied from outside the microcontroller 200.
Based on 0, an internal clock C1 serving as a reference for the clock supply control unit 230 is generated. CPU clock control unit 2
32 generates a CPU clock C2 synchronized with the internal clock C1 supplied from the operation clock generator 231. The peripheral clock controller 233 generates a peripheral clock C3 synchronized with the internal clock C1 supplied from the external clock generator 231.

【0056】以上のように構成されるマイクロコントロ
ーラ200の動作を,図6に示したタイミングチャート
を参照しながら説明する。なお,図6に示した時刻を表
す符号T1,T2に従い,時系列的に説明する。
The operation of the microcontroller 200 configured as described above will be described with reference to the timing chart shown in FIG. The description will be given in chronological order according to the symbols T1 and T2 indicating the time shown in FIG.

【0057】本実施の形態において特徴的なのは以下の
点である。すなわち,時刻T1で,メモリ部240より
待機モードに移行する命令が発行されたとき,CPU2
10はこの命令をデコードすると同時に,周辺回路22
0から動作終了信号S2が出力されているかどうかを判
断するという点である。
The features of this embodiment are as follows. That is, at time T1, when an instruction to shift to the standby mode is issued from the memory unit 240, the CPU 2
10 decodes this instruction and, at the same time,
The point is that it is determined from 0 whether or not the operation end signal S2 is output.

【0058】時刻T1で,メモリ部240より待機モー
ドに移行する命令が内部バス250を介してCPU21
0に発せられ,CPU210はこの命令をデコードし
て,待機モード信号S1をクロック供給制御部130に
出力する。同時に,周辺回路220から動作終了信号S
2が出力されているかどうかを判断する。
At time T 1, an instruction to shift to the standby mode is issued from the memory 240 to the CPU 21 via the internal bus 250.
0, the CPU 210 decodes this instruction and outputs the standby mode signal S1 to the clock supply control unit 130. At the same time, the operation end signal S
It is determined whether or not 2 has been output.

【0059】周辺回路220の動作が終了されていると
CPU210が判断した場合は,CPU210は,クロ
ック供給制御部230に待機モード信号S1を出力す
る。待機モード信号S1を受けて,クロック供給制御部
230は内部クロックC1を停止し,CPUクロックC
2および周辺クロックC3の供給を停止し,マイクロコ
ントローラ200全体が待機モードに移行する。
When the CPU 210 determines that the operation of the peripheral circuit 220 has been completed, the CPU 210 outputs a standby mode signal S 1 to the clock supply control unit 230. Upon receiving the standby mode signal S1, the clock supply control unit 230 stops the internal clock C1, and
2 and the supply of the peripheral clock C3 are stopped, and the entire microcontroller 200 shifts to the standby mode.

【0060】一方,周辺回路220の動作が終了されて
いないとCPU210が判断した場合は,CPU210
は演算処理を行わないNOP(No OPeratio
n)命令を繰り返し,動作を行わない状態となる。この
とき,クロック供給制御部230に待機モード信号S1
は出力されず,CPU210は演算処理を行わない状
態,周辺回路220は動作状態という状態になる。
On the other hand, if the CPU 210 determines that the operation of the peripheral circuit 220 has not been completed, the CPU 210
Is a NOP (No Operatio) that does not perform arithmetic processing.
n) The instruction is repeated and no operation is performed. At this time, the standby mode signal S1 is supplied to the clock supply control unit 230.
Is not output, the CPU 210 does not perform the arithmetic processing, and the peripheral circuit 220 is in the operating state.

【0061】その後,時刻T2で,周辺回路220の動
作が終了すると,周辺回路220はCPU210に対し
周辺動作終了信号S2を出力する。CPU210は,周
辺動作終了信号S2を受けて,待機モード信号S1を外
部クロック制御部230に出力する。外部クロック制御
部231は内部クロックC1を停止し,内部クロックC
1が停止することで,周辺クロック供給制御部233か
ら出力される周辺クロックC3も停止され,マイクロコ
ントローラ200全体が待機モードに移行する。
Thereafter, at time T2, when the operation of the peripheral circuit 220 ends, the peripheral circuit 220 outputs a peripheral operation end signal S2 to the CPU 210. The CPU 210 receives the peripheral operation end signal S2 and outputs a standby mode signal S1 to the external clock control unit 230. The external clock control unit 231 stops the internal clock C1, and
When 1 stops, the peripheral clock C3 output from the peripheral clock supply control unit 233 also stops, and the entire microcontroller 200 shifts to the standby mode.

【0062】本実施の形態にかかるマイクロコントロー
ラ200は上記のように構成され,動作することによ
り,以下のような優れた効果を奏することが可能であ
る。すなわち,待機モードに移行するときに,周辺回路
120が動作中である場合,動作が終了するまでCPU
210は演算処理を行わないNOP(No OPera
tion)命令を繰り返し,動作を行わない状態とな
る。そして,周辺回路220の動作が終了すると同時に
マイクロコントローラ200全体が待機モードに移行す
る。従って,シリアルIO221やADコンバータ22
2の処理データが有効になる。
The microcontroller 200 according to the present embodiment is configured and operated as described above, and can exert the following excellent effects. In other words, when the peripheral circuit 120 is operating when shifting to the standby mode, the CPU operates until the operation is completed.
Reference numeral 210 denotes a NOP (No OPera) that does not perform arithmetic processing.
(tion) The instruction is repeated and no operation is performed. Then, at the same time when the operation of the peripheral circuit 220 ends, the entire microcontroller 200 shifts to the standby mode. Therefore, the serial IO 221 and the AD converter 22
The processing data of No. 2 becomes valid.

【0063】さらに,待機モードに移行するときに,プ
ログラムによるソフト的な判断を必要とせずに,マイク
ロコントローラ200全体が待機モードに移行できる。
Further, when shifting to the standby mode, the entire microcontroller 200 can shift to the standby mode without requiring software judgment by a program.

【0064】以上,添付図面を参照しながら本発明にか
かるマイクロコントローラの制御方法及びマイクロコン
トローラの好適な実施形態について説明したが,本発明
はかかる例に限定されない。当業者であれば,特許請求
の範囲に記載された技術的思想の範疇内において各種の
変更例または修正例に想到し得ることは明らかであり,
それらについても当然に本発明の技術的範囲に属するも
のと了解される。
The preferred embodiments of the microcontroller control method and microcontroller according to the present invention have been described with reference to the accompanying drawings, but the present invention is not limited to such examples. It is obvious that those skilled in the art can conceive various changes or modifications within the scope of the technical idea described in the claims.
It is understood that these also belong to the technical scope of the present invention.

【0065】例えば,上記実施の形態では,待機モード
への移行をCPUからの命令により行った場合の一例に
つき説明したが,本発明はこれに限定されない。例え
ば,マイクロコントローラの外部から入力される信号に
よって待機モードに移行する場合であっても,同様に本
発明は適用可能である。
For example, in the above-described embodiment, an example has been described in which the transition to the standby mode is performed by an instruction from the CPU, but the present invention is not limited to this. For example, the present invention can be similarly applied to a case where a transition is made to the standby mode by a signal input from outside the microcontroller.

【0066】さらに,上記実施の形態では,低消費電力
化の待機モードに関してのみ説明しているが,本発明は
これに限定されない。CPUや周辺回路を低速動作させ
ることにより低消費電力化する低速モードの場合であっ
ても,上記実施の形態でクロックを停止した動作を行っ
た代わりに,低速クロックへの供給に切り替える動作を
行うことにより,同様に本発明は適用可能である。
Further, in the above-described embodiment, only the standby mode for reducing power consumption has been described, but the present invention is not limited to this. Even in the low-speed mode in which the power consumption is reduced by operating the CPU and peripheral circuits at a low speed, the operation for switching to the supply of the low-speed clock is performed instead of the operation in which the clock is stopped in the above embodiment. Accordingly, the present invention is also applicable.

【0067】[0067]

【発明の効果】以上説明したように,本発明によれば,
待機モードに移行するときに,周辺回路が動作中である
場合,動作が終了するまで周辺クロックを供給し,動作
が終了すると同時にマイクロコントローラ全体が待機モ
ードに移行するため,シリアルIOやADコンバータの
処理データを無効にしないですむ。
As described above, according to the present invention,
When the peripheral circuit is operating when shifting to the standby mode, a peripheral clock is supplied until the operation is completed. At the same time as the operation is completed, the entire microcontroller shifts to the standby mode. No need to invalidate processing data.

【0068】さらに,待機モードに移行するときに,プ
ログラムによるソフト的な判断を必要とせずに,マイク
ロコントローラ全体が待機モードに移行できる。
Further, when shifting to the standby mode, the entire microcontroller can shift to the standby mode without requiring software judgment by a program.

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

【図1】本発明にかかるマイクロコントローラの一の実
施の形態を示す説明図である。
FIG. 1 is an explanatory diagram showing one embodiment of a microcontroller according to the present invention.

【図2】図1のマイクロコントローラのクロック供給制
御部の構成を示す説明図である。
FIG. 2 is an explanatory diagram illustrating a configuration of a clock supply control unit of the microcontroller of FIG. 1;

【図3】図1のマイクロコントローラのタイミングチャ
ートである。
FIG. 3 is a timing chart of the microcontroller of FIG. 1;

【図4】本発明にかかるマイクロコントローラの別の実
施の形態を示す説明図である。
FIG. 4 is an explanatory diagram showing another embodiment of the microcontroller according to the present invention.

【図5】図4のマイクロコントローラのクロック供給制
御部の構成を示す説明図である。
FIG. 5 is an explanatory diagram illustrating a configuration of a clock supply control unit of the microcontroller in FIG. 4;

【図6】図4のマイクロコントローラのタイミングチャ
ートである。
FIG. 6 is a timing chart of the microcontroller of FIG. 4;

【図7】従来のマイクロコントローラの概略を示す説明
図である。
FIG. 7 is an explanatory view schematically showing a conventional microcontroller.

【図8】図7のマイクロコントローラのクロック供給制
御部の構成を示す説明図である。
FIG. 8 is an explanatory diagram illustrating a configuration of a clock supply control unit of the microcontroller of FIG. 7;

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

100 マイクロコントローラ 110 CPU 120 周辺回路 121 シリアルIO 122 ADコンバータ 130 クロック供給制御部 131 外部クロック制御部 132 CPUクロック制御部 133 周辺クロック制御部 140 メモリ部 141 ROM 142 RAM 150 内部バス C0 外部クロック C1 内部クロック C2 CPUクロック C3 周辺クロック S1 待機モード信号 S2 周辺動作終了信号 REFERENCE SIGNS LIST 100 Microcontroller 110 CPU 120 Peripheral circuit 121 Serial IO 122 A / D converter 130 Clock supply control unit 131 External clock control unit 132 CPU clock control unit 133 Peripheral clock control unit 140 Memory unit 141 ROM 142 RAM 150 Internal bus C0 External clock C1 Internal clock C2 CPU clock C3 Peripheral clock S1 Standby mode signal S2 Peripheral operation end signal

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 演算処理部と,周辺回路と,前記演算処
理部を駆動する演算処理部用クロック及び前記周辺回路
を駆動する周辺回路用クロックとを個別に出力可能なク
ロック供給制御部とを備えたマイクロコントローラの制
御方法であって,低消費電力モードへのモード変更信号
が発生すると,前記周辺回路が動作しているかどうかを
判断する工程と,前記工程において前記周辺回路が動作
していないと判断された場合には,前記演算処理部用ク
ロックおよび前記周辺回路用クロックを低消費電力モー
ドに切り替え,前記工程において前記周辺回路が動作し
ていると判断された場合には,前記演算処理部用クロッ
クは低消費電力モードに切り替えるが,前記周辺回路用
クロックは前記周辺回路の動作が終了した後に低消費電
力モードに切り替える工程と,を含むことを特徴とす
る,マイクロコントローラの制御方法。
1. An arithmetic processing unit, a peripheral circuit, and a clock supply control unit capable of individually outputting a clock for an arithmetic processing unit for driving the arithmetic processing unit and a clock for a peripheral circuit for driving the peripheral circuit. A control method for a microcontroller, comprising: when a mode change signal to a low power consumption mode is generated, determining whether the peripheral circuit is operating; and in the step, the peripheral circuit is not operating. If it is determined that the peripheral processing circuit is operating in the step, the operation processing clock and the peripheral circuit clock are switched to a low power consumption mode. The internal clock is switched to the low power consumption mode, but the peripheral circuit clock is switched to the low power consumption mode after the operation of the peripheral circuit is completed. And controlling the microcontroller.
【請求項2】 演算処理部と,周辺回路と,前記演算処
理部を駆動する演算処理部用クロック及び前記周辺回路
を駆動する周辺回路用クロックとを個別に出力可能なク
ロック供給制御部とを備えたマイクロコントローラの制
御方法であって,低消費電力モードへのモード変更信号
が発生すると,前記周辺回路が動作しているかどうかを
判断する工程と,前記工程において前記周辺回路が動作
していないと判断された場合には,前記演算処理部用ク
ロックおよび前記周辺回路用クロックを低消費電力モー
ドに切り替え,前記工程において前記周辺回路が動作し
ていると判断された場合には,前記演算処理部は演算処
理を停止し,前記演算処理部用クロックおよび前記周辺
回路用クロックは前記周辺回路の動作が終了した後に低
消費電力モードに切り替える工程と,を含むことを特徴
とする,マイクロコントローラの制御方法。
2. An arithmetic processing unit, a peripheral circuit, and a clock supply control unit capable of individually outputting an arithmetic processing unit clock for driving the arithmetic processing unit and a peripheral circuit clock for driving the peripheral circuit. A control method for a microcontroller, comprising: when a mode change signal to a low power consumption mode is generated, determining whether the peripheral circuit is operating; and in the step, the peripheral circuit is not operating. If it is determined that the peripheral processing circuit is operating in the step, the operation processing clock and the peripheral circuit clock are switched to a low power consumption mode. The unit stops arithmetic processing, and the operation processing unit clock and the peripheral circuit clock are switched to a low power consumption mode after the operation of the peripheral circuit is completed. And controlling the microcontroller.
【請求項3】 演算処理部用クロックにより駆動される
演算処理部と,周辺回路用クロックにより駆動される周
辺回路とを備えたマイクロコントローラであって,低消
費電力モードへのモード変更信号を発生するモード変更
装置と,モード変更信号が入力されて前記周辺動作回路
が動作しているかどうかを判断する判断装置と,前記判
断装置において前記周辺動作回路が動作していないと判
断された場合には,前記演算処理部用クロックと前記周
辺回路用クロックを低消費電力モードに切り替え,前記
判断装置において前記周辺動作回路が動作していると判
断された場合には,前記演算処理部用クロックは低消費
電力モードに切り替えるが,前記周辺回路用クロックは
前記周辺回路の動作が終了した後に低消費電力モードに
切り替えるクロック供給制御部と,を含むことを特徴と
する,マイクロコントローラ。
3. A microcontroller comprising an arithmetic processing unit driven by a clock for an arithmetic processing unit and a peripheral circuit driven by a clock for a peripheral circuit, wherein the microcontroller generates a mode change signal to a low power consumption mode. A mode change device that performs the operation, a determination device that receives a mode change signal to determine whether the peripheral operation circuit is operating, and a determination device that determines that the peripheral operation circuit is not operating when the determination device determines that the peripheral operation circuit is not operating. The clock for the arithmetic processing unit and the clock for the peripheral circuit are switched to a low power consumption mode, and when the determination unit determines that the peripheral operation circuit is operating, the clock for the arithmetic processing unit is set to low. The clock for the peripheral circuit is switched to the power consumption mode, and the clock for switching to the low power consumption mode after the operation of the peripheral circuit is completed. And a supply controller.
【請求項4】 演算処理部用クロックにより駆動される
演算処理部と,周辺回路用クロックにより駆動される周
辺回路とを備えたマイクロコントローラであって,低消
費電力モードへのモード変更信号を発生するモード変更
装置と,モード変更信号が入力されて前記周辺動作回路
が動作しているかどうかを判断する判断装置と,前記判
断装置において前記周辺動作回路が動作していないと判
断された場合には,前記演算処理部用クロックと前記周
辺回路用クロックを低消費電力モードに切り替え,前記
判断装置において前記周辺動作回路が動作していると判
断された場合には,前記演算処理部は演算処理を停止
し,前記演算処理部用クロックおよび前記周辺回路用ク
ロックは前記周辺回路の動作が終了した後に低消費電力
モードに切り替えるクロック供給制御部と,を含むこと
を特徴とする,マイクロコントローラ。
4. A microcontroller comprising an arithmetic processing unit driven by a clock for an arithmetic processing unit and a peripheral circuit driven by a clock for a peripheral circuit, wherein the microcontroller generates a mode change signal to a low power consumption mode. A mode change device that performs the operation, a determination device that receives a mode change signal to determine whether the peripheral operation circuit is operating, and a determination device that determines that the peripheral operation circuit is not operating when the determination device determines that the peripheral operation circuit is not operating. The operation processing unit clock and the peripheral circuit clock are switched to a low power consumption mode, and when the judgment device judges that the peripheral operation circuit is operating, the operation processing unit executes the operation processing. After the operation of the peripheral circuit ends, the clock for switching to the low power consumption mode is stopped. And a lock supply control unit.
JP10113657A 1998-04-23 1998-04-23 Method for controlling microcontroller and microcontroller Withdrawn JPH11305887A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10113657A JPH11305887A (en) 1998-04-23 1998-04-23 Method for controlling microcontroller and microcontroller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10113657A JPH11305887A (en) 1998-04-23 1998-04-23 Method for controlling microcontroller and microcontroller

Publications (1)

Publication Number Publication Date
JPH11305887A true JPH11305887A (en) 1999-11-05

Family

ID=14617845

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10113657A Withdrawn JPH11305887A (en) 1998-04-23 1998-04-23 Method for controlling microcontroller and microcontroller

Country Status (1)

Country Link
JP (1) JPH11305887A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001093584A1 (en) * 2000-06-02 2001-12-06 Sony Corporation Data processing system and method, communication system and method, and charging device and method
US8190924B2 (en) 2007-06-29 2012-05-29 Panasonic Corporation Computer system, processor device, and method for controlling computer system
CN107505878A (en) * 2017-09-26 2017-12-22 惠州拓邦电气技术有限公司 A kind of control circuit

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001093584A1 (en) * 2000-06-02 2001-12-06 Sony Corporation Data processing system and method, communication system and method, and charging device and method
US7313386B2 (en) 2000-06-02 2007-12-25 Sony Corporation Data processing system and method, communication system and method, and charging device and method
US7856227B2 (en) 2000-06-02 2010-12-21 Sony Corporation Data processing system and method, communication system and method, and charging apparatus and method
US7869797B2 (en) * 2000-06-02 2011-01-11 Sony Corporation Data processing system and method, communication system and method, and charging apparatus and method
US7966005B2 (en) 2000-06-02 2011-06-21 Sony Corporation Data processing system and method, communication system and method, and charging apparatus and method
US8190924B2 (en) 2007-06-29 2012-05-29 Panasonic Corporation Computer system, processor device, and method for controlling computer system
CN107505878A (en) * 2017-09-26 2017-12-22 惠州拓邦电气技术有限公司 A kind of control circuit

Similar Documents

Publication Publication Date Title
JP2762670B2 (en) Data processing device
JP2676966B2 (en) Single chip microcomputer
US5737616A (en) Power supply circuit with power saving capability
KR100479948B1 (en) Mobile radio telephone set
JPH11184554A (en) Clock control type information processor
WO1996037960A2 (en) Configurable power management scheme
US5261082A (en) Semiconductor integrated circuit having a plurality of oscillation circuits
GB2355899A (en) Multistage digital processor with dedicated stage clock controllers
JPH0854955A (en) Clock signal generation circuit
US7219248B2 (en) Semiconductor integrated circuit operable to control power supply voltage
JPH07334267A (en) Logic lsi
JPH10149237A (en) Semiconductor circuit
JPH11305887A (en) Method for controlling microcontroller and microcontroller
JP4831899B2 (en) Semiconductor integrated circuit and clock control method
JP3808716B2 (en) Power supply
JP2004185378A (en) Clock-synchronous serial communication device and semiconductor integrated circuit device
JP4219601B2 (en) Information processing device
JPH076155A (en) Single chip microcomputer
JPH06350415A (en) Module clock signal genarating circuit and electronics system
JPH0683616A (en) Semiconductor integrated circuit
JPH11219237A (en) Electronic equipment device and its controlling method
JPH07295956A (en) Microcontroller
JP2003256068A (en) Clock control system
JPH08272478A (en) Clock controller
JP2835224B2 (en) Clock switching control device

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: 20050705