JP2013101457A - Semiconductor device - Google Patents
Semiconductor device Download PDFInfo
- Publication number
- JP2013101457A JP2013101457A JP2011244291A JP2011244291A JP2013101457A JP 2013101457 A JP2013101457 A JP 2013101457A JP 2011244291 A JP2011244291 A JP 2011244291A JP 2011244291 A JP2011244291 A JP 2011244291A JP 2013101457 A JP2013101457 A JP 2013101457A
- Authority
- JP
- Japan
- Prior art keywords
- voltage
- external power
- processor
- power supply
- cpu
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
Description
本発明は、プロセッサおよび不揮発性メモリを含む半導体装置に関する。 The present invention relates to a semiconductor device including a processor and a nonvolatile memory.
従来から、同一基板上にプロセッサおよび不揮発性メモリが実装されたマイクロコンピュータがさまざまな用途で用いられている。このようなマイクロコンピュータに供給される外部電源の種類は、実装先の装置構成や用途などに応じて制約されることがある。 Conventionally, a microcomputer in which a processor and a nonvolatile memory are mounted on the same substrate has been used for various purposes. The type of external power supply supplied to such a microcomputer may be restricted depending on the device configuration and application of the mounting destination.
特開平07−029386号公報(特許文献1)に開示されるマイクロコンピュータに含まれるフラッシュメモリは、書込または消去動作時に使用される通常動作電圧よりもレベルの高い電圧を発生する高電圧発生回路を有する電源回路と、通常動作電圧を外部から供給する第1の電源端子と、書込または消去動作時に使用される通常動作電圧よりも高いレベルの電圧を外部から供給するための第2の電源端子とを有している。そして、第2の電源端子に供給された高レベルの電圧または高電圧発生回路で発生された高電圧のいずれかが選択されて、不揮発性記憶素子に供給される。このような昇圧電圧と外部高電圧とを切り換えてデータの消去、書込を行わせることで、携帯用装置において異なる電圧の電池を内蔵する必要がないという効果を奏する。 A flash memory included in a microcomputer disclosed in Japanese Patent Application Laid-Open No. 07-029386 (Patent Document 1) is a high voltage generation circuit that generates a voltage having a level higher than a normal operation voltage used during a write or erase operation. A first power supply terminal for supplying a normal operation voltage from the outside, and a second power supply for supplying a voltage at a level higher than the normal operation voltage used during the write or erase operation from the outside Terminal. Then, either the high level voltage supplied to the second power supply terminal or the high voltage generated by the high voltage generation circuit is selected and supplied to the nonvolatile memory element. By switching between the boosted voltage and the external high voltage so as to erase and write data, there is an effect that it is not necessary to incorporate batteries with different voltages in the portable device.
上述したように、上述のようなマイクロコンピュータは、さまざまな用途に用いられることが想定されており、外部電源に対する汎用性を高めたいというニーズがある。すなわち、マイクロコンピュータに提供される外部電源の種類(電圧)は、実装先の装置構成や用途などによって制限されるので、より外部電源についての制約を受けないように、動作可能な電圧範囲を拡大するための取組みが進められている。 As described above, the microcomputer as described above is assumed to be used for various purposes, and there is a need to improve the versatility of the external power supply. In other words, the type (voltage) of the external power supply provided to the microcomputer is limited by the device configuration and application of the mounting destination, so the voltage range that can be operated is expanded so that it is not subject to restrictions on the external power supply. Efforts to do so are underway.
一方、プロセッサや不揮発性メモリの有する性能を最大限利用するためには、外部電源の電圧に応じて、より好適な動作モードや動作周波数を自動的に設定することが好ましい。しかしながら、このような機能を有する構成は存在しなかった。 On the other hand, in order to make maximum use of the performance of the processor and the nonvolatile memory, it is preferable to automatically set a more suitable operation mode and operation frequency according to the voltage of the external power supply. However, there is no configuration having such a function.
本発明は、かかる課題を解決するためになされたものであり、その目的は、外部電源の電圧に応じて、より適切な動作モードや動作周波数を自動的に設定することが可能な半導体装置を提供することである。 The present invention has been made to solve such a problem, and an object of the present invention is to provide a semiconductor device capable of automatically setting a more appropriate operation mode and operation frequency in accordance with the voltage of the external power supply. Is to provide.
ある実施の形態に従う半導体装置は、プロセッサと、プロセッサによるアクセスが可能な不揮発性メモリと、少なくともプロセッサおよび不揮発性メモリを駆動するための外部電源の電圧を検出する電圧検出部とを含む。プロセッサは、命令群を実行することで、電圧検出部によって検出された電圧に応じて、プロセッサおよび不揮発性メモリの少なくとも一方についての動作モードおよび/または動作周波数を設定する。 A semiconductor device according to an embodiment includes a processor, a nonvolatile memory that can be accessed by the processor, and a voltage detection unit that detects at least a voltage of an external power source for driving the processor and the nonvolatile memory. The processor sets an operation mode and / or an operation frequency for at least one of the processor and the nonvolatile memory in accordance with the voltage detected by the voltage detection unit by executing the instruction group.
ある実施の形態によれば、外部電源の電圧に応じて、より適切な動作モードや動作周波数を自動的に設定することができる。 According to an embodiment, a more appropriate operation mode and operation frequency can be automatically set according to the voltage of the external power supply.
本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。 Embodiments of the present invention will be described in detail with reference to the drawings. Note that the same or corresponding parts in the drawings are denoted by the same reference numerals and description thereof will not be repeated.
<A.概要>
マイクロコンピュータに内蔵されているブートローダ(命令群)は、マイクロコンピュータ内のフラッシュメモリを書き換える(アクセスする)場合に、当該マイクロコンピュータに供給されている外部電源の電圧に応じて、CPUおよびフラッシュメモリの動作モードや動作周波数を適性化することが好ましい。さらに、フラッシュメモリにおけるデータの書き換えに要する時間を短縮化するためにも、動作周波数や動作モードをより好適に設定する必要がある。
<A. Overview>
The boot loader (instruction group) built in the microcomputer rewrites (accesses) the flash memory in the microcomputer according to the voltage of the external power supply supplied to the microcomputer. It is preferable to optimize the operation mode and the operation frequency. Further, in order to shorten the time required for rewriting data in the flash memory, it is necessary to set the operating frequency and the operating mode more suitably.
このような設定を行う場合には、マイクロコンピュータに供給されている外部電源の電圧を知る必要がある。 When performing such setting, it is necessary to know the voltage of the external power source supplied to the microcomputer.
従来の方法としては、ユーザが、パーソナルコンピュータ上で実行されるフラッシュメモリ書き換え用フロントエンドソフトウェアを用いて、ターゲット電圧を入力し、その情報をマイクロコンピュータへ送信することで、CPUおよびフラッシュメモリの動作モードや動作周波数を設定していた。 As a conventional method, the user inputs the target voltage using the flash memory rewriting front-end software executed on the personal computer, and transmits the information to the microcomputer. The mode and operating frequency were set.
しかしながら、このような方法では、ユーザが、パーソナルコンピュータ上で実行されるフラッシュメモリ書き換え用フロントエンドソフトウェアにて誤った電圧情報(ターゲット電圧)を入力しても、マイクロコンピュータ側ではその誤りを検出することができないので、マイクロコンピュータの予め規定された動作範囲外でフラッシュメモリの書き換えを行ってしまう可能性がある。 However, in such a method, even if the user inputs incorrect voltage information (target voltage) with the flash memory rewriting front-end software executed on the personal computer, the microcomputer detects the error. Therefore, there is a possibility that the flash memory is rewritten outside the predetermined operating range of the microcomputer.
また、電圧情報(ターゲット電圧)がマイクロコンピュータへ予め通知されないシステムでは、動作を保障するため、CPUやフラッシュメモリの動作周波数をより低く設定して動作させることが一般的であり、その結果、フラッシュメモリの書き換え時間が長くなるという課題があった。 Further, in a system in which voltage information (target voltage) is not notified to the microcomputer in advance, it is common to operate with a lower operating frequency of the CPU or flash memory in order to ensure the operation. There was a problem that the memory rewrite time was long.
そこで、本実施の形態においては、マイクロコンピュータに供給される外部電源の電圧を検出して、当該検出された電圧に応じたより好適なCPUおよびフラッシュメモリの動作モードや動作周波数を設定する。 Therefore, in this embodiment, the voltage of the external power supply supplied to the microcomputer is detected, and more preferable operation modes and operation frequencies of the CPU and the flash memory are set according to the detected voltage.
具体的には、本実施の形態に従うマイクロコンピュータは、プロセッサであるCPU(Central Processing Unit)が処理すべき情報(データ)を電気的な消去・書込によって書き換え可能な不揮発性メモリ(フラッシュメモリ)を有する。マイクロコンピュータは、マイクロコンピュータに供給される外部電源の電圧を検出する電圧検出部と、フラッシュメモリの書き換えを行うソフトウエア(ブートローダ)で構成される。 Specifically, the microcomputer according to the present embodiment includes a nonvolatile memory (flash memory) that can rewrite information (data) to be processed by a CPU (Central Processing Unit) that is a processor by electrical erasing / writing. Have The microcomputer includes a voltage detection unit that detects the voltage of an external power source supplied to the microcomputer and software (boot loader) that rewrites the flash memory.
一例として、電圧検出部は、VCC端子(電源端子)に印加されている外部電源を異なる分圧比で分圧した複数種類の電圧を生成し、レジスタを用いて検出したい電圧レベルを選択することにより、選択された電圧レベルがセレクタから出力される。この出力された電圧と基準電圧とを比較器により比較し、その比較結果がレジスタに格納される。この比較結果により、マイクロコンピュータに供給される外部電源の電圧を判断でき、ブートローダによって外部電源の電圧に応じてより好適なCPUおよびフラッシュメモリの動作モードや動作周波数の設定が可能となる。 As an example, the voltage detection unit generates a plurality of types of voltages obtained by dividing the external power supply applied to the VCC terminal (power supply terminal) at different voltage division ratios, and selects a voltage level to be detected using a register. The selected voltage level is output from the selector. The output voltage and the reference voltage are compared by a comparator, and the comparison result is stored in a register. From this comparison result, the voltage of the external power supply supplied to the microcomputer can be determined, and the operation mode and the operation frequency of the CPU and the flash memory can be more suitably set by the boot loader according to the voltage of the external power supply.
<B.全体構成>
図1は、本発明の実施の形態に従うマイクロコンピュータ1の構成を示す模式図である。図1を参照して、マイクロコンピュータ1は、CPU102と、ブートROM(Read Only Memory)104と、フラッシュメモリ106と、クロック発生回路108と、電圧検出部110とを含む。これらの各部は、内部バス100を介して互いデータ通信可能に接続されている。
<B. Overall configuration>
FIG. 1 is a schematic diagram showing a configuration of a microcomputer 1 according to the embodiment of the present invention. Referring to FIG. 1, microcomputer 1 includes a
CPU102は、プロセッサの典型例であり、予め指定された順序で命令を順次実行することで、マイクロコンピュータ1に含まれる各部を制御する。
The
ブートROM104は、マイクロコンピュータ1の起動時における各種処理を実行するための命令群を格納する記憶部である。すなわち、ブートROM104は、ブートローダとして機能する。具体的には、マイクロコンピュータ1の起動時において、CPU102は、ブートROM104に格納されている命令群を所定順序でロードして実行することで、後述するような、電圧検出部110によって検出された電圧に応じて、CPU102およびフラッシュメモリ106の動作モードおよび/または動作周波数を動作環境に応じた値に設定する。ブートROM104に格納される命令群は、このような動作モードおよび/または動作周波数を設定するためのプログラムに加えて、各種の初期化処理を実行するためのプログラムを含みうる。
The
フラッシュメモリ106は、プロセッサであるCPU102によるアクセスが可能な不揮発性メモリの典型例であり、CPU102によって書き込まれたデータを不揮発的に格納する。フラッシュメモリ106は、メモリセルに対する電圧の印加によって、データの記憶(プログラム)および消去(イレース)を行う。本実施の形態において、フラッシュメモリ106としては、任意の構造(NAND型やNOR型)および任意のセル方式(SLC(Single Level Cell)やMLC(Multi Level Cell))のものを採用することができる。さらに、フラッシュメモリに限られず、MRAM(Magnetic Random Access Memory)やFeRAM(Ferroelectric Random Access Memory)などの不揮発性メモリを採用してもよい。
The
クロック発生回路108は、CPU102およびフラッシュメモリ106、ならびに、内部バス100などのデータ伝送および処理タイミングなどを決定するクロック信号を発生する。後述するように、クロック発生回路108は、駆動されるデバイスの別に複数の動作周波数を有するクロック信号を発生するとともに、CPU102によって設定された動作周波数のクロック信号を各コンポーネントへ提供する。
The
電圧検出部110は、マイクロコンピュータ1に供給される外部電源の電圧を検出する。外部電源は、少なくともCPU102およびフラッシュメモリ106を駆動する。電圧検出部110は、外部電源を供給するための端子であるVCC端子(電源端子)と電気的に接続される。より具体的には、電圧検出部110は、比較用処理回路120と、比較切換用レジスタ122と、比較器124と、比較結果格納レジスタ126とを含む。
The
比較用処理回路120は、VCC端子を介して入力される外部電源の電圧を比較するために前処理する回路である。比較器124は、外部電源に依存する電圧と基準電圧とを比較する。比較切換用レジスタ122は、外部電源の電圧レベルを判定するために、比較器124に入力される電圧信号を切り換える。比較結果格納レジスタ126は、比較器124により判断される大小関係と、比較切換用レジスタ122における切換指令との関係に基づいて、外部電源の電圧(電圧レベル)を判定する。
The
マイクロコンピュータ1は、フラッシュメモリ106の内容を書き換えるにあたって、マイクロコンピュータ1に供給されている外部電源の電圧を電圧検出部110により検出し、当該外部電源の電圧に応じて、CPU102およびフラッシュメモリ106についてのより好適な動作モードおよび/または動作周波数を設定する。そして、マイクロコンピュータ1は、より好適な動作モードおよび/または動作周波数を設定した上で、フラッシュメモリ106を書き換える。このような動作モードおよび/または動作周波数の設定処理は、CPU102が、ブートROM104に格納されているブートローダ(命令群)に従って実行する。
When the microcomputer 1 rewrites the contents of the
<C.電圧検出部>
次に、図2を参照して、図1に示す電圧検出部110の具体的な構成の一例を示す。図2は、本発明の実施の形態に従うマイクロコンピュータ1に含まれる電圧検出部110の構成を示す模式図である。図2(A)には、基準電圧を順次切り換えることで外部電源の電圧を検出する構成例である電圧検出部110Aを示し、図2(B)には、外部電源の分圧比を順次切り換えることで外部電源の電圧を検出する構成例である構成例である電圧検出部110Bを示す。
<C. Voltage detector>
Next, an example of a specific configuration of the
(c1:基準電圧を切り換える構成)
図2(A)に示す電圧検出部110Aにおいて、比較用処理回路120Aは、VCC端子とグランドGNDとの間に直列に接続された分圧抵抗1201および1202と、内部基準電圧源(図示しない)から内部基準電圧を印加されるレベル選択回路1204とを含む。また、電圧検出部110Aは、比較切換用レジスタ122として、レベル選択用レジスタ1221を含む。
(C1: Configuration for switching the reference voltage)
In the
分圧抵抗1201と分圧抵抗1202との接続点にあるノード1203と比較器124の+端子が電気的に接続される。すなわち、外部電源の電圧が分圧抵抗1201と分圧抵抗1202との比で分圧された検出電圧Vdetが比較器124へ入力される。レベル選択回路1204は、レベル選択用レジスタ1221に設定される値(レジスタ値)に従って、入力される内部基準電圧を所定比率で分圧して基準電圧Vrefを出力する。すなわち、基準電圧Vrefが比較器124の−端子へ入力され、比較器124において、検出電圧Vdetと基準電圧Vrefとの大小関係が判定される。レベル選択用レジスタ1221に設定される値は、外部電源の電圧検出処理において、CPU102が順次切り換える。すなわち、レベル選択用レジスタ1221に設定される値を順次切り換えることで、比較器124へ入力される基準電圧Vrefを変化させていき、比較器124における大小関係が反転する基準電圧Vrefに基づいて、外部電源の電圧(電圧レベル)を判定する。なお、比較器124における比較結果は、比較結果格納レジスタ126(図1)へ格納される。
A node 1203 at a connection point between the
このように、図2(A)に示す電圧検出部110Aは、VCC端子(電源端子)に印加されている電圧を所定比率で分圧して得られた検出電圧Vdetを生成するとともに、内部基準電圧から検出したい電圧レベルをレベル選択用レジスタ1221で選択して基準電圧Vrefを生成する。そして、検出電圧Vdetと基準電圧Vrefとを比較器124により比較し、比較結果を比較結果格納レジスタ126(図1)に格納する。
As described above, the
すなわち、電圧検出部110Aは、外部電源を所定比率で分圧した電圧と予め定められた基準電圧と比較する比較回路である比較器124と、基準電圧の大きさを複数種類に切り換える基準電圧発生回路であるレベル選択回路1204およびレベル選択用レジスタ1221と、比較器124における比較結果とレベル選択回路1204から出力される基準電圧とに基づいて、外部電源の電圧を判定する判定回路とを含む。
That is, the
(c2:外部電源の分圧比を切り換える構成)
図2(B)に示す電圧検出部110Bにおいて、比較用処理回路120は、VCC端子とグランドGNDとの間に直列に接続された分圧抵抗1205,1206,1207,1208と、分圧レベル選択回路1209とを含む。また、電圧検出部110Bは、比較切換用レジスタ122として、レベル選択用レジスタ1222を含む。
(C2: Configuration for switching the voltage division ratio of the external power supply)
In the
分圧抵抗1205と分圧抵抗1206との接続点にあるノードN1と、分圧抵抗1206と分圧抵抗1207との接続点にあるノードN2と、分圧抵抗1207と分圧抵抗1208との接続点にあるノードN3とのそれぞれが、分圧レベル選択回路1209と電気的に接続される。分圧レベル選択回路1209は、レベル選択用レジスタ1222に設定される値(レジスタ値)に従って、ノードN1,N2,N3のそれぞれからの電圧のうち指定された電圧を比較器124の+端子へ出力する。また、内部基準電圧である基準電圧Vrefが比較器124の−端子へ入力され、比較器124において、検出電圧Vdetと基準電圧Vrefとの大小関係が判定される。レベル選択用レジスタ1222に設定される値は、外部電源の電圧検出処理において、CPU102が順次切り換える。すなわち、レベル選択用レジスタ1222に設定される値を順次切り換えることで、比較器124へ入力される検出電圧Vdetを変化させていき、比較器124における大小関係が反転する検出電圧Vdetに基づいて、外部電源の電圧(電圧レベル)を判定する。なお、比較器124における比較結果は、比較結果格納レジスタ126(図1)へ格納される。
A node N1 at a connection point between the
このように、図2(B)に示す電圧検出部110Bは、VCC端子(電源端子)に印加されている電圧を異なる比率で分圧して得られた複数の検出電圧のうち、検出したい電圧レベルをレベル選択用レジスタ1222で選択して検出電圧Vdetを生成する。そして、検出電圧Vdetと基準電圧Vrefとを比較器124により比較し、比較結果を比較結果格納レジスタ126(図1)に格納する。
As described above, the
すなわち、電圧検出部110Bは、外部電源を分圧して複数段階の分圧電圧(検出電圧Vdet)を出力する分圧回路である分圧レベル選択回路1209と、分圧レベル選択回路1209により出力される検出電圧Vdetを予め定められた基準電圧と比較する比較回路である比較器124と、分圧レベル選択回路1209から出力される検出電圧Vdetと比較器124における比較結果とに基づいて、外部電源の電圧を判定する判定回路とを含む。
That is, the
<D.動作モード/動作周波数の設定>
マイクロコンピュータ1の内部では、供給される外部電源を用いて、各種の内部クロック信号や内部電圧を生成する。そのため、外部電源の電圧は、マイクロコンピュータ1の性能を左右する。例えば、CPU102などを駆動するためのクロック信号の上限周波数は、外部電源の電圧に応じて制約される。また、フラッシュメモリ106においては、書込(プログラム)動作は、フローティングゲートへの電荷注入により行われ、消去(イレース)動作は、チャネルへの電圧印加によりフローティングゲートからの電荷引抜きにより行われる。そのため、これらの印加電圧を生成するための外部電源の電圧は重要である。
<D. Operation mode / frequency setting>
Inside the microcomputer 1, various internal clock signals and internal voltages are generated using the supplied external power supply. Therefore, the voltage of the external power source affects the performance of the microcomputer 1. For example, the upper limit frequency of a clock signal for driving the
そのため、マイクロコンピュータ1は、外部電源の電圧に応じて、CPU102およびフラッシュメモリ106についての動作モードおよび/または動作周波数を設定する。具体的には、以下の表に示すように、複数の動作モードの別に動作電圧範囲を予め規定しておき、検出される外部電源の電圧に応じて、適切な動作モードを設定する。
Therefore, the microcomputer 1 sets an operation mode and / or an operation frequency for the
上記の表において定義される設定では、主として、外部電源の電圧が2.7Vおよび1.62Vにおいて、動作モードが切り換えられることになる。例えば、外部電源の電圧が3.0Vであれば、動作モード1〜3のいずれについても設定可能であるが、より高速な処理を行うという観点からは、動作モード1が選択される。これに対して、外部電源の電圧が2.5Vであれば、動作モード2および3のみが設定可能となる(但し、動作モード2においてはフラッシュメモリ106に対する読出(リード)動作のみが可能である)。このとき、フラッシュメモリ106に対する書込動作が要求されるのであれば、動作モード3が選択される。
With the settings defined in the above table, the operation mode is switched mainly when the voltage of the external power supply is 2.7 V and 1.62 V. For example, if the voltage of the external power supply is 3.0 V, any of the operation modes 1 to 3 can be set, but the operation mode 1 is selected from the viewpoint of performing higher-speed processing. On the other hand, if the voltage of the external power supply is 2.5 V, only the
各種クロック信号の動作周波数は、それぞれの動作モードに応じて固定値としてもよいが、外部電源の電圧に応じてさらに変更してもよい。すなわち、前者の場合には、外部電源の電圧に応じて、CPU102およびフラッシュメモリ106についての動作モードのみが設定される。一方、後者の場合には、外部電源の電圧に応じて、CPU102およびフラッシュメモリ106についての動作モードおよび動作周波数が設定されることになる。
The operating frequencies of the various clock signals may be fixed values according to the respective operation modes, but may be further changed according to the voltage of the external power supply. That is, in the former case, only the operation mode for the
一例として、動作モードの別に、各種クロック信号の動作周波数を以下のように設定することができる。 As an example, the operating frequencies of various clock signals can be set as follows depending on the operation mode.
このように、動作モードを設定した上で、さらに、マイクロコンピュータ1の各コンポーネントが使用するクロック信号をより詳細に設定することで、外部電源の電圧に応じて、マイクロコンピュータ1の性能を最大限発揮させることができる。 Thus, after setting the operation mode, the clock signal used by each component of the microcomputer 1 is set in more detail, so that the performance of the microcomputer 1 is maximized according to the voltage of the external power supply. It can be demonstrated.
なお、上述のような動作モードを区分することなく、外部電源の電圧に応じて、CPU102およびフラッシュメモリ106についての動作周波数のみを設定するようにしてもよい。
Note that only the operating frequency for the
図3は、本発明の実施の形態に従うマイクロコンピュータ1におけるクロック信号を発生する回路構成の一例を示す図である。図3を参照して、マイクロコンピュータ1においては、主として、FlashIFクロック(FCLK)、システムクロック(ICLK)、周辺モジュールクロック(PCLKB,PCLKD)、および、外部バスクロック(BCLK)が用いられる。これらのクロック信号は、上述のクロック信号の設定例に対応している。 FIG. 3 shows an example of a circuit configuration for generating a clock signal in microcomputer 1 according to the embodiment of the present invention. Referring to FIG. 3, in microcomputer 1, a FlashIF clock (FCLK), a system clock (ICLK), peripheral module clocks (PCLKB, PCLKD), and an external bus clock (BCLK) are mainly used. These clock signals correspond to the clock signal setting examples described above.
FlashIFクロック(FCLK)は、フラッシュメモリ106に対するアクセス(読出動作、書込動作、消去動作)に用いられるクロック信号である。システムクロック(ICLK)は、内部バス100のデータ伝送やCPU102の駆動に用いられるクロック信号である。周辺モジュールクロック(PCLKB,PCLKD)は、マイクロコンピュータ1の入出力などの周辺モジュール(タイマーユニット、A/D変換ユニット、D/A変換ユニットなど)の駆動に用いられるクロック信号である。外部バスクロック(BCLK)は、マイクロコンピュータ1と外部装置との間でデータを遣り取りするために用いられるクロック信号である。
The Flash IF clock (FCLK) is a clock signal used for access (read operation, write operation, erase operation) to the
図3を参照して、マイクロコンピュータ1のクロック信号を発生するための構成として、メインクロック発振器1081と、サブクロック発振器1082と、高速クロック発振器1083と、低速クロック信号発振器1084と、セレクタ130,140,144,148,152と、レジスタ132,142,146,150,154と、分周器134とを含む。
Referring to FIG. 3, as a configuration for generating a clock signal of microcomputer 1,
メインクロック発振器1081、サブクロック発振器1082、高速クロック発振器1083、および、低速クロック信号発振器1084は、それぞれ所定の動作周波数のクロック信号を発生する。セレクタ130は、それぞれの発振器からのクロック信号のうち一つを選択し、分周器134へ出力する。セレクタ130は、レジスタ132に設定される値(CKSEL)に従って、クロック信号を選択する。基本的には、レジスタ132には、選択される動作モードに応じた値が設定される。すなわち、設定される動作モードに応じて、分周器134に入力されるクロック信号の動作周波数が切り換えられる。
The
分周器134は、入力されるクロック信号をそれぞれ異なる分周比で分周した複数のクロック信号を生成する。それぞれのクロック信号は、並列に配置されたバスによって、セレクタ140,144,148,152へそれぞれ与えられる。
The
セレクタ140は、レジスタ142に設定される値(FCK)に従って選択したクロック信号を、FlashIFクロック(FCLK)として出力する。
The
セレクタ144は、レジスタ146に設定される値(ICK)に従って選択したクロック信号を、システムクロック(ICLK)として出力する。
The
セレクタ148は、レジスタ150に設定される値(PCKB,PCKD)に従ってそれぞれ選択したクロック信号(2種類)を、周辺モジュールクロック(PCLKB,PCLKD)として出力する。
The
セレクタ152は、レジスタ150に設定される値(BCK)に従って選択したクロック信号を、外部バスクロック(BCLK)として出力する。
The
上述したように、典型的には、CPU102は、選択した動作モードに応じた値をレジスタ132に設定するとともに、選択した動作周波数に応じたそれぞれの値をレジスタ142,146,150,154に設定する。
As described above, typically, the
<E.処理手順>
次に、本実施の形態に従うマイクロコンピュータ1において実行される処理手順について説明する。基本的には、上述のCPU102およびフラッシュメモリ106の動作モードおよび/または動作周波数を動作環境に応じた値に設定する処理は、マイクロコンピュータ1の出荷時またはファームウェアのアップデート時に実行される。すなわち、CPU102は、電源投入後の起動時に、CPU102およびフラッシュメモリ106の動作モードおよび/または動作周波数を設定する。
<E. Processing procedure>
Next, a processing procedure executed in microcomputer 1 according to the present embodiment will be described. Basically, the processing for setting the operation mode and / or the operation frequency of the
(e1:設定処理)
図4は、本発明の実施の形態に従うマイクロコンピュータ1における設定処理およびフラッシュメモリへのアクセスの手順を示すフローチャートである。図5および図6は、図4に示す外部電源の電圧検出処理における処理手順を示すフローチャートである。
(E1: Setting process)
FIG. 4 is a flowchart showing a setting process and a procedure for accessing the flash memory in microcomputer 1 according to the embodiment of the present invention. 5 and 6 are flowcharts showing a processing procedure in the voltage detection processing of the external power source shown in FIG.
図4を参照して、マイクロコンピュータ1の電源が投入されると、CPU102は、ブートROM104に格納されているブートローダを実行する(ステップS2)。続いて、CPU102は、CPU102およびフラッシュメモリ106の動作モードおよび動作周波数の設定の実行が要求されているか否かを判断する(ステップS4)。マイクロコンピュータ1に最初に電源が投入される場合や、ファームウェアをアップデートした場合などに、設定処理の実行が要求されることになる。
Referring to FIG. 4, when the microcomputer 1 is turned on,
動作モードおよび動作周波数の設定の実行が要求されていない場合(ステップS4においてNOの場合)には、ステップS6〜S10の処理はスキップされ、処理はステップS20へ進む。 If execution of the setting of the operation mode and the operation frequency is not requested (NO in step S4), the processes in steps S6 to S10 are skipped, and the process proceeds to step S20.
動作モードおよび動作周波数の設定の実行が要求されている場合(ステップS4においてYESの場合)には、CPU102は、外部電源の電圧検出処理を実行する(ステップS6)。この外部電源の電圧検出処理の詳細については、図5および図6を参照して後述する。
When execution of setting of the operation mode and the operation frequency is requested (YES in step S4),
続いて、CPU102は、外部電源の電圧検出処理によって検出される外部電源の電圧に基づいて、CPU102のより好適な動作モードおよび/またはより好適な動作周波数を設定する(ステップS8)。また、CPU102は、外部電源の電圧検出処理によって検出される外部電源の電圧に基づいて、フラッシュメモリ106のより好適な動作モードおよび/またはより好適な動作周波数を設定する(ステップS10)。なお、ステップS8およびS10の処理は、並列的に行ってもよい。
Subsequently, the
以上の処理により、CPU102およびフラッシュメモリ106の動作モードおよび動作周波数の設定は完了する。その後、CPU102は、フラッシュメモリ106へのアクセス要求が発生したか否かを判断する(ステップS20)。フラッシュメモリ106へのアクセス要求が発生していない場合(ステップS20においてNOの場合)には、ステップS20以下の処理が繰返される。
With the above processing, the setting of the operation mode and the operation frequency of the
フラッシュメモリ106へのアクセス要求が発生した場合(ステップS20においてYESの場合)には、CPU102は、フラッシュメモリ106へのアクセスの種類を判断する(ステップS22)。そして、CPU102は、ステップS22において判断した種類に応じて、消去(イレース)処理、読出(ロード)処理、書込(プログラム)処理、ブランクチェック処理のいずれかを実行する(ステップS24)。そして、ステップS20以下の処理が繰返される。
If an access request to the
(e2:外部電源の電圧検出処理その1)
外部電源の電圧検出処理の一例として、図2(A)に示す電圧検出部110Aにより外部電源の電圧を検出する処理について説明する。
(E2: External power supply voltage detection process 1)
As an example of the voltage detection process of the external power supply, a process of detecting the voltage of the external power supply by the
図5を参照して、CPU102は、基準電圧Vrefを最高レベルに設定する(ステップS100)。具体的には、CPU102は、レベル選択用レジスタ1221(図2(A))に基準電圧Vrefを最高レベルに設定するための値を設定する。
Referring to FIG. 5,
続いて、CPU102は、電圧検出部110Aを活性化し(ステップS102)、電圧検出部110Aにおける比較結果(図2(A)の電圧検出信号)を読出す(ステップS104)。そして、CPU102は、検出電圧Vdetが現在の基準電圧Vref以上であるか否かを判断する(ステップS106)。
Subsequently, the
検出電圧Vdetが現在の基準電圧Vref以上である場合(ステップS106においてYESの場合)には、CPU102は、外部電源の電圧レベルを最高レベル以上であると判定する(ステップS108)。そして、処理は終了する。
When detection voltage Vdet is equal to or higher than current reference voltage Vref (YES in step S106),
検出電圧Vdetが現在の基準電圧Vref未満である場合(ステップS106においてNOの場合)には、CPU102は、基準電圧Vrefを現在のレベルから1段階だけ低いレベルに設定し(ステップS110)、電圧検出部110Aにおける比較結果を読出す(ステップS112)。そして、CPU102は、検出電圧Vdetが現在の基準電圧Vref以上であるか否かを判断する(ステップS118)。
When the detection voltage Vdet is lower than the current reference voltage Vref (NO in step S106), the
検出電圧Vdetが現在の基準電圧Vref以上である場合(ステップS118においてYESの場合)には、CPU102は、外部電源の電圧レベルを現在の基準電圧Vrefのレベル以上であり、かつ、現在の基準電圧Vrefのレベルより1段階だけ高いレベル未満であると判定する(ステップS120)。そして、処理は終了する。
When the detection voltage Vdet is equal to or higher than the current reference voltage Vref (YES in step S118), the
検出電圧Vdetが現在の基準電圧Vref未満である場合(ステップS118においてNOの場合)には、CPU102は、現在の基準電圧Vrefが最低レベルであるか否かを判断する(ステップS122)。
When the detected voltage Vdet is less than the current reference voltage Vref (NO in step S118), the
現在の基準電圧Vrefが最低レベルである場合(ステップS122においてYESの場合)には、CPU102は、外部電源の電圧レベルを最低レベル未満であると判定する(ステップS124)。そして、処理は終了する。
If current reference voltage Vref is at the lowest level (YES in step S122),
現在の基準電圧Vrefが最低レベルではない場合(ステップS122においてNOの場合)には、ステップS110以下の処理が実行される。 If the current reference voltage Vref is not at the lowest level (NO in step S122), the processing from step S110 is executed.
(e3:外部電源の電圧検出処理その2)
外部電源の電圧検出処理の別の例として、図2(B)に示す電圧検出部110Bにより外部電源の電圧を検出する処理について説明する。
(E3: External power supply voltage detection process 2)
As another example of the voltage detection process of the external power supply, a process of detecting the voltage of the external power supply by the
図6を参照して、CPU102は、最低レベルの検出電圧Vdetを選択する(ステップS200)。具体的には、CPU102は、レベル選択用レジスタ1222(図2(B))に最低レベルの検出電圧Vdetを選択するための値を設定する。すなわち、CPU102は、分圧比が最も低くなるように、分圧レベル選択回路1209を駆動する。
Referring to FIG. 6,
続いて、CPU102は、電圧検出部110Bを活性化し(ステップS202)、電圧検出部110Bにおける比較結果(図2(B)の電圧検出信号)を読出す(ステップS204)。そして、CPU102は、現在の検出電圧Vdetが基準電圧Vref以上であるか否かを判断する(ステップS206)。
Subsequently, the
現在の検出電圧Vdetが基準電圧Vref以上である場合(ステップS206においてYESの場合)には、CPU102は、外部電源の電圧レベルを最高レベル以上であると判定する(ステップS208)。そして、処理は終了する。
If current detection voltage Vdet is equal to or higher than reference voltage Vref (YES in step S206),
現在の検出電圧Vdetが基準電圧Vref未満である場合(ステップS206においてNOの場合)には、CPU102は、現在のレベルから1段階だけ高い検出電圧Vdetを選択し(ステップS210)、電圧検出部110Bにおける比較結果を読出す(ステップS212)。そして、CPU102は、現在の検出電圧Vdetが基準電圧Vref以上であるか否かを判断する(ステップS218)。
When current detection voltage Vdet is lower than reference voltage Vref (NO in step S206),
現在の検出電圧Vdetが基準電圧Vref以上である場合(ステップS218においてYESの場合)には、CPU102は、外部電源の電圧レベルを、現在の分圧比に対応するレベル以上であり、かつ、現在の分圧比に対応するレベルより1段階だけ高いレベル未満であると判定する(ステップS220)。そして、処理は終了する。
When current detection voltage Vdet is equal to or higher than reference voltage Vref (YES in step S218),
現在の検出電圧Vdetが基準電圧Vref未満である場合(ステップS218においてNOの場合)には、CPU102は、現在の検出電圧Vdetが最高レベルであるか否かを判断する(ステップS222)。
When current detection voltage Vdet is lower than reference voltage Vref (NO in step S218),
現在の検出電圧Vdetが最高レベルである場合(ステップS222においてYESの場合)には、CPU102は、外部電源の電圧レベルを最低レベル未満であると判定する(ステップS224)。そして、処理は終了する。
When current detection voltage Vdet is the highest level (YES in step S222),
現在の検出電圧Vdetが最高レベルではない場合(ステップS222においてNOの場合)には、ステップS210以下の処理が実行される。 If the current detection voltage Vdet is not at the highest level (NO in step S222), the processing from step S210 is executed.
(e4:変形例)
上述した出荷時/アップデート時に代えて、または、それに加えて、フラッシュメモリ106に対してアクセスする際に、CPU102およびフラッシュメモリ106の動作モードおよび/または動作周波数を動作環境に応じた値に設定する処理を行ってもよい。すなわち、CPU102は、フラッシュメモリ106へのアクセスが要求されたことに応答して、CPU102およびフラッシュメモリ106の動作モードおよび/または動作周波数を設定する。
(E4: Modification)
In place of, or in addition to, the above-mentioned shipment / update time, when the
図7は、本発明の実施の形態に従うマイクロコンピュータ1における設定処理およびフラッシュメモリへのアクセスの手順の変形例を示すフローチャートである。 FIG. 7 is a flowchart showing a modification of the procedure of the setting process and the access to the flash memory in microcomputer 1 according to the embodiment of the present invention.
図7を参照して、マイクロコンピュータ1の電源が投入されると、CPU102は、ブートROM104に格納されているブートローダを実行する(ステップS52)。
Referring to FIG. 7, when the microcomputer 1 is powered on,
続いて、CPU102は、フラッシュメモリ106へのアクセス要求が発生したか否かを判断する(ステップS54)。フラッシュメモリ106へのアクセス要求が発生していない場合(ステップS54においてNOの場合)には、ステップS54以下の処理が繰返される。
Subsequently, the
フラッシュメモリ106へのアクセス要求が発生した場合(ステップS54においてYESの場合)には、CPU102は、CPU102およびフラッシュメモリ106の動作モードおよび動作周波数を設定する。すなわち、まず、CPU102は、外部電源の電圧検出処理を実行する(ステップS56)。続いて、CPU102は、外部電源の電圧検出処理によって検出される外部電源の電圧に基づいて、CPU102のより好適な動作モードおよび/またはより好適な動作周波数を設定する(ステップS58)。また、CPU102は、外部電源の電圧検出処理によって検出される外部電源の電圧に基づいて、フラッシュメモリ106のより好適な動作モードおよび/またはより好適な動作周波数を設定する(ステップS60)。なお、ステップS58およびS60の処理は、並列的に行ってもよい。
When an access request to the
その後、CPU102は、フラッシュメモリ106へのアクセスの種類を判断する(ステップS62)。そして、CPU102は、ステップS52において判断した種類に応じて、消去(イレース)処理、読出(ロード)処理、書込(プログラム)処理、ブランクチェック処理のいずれかを実行する(ステップS64)。そして、ステップS54以下の処理が繰返される。
Thereafter, the
<F.まとめ>
本実施の形態によれば、フラッシュメモリの書き換えなどが必要な場合に、マイクロコンピュータに供給されている外部電源の電圧を検出することにより、好適な動作モードや動作周波数が自動的に設定される。そのため、従来のように、ユーザが誤って電圧情報(ターゲット電圧)を入力しまうことで、マイクロコンピュータが誤動作することを防止できる。これにより、外部電源の電圧に応じて、マイクロコンピュータの動作により好適なCPUおよびフラッシュメモリの動作モードや動作周波数の設定が可能となり、フラッシュメモリの書き換え時間の短縮を実現できる。
<F. Summary>
According to the present embodiment, when the flash memory needs to be rewritten, a suitable operation mode and operation frequency are automatically set by detecting the voltage of the external power supply supplied to the microcomputer. . Therefore, it is possible to prevent the microcomputer from malfunctioning when the user erroneously inputs voltage information (target voltage) as in the prior art. As a result, it is possible to set the operation mode and the operation frequency of the CPU and the flash memory more suitable for the operation of the microcomputer in accordance with the voltage of the external power supply, and the flash memory rewriting time can be shortened.
今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
1 マイクロコンピュータ、100 内部バス、102 CPU、104 ROM、106 フラッシュメモリ、108 クロック発生回路、110,110A,110B 電圧検出部、120,120A,120B 比較用処理回路、122 比較切換用レジスタ、124 比較器、126 比較結果格納レジスタ、130,140,144,148,152 セレクタ、132,142,146,150,154 レジスタ、134 分周器、1081 メインクロック発振器、1082 サブクロック発振器、1083 高速クロック発振器、1084 低速クロック信号発振器、1201,1202,1205,1206,1207,1208 分圧抵抗、1203,N1,N2,N3 ノード、1204 レベル選択回路、1209 分圧レベル選択回路、1221,1222 レベル選択用レジスタ、GND グランド。
1 microcomputer, 100 internal bus, 102 CPU, 104 ROM, 106 flash memory, 108 clock generation circuit, 110, 110A, 110B voltage detection unit, 120, 120A, 120B comparison processing circuit, 122 comparison switching register, 124
Claims (5)
前記プロセッサによるアクセスが可能な不揮発性メモリと、
少なくとも前記プロセッサおよび前記不揮発性メモリを駆動するための外部電源の電圧を検出する電圧検出部とを備え、
前記プロセッサは、命令群を実行することで、前記電圧検出部によって検出された電圧に応じて、前記プロセッサおよび前記不揮発性メモリの少なくとも一方についての動作モードおよび/または動作周波数を設定する、半導体装置。 A processor;
A non-volatile memory accessible by the processor;
A voltage detection unit for detecting a voltage of an external power source for driving at least the processor and the nonvolatile memory;
The processor executes an instruction group to set an operation mode and / or an operation frequency for at least one of the processor and the non-volatile memory according to a voltage detected by the voltage detection unit. .
前記外部電源を所定比率で分圧した電圧と予め定められた基準電圧と比較する比較回路と、
前記基準電圧の大きさを複数種類に切り替える基準電圧発生回路と、
前記比較回路における比較結果と前記基準電圧発生回路から出力される前記基準電圧とに基づいて、前記外部電源の電圧を判定する判定回路とを含む、請求項1〜3のいずれか1項に記載の半導体装置。 The voltage detector is
A comparison circuit that compares a voltage obtained by dividing the external power supply by a predetermined ratio with a predetermined reference voltage;
A reference voltage generating circuit for switching the reference voltage to a plurality of types;
The determination circuit which determines the voltage of the said external power supply based on the comparison result in the said comparison circuit, and the said reference voltage output from the said reference voltage generation circuit, The control circuit of any one of Claims 1-3 Semiconductor device.
前記外部電源を分圧して複数段階の分圧電圧を出力する分圧回路と、
前記分圧回路により出力される分圧電圧を予め定められた基準電圧と比較する比較回路と、
前記分圧回路から出力される分圧電圧と前記比較回路における比較結果とに基づいて、前記外部電源の電圧を判定する判定回路とを含む、請求項1〜3のいずれか1項に記載の半導体装置。 The voltage detector is
A voltage dividing circuit that divides the external power source and outputs a divided voltage of a plurality of stages;
A comparison circuit that compares the divided voltage output by the voltage dividing circuit with a predetermined reference voltage;
The determination circuit according to claim 1, further comprising: a determination circuit that determines a voltage of the external power source based on a divided voltage output from the voltage dividing circuit and a comparison result in the comparison circuit. Semiconductor device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011244291A JP2013101457A (en) | 2011-11-08 | 2011-11-08 | Semiconductor device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011244291A JP2013101457A (en) | 2011-11-08 | 2011-11-08 | Semiconductor device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2013101457A true JP2013101457A (en) | 2013-05-23 |
Family
ID=48622033
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011244291A Pending JP2013101457A (en) | 2011-11-08 | 2011-11-08 | Semiconductor device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2013101457A (en) |
-
2011
- 2011-11-08 JP JP2011244291A patent/JP2013101457A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200218446A1 (en) | Method and apparatus for memory management | |
US20210271412A1 (en) | Storage device and method of operating the storage device | |
US7684246B2 (en) | Flash memory device having pump with multiple output voltages | |
JP2012513652A (en) | Pre-characterization of flash memory timing | |
KR100914265B1 (en) | Nonvolatile memory device, memory system thereof, and reading method thereof | |
US20120236672A1 (en) | High voltage generating circuit and method of operating the same | |
CN111399752B (en) | Control device and method for different types of storage units | |
CN103093831A (en) | Built-in self trim for non-volatile memory reference current | |
US8339889B2 (en) | Semiconductor memory device | |
JP5931236B1 (en) | Semiconductor device control circuit and method, and semiconductor device | |
US9454437B2 (en) | Non-volatile logic based processing device | |
US10324627B2 (en) | Memory system and operation method thereof | |
JP2013101457A (en) | Semiconductor device | |
JP6495160B2 (en) | Semiconductor integrated circuit | |
WO2020223849A1 (en) | Memory control system with a sequence processing unit | |
JP5385220B2 (en) | Nonvolatile memory, data processing apparatus, and microcomputer application system | |
US11237739B2 (en) | Memory system | |
KR100970933B1 (en) | Apparatus and method for high speed booting an operating system | |
US20190369906A1 (en) | Semiconductor device | |
JP2004253031A (en) | Semiconductor integrated circuit and its test method | |
KR20050079534A (en) | Apparatus for cache program and method of cache programming |