JP2005043952A - Microcomputer system - Google Patents
Microcomputer system Download PDFInfo
- Publication number
- JP2005043952A JP2005043952A JP2003199828A JP2003199828A JP2005043952A JP 2005043952 A JP2005043952 A JP 2005043952A JP 2003199828 A JP2003199828 A JP 2003199828A JP 2003199828 A JP2003199828 A JP 2003199828A JP 2005043952 A JP2005043952 A JP 2005043952A
- Authority
- JP
- Japan
- Prior art keywords
- signal
- level
- wait
- output
- 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
【0001】
【発明の属する技術分野】
本発明は、マイクロコンピュータシステムに関し、特に、命令を格納するプログラムメモリのリードサイクル時間の制御を行うマイクロコンピュータシステムに関する。
【0002】
【従来の技術】
マイクロコンピュータにおける演算は、プログラムメモリに格納された命令を読み出してCPUへ入力することによって実行される。
【0003】
このとき、プログラムメモリから読み出されたデータが、端子間の信号反射の影響や電源ノイズ、電磁ノイズ等のノイズの影響を受けてレベル変動し、本来の命令とは異なった命令としてCPUへ入力されることがある。
【0004】
このようにして、本来実行すべき命令とは異なった命令がCPUへ入力されると、マイクロコンピュータが誤動作し、場合によっては、マイクロコンピュータが暴走状態に陥ることがある。そのため、マイクロコンピュータには、ウォッチドッグタイマなどの暴走検知回路が設けられており、この暴走検知回路が暴走状態を検知したときには、CPUへの割り込みまたはシステムへのリセットをかけ、マイクロコンピュータを正常状態へ復帰させる対策が取られている。
【0005】
しかしながら、このような暴走検知回路による対策では、暴走を検知するまでに時間がかかり、暴走を検知するまでの間は、マイクロコンピュータの誤動作が継続するという問題があった。
【0006】
そこで、CPUが命令を実行する前に、CPUへ間違った命令が入力されたことを検知することが望まれている。そのために、例えば、プログラムメモリに本来のデータとは別に識別コードを格納し、この識別コードを利用することで、間違った命令がCPUに入力されることを防止する回路が提案されている(例えば、特許文献1参照。)。
【0007】
【特許文献1】
特開平5−233339号公報(第2−3頁、図1)
【0008】
【発明が解決しようとする課題】
しかし、上述の識別コードを利用する従来の回路で防止できるのは、オペコード読み取りパルスが誤ってオペランドサイクルで発生し、命令中のオペランドを誤ってオペコードとして読み取ろうとする誤動作である。
【0009】
そのため、オペコード読み取りパルスが正しくオペコードサイクルに発生していれば、プログラムメモリから読み出した命令データに電源ノイズ等の影響を受けたレベル変動があるような場合でも、レベルの変動したデータがそのままCPUへ誤ったデータとして入力されてしまい、マイクロコンピュータの誤動作を防止することができなかった。
【0010】
そこで、本発明の目的は、プログラムメモリから読み出された命令データにレベル変動があっても、誤ったレベルの命令データがCPUへ入力されることのないマイクロコンピュータシステムを提供することである。
【0011】
【課題を解決するための手段】
本発明の一態様によれば、CPUと、前記CPUへ与える命令を格納するプログラムメモリと、前記プログラムメモリからの前記命令の読み出しを制御するリード信号を生成するメモリコントローラと、前記プログラムメモリから読み出された前記命令のデータの信号レベル変動を検知するレベル変動検知部と、前記レベル変動検知部から出力されたレベル変動検知信号に基づいて、前記メモリコントローラから出力される前記リード信号にウェイト期間を与えるウェイト信号を生成するウェイト信号生成部とを具備し、前記プログラムメモリから読み出した前記命令のデータに信号レベルの変動があるときは、前記命令のデータの信号レベルが安定するまで前記プログラムメモリからの前記命令のデータの読み出しを継続することを特徴とするマイクロコンピュータシステムが提供される。
【0012】
【発明の実施の形態】
以下、図面を参照しながら本発明の実施の形態を説明する。
【0013】
(第1の実施の形態)
図1は、本発明の第1の実施の形態に係るマイクロコンピュータシステムの構成を示すブロック図である。
【0014】
本実施の形態のマイクロコンピュータシステムは、1つの半導体集積回路チップであるMCUチップ1に搭載されたCPU2とメモリコントローラ3と、MCUチップ1とは別の半導体集積回路チップであるプログラムメモリ4を有している。また、他の構成要素として、レベル変動検知部5とウェイト信号生成部6とクロックジェネレータ7を備えている。
【0015】
このうち、メモリコントローラ3は、プログラムメモリ4からのデータの読み出しを制御するリード(/RD)信号を出力するもので、入力端子としてウェイト(/WAIT)端子を有しており、MCUチップ1の外部からウェイト(/WAIT)信号が与えられているときは、/RD信号に所望のウェイト期間を与えることができるものである。
【0016】
次に、本実施の形態のマイクロコンピュータシステムの動作について説明する。まず、プログラムメモリ4からデータを読み出してCPU2への命令として読み込む動作について説明し、その後、レベル変動検知部5とウェイト信号生成部6の動作について説明する。
【0017】
プログラムメモリ4には、CPU2へ与える命令が格納されており、メモリコントローラ3から出力されるリード信号(/RD信号)がプログラムメモリ4に与えられることにより、プログラムメモリ4に格納された命令が、複数のビットからなる命令データとして読み出される。
【0018】
メモリコントローラ3における/RD信号は、CPU2から与えられる基準/RD信号に基づいて生成される。本実施の形態においては、メモリコントローラ3から出力される/RD信号がLレベルに立ち下がったときにプログラムメモリ4からの命令データの読み出しが開始され、/RD信号がLレベルの間は読み出しのイネーブル期間であり、プログラムメモリ4からの命令データの出力が継続する。しかし、CPU2へ命令データが読み込まれるのは、/RD信号の立ち上がり、すなわち読み出しイネーブル期間終了のタイミングであり、その時点の命令データの信号レベルがCPU2へ読み込まれる。
【0019】
このようにして、メモリコントローラ3から出力される/RD信号のLレベルへの立ち下がりでプログラムメモリ4からの命令データの読み出しが始まるが、一般にスイッチング動作を行うと過渡現象が生じ、プログラムメモリ4から読み出された命令データが、すぐに安定した信号レベルに落ち着くとは限らない。
【0020】
特に、信号端子間のインピーダンスの不整合による反射や、多数の信号が一斉に変化するいわゆる同時スイッチングによる電源電位の変動が生じると、信号レベルの変動が大きく、場合によっては、信号レベルが反転するほど大きなレベルの変動が生じることがある。しかも、その変動の振幅が、ある一定以下のレベルに安定するまでには、時間がかかることがある。
【0021】
このようなスイッチング動作に伴う出力レベルの変動は、信号の配線長や配線のインピーダンスの時定数による周期性を持った減衰振動となることが多いが、/RD信号の立ち上がりのタイミング時点で、信号レベルの変動がある一定以下にまで小さくなっていないと、CPU2へ誤ったレベルの信号として読み込まれる。すなわち、CPU2へ、誤った命令が与えられることになる。
【0022】
そこで、本実施の形態のマイクロコンピュータシステムでは、レベル変動検知部5とウェイト信号生成部6を設け、プログラムメモリ4から出力された命令データの信号レベルに変動があっても、CPU2へ誤ったレベルの信号として読み込まれることを防止している。
【0023】
このうち、レベル変動検知部5は、プログラムメモリ4から出力された命令データが入力されており、命令データに信号レベルの反転と認識されるほど大きな信号レベルの変動があったときに、これを検知して、レベル変動検知信号を出力する回路である。
【0024】
また、ウェイト信号生成部6は、レベル変動検知部5から出力されるレベル変動検知信号を受けて、メモリコントローラ3のWAIT端子へ入力する/WAIT信号を生成する。
【0025】
この、レベル変動検知部5とウェイト信号生成部6の働きにより、プログラムメモリ4から出力された命令データに信号レベルが誤認識されるほど大きな信号レベルの変動がある間は、メモリコントローラ3のWAIT端子に/WAIT信号が与えられ、メモリコントローラ3から出力される/RD信号にウェイト期間が挿入される。
【0026】
その後、命令データの信号レベルの変動がある一定以下の値に収まると、命令レベル変動検知信号が出力されなくなる。すなわち、この時点で、データの信号レベルが安定したと見なすことができる。これにより、/WAIT信号も出力されなくなってウェイト期間の付与が終わり、/RD信号が立ち上がる。したがって、CPU2へは、信号レベルの変動が安定した後の命令データが読み込まれる。
【0027】
なお、ウェイト信号生成部6には、クロックジェネレータ7で生成されてCPU2へ供給されるシステムクロック信号CKと基準/RD信号も入力されており、これらの信号により、レベル変動検知信号の受け付け開始タイミングを決めている。
【0028】
通常、基準/RD信号のLレベル期間は、システムクロック信号CKの一周期分を単位として生成されるが、/WAIT信号の出力するかどうかの判断が必要となるのは、/RD信号の周期の後半に入ってからである。そこで、システムクロック信号CKで基準/RD信号の周期の後半期間を切り出し、この期間にレベル変動検知信号の出力があれば、これを受け付けるようにする。
【0029】
そして、基準/RD信号の出力期間を超えて、レベル変動検知信号が出力される場合には、そのレベル変動検知信号が出力されている間、/WAIT信号を出力する。
【0030】
また、ウェイト信号生成部6には、外部/WAIT信号も入力されているが、この信号は通常動作におけるウェイト制御に用いられる信号であり、ここでは使用しない。
【0031】
図2はレベル変動検知部5の回路の例、図3はウェイト信号生成部6の回路の例をそれぞれ示す回路図である。
【0032】
図2において、入力D1、D2、・・・、Dnは、nビットからなる命令データのそれぞれのビットのデータ信号を表わす。このD1、D2、・・・、Dnは、それぞれEX―NORゲート511、512、・・・、51nの一端に入力される。
【0033】
一方、EX―NORゲート511、512、・・・、51nの他端には、D1、D2、・・・、Dnをそれぞれ遅延回路521、522、・・・、52nに介した信号dD1、dD2、・・・、dDnが入力される。
【0034】
このEX―NORゲート511、512、・・・、51nの出力が、n入力のANDゲート53に入力され、このANDゲート53の出力が、レベル変動検知信号となっている。
【0035】
いま、入力D1、D2、・・・、Dnに信号レベルの変動があった場合、入力D1、D2、・・・、Dnと、これを遅延させた信号dD1、dD2、・・・、dDnとの間に、ある時刻で見た場合、信号レベルの相違が生じる。この信号レベルの相違が大きい場合、EX―NORゲート511、512、・・・、51nで入力信号レベルの不一致と認識され、その出力がLとなる。
【0036】
EX―NORゲート511、512、・・・、51nの出力のいずれかがLとなると、これらの出力が入力されているANDゲート53の出力、すなわちレベル変動検知信号がLとなる。
【0037】
一方、入力D1、D2、・・・、Dnの信号レベルの変動が収束すると、入力D1、D2、・・・、Dnと、これを遅延させた信号dD1、dD2、・・・、dDnとの間に信号レベルの差が生じなくなり、EX―NORゲート511、512、・・・、51nの出力はHとなる。EX―NORゲート511、512、・・・、51nの出力の総てがHとなると、ANDゲート53の出力、すなわちレベル変動検知信号はHとなる。
【0038】
つまり、入力D1、D2、・・・、Dnのいずれかに信号レベルの変動が生じると、レベル変動検知信号はLになるが、入力D1、D2、・・・、Dnの信号レベルの変動が総て収束すると、レベル変動検知信号はHとなるものである。
【0039】
なお、遅延回路521、522、・・・、52nに与える遅延時間としては、入力D1、D2、・・・、Dnの信号レベルの変動の周期がTであるとした場合には、その周期の半分、すなわちT/2程度とすればよい。
【0040】
図3は、上述した図2の回路から出力されるレベル変動検知信号を受けて、/WAIT信号を出力するウェイト信号生成部6の回路の例である。
【0041】
図3の回路では、ORゲート67にレベル変動検知信号と/RD信号が入力され、/RD信号がLの期間のみレベル変動検知信号は有効となる。このORゲート67の出力は、ORゲート61とORゲート62のそれぞれ一端に入力されている。そして、ORゲート61とORゲート62の出力がANDゲート65に入力され、ANDゲート65の出力がANDゲート66の一端に入力され、ANDゲート66の出力が/WAIT信号となっている。
【0042】
ここで、ORゲート61の他端には、ORゲート63の出力が入力され、ORゲート62の他端には、インバータ64の出力が入力されている。このうち、ORゲート63には、基準/RD信号とシステムクロックCKが入力され、インバータ64には、基準/RD信号が入力されている。また、ANDゲート66の他端には、外部/WAIT信号が入力されているが、ここでは、この外部/WAIT信号には、Hレベルが入力されているものとする。
【0043】
次に、この回路の動作について説明する。
【0044】
ORゲート63は、基準/RD信号のLレベル期間の後半の周期を切り出す回路であり、レベル変動検知信号の受付を開始する信号を出力する。すなわち、基準/RD信号とシステムクロックCKがともにLのとき、ORゲート63の出力がLとなり、レベル変動検知信号のL入力をORゲート61の出力へ通過させるように働く。
【0045】
このORゲート61の出力がLであると、ANDゲート65の出力もLとなり、次いで、ANDゲート66の出力もLとなり、すなわち/WAIT信号がLとなる。
【0046】
その後、基準/RD信号が立ち上がっても、なお、レベル変動検知信号のL入力が続く場合には、ORゲート61に代わって、ORゲート62が、レベル変動検知信号のL入力をANDゲート65の出力へ伝達するように働く。すなわち、基準/RD信号がHになると、ORゲート63の出力はHになって、ORゲート61の出力をHにするようになるが、代わりに、インバータ64の出力がLになって、レベル変動検知信号のL入力をORゲート62の出力へ通過させるように働く。
【0047】
このORゲート62の出力がLであるときも、ANDゲート65の出力はLとなり、ANDゲート66の出力もLとなって、/WAIT信号もLとなる。
【0048】
一方、レベル変動検知信号がHであるときは、ORゲート61とORゲート62の出力はともにHとなり、ANDゲート65の出力はHとなる。そして、ANDゲート65の出力がHであると、ANDゲート66の出力、すなわち/WAIT信号もHとなる。
【0049】
図4は、上述したレベル変動検知部5の回路の例とウェイト信号生成部6の回路の例を用いて、本実施の形態のマイクロコンピュータシステムを動作させたときの波形図である。
【0050】
システムクロックCKの1周期分発生する基準/RD信号がt1サイクルで与えられると、メモリコントローラ3からの/RD信号も出力される。すると、プログラムメモリ4から、命令データD1、D2、・・・、Dnが読み出される。
【0051】
いま、このD1、D2、・・・、Dnにレベル変動があると、これを遅延させたdD1、dD2、・・・、dDnにも遅延時間分遅れてレベル変動が生じる。
【0052】
レベル変動検知部5が、D1、D2、・・・、DnとdD1、dD2、・・・、dDnのレベルとの間の信号レベルの不一致を検出すると、レベル変動検知信号をLにする。
【0053】
ウェイト信号生成部6にレベル変動検知信号のLが入力されると、ウェイト信号生成部6は、基準/RD信号のLレベル期間の後半の周期から/WAIT信号にLを出力する。
【0054】
t2サイクルになって、基準/RD信号が立ち上がっても、レベル変動検知信号をLのままの場合、ウェイト信号生成部6は、/WAIT信号を引き続きLにしておく。すると、メモリコントローラ3は、/RD信号にシステムクロックCKの1周期分のウェイト期間を挿入し、/RD信号の立ちあがりを遅らせる。
【0055】
この/RD信号へのウェイト期間の挿入は、レベル変動検知信号がLの間、継続する。
【0056】
t3サイクルの途中で、レベル変動検知信号がHに変化すると、/WAIT信号もHに立ち上がり、/RD信号へのウェイト期間の挿入もこのサイクルで終了する。
【0057】
t4サイクルのシステムクロックCKの立ち上がりで、/RD信号も立ち上がり、このときのD1、D2、・・・、Dnのレベルが、命令データとしてCPU2へ読み込まれる。
【0058】
このように、本実施の形態のマイクロコンピュータシステムにおいては、プログラムメモリ4から読み出した命令データに信号レベルの変動があったときは、メモリコントローラ3から出力される/RD信号にウェイト期間を挿入し、命令データの信号レベルの変動が収束した後で、/RD信号を立ち上げる。これにより、CPU2へ誤った信号レベルの命令データが読み込まれることを防止することができる。
【0059】
(第2の実施の形態)
図5は、本発明の第2の実施の形態に係るマイクロコンピュータシステムの構成を示すブロック図である。
【0060】
本実施の形態におけるマイクロコンピュータシステムを構成するブロックの機能は、第1の実施の形態におけるマイクロコンピュータシステムのブロックと同じである。したがって、図5においては、図1に示すブロック図と同一の機能のブロックには同一の符号を付して示し、ここでは、その詳細な説明は省略する。
【0061】
本実施の形態のマイクロコンピュータシステムが、第1の実施の形態のマイクロコンピュータシステムと異なる点は、そのシステムを構成するブロックが、総て1つの半導体集積回路チップに搭載されていることである。
【0062】
すなわち、図5において、MCUチップ11に、CPU2と、メモリコントローラ3と、プログラムメモリ4が搭載され、さらに、レベル変動検知部5とウェイト信号生成部6が搭載されている。
【0063】
このように、本実施の形態のマイクロコンピュータシステムは、1つの半導体集積回路チップで作られているため、このマイクロコンピュータシステムが搭載される機器の実装面積を少なくすることができる。
【0064】
(第3の実施の形態)
図6は、本発明の第3の実施の形態に係るマイクロコンピュータシステムの構成を示すブロック図である。
【0065】
本実施の形態におけるマイクロコンピュータシステムの構成も、第1の実施の形態におけるマイクロコンピュータシステムの構成と同じである。また、システムを構成するするブロックの機能も、第1の実施の形態におけるマイクロコンピュータシステムのブロックと同じである。
【0066】
そのため、図6においては、図1に示すブロック図と同一の機能のブロックには同一の符号を付して示し、ここでは、その詳細な説明は省略する。
【0067】
本実施の形態におけるマイクロコンピュータシステムが、第1の実施の形態におけるマイクロコンピュータシステムと異なる点は、MCUチップ21からの基準/RD信号の出力がなく、ウェイト信号生成部26が、基準/RD信号を用いずに/WAIT信号を生成する点である。
【0068】
そこで、ここでは、ウェイト信号生成部26の回路構成と動作を中心に説明を行う。
【0069】
図7は、本実施の形態におけるウェイト信号生成部26の回路の例である。
【0070】
図7の回路では、ORゲート261にCKと/RD信号が入力され、window信号が生成される。このwindow信号とレベル変動検知信号がORゲート263に入力され、レベル変動トリガ信号が生成される。
【0071】
このレベル変動トリガ信号は、インバータ264でレベルが反転され、プリセット付きのDフリップフロップ265のクロック端子(CK)に入力される。このDフリップフロップ265のプリセット端子(/PR)には、window信号をインバータ262で反転した/window信号が入力され、入力端子(D)は、Lレベルに固定されている。
【0072】
Dフリップフロップ265の出力端子(Q)は、プリセット付きのDフリップフロップ266の入力端子(D)に接続されている。
【0073】
このDフリップフロップ266のクロック端子(CK)には、CKが入力され、プリセット端子(/PR)には、/RD信号をインバータ267でレベル反転した信号が入力される。
【0074】
そして、Dフリップフロップ266の出力と上述したDフリップフロップ265の出力がANDゲート268に入力され、ANDゲート268の出力がANDゲート269の一端に入力され、ANDゲート269の出力が/WAIT信号となっている。
【0075】
また、ANDゲート269の他端には、外部/WAIT信号が入力されているが、ここでは、この外部/WAIT信号には、Hレベルが入力されているものとする。
【0076】
次に、この回路の動作について図8の動作波形図を用いて説明する。
【0077】
図8は、本実施の形態におけるウェイト信号生成部26の動作の様子を示す動作波形図である。
【0078】
window信号は、/RD信号がHの期間Hであるが、t1期間で/RD信号がLに立ち下がると、CKと同じ波形を出力するようになる。
【0079】
ここで、レベル変動検知信号が、t1期間、t2期間を通じてLであるとすると、この間は、レベル変動トリガ信号にもCKと同じ波形を出力される。このレベル変動トリガ信号は、インバータ264で反転されDフリップフロップ265のCKとなる。
【0080】
Dフリップフロップ265は、window信号の反転信号である/window信号でプリセットされるため、/window信号がLのときは、Dフリップフロップ265の出力はHである。
【0081】
t1期間で、/window信号がHに変化すると、Dフリップフロップ265はプリセットが解除されるとともに、インバータ264で反転されたレベル変動トリガ信号によりD入力のLレベルが読み込まれ、Dフリップフロップ265の出力はLに変化する。
【0082】
t2期間で、/window信号がLに変化すると、Dフリップフロップ265は再度プリセットされ、Dフリップフロップ265の出力はHに変化する。その後、/window信号がHに変化すると、Dフリップフロップ265はプリセットが解除され、インバータ264で反転されたレベル変動トリガ信号によりD入力のLレベルが読み込まれ、Dフリップフロップ265の出力は、Lに変化する。
【0083】
t3期間で、/window信号がLに変化すると、Dフリップフロップ265は再度プリセットされ、Dフリップフロップ265の出力はHに変化する。その後、/window信号がHに変化するとプリセットは解除される。しかし、t3期間に入ってレベル変動検知信号がHに変化したため、レベル変動トリガ信号もHに固定され、その反転信号はLに固定される。そのため、プリセットが解除されてもD入力は読み込まれず、Dフリップフロップ265の出力はHのままとなる。
【0084】
一方、Dフリップフロップ266は、/RD信号の反転信号でプリセットされているため、/RD信号がHの間は、Dフリップフロップ266の出力は、Hにプリセットされている。
【0085】
t1期間で、/RD信号がLに変化すると、プリセットは解除される。
【0086】
t2期間で、CKが立ち上がると、Dフリップフロップ266は、D端子に接続されているDフリップフロップ265の出力のLを読み込んで、Dフリップフロップ266の出力は、Lに変化する。
【0087】
t3期間で、CKが立ち上がると、Dフリップフロップ266は、Dフリップフロップ265の出力のLを再度読み込み、Dフリップフロップ266の出力は、Lを継続する。
【0088】
t4期間で、CKが立ち上がると、Dフリップフロップ266は、Dフリップフロップ265の出力のHを読み込んで、Dフリップフロップ266の出力は、Hに変化する。
【0089】
外部/WAIT信号がHであるので、/WAIT信号は、Dフリップフロップ265の出力とDフリップフロップ266の出力のANDゲート268によるAND出力そのものとなる。したがって、t1期間で、Dフリップフロップ265の出力がLになったときに、/WAIT信号はLに変化し、t4期間でDフリップフロップ266の出力がHになるまでLが継続する。
【0090】
この/WAIT信号がLであると、/RD信号にウェイト期間が付与され、/RD信号はLを継続する。すなわち、/WAIT信号がHに変化するt4期間の終了までは、/RD信号はLを継続する。
【0091】
このように、本実施の形態のマイクロコンピュータシステムは、MCUチップ21から基準/RD信号の出力がなくても、/RD信号とレベル変動検知信号とシステムクロックCKに基づいて、ウェイト信号生成部26が/WAIT信号を生成することができる。
【0092】
【発明の効果】
本発明のマイクロコンピュータシステムによれば、プログラムメモリから読み出された命令データにレベル変動があっても、誤ったレベルの命令データがCPUへ入力されることを防止することができる。これにより、CPUに誤った命令が入力されることで発生する誤動作を防止することができる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態に係るマイクロコンピュータシステムの構成を示すブロック図。
【図2】本発明の実施の形態に係るレベル変動検知部の回路の例を示す回路図。
【図3】本発明の第1および第2の実施の形態に係るウェイト信号生成部の回路の例を示す回路図。
【図4】本発明の第1の実施の形態に係るマイクロコンピュータシステムの動作波形図。
【図5】本発明の第2の実施の形態に係るマイクロコンピュータシステムの構成を示すブロック図。
【図6】本発明の第3の実施の形態に係るマイクロコンピュータシステムの構成を示すブロック図。
【図7】本発明の第3の実施の形態に係るウェイト信号生成部の回路の例を示す回路図。
【図8】本発明の第3の実施の形態に係るウェイト信号生成部の動作波形図。
【符号の説明】
1、11、21 MCUチップ
2 CPU
3 メモリコントローラ
4 プログラムメモリ
5 レベル変動検知部
6、26 ウェイト信号生成部
7 クロックジェネレータ
511、512、・・・、51n EX−NORゲート
521、522、・・・、52n 遅延回路
53、65、66、268、269 ANDゲート
61、62、63、67、261、263 ORゲート
64、262、264、267 インバータ
265、266 Dフリップフロップ[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a microcomputer system, and more particularly to a microcomputer system that controls the read cycle time of a program memory that stores instructions.
[0002]
[Prior art]
Calculations in the microcomputer are executed by reading out the instructions stored in the program memory and inputting them to the CPU.
[0003]
At this time, the data read from the program memory fluctuates due to the influence of signal reflection between terminals, noise such as power supply noise and electromagnetic noise, and is input to the CPU as an instruction different from the original instruction. May be.
[0004]
In this way, when an instruction different from the instruction to be executed is input to the CPU, the microcomputer malfunctions, and in some cases, the microcomputer may enter a runaway state. For this reason, the microcomputer is provided with a runaway detection circuit such as a watchdog timer. When the runaway detection circuit detects a runaway state, it interrupts the CPU or resets the system, and the microcomputer is in a normal state. Measures are being taken to return to.
[0005]
However, such a countermeasure using the runaway detection circuit has a problem that it takes time until the runaway is detected and the microcomputer continues to malfunction until the runaway is detected.
[0006]
Therefore, it is desired to detect that an incorrect command is input to the CPU before the CPU executes the command. For this purpose, for example, a circuit has been proposed in which an identification code is stored in the program memory separately from the original data, and by using this identification code, an incorrect instruction is prevented from being input to the CPU (for example, , See Patent Document 1).
[0007]
[Patent Document 1]
JP-A-5-233339 (page 2-3, FIG. 1)
[0008]
[Problems to be solved by the invention]
However, what can be prevented by the conventional circuit using the above-described identification code is a malfunction in which an operation code read pulse is erroneously generated in an operand cycle and an operand in the instruction is erroneously read as an operation code.
[0009]
Therefore, if the operation code read pulse is correctly generated in the operation code cycle, even if the instruction data read from the program memory has a level fluctuation affected by power supply noise or the like, the data whose level fluctuation has occurred is directly sent to the CPU. It was input as incorrect data, and the malfunction of the microcomputer could not be prevented.
[0010]
SUMMARY OF THE INVENTION An object of the present invention is to provide a microcomputer system in which an incorrect level of instruction data is not input to a CPU even when the level of instruction data read from a program memory varies.
[0011]
[Means for Solving the Problems]
According to one aspect of the present invention, a CPU, a program memory that stores an instruction to be given to the CPU, a memory controller that generates a read signal that controls reading of the instruction from the program memory, and a read from the program memory A level fluctuation detection unit for detecting a signal level fluctuation of the data of the issued command, and a wait period in the read signal output from the memory controller based on the level fluctuation detection signal output from the level fluctuation detection unit A wait signal generating section for generating a wait signal for providing the signal, and when there is a signal level fluctuation in the data of the instruction read from the program memory, the program memory until the signal level of the data of the instruction is stabilized Continue reading the data of the command from That the microcomputer system is provided.
[0012]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0013]
(First embodiment)
FIG. 1 is a block diagram showing a configuration of a microcomputer system according to the first embodiment of the present invention.
[0014]
The microcomputer system of the present embodiment has a
[0015]
Among these, the
[0016]
Next, the operation of the microcomputer system of this embodiment will be described. First, an operation of reading data from the
[0017]
The
[0018]
The / RD signal in the
[0019]
In this way, reading of instruction data from the
[0020]
In particular, when the reflection due to impedance mismatch between signal terminals or the fluctuation of the power supply potential due to so-called simultaneous switching in which a large number of signals change at the same time, the fluctuation of the signal level is large, and the signal level is reversed in some cases Larger levels of fluctuations can occur. In addition, it may take some time for the amplitude of the fluctuation to stabilize to a certain level or less.
[0021]
Such a change in the output level accompanying the switching operation often results in a damped oscillation having periodicity due to the time constant of the wiring length of the signal and the impedance of the wiring, but at the timing of the rise of the / RD signal, If the level fluctuation is not reduced below a certain level, it is read into the
[0022]
Therefore, in the microcomputer system of the present embodiment, the level
[0023]
Among these, the level
[0024]
The wait
[0025]
While the level
[0026]
Thereafter, when the fluctuation in the signal level of the instruction data falls within a certain value, the instruction level fluctuation detection signal is not output. That is, at this point, it can be considered that the signal level of the data is stable. As a result, the / WAIT signal is also not output, the provision of the wait period ends, and the / RD signal rises. Therefore, the instruction data after the fluctuation of the signal level is stabilized is read into the
[0027]
The
[0028]
Usually, the L level period of the reference / RD signal is generated in units of one cycle of the system clock signal CK, but it is necessary to determine whether or not the / WAIT signal is output because of the cycle of the / RD signal. Since the second half of the year. Therefore, the second half of the period of the reference / RD signal is cut out by the system clock signal CK, and if there is an output of the level fluctuation detection signal during this period, it is accepted.
[0029]
When the level fluctuation detection signal is output beyond the output period of the reference / RD signal, the / WAIT signal is output while the level fluctuation detection signal is being output.
[0030]
The
[0031]
FIG. 2 is a circuit diagram showing an example of the circuit of the
[0032]
In FIG. 2, inputs D1, D2,..., Dn represent data signals of respective bits of n-bit instruction data. Dn are input to one end of each of the
[0033]
On the other hand, the other ends of the
[0034]
The outputs of the
[0035]
If there is a change in signal level at the inputs D1, D2,..., Dn, the inputs D1, D2,..., Dn and the signals dD1, dD2,. When viewed at a certain time, a difference in signal level occurs. When the difference in signal level is large, the
[0036]
When any of the outputs of the
[0037]
On the other hand, when the signal level fluctuations of the inputs D1, D2,..., Dn converge, the inputs D1, D2,..., Dn and the signals dD1, dD2,. .., 51n becomes H. The signal level difference does not occur between the
[0038]
That is, when a signal level fluctuation occurs in any of the inputs D1, D2,..., Dn, the level fluctuation detection signal becomes L, but the signal level fluctuations of the inputs D1, D2,. When all converge, the level fluctuation detection signal becomes H.
[0039]
The delay time given to the
[0040]
FIG. 3 is an example of a circuit of the wait
[0041]
In the circuit of FIG. 3, the level fluctuation detection signal and the / RD signal are input to the
[0042]
Here, the output of the
[0043]
Next, the operation of this circuit will be described.
[0044]
The
[0045]
When the output of the
[0046]
Thereafter, even if the reference / RD signal rises, if the L input of the level fluctuation detection signal continues, the
[0047]
When the output of the
[0048]
On the other hand, when the level fluctuation detection signal is H, the outputs of the
[0049]
FIG. 4 is a waveform diagram when the microcomputer system of the present embodiment is operated using the example of the circuit of the level
[0050]
When the reference / RD signal generated for one cycle of the system clock CK is given in the t1 cycle, the / RD signal from the
[0051]
Now, if there is a level fluctuation in D1, D2,..., Dn, the level fluctuation is also delayed by the delay time in dD1, dD2,.
[0052]
When the level
[0053]
When the level variation detection signal L is input to the wait
[0054]
Even if the reference / RD signal rises at the t2 cycle, if the level fluctuation detection signal remains L, the wait
[0055]
The insertion of the wait period into the / RD signal continues while the level fluctuation detection signal is L.
[0056]
If the level fluctuation detection signal changes to H in the middle of the t3 cycle, the / WAIT signal also rises to H, and the insertion of the wait period into the / RD signal is also completed in this cycle.
[0057]
At the rising edge of the system clock CK in the t4 cycle, the / RD signal also rises, and the levels of D1, D2,..., Dn at this time are read into the
[0058]
As described above, in the microcomputer system according to the present embodiment, when the signal level of the instruction data read from the
[0059]
(Second Embodiment)
FIG. 5 is a block diagram showing a configuration of a microcomputer system according to the second embodiment of the present invention.
[0060]
The functions of the blocks constituting the microcomputer system in the present embodiment are the same as the blocks of the microcomputer system in the first embodiment. Accordingly, in FIG. 5, blocks having the same functions as those in the block diagram shown in FIG. 1 are denoted by the same reference numerals, and detailed description thereof is omitted here.
[0061]
The microcomputer system of the present embodiment is different from the microcomputer system of the first embodiment in that all the blocks constituting the system are mounted on one semiconductor integrated circuit chip.
[0062]
That is, in FIG. 5, the
[0063]
Thus, since the microcomputer system of the present embodiment is made of one semiconductor integrated circuit chip, the mounting area of equipment on which the microcomputer system is mounted can be reduced.
[0064]
(Third embodiment)
FIG. 6 is a block diagram showing a configuration of a microcomputer system according to the third embodiment of the present invention.
[0065]
The configuration of the microcomputer system in the present embodiment is also the same as the configuration of the microcomputer system in the first embodiment. The functions of the blocks constituting the system are also the same as the blocks of the microcomputer system in the first embodiment.
[0066]
Therefore, in FIG. 6, blocks having the same functions as those in the block diagram shown in FIG. 1 are denoted by the same reference numerals, and detailed description thereof is omitted here.
[0067]
The microcomputer system in the present embodiment is different from the microcomputer system in the first embodiment in that there is no output of the reference / RD signal from the MCU chip 21, and the weight
[0068]
Therefore, here, the description will focus on the circuit configuration and operation of the wait
[0069]
FIG. 7 is an example of a circuit of the wait
[0070]
In the circuit of FIG. 7, the CK and / RD signals are input to the
[0071]
The level fluctuation trigger signal is inverted in level by the
[0072]
The output terminal (Q) of the D flip-
[0073]
CK is input to the clock terminal (CK) of the D flip-
[0074]
The output of the D flip-
[0075]
In addition, the external / WAIT signal is input to the other end of the AND
[0076]
Next, the operation of this circuit will be described with reference to the operation waveform diagram of FIG.
[0077]
FIG. 8 is an operation waveform diagram showing how the
[0078]
The window signal is the period H when the / RD signal is H, but when the / RD signal falls to L during the period t1, the same waveform as that of CK is output.
[0079]
Here, if the level fluctuation detection signal is L throughout the t1 period and the t2 period, the same waveform as that of CK is also output to the level fluctuation trigger signal during this period. This level fluctuation trigger signal is inverted by the
[0080]
Since the D flip-
[0081]
When the / window signal changes to H in the period t1, the preset of the D flip-
[0082]
When the / window signal changes to L in the period t2, the D flip-
[0083]
When the / window signal changes to L in the period t3, the D flip-
[0084]
On the other hand, since the D flip-
[0085]
When the / RD signal changes to L in the period t1, the preset is canceled.
[0086]
When CK rises during the period t2, the D flip-
[0087]
When CK rises in the period t3, the D flip-
[0088]
When CK rises in the period t4, the D flip-
[0089]
Since the external / WAIT signal is H, the / WAIT signal becomes the AND output itself of the output of the D flip-
[0090]
When the / WAIT signal is L, a wait period is given to the / RD signal, and the / RD signal continues to be L. That is, the / RD signal continues to be L until the end of the t4 period when the / WAIT signal changes to H.
[0091]
As described above, in the microcomputer system according to the present embodiment, the wait
[0092]
【The invention's effect】
According to the microcomputer system of the present invention, it is possible to prevent an incorrect level of instruction data from being input to the CPU even if the instruction data read from the program memory varies in level. As a result, it is possible to prevent a malfunction that occurs when an erroneous command is input to the CPU.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a microcomputer system according to a first embodiment of the present invention.
FIG. 2 is a circuit diagram showing an example of a circuit of a level fluctuation detection unit according to the embodiment of the present invention.
FIG. 3 is a circuit diagram showing an example of a circuit of a wait signal generation unit according to the first and second embodiments of the present invention.
FIG. 4 is an operation waveform diagram of the microcomputer system according to the first embodiment of the present invention.
FIG. 5 is a block diagram showing a configuration of a microcomputer system according to a second embodiment of the present invention.
FIG. 6 is a block diagram showing a configuration of a microcomputer system according to a third embodiment of the present invention.
FIG. 7 is a circuit diagram showing an example of a circuit of a wait signal generation unit according to the third embodiment of the present invention.
FIG. 8 is an operation waveform diagram of a wait signal generation unit according to a third embodiment of the present invention.
[Explanation of symbols]
1, 11, 21 MCU chip
2 CPU
3 Memory controller
4 Program memory
5 Level fluctuation detector
6, 26 Weight signal generator
7 Clock generator
511, 512,..., 51n EX-NOR gate
521, 522, ..., 52n Delay circuit
53, 65, 66, 268, 269 AND gate
61, 62, 63, 67, 261, 263 OR gate
64, 262, 264, 267 Inverter
265, 266 D flip-flop
Claims (6)
前記CPUへ与える命令を格納するプログラムメモリと、
前記プログラムメモリからの前記命令の読み出しを制御するリード信号を生成するメモリコントローラと、
前記プログラムメモリから読み出された前記命令のデータの信号レベル変動を検知するレベル変動検知部と、
前記レベル変動検知部から出力されたレベル変動検知信号に基づいて、前記メモリコントローラから出力される前記リード信号にウェイト期間を与えるウェイト信号を生成するウェイト信号生成部とを具備し、
前記プログラムメモリから読み出した前記命令のデータに信号レベルの変動があるときは、前記命令のデータの信号レベルが安定するまで前記プログラムメモリからの前記命令のデータの読み出しを継続することを特徴とするマイクロコンピュータシステム。CPU,
A program memory for storing instructions to be given to the CPU;
A memory controller that generates a read signal that controls reading of the instruction from the program memory;
A level fluctuation detecting unit for detecting a signal level fluctuation of the data of the instruction read from the program memory;
A wait signal generation unit that generates a wait signal that gives a wait period to the read signal output from the memory controller based on the level variation detection signal output from the level variation detection unit;
When there is a signal level variation in the data of the instruction read from the program memory, reading of the data of the instruction from the program memory is continued until the signal level of the data of the instruction is stabilized. Microcomputer system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003199828A JP2005043952A (en) | 2003-07-22 | 2003-07-22 | Microcomputer system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003199828A JP2005043952A (en) | 2003-07-22 | 2003-07-22 | Microcomputer system |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005043952A true JP2005043952A (en) | 2005-02-17 |
Family
ID=34260469
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003199828A Pending JP2005043952A (en) | 2003-07-22 | 2003-07-22 | Microcomputer system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005043952A (en) |
-
2003
- 2003-07-22 JP JP2003199828A patent/JP2005043952A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7622961B2 (en) | Method and apparatus for late timing transition detection | |
EP0722137A1 (en) | Clock control system for microprocessors | |
US7840830B2 (en) | Semiconductor integrated circuit having data input apparatus and method of inputting data using the same | |
KR20180129969A (en) | Apparatus and method comprising an instruction delay adjustment circuit | |
US6313622B1 (en) | Power source voltage controller | |
US20070170960A1 (en) | Reset signal generation circuit | |
JP2010119090A (en) | Dll circuit, update controller for dll circuit, and update method for dll circuit | |
US20090040848A1 (en) | Semiconductor memory device | |
JP2001184234A (en) | Watch dog timer | |
US7375571B1 (en) | Glitch free clock multiplexer that uses a delay element to detect a transition-free period in a clock signal | |
US7042267B1 (en) | Gated clock circuit with a substantially increased control signal delay | |
US7249275B2 (en) | Clock generating device and method for executing overclocking operation | |
KR101034338B1 (en) | Data transmission circuit | |
KR20170045058A (en) | Input circuit and electric apparatus including input circuit | |
JP2005043952A (en) | Microcomputer system | |
US7768866B2 (en) | Method and system for preventing noise disturbance in high speed, low power memory | |
US7454649B2 (en) | Marginless status determination circuit | |
US9274170B2 (en) | Semiconductor device | |
US8085104B2 (en) | Oscillation circuit, driving circuit thereof, and driving method thereof | |
KR100974217B1 (en) | Temperature Detecting Appratus and DLL Circuit Having the Same | |
KR100845784B1 (en) | Delay Apparatus for Delay Locked Loop | |
US20080238490A1 (en) | Semiconductor device and method for driving the same | |
JP2000188540A (en) | Clock generating circuit | |
CN116028414B (en) | Power consumption control circuit and control device | |
JP2003323393A (en) | Peripheral device control circuit and electronic circuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20050428 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20050606 |