JP2001043111A - Interruption control circuit and microcontroller - Google Patents

Interruption control circuit and microcontroller

Info

Publication number
JP2001043111A
JP2001043111A JP11212036A JP21203699A JP2001043111A JP 2001043111 A JP2001043111 A JP 2001043111A JP 11212036 A JP11212036 A JP 11212036A JP 21203699 A JP21203699 A JP 21203699A JP 2001043111 A JP2001043111 A JP 2001043111A
Authority
JP
Japan
Prior art keywords
interrupt
address
register
cpu
control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP11212036A
Other languages
Japanese (ja)
Inventor
Kazuya Taniguchi
一哉 谷口
Seiji Kamata
誠司 鎌田
Takehiko Yamashita
武彦 山下
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP11212036A priority Critical patent/JP2001043111A/en
Publication of JP2001043111A publication Critical patent/JP2001043111A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an interruption control circuit equipped with a means for improving reliability by preventing runaway of a microcomputer system by outputting a control signal of write/read to a memory and controlling generation of the interruption request signal to a CPU on the basis of contents of a control register. SOLUTION: A control register 7 sets a write/read condition of the memory and the condition of interruption to a CPU 21. A control circuit 8 receives coincidence signals ch0 and ch1 from comparators 5 and 6 and a signal 28 for controlling the write/read of a RAM 24 from the CPU 21 and outputs a signal 70 for controlling the write/read and a flag signal 73 showing the generation of interruption corresponding to a value of the control register 7. A flag register 9 holds the flag signal 73 showing the interruption generation outputted from the control circuit 8. On the basis of the flag signal 73 showing the interruption generation, an interruption signal generating circuit 10 generates an interruption request signal 71.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、1チップマイクロ
コントローラに係り、特に、1チップマイコンなどの半
導体集積回路に内蔵され割り込みを発生させる回路に関
する。
[0001] 1. Field of the Invention [0002] The present invention relates to a one-chip microcontroller, and more particularly to a circuit which is built in a semiconductor integrated circuit such as a one-chip microcomputer and generates an interrupt.

【0002】[0002]

【従来の技術】図1は、従来の1チップマイコンすなわ
ち1チップマイクロコントローラの構成の一例を示すブ
ロック図である。CPU21は、プログラムに従い処理
演算を実行する。I/Oポートすなわち入出力ポート2
2は、1チップマイコンの外部とデータをやりとりす
る。ROM23は、プログラムを格納する読み出し専用
メモリである。RAM24は、計算結果やデータを一時
的に記録する書き込み/読み出し可能なメモリである。
ウォッチドッグタイマ25は、カウンタ値のオーバーフ
ローに応じて、1チップマイコンをリセットし、また
は、CPU21に対する割り込みを発生する。アドレス
バス26は、CPU21からRAM24,ROM23に
アドレスを受け渡しする。データバス27は、CPU2
1,RAM24,ROM23とデータを受け渡しする。
CPU21から出力される書き込み/読み出し制御信号
iwre28は、RAM24,ROM23などのデータの書
き込み/読み出しを制御する。
2. Description of the Related Art FIG. 1 is a block diagram showing an example of the configuration of a conventional one-chip microcomputer, that is, a one-chip microcontroller. The CPU 21 performs a processing operation according to a program. I / O port, ie I / O port 2
2 exchanges data with the outside of the one-chip microcomputer. The ROM 23 is a read-only memory for storing programs. The RAM 24 is a writable / readable memory for temporarily recording calculation results and data.
The watchdog timer 25 resets the one-chip microcomputer or generates an interrupt to the CPU 21 according to the overflow of the counter value. The address bus 26 transfers addresses from the CPU 21 to the RAM 24 and the ROM 23. The data bus 27 is connected to the CPU 2
1, the data is transferred to and from the RAM 24 and the ROM 23.
Write / read control signal output from CPU 21
The iwre 28 controls writing / reading of data in the RAM 24, the ROM 23, and the like.

【0003】この種の1チップマイコンは、主に組み込
み制御機器のシステムコントローラとして用いられる。
そのような組み込み制御機器は、マイコンシステムと呼
ばれる。
A one-chip microcomputer of this kind is mainly used as a system controller of an embedded control device.
Such an embedded control device is called a microcomputer system.

【0004】マイコンシステムの一例として、自動車の
エンジン制御システムを考える。自動車のエンジン制御
システムは、CPU21が、I/Oポート22を介し
て、アクセルなどからの信号を受け取り、ROM23に
格納されているプログラムに従い、計算およびデータ処
理を実行し、I/Oポート22を介して、処理結果をエ
ンジンに送り、インジェクタのガソリン噴射量などを制
御する。
As an example of a microcomputer system, an automobile engine control system will be considered. In the engine control system of the automobile, the CPU 21 receives a signal from an accelerator or the like via the I / O port 22, executes calculation and data processing according to a program stored in the ROM 23, and controls the I / O port 22. The processing result is sent to the engine via the engine, and the gasoline injection amount of the injector is controlled.

【0005】従来の1チップマイコンでは、自動車のエ
ンジン制御システムようなマイコンシステムの信頼性を
高めるために、暴走時の対処手段として、ウォッチドッ
グタイマ25を設けていた。ウォッチドッグタイマ25
は、カウンタ値を設定できるタイマであり、カウンタが
オーバーフローしたとき、1チップマイコンをリセット
し、または、CPU21に対する割り込みを発生する。
In a conventional one-chip microcomputer, a watchdog timer 25 is provided as a measure against a runaway in order to increase the reliability of a microcomputer system such as an engine control system of an automobile. Watchdog timer 25
Is a timer that can set a counter value, and resets the one-chip microcomputer or generates an interrupt to the CPU 21 when the counter overflows.

【0006】ウォッチドッグタイマを使用してシステム
を監視する方法は、以下の通りである。ウォッチドック
タイマ25のカウンタを0にして、タイマを動作させ
る。正常動作時は、タイマがオーバーフローする前に、
CPU21がウォッチドッグタイマ25のカウンタを0
にクリアし、最初からの動作を繰り返す。もし暴走など
により、CPU21がカウンタを0にクリアできなけれ
ば、ウォッチドックタイマ25のオーバーフローが生
じ、1チップマイコンのリセットまたはCPU21に対
する割り込みが発生する。
A method for monitoring a system using a watchdog timer is as follows. The counter of the watchdog timer 25 is set to 0 to operate the timer. During normal operation, before the timer overflows,
The CPU 21 sets the counter of the watchdog timer 25 to 0
And repeat the operation from the beginning. If the CPU 21 cannot clear the counter to 0 due to a runaway or the like, an overflow of the watchdog timer 25 occurs, and a one-chip microcomputer reset or an interrupt to the CPU 21 occurs.

【0007】次に、プログラム構成の観点から、ウォッ
チドックタイマ25を用いたマイコンシステムの暴走の
防止を考察する。1チップマイコンに搭載されているプ
ログラムを、オペレーティングシステムOSとアプリケ
ーションプログラムAppとの二つに分けて考える。O
Sは、マイコンシステムのスケジユーリングなどの基本
的動作を管理している。アプリケーションプログラム
は、エンジン制御システムの制御などを実際に実行す
る。
Next, from the viewpoint of the program configuration, prevention of runaway of the microcomputer system using the watchdog timer 25 will be considered. The program installed in the one-chip microcomputer will be divided into two, an operating system OS and an application program App. O
S manages basic operations such as scheduling of the microcomputer system. The application program actually executes control of the engine control system and the like.

【0008】その場合、ウォッチドックタイマ25を設
定するプログラムは、OSであり、設定時間は、次に実
行するアプリケーションプログラムの実行時間である。
アプリケーションプログラムが正常に動作していれば、
CPU21は、設置時間内にアプリケーションプログラ
ムからOSに制御を移せるので、OS実行中にウォッチ
ドッグタイマをクリアできる。もし、アプリケーション
プログラムが暴走した場合、CPU21は、ウォッチド
ッグタイマ25の設定時間内にOSに制御を移せないの
で、ウォッチドックイマ25を0にクリアできず、タイ
マがオーバーフローしてしまい、1チップマイコンのリ
セットまたはCPU21に対する割り込みが発生する。
一般には、このような仕組みで、マイコンシステムの信
頼性を確保している。
In this case, the program for setting the watchdog timer 25 is the OS, and the set time is the execution time of the application program to be executed next.
If the application program is working properly,
Since the CPU 21 can transfer control from the application program to the OS within the installation time, the watchdog timer can be cleared during execution of the OS. If the application program runs away, the CPU 21 cannot transfer control to the OS within the set time of the watchdog timer 25, so that the watchdog timer 25 cannot be cleared to 0, the timer overflows, and the one-chip microcomputer Is reset or an interrupt to the CPU 21 occurs.
Generally, the reliability of the microcomputer system is secured by such a mechanism.

【0009】[0009]

【発明が解決しようとする課題】しかし、このようなシ
ステムの場合、従来の対処手段は、暴走を未然に防止す
るわけではなく、暴走後のいわば対症療法でしかない。
However, in the case of such a system, the conventional countermeasure does not prevent runaway beforehand, but is merely a symptomatic treatment after runaway.

【0010】しかも、一度暴走すれば、タイマのオーバ
ーフローが生じ、リセットまたは割り込みが発生するま
で暴走し続けるので、暴走発生から暴走への対処まで、
最大ではカウンタの設定値分の時間を必要とする。ま
た、RAM24などの書き換え可能な領域は、暴走の間
に書き換えられてしまう確率が高い。
Moreover, once a runaway occurs, a timer overflow occurs and the runaway continues until a reset or an interrupt occurs.
At the maximum, the time corresponding to the set value of the counter is required. A rewritable area such as the RAM 24 has a high probability of being rewritten during a runaway.

【0011】そのため、かりに割り込みにより暴走処理
ルーチンに制御が移っても、データが既に破壊されてお
り、システムを暴走直前の状態に戻すことはできない。
Therefore, even if the control is transferred to the runaway processing routine due to the interruption, the data has already been destroyed and the system cannot be returned to the state immediately before the runaway.

【0012】特に、OSのデータ領域が破壊されている
場合は、OS自体が誤動作する可能性があるので、シス
テムをリセットする以外には、暴走状態から復帰する方
法がない。
In particular, when the data area of the OS is destroyed, the OS itself may malfunction, and there is no way to recover from the runaway state except for resetting the system.

【0013】例えば、自動車のエンジン制御システムで
は、リセットさせると事故に直接つながるおそれがあ
り、システム動作中は簡単にリセットできない場合が多
く、従来のウォッチドッグタイマによるシステムの監視
では、信頼性が不十分であった。
For example, in an engine control system of an automobile, resetting may directly lead to an accident. In many cases, resetting cannot be easily performed while the system is operating. Therefore, the reliability of conventional system monitoring using a watchdog timer is not high. Was enough.

【0014】上記暴走を事前に防ぐ方法を考える。マイ
コンシステム暴走の一つの原因は、RAMなどの書き込
み可能領域に格納されているデータまたはCALL命令
などのスタックデータが何らかの理由により破壊され、
OSまたはアプリケーションプログラムがその破壊され
たデータにアクセスすることである。
A method for preventing the runaway in advance will be considered. One cause of microcomputer system runaway is that data stored in a writable area such as RAM or stack data such as a CALL instruction is destroyed for some reason.
The OS or the application program accesses the destroyed data.

【0015】現在の32bitクラスの高性能マイクロプ
ロセッサにおいては、RAMなどのデータ破壊を最低限
に抑制するため、CPU動作モード切り替えによるメモ
リ管理機能をCPUに持たせ、メモリをプロテクトする
機能がある。すなわち、CPUの動作をOSとアプリケ
ーションプログラムとに分け、それに対応して、OSの
ようなマイコンシステムの根幹に関わるデータ領域とア
プリケーションプログラムがアクセスするデータ領域と
を分け、アプリケーションプログラムが、OSのデータ
領域をアクセスできないようにする。その結果、誤動作
による不適切な領域へのデータ書き込みを禁止し、デー
タ破壊による暴走の発生を事前に防止する。
The current 32-bit class high-performance microprocessor has a function of protecting the memory by giving the CPU a memory management function by switching the CPU operation mode in order to minimize the destruction of data in the RAM and the like. That is, the operation of the CPU is divided into an OS and an application program, and correspondingly, a data area related to the foundation of the microcomputer system such as the OS and a data area accessed by the application program are divided, and the application program Make the area inaccessible. As a result, data writing to an inappropriate area due to a malfunction is prohibited, and runaway due to data destruction is prevented in advance.

【0016】このような場合、アプリケーションプログ
ラムがたとえ暴走しても、ウォッチドッグタイマなどの
割り込みにより、OSに制御を移すことが確実にできれ
ば、システムをリセットせずに、暴走から復帰すること
は可能である。
In such a case, even if the application program goes out of control, it is possible to return from the runaway without resetting the system if control of the OS can be reliably transferred by an interrupt such as a watchdog timer. It is.

【0017】また、MIPS R2000/R3000のような
マイクロプロセッサでは、OSのデータ領域をアプリケ
ーションプログラムがアクセスした場合、割り込みを発
生させることも可能である。
In a microprocessor such as the MIPS R2000 / R3000, an interrupt can be generated when an application program accesses the data area of the OS.

【0018】しかし、このような動作モード切り替え方
式のメモリ管理機能によりマイコンシステムの信頼性を
高める方法には、以下のような問題がある。メモリ管理
機能を実現するには、大きな論理を8bitまたは16bit
クラスのCPUに載せる必要があり、このクラスのCP
Uをそのアーキテクチャから変更しなければならず、こ
の動作モード切り替え方式は、既存の1チップマイコン
には適用できない。
However, there are the following problems in a method of improving the reliability of the microcomputer system by using the memory management function of the operation mode switching method. To implement the memory management function, large logic must be 8 bits or 16 bits.
It must be placed on the CPU of the class.
U must be changed from its architecture, and this operation mode switching method cannot be applied to existing one-chip microcomputers.

【0019】信頼性を高めたいマイコンシステムにメモ
リ管理機能を持たない1チップマイコンを使用していた
場合は、マイクロプロセッサを32bitクラス以上の高
性能マイクロプロセッサに変更する必要があるので、今
までのプログラムの大幅な変更やマイコンシステムの再
設計を必要とし、システムのコストアップを招き、開発
期間が長期化する。
When a one-chip microcomputer without a memory management function is used in a microcomputer system for which reliability is to be improved, it is necessary to change the microprocessor to a 32-bit class or higher-performance microprocessor. This requires a significant change in the program and redesign of the microcomputer system, resulting in an increase in system cost and a prolonged development period.

【0020】本発明の目的は、メモリ管理機能を持たな
い1チップマイコンを使用したマイコンシステムにおい
て、マイコンシステムのコストアップや開発期間の長期
化を招かずに、マイコンシステム暴走の一つの原因であ
る不必要なメモリ書き込み防ぎ、マイコンシステムの暴
走を未然に防止し信頼性を高める手段を備えた割り込み
制御回路およびこの割り込み制御回路を内蔵したマイク
ロコントローラを提供することである。
An object of the present invention is one of the causes of microcomputer system runaway in a microcomputer system using a one-chip microcomputer without a memory management function, without increasing the cost of the microcomputer system or lengthening the development period. An object of the present invention is to provide an interrupt control circuit having means for preventing unnecessary memory writing and preventing runaway of a microcomputer system and improving reliability, and a microcontroller incorporating the interrupt control circuit.

【0021】[0021]

【課題を解決するための手段】本発明は、上記目的を達
成するために、割り込み発生要因となるアドレスを指定
するアドレスレジスタと、割り込み発生要因となるアド
レスとCPUが指定したアドレスとの一致を検出する一
致検出手段と、メモリの書き込み/読み出し条件および
CPUへの割り込み条件を設定するコントロールレジス
タと、一致が検出されたときに、コントロールレジスタ
の内容に基づき、メモリへの書き込み/読み出し制御信
号を出力するとともに、CPUへの割り込み要求信号の
発生を制御する制御手段とを含む割り込み制御回路を提
案する。
SUMMARY OF THE INVENTION In order to achieve the above object, the present invention provides an address register for designating an address causing an interrupt and a match between the address causing the interrupt and the address designated by the CPU. A match detecting means for detecting, a control register for setting a memory write / read condition and an interrupt condition to the CPU, and a memory write / read control signal based on the contents of the control register when a match is detected. And an output control circuit for controlling generation of an interrupt request signal to the CPU.

【0022】前記割り込み制御回路は、アドレスレジス
タが指定したアドレスの一部をマスクするマスクレジス
タを備えてもよい。
The interrupt control circuit may include a mask register for masking a part of the address specified by the address register.

【0023】いずれの割り込み制御回路も、アドレスレ
ジスタと一致検出手段との組またはアドレスレジスタと
マスクレジスタと一致検出手段との組を複数備えること
ができる。
Each interrupt control circuit can include a plurality of sets of address registers and coincidence detecting means or a plurality of sets of address registers, mask registers and coincidence detecting means.

【0024】この場合は、前記制御手段は、指定した複
数の割り込み発生アドレスの一致順序に応じて割り込み
発生を許可する機能を備えることもできる。
In this case, the control means may have a function of permitting the occurrence of an interrupt in accordance with the order of coincidence of a plurality of designated interrupt occurrence addresses.

【0025】本発明は、また、上記目的を達成するため
に、外部の回路とデータをやりとりするI/Oポート
と、CPUと、プログラムを格納するROMと、計算結
果やデータを一時的に記録する書き込み/読み出し可能
なRAMと、カウンタ値のオーバーフローに応じてマイ
クロコントローラをリセットしまたはCPUに対する割
り込みを発生するウォッチドッグタイマとを有するマイ
クロコントローラにおいて、割り込み発生要因となるア
ドレスを指定するアドレスレジスタと、割り込み発生要
因となるアドレスとCPUが指定したアドレスとの一致
を検出する一致検出手段と、RAMの書き込み/読み出
し条件およびCPUへの割り込み条件を設定するコント
ロールレジスタと、一致が検出されたときに、コントロ
ールレジスタの内容に基づき、RAMへの書き込み/読
み出し制御信号を出力するとともに、CPUへの割り込
み要求信号の発生を制御する制御手段とを含むマイクロ
コントローラを提案する。
According to another aspect of the present invention, there is provided an I / O port for exchanging data with an external circuit, a CPU, a ROM for storing a program, and temporarily storing calculation results and data. A microcontroller having a writable / readable RAM and a watchdog timer for resetting the microcontroller or generating an interrupt to the CPU in response to an overflow of the counter value; A match detecting means for detecting a match between an address causing an interrupt and an address designated by the CPU; a control register for setting a RAM write / read condition and a CPU interrupt condition; , Control register contents Based outputs the write / read control signal to the RAM, and proposes a microcontroller and a control means for controlling the generation of an interrupt request signal to the CPU.

【0026】前記マイクロコントローラは、アドレスレ
ジスタが指定したアドレスの一部をマスクするマスクレ
ジスタを備えてもよい。
The microcontroller may include a mask register for masking a part of the address specified by the address register.

【0027】いずれのマイクロコントローラも、アドレ
スレジスタと一致検出手段との組またはアドレスレジス
タとマスクレジスタと一致検出手段との組を複数備える
ことができる。
Each microcontroller can include a plurality of sets of address registers and coincidence detecting means or a plurality of sets of address registers, mask registers and coincidence detecting means.

【0028】この場合は、前記制御手段は、指定した複
数の割り込み発生アドレスの一致順序に応じて割り込み
発生を許可する機能を備えることも可能である。
In this case, the control means may have a function of permitting the occurrence of an interrupt in accordance with the order of coincidence of a plurality of designated interrupt occurrence addresses.

【0029】本発明は、アドレス一致によって割り込み
を発生する割り込み制御回路において、割り込み発生要
因となるアドレスを指定するアドレスレジスタと、前記
割り込み発生要因となるアドレスとCPUが指定したア
ドレスとの一致を検出する一致検出手段と、メモリの書
き込み/読み出し条件および前記CPUへの割り込み条
件を設定するコントロールレジスタと、前記一致が検出
されたときに、前記コントロールレジスタの内容に基づ
き、前記メモリへの書き込み/読み出し制御信号を出力
するとともに、前記CPUへの割り込み要求信号の発生
を制御する制御手段とを含むので、アドレスが一致し割
り込みが発生したとき、その一致アドレスの書き込み/
読み出しの許可を制御し、暴走の一つの原因であるメモ
リヘの誤ったデータ書き込みを防ぎ、誤った書き込み試
行の直後に割り込み処理を発生させ、暴走を未然に防止
できる。
According to the present invention, in an interrupt control circuit for generating an interrupt upon an address match, an address register for specifying an address as a cause of an interrupt and detecting a match between the address as a cause of the interrupt and an address specified by a CPU. A match detection means, a control register for setting a memory write / read condition and an interrupt condition to the CPU, and a write / read to / from the memory based on the contents of the control register when the match is detected. Control means for outputting a control signal and controlling generation of an interrupt request signal to the CPU, so that when an address matches and an interrupt occurs, writing / writing of the matching address is performed.
By controlling read permission, erroneous data writing to the memory, which is one cause of runaway, can be prevented, and an interrupt process can be generated immediately after an erroneous write attempt, thereby preventing runaway.

【0030】また、複数のレジスタとアドレスとの一致
の順序に応じて割り込み発生を許可する制御手段を備え
たので、記憶装置へのアクセス順序に応じてより多様に
データを保譲し割り込みを制御するメモリ管理機能を実
現できる。
In addition, since control means for permitting an interrupt to be generated in accordance with the order of coincidence between a plurality of registers and an address is provided, data can be transferred more variously and interrupts can be controlled in accordance with the order of access to the storage device. A memory management function that performs

【0031】本発明の割り込み制御回路は、CPUの動
作モードによらず、常にアドレスを監視し、アドレスと
本発明により設置されたレジスタの内容との一致によっ
て、記憶装置のデータを保護し割り込みを制御する。
The interrupt control circuit of the present invention always monitors an address irrespective of the operation mode of the CPU, and protects data in a storage device and interrupts by matching an address with the contents of a register installed according to the present invention. Control.

【0032】CPUアーキテクチャの変更なしに、この
メモリ管理機能を実現できる。したがって、既存のCP
Uのコア部分を変更する必要がないので、OSなどの変
更が最小限で済み、コストアップと開発期間の増加とを
抑えつつ、マイコンシステムの信頼性を高めることが可
能になる。
This memory management function can be realized without changing the CPU architecture. Therefore, the existing CP
Since it is not necessary to change the core portion of the U, changes in the OS and the like can be minimized, and the reliability of the microcomputer system can be enhanced while suppressing an increase in cost and development period.

【0033】[0033]

【発明の実施の形態】BEST MODE FOR CARRYING OUT THE INVENTION

【0034】[0034]

【実施例1】図2は、本発明による割り込み制御回路を
内蔵した1チップマイコンの実施例1の構成を示すブロ
ック図である。図1の従来の1チップマイコンの構成と
比較すれば明らかなように、本実施例1は、図1の従来
の1チップマイコンに、割り込み制御回路69と論理和
回路72とを追加して、書き込み/読み出し制御信号iw
re28に応じて、割り込み制御回路69から、書き込み
/読み出し制御信号wre70と割り込み要求信号irq71
とを出力するようにした1チップマイコンである。
FIG. 2 is a block diagram showing a configuration of a first embodiment of a one-chip microcomputer incorporating an interrupt control circuit according to the present invention. As is apparent from comparison with the configuration of the conventional one-chip microcomputer of FIG. 1, the first embodiment adds an interrupt control circuit 69 and an OR circuit 72 to the conventional one-chip microcomputer of FIG. Write / read control signal iw
In response to re28, the interrupt control circuit 69 sends a write / read control signal wre70 and an interrupt request signal irq71.
And a one-chip microcomputer configured to output

【0035】CPU21は、プログラムに従い処理演算
を実行する。I/Oポートすなわち入出力ポート22
は、1チップマイコンの外部とデータをやりとりする。
ROM23は、プログラムを格納する読み出し専用メモ
リである。RAM24は、計算結果やデータを一時的に
記録する書き込み/読み出し可能なメモリである。ウォ
ッチドッグタイマ25は、カウンタ値のオーバーフロー
に応じて、1チップマイコンをリセットし、または、C
PU21に対する割り込みを発生する。アドレスバス2
6は、CPU21からRAM24,ROM23にアドレ
スを受け渡しする。データバス27は、CPU21,R
AM24,ROM23とデータを受け渡しする。CPU
21から出力される書き込み/読み出し制御信号iwre2
8は、RAM24,ROM23などのデータの書き込み
/読み出しを制御する。
The CPU 21 executes a processing operation according to a program. I / O port or input / output port 22
Exchanges data with the outside of the one-chip microcomputer.
The ROM 23 is a read-only memory for storing programs. The RAM 24 is a writable / readable memory for temporarily recording calculation results and data. The watchdog timer 25 resets the one-chip microcomputer according to the overflow of the counter value, or
An interrupt to the PU 21 is generated. Address bus 2
6 transfers an address from the CPU 21 to the RAM 24 and the ROM 23. The data bus 27 is connected to the CPU 21, R
The data is transferred to and from the AM 24 and the ROM 23. CPU
21 is a write / read control signal iwre2
Reference numeral 8 controls writing / reading of data in the RAM 24, the ROM 23, and the like.

【0036】図3は、本発明による割り込み制御回路の
一実施例の回路構成を示すブロック図である。アドレス
レジスタ1,2は、割り込みを発生させたいアドレスを
格納する。マスクレジスタ3,4は、一致アドレスビッ
トのマスクを指定する。比較器5,6は、アドレスバス
の値とアドレスレジスタ1,2の値とを比較し、一致し
たら、一致信号ch0,ch1を出力する。コントロールレ
ジスタ7は、メモリの書き込み/読み出し条件およびC
PU21への割り込み条件を設定する。
FIG. 3 is a block diagram showing a circuit configuration of an embodiment of the interrupt control circuit according to the present invention. The address registers 1 and 2 store an address at which an interrupt is to be generated. The mask registers 3 and 4 specify a mask of the matching address bits. The comparators 5 and 6 compare the value of the address bus with the values of the address registers 1 and 2 and output coincidence signals ch0 and ch1 when they match. The control register 7 stores the write / read conditions of the memory and C
An interrupt condition for the PU 21 is set.

【0037】制御回路8は、比較器5,6からの一致信
号ch0,ch1とCPU21からのRAM24の書き込み
/読み出しを制御する信号iwre28とを受け、コントロ
ールレジスタ7の値に応じて、書き込み/読み出しを制
御する信号wre70と割り込み発生を示すフラグ信号7
3とを出力する。
The control circuit 8 receives the coincidence signals ch0 and ch1 from the comparators 5 and 6, and the signal iwre 28 for controlling the writing / reading of the RAM 24 from the CPU 21, and writes / reads according to the value of the control register 7. Control signal wre70 and a flag signal 7 indicating the occurrence of an interrupt
3 is output.

【0038】フラグレジスタ9は、制御回路8から出力
された割り込み発生を示すフラグ信号73を保持する。
割り込み信号発生回路10は、フラグレジスタ9からの
割り込み発生を示すフラグ信号73に基づいて、割り込
み要求信号irq71を発生させる。
The flag register 9 holds a flag signal 73 output from the control circuit 8 and indicating the occurrence of an interrupt.
The interrupt signal generation circuit 10 generates an interrupt request signal irq71 based on a flag signal 73 from the flag register 9 indicating occurrence of an interrupt.

【0039】なお、アドレスレジスタ1,マスクレジス
タ3,比較器5の部分と、アドレスレジスタ2,マスク
レジスタ4,比較器6の部分とは、独立しており、この
例では、設定した二つのアドレスに対して割り込みを発
生できる。
The address register 1, the mask register 3, and the comparator 5 are independent from the address register 2, the mask register 4, and the comparator 6, and in this example, the two set addresses are set. Interrupt can be generated.

【0040】本明細書においては、アドレスレジスタ
1,マスクレジスタ3,比較器5の部分をチャンネル
0、アドレスレジスタ2,マスクレジスタ4,比較器6
の部分をチャンネル1と呼ぶ。チャンネルは、二つに限
らず、更に増設してもよい。
In this specification, the address register 1, the mask register 3, and the comparator 5 are referred to as channel 0, the address register 2, the mask register 4, the comparator 6
Is referred to as channel 1. The number of channels is not limited to two, and may be further increased.

【0041】図4(a)は、コントロールレジスタ7の構
成の一例を示す図である。書き込み/読み出しおよび割
り込みの条件を設定するコントロールレジスタ7は、C
PU21が書き込み/読み出し可能なレジスタである。
FIG. 4A is a diagram showing an example of the configuration of the control register 7. As shown in FIG. The control register 7 for setting the conditions for writing / reading and interrupts is
The PU 21 is a writable / readable register.

【0042】図4(a)のコントロールレジスタ7のbit
0は、チャンネル0アドレスレジスタ1に設定したアド
レスとCPU21がアドレスバス26でアクセスしたア
ドレスとが一致し、チャンネル0の一致信号ch0が出さ
れたときに、一致したアドレスヘのデータ書き込みの許
可/禁止を設定するbit(WE0)である。このbitが1のと
きには、書き込みを禁止する。
The bit of the control register 7 shown in FIG.
0 indicates that the address set in the channel 0 address register 1 and the address accessed by the CPU 21 on the address bus 26 match, and when the match signal ch0 of the channel 0 is output, the permission of writing data to the matched address is set. This bit (WE0) sets prohibition. When this bit is 1, writing is prohibited.

【0043】図4(a)のコントロールレジスタ7のbit
1は、チャンネル1アドレスレジスタ2に設定したアド
レスとCPU21がアドレスバス26でアクセスしたア
ドレスとが一致し、チャンネル1の一致信号ch1が出さ
れたときに、一致したアドレスヘのデータ書き込みの許
可/禁止を設定するbit(WE1)である。このbitが1のと
きには、書き込みを禁止する。
The bit of the control register 7 shown in FIG.
1 indicates that when the address set in the channel 1 address register 2 matches the address accessed by the CPU 21 on the address bus 26, and when the match signal ch1 of channel 1 is output, the permission of data writing to the matched address is obtained. This bit (WE1) sets prohibition. When this bit is 1, writing is prohibited.

【0044】図4(a)のbit2は、チャンネル0の一致
信号ch0によって、割り込み発生の許可/禁止を設定す
るbit(IE0)である。このbitが1のとき、チャンネル0
による割り込み発生を許可する。
Bit 2 in FIG. 4A is a bit (IE0) for setting permission / inhibition of interrupt generation by the coincidence signal ch0 of channel 0. When this bit is 1, channel 0
Enable interrupt generation by.

【0045】図4(a)のbit3は、チャンネル1の一致
信号ch1によって、割り込み発生の許可/禁止を設定す
るbit(IE1)である。このbitが1のとき、チャンネル1
による割り込み発生を許可する。
Bit 3 in FIG. 4A is a bit (IE1) for setting permission / inhibition of the occurrence of an interrupt by the coincidence signal ch1 of channel 1. When this bit is 1, channel 1
Enable interrupt generation by.

【0046】図4(b)は、フラグレジスタ9の構成の一
例を示す図である。図4(b)のbit0は、チャンネル0
アドレスレジスタ1に設定したアドレスとCPU21が
アドレスバス26でアクセスしたアドレスとが一致し、
チャンネル0の一致信号ch0が出力され、しかも、コン
トロールレジスタ7のbit2のIE0が1のとき、すなわ
ち、チャンネル0による割り込み発生が許可されたとき
に1にセットされるbit(f0)である。
FIG. 4B is a diagram showing an example of the configuration of the flag register 9. Bit 0 in FIG.
The address set in the address register 1 matches the address accessed by the CPU 21 on the address bus 26,
This bit (f0) is set to 1 when the coincidence signal ch0 of the channel 0 is output and IE0 of bit 2 of the control register 7 is 1, that is, when the interrupt generation by the channel 0 is permitted.

【0047】図4(b)のbit1は、チャンネル1アドレ
スレジスタ2に設定したアドレスとCPU21がアドレ
スバス26でアクセスしたアドレスとが一致し、チャン
ネル1の一致信号ch1が出力され、しかも、コントロー
ルレジスタ7のbit3のIE1が1のとき、すなわち、チャ
ンネル1による割り込み発生が許可されたときに1にセ
ットされるbit(f1)である。
In bit 1 of FIG. 4B, the address set in the channel 1 address register 2 matches the address accessed by the CPU 21 on the address bus 26, and a match signal ch1 of channel 1 is output. This bit (f1) is set to 1 when IE1 of bit 3 of bit 7 is 1, that is, when interrupt generation by channel 1 is permitted.

【0048】CPU21は、フラグレジスタ9の内容を
読み出し、フラグをクリアできる。フラグレジスタ9
は、一度セットされると、CPU21がクリアしない限
り、フラグをクリアされない。
The CPU 21 can read the contents of the flag register 9 and clear the flag. Flag register 9
Once set, the flag is not cleared unless the CPU 21 clears it.

【0049】割り込み発生回路10は、フラグレジスタ
9のbit0(f0)に1がセットされ、または、bit1(f1)に
1がセットされた場合、割り込み要求信号irq71を発
生させる。
When the bit 0 (f0) of the flag register 9 is set to 1 or the bit 1 (f1) is set to 1, the interrupt generation circuit 10 generates an interrupt request signal irq71.

【0050】図4(c)は、マスクレジスタ3,4の構成
の一例を示す図である。図4(c)のマスクレジスタ3,
4が設定されていると、アドレスの完全一致ではなく、
所定の領域同士のみを一致させることができる。すなわ
ち、マスクレジスタに4(hex)を入れると、アドレスbit
3〜0を比較対象から除外する。
FIG. 4C is a diagram showing an example of the configuration of the mask registers 3 and 4. The mask registers 3 and 3 shown in FIG.
If 4 is set, it is not an exact address match,
Only predetermined areas can be matched. That is, if 4 (hex) is input to the mask register, the address bit
3 to 0 are excluded from comparison.

【0051】例えば、チャンネル0アドレスレジスタ1
の設定値が5555(hex)でマスクレジスタ3の設定値が4
の場合に、アドレス5550〜555F(hex)までの間のアドレ
スについて、一致信号ch0を出力する。同様に、チャン
ネル1アドレスレジスタ2の設定値が7777(hex)でマス
クレジスタ4の設定値が5の場合に、アドレス7700〜77
FF(hex)までの間のアドレスについて、一致信号ch1を
出力する。
For example, channel 0 address register 1
Is set to 5555 (hex) and the set value of mask register 3 is set to 4
In this case, the match signal ch0 is output for addresses between addresses 5550 to 555F (hex). Similarly, when the set value of the channel 1 address register 2 is 7777 (hex) and the set value of the mask register 4 is 5, addresses 7700 to 77
A match signal ch1 is output for addresses up to FF (hex).

【0052】図5は、実施例1の制御回路8のverilog
−HDL(IEEE Std1364)記述の一例を示す図である。制御
回路8は、比較器5,6からの一致信号ch0,ch1とC
PU21からのRAM24の書き込み/読み出しを制御
する信号iwre28とを受け、コントロールレジスタ7の
値に応じて、書き込み/読み出しを制御する信号wre7
0と割り込み発生を示すフラグ信号73とを出力する。
フラグレジスタ9は、制御回路8から出力された割り込
み発生を示すフラグ信号73を保持する。なお、CPU
21からの書き込み/読み出し信号iwre28は、書き込
み時にiwre=1,読み出し時にiwre=0となる。
FIG. 5 shows the verilog of the control circuit 8 of the first embodiment.
FIG. 18 is a diagram illustrating an example of an HDL (IEEE Std1364) description. The control circuit 8 controls the coincidence signals ch0 and ch1 from the comparators 5 and 6 with C
A signal iwre28 for controlling writing / reading of the RAM 24 from the PU 21 is received, and a signal wre7 for controlling writing / reading according to the value of the control register 7 is received.
0 and a flag signal 73 indicating occurrence of an interrupt are output.
The flag register 9 holds a flag signal 73 output from the control circuit 8 and indicating the occurrence of an interrupt. In addition, CPU
The write / read signal iwre 28 from 21 is iwre = 1 at the time of writing and iwre = 0 at the time of reading.

【0053】まず、書き込み/読み出しの制御について
説明する。通常時、書き込み/読み出し制御信号wre7
0は、書き込み/読み出し信号iwre28と一致し、wre
=iwreである。
First, write / read control will be described. Normally, the write / read control signal wre7
0 matches the write / read signal iwre28, wre
= Iwre.

【0054】これに対して、WE0=1かつch0=1の場
合、すなわちコントロールレジスタ7の一致したアドレ
スヘのデータ書き込みの許可/禁止を設定するbit(WE0)
が書き込み禁止にセットされており、チャンネル0アド
レスレジスタ1に設定された値とCPU21がアクセス
したアドレスとが一致した場合、書き込み/読み出し制
御信号wre70は、強制的にwre=0になる。
On the other hand, when WE0 = 1 and ch0 = 1, that is, a bit (WE0) for setting permission / inhibition of data writing to the coincident address of the control register 7 is set.
Is set to write-protection, and when the value set in the channel 0 address register 1 matches the address accessed by the CPU 21, the write / read control signal wre70 is forcibly set to wre = 0.

【0055】また、WE1=1でch1=1の場合、すなわ
ちコントロールレジスタ7の一致したアドレスヘのデー
タ書き込みの許可/禁止を設定するbit(WE1)が書き込み
禁止にセットされており、チャンネル1アドレスレジス
タ2に設定された値とCPU21がアクセスしたアドレ
スとが一致した場合、書き込み/読み出し制御信号wre
70は、強制的にwre=0になる。
When WE1 = 1 and ch1 = 1, that is, the bit (WE1) for setting permission / inhibition of data writing to the coincident address of the control register 7 is set to write inhibition, and the channel 1 address is set. When the value set in the register 2 matches the address accessed by the CPU 21, the write / read control signal wre
70 is forcibly set to wre = 0.

【0056】次に、フラグレジスタ9の制御について説
明する。if0,if1は、フラグレジスタ9の入力信号名
である。IE0=1でch0=1の場合、すなわち、コント
ロールレジスタ7のIE0が割り込み発生にセットされて
おり、チャンネル0のアドレスレジスタ1に設定された
値とCPU21がアクセスしたアドレスとが一致した場
合、if0=1になる。この値がフラグレジスタ9に入力
され、f0=1となる。
Next, control of the flag register 9 will be described. if0 and if1 are input signal names of the flag register 9. If IE0 = 1 and ch0 = 1, that is, if IE0 of the control register 7 is set to generate an interrupt and the value set in the address register 1 of channel 0 matches the address accessed by the CPU 21, if0 = 1. This value is input to the flag register 9 and f0 = 1.

【0057】また、IE1=1でch1=1の場合、すなわ
ち、コントロールレジスタ7のWE1が書き込み禁止にセ
ットされており、チャンネル1アドレスレジスタ2に設
定された値とCPU21がアクセスしたアドレスとが一
致した場合、if1=1になる。この値がフラグレジスタ
9に入力され、f1=1となる。
If IE1 = 1 and ch1 = 1, that is, WE1 of the control register 7 is set to write-protection, and the value set in the channel 1 address register 2 matches the address accessed by the CPU 21. In this case, if1 = 1. This value is input to the flag register 9, and f1 = 1.

【0058】図6は、割り込み発生回路10のverilog
−HDL(IEEE Std1364)記述の一例を示す図である。of
0,of1は、フラグレジスタ9の出力信号名でf0=of
0,f1=of1ある。f0またはf1=1すなわちof0またはof1
=1のとき、割り込みを発生する論理である。
FIG. 6 shows the verilog of the interrupt generation circuit 10.
FIG. 18 is a diagram illustrating an example of an HDL (IEEE Std1364) description. of
0 and of1 are output signal names of the flag register 9 and f0 = of
0, f1 = of1. f0 or f1 = 1, ie, of0 or of1
When = 1, it is a logic for generating an interrupt.

【0059】図7は、マイコンシステムのプログラムの
一例を示す図である。図7(a)はメモリマップを示し、
図7(b)はその制御手順を示している。この場合は、O
SとApp1,App2とがあり、OSのスタックおよ
びデータ領域は、E800〜EFFF(hex)であり、App1お
よびApp2のスタックおよびデータ領域は、E000〜E7
FF(hex)であるとする。
FIG. 7 is a diagram showing an example of a program of the microcomputer system. FIG. 7A shows a memory map,
FIG. 7B shows the control procedure. In this case, O
S and App1 and App2, the stack and data area of the OS are E800 to EFFF (hex), and the stack and data area of App1 and App2 are E000 to E7.
Let it be FF (hex).

【0060】App1およびApp2は、OSの管理の
元で実行される。すなわちApp1およびApp2は、
OS→App1→OS,OS→App2→OSという流
れで実行され、実行が、App1からApp2へまたは
App2からApp1へ、直接移ることはない。
[0060] App1 and App2 are executed under the management of the OS. That is, App1 and App2 are
It is executed in the flow of OS → App1 → OS, OS → App2 → OS, and execution does not directly go from App1 to App2 or from App2 to App1.

【0061】OSにおいて、アドレスレジスタ1にE800
(hex)を代入し、マスクレジスタ2にアドレスのbit14
−bit0までをマスクするように、コントロールレジス
タ7を設定する。こうすると、チャンネル0は、E800〜
EFFF(hex)までの値に対して、チャンネル0の一致信号c
h0を出力する。ch0の一致に対して割り込みを有効に
するIE0をセットし、チャンネル0のアドレスに対し書
き込みを禁止するフラグWE0を1にセットする。設定
後、CPU21は、OSの実行からApp1またはAp
p2を実行する。
In the OS, E800 is stored in the address register 1.
(hex) and bit 14 of the address in the mask register 2.
The control register 7 is set so as to mask up to -bit0. In this way, channel 0 will be
For values up to EFFF (hex), the match signal c for channel 0
Outputs h0. IE0 for enabling an interrupt is set for a match of ch0, and a flag WE0 for inhibiting writing to an address of channel 0 is set to 1. After the setting, the CPU 21 executes App1 or App1 from execution of the OS.
Execute p2.

【0062】App1またはApp2のスタックおよび
データ領域は、E000〜E7FF(hex)であるから、App
1,App2実行中は、通常E000〜E7FF(hex)の範囲し
かアクセスされない。そのため、チャンネル0アドレス
レジスタ1の値とアドレスバスの値とは一致することが
なく、ch0はセットされず、そのためフラグレジスタ9
のf0が1にセットされないので、割り込みは発生せ
ず、CPU21は、App1,App2を実行後、速や
かにOSに処理を移動する。
Since the stack and data area of App1 or App2 are E000 to E7FF (hex),
During the execution of 1, App2, usually only the range of E000 to E7FF (hex) is accessed. Therefore, the value of the channel 0 address register 1 does not match the value of the address bus, and ch0 is not set.
Is not set to 1, no interrupt is generated, and the CPU 21 executes App1 and App2, and immediately moves the processing to the OS.

【0063】しかし、例えば、App1,App2が計
算を実行し、計算の結果を格納するためにE000〜E7FF(h
ex)の範囲をアクセスし、結果の値がプログラムの予想
を越えた桁数になり、E800に対し書き込みアクセスをし
た場合、チャンネル0アドレスレジスタ1の設定値にマ
ッチするから、ch0がセットされ、f0が1にセットさ
れるので、本発明の割り込み制御回路69は、割り込み
をCPU21に対して発生する。割り込み発生後、CP
U21は、OSのエラー処理を実行し、割り込み情報に
基づき、App1またはApp2がOSのスタック,デ
ータ領域をアクセスしたことを確実に感知し、アクセス
禁止エリアに対するアクセス異常の処理を実行できる。
このとき、書き込み禁止フラグWE0をセットしてあるの
で、CPU21がアドレスE800(hex)に対し書き込みア
クセス(iwre=1)をした場合でも、RAMの書き込み許
可信号wreは、図6に示した論理によって、wre=0であ
るから、App1またはApp2によるE800〜EFFF(he
x)領域へのデータ書き込みはなされず、OSのスタッ
ク,データ領域の値は変わらないので、CPU21は、
OSを正常に実行できる。
However, for example, App1 and App2 execute the calculation and store E000 to E7FF (h
When the range of (ex) is accessed and the result value has more digits than expected by the program and a write access is made to the E800, it matches the set value of the channel 0 address register 1, so ch0 is set, Since f0 is set to 1, the interrupt control circuit 69 of the present invention generates an interrupt to the CPU 21. After an interrupt occurs,
U21 executes error processing of the OS, reliably detects that App1 or App2 has accessed the stack or data area of the OS based on the interrupt information, and can execute processing of an abnormal access to the access prohibited area.
At this time, since the write prohibition flag WE0 is set, even when the CPU 21 makes a write access (iwre = 1) to the address E800 (hex), the write enable signal wre of the RAM is generated by the logic shown in FIG. , Wre = 0, E800 to EFFF (he by App1 or App2)
x) No data is written to the area, and the values of the stack and data area of the OS do not change.
OS can be executed normally.

【0064】CPU21は、OSを正常動作させ、割り
込みによる異常処理を実行できるので、マイコンシステ
ムの暴走を未然に防止できる。また、リセットを行う必
要もなく、マイコンシステムの信頼性を高めることがで
きる。
Since the CPU 21 can operate the OS normally and execute abnormal processing by interruption, runaway of the microcomputer system can be prevented. Further, there is no need to perform a reset, and the reliability of the microcomputer system can be improved.

【0065】なお、本発明では、チャンネル1なども、
チャンネル0と同様に動作できるから、チャンネル0と
チャンネル1などの動作条件を独立して設定可能であ
る。
In the present invention, channel 1 and the like are also
Since operation can be performed in the same manner as channel 0, operation conditions such as channel 0 and channel 1 can be set independently.

【0066】[0066]

【実施例2】図8(a)は、本発明による割り込み制御回
路を内蔵した1チップマイコンの実施例2のコントロー
ルレジスタ7の構成の一例を示す図である。実施例1と
実施例2とは、コントロールレジスタ7,制御回路8,
フラグレジスタ9,割り込み発生回路10の内部回路が
違うだけであるから、実施例2の1チップマイコンの全
体構成を示すブロック図は、上記図2になる。また、割
り込み制御回路の構成も、上記図3になる。
Second Embodiment FIG. 8A is a diagram showing an example of the configuration of a control register 7 of a second embodiment of a one-chip microcomputer incorporating an interrupt control circuit according to the present invention. The first and second embodiments are different from the control register 7, the control circuit 8,
Since only the internal circuits of the flag register 9 and the interrupt generation circuit 10 are different, the block diagram showing the entire configuration of the one-chip microcomputer of the second embodiment is shown in FIG. Also, the configuration of the interrupt control circuit is as shown in FIG.

【0067】図8(a)のbit0,bit1,bit4,bit5
は、実施例1と同様の構成であり、同様に動作する。
Bit 0, bit 1, bit 4, bit 5 in FIG.
Has the same configuration as the first embodiment, and operates in the same manner.

【0068】図8(a)のbit2は、CPU21が出した
アドレスが、チャンネル0のアドレスと一致し、かつ、
次の命令実行時に、チャンネル1のアドレスと一致した
場合、チャンネル1のアドレスヘのデータ書き込みの許
可/禁止を設定するbit(WE2)である。このbitが1のと
き、データ書き込みを禁止する。
Bit 2 in FIG. 8A indicates that the address issued by the CPU 21 matches the address of channel 0, and
This bit (WE2) sets permission / prohibition of writing data to the channel 1 address when the address matches the channel 1 address when the next instruction is executed. When this bit is 1, data writing is prohibited.

【0069】図8(a)のbit3は、CPU21が出した
アドレスが、チャンネル1のアドレスと一致し、かつ、
次の命令実行時に、チャンネル0のアドレスと一致した
場合、チャンネル0のアドレスヘのデータ書き込みの許
可/禁止を設定するbit(WE3)である。このbitが1のと
き、データの書き込みを禁止する。
Bit 3 in FIG. 8A indicates that the address issued by the CPU 21 matches the address of channel 1 and
This bit (WE3) sets permission / prohibition of writing data to the address of channel 0 when the address matches the address of channel 0 when the next instruction is executed. When this bit is 1, data writing is prohibited.

【0070】図8(a)のbit6は、チャンネル0のアド
レスと一致し、かつ、次の命令実行時に、チャンネル1
のアドレスと一致した場合、割り込み発生を許可/禁止
を設定するbit(IE2)である。このbitが1のとき、割り
込み発生を許可する。
Bit 6 in FIG. 8A matches the address of channel 0, and when the next instruction is executed, channel 1
This bit (IE2) sets permission / inhibition of interrupt generation when the address matches the address. When this bit is 1, interrupt generation is permitted.

【0071】図8(a)のbit7は、チャンネル1のアド
レスと一致し、かつ、次の命令実行時に、チャンネル0
のアドレスと一致した場合、割り込み発生を許可/禁止
を設定するbit(IE3)である。このbitが1のとき、割り
込み発生を許可する。
Bit 7 in FIG. 8 (a) matches the address of channel 1 and, when the next instruction is executed, channel 0
This bit (IE3) sets permission / inhibition of interrupt generation when the address matches the address. When this bit is 1, interrupt generation is permitted.

【0072】実施例2においても、割り込み条件を設定
するコントロールレジスタ7は、CPU21が書き込み
/読み出し可能なレジスタである。
Also in the second embodiment, the control register 7 for setting an interrupt condition is a register to which the CPU 21 can write / read.

【0073】図8(b)は、実施例におけるフラグレジス
タ9の構成の一例を示す図である。図8(b)のbit0,b
it1は本発明の実施例1と同じである。
FIG. 8B is a diagram showing an example of the configuration of the flag register 9 in the embodiment. Bit 0, b in FIG.
it1 is the same as in the first embodiment of the present invention.

【0074】図8(b)のbit2は、CPU21が出した
アドレスがチャンネル0のアドレスと一致し、かつ、そ
の次にチャンネル1のアドレスと一致した場合、しか
も、コントロール信号のIE2が1のときに、セットされ
るbit(f2)である。
Bit 2 in FIG. 8B indicates that the address issued by the CPU 21 matches the address of channel 0 and the address of channel 1 next, and that the control signal IE2 is 1. And bit (f2) to be set.

【0075】図8(b)のbit3は、CPU21が出した
アドレスがチャンネル1のアドレスと一致し、かつ、そ
の次にチャンネル0のアドレスと一致した場合、しか
も、コントロール信号のIE3が1のときに、セットされ
るbit(f3)である。
Bit 3 in FIG. 8B indicates that the address issued by the CPU 21 matches the address of channel 1 and the address of channel 0 next, and that the control signal IE3 is 1. Is the bit (f3) to be set.

【0076】実施例2でも、CPU21は、フラグレジ
スタ9の内容を読み出し、フラグをクリアできる。フラ
グレジスタ9は、一度セットされると、CPU21がク
リアしない限り、フラグをクリアされない。
Also in the second embodiment, the CPU 21 can read the contents of the flag register 9 and clear the flag. Once set, the flag register 9 is not cleared unless the CPU 21 clears it.

【0077】フラグレジスタのbitであるf0,f1,f
2,f3のどれかがセットされていた場合、割り込みが
発生する。
The bits f0, f1, and f of the flag register
If any of f2 and f3 is set, an interrupt occurs.

【0078】制御回路8は、コントロールレジスタ7の
設定に従い、書き込み/読み出し制御信号rwe70を出
力し、フラグレジスタ9を制御する。
The control circuit 8 outputs a write / read control signal rwe70 in accordance with the setting of the control register 7, and controls the flag register 9.

【0079】割り込み制御回路10は、フラグレジスタ
9の値に基づき、CPU21に対し割り込み要求信号ir
q71を発生する。
The interrupt control circuit 10 sends an interrupt request signal ir to the CPU 21 based on the value of the flag register 9.
Generates q71.

【0080】図9は、実施例2の制御回路8のverilog
−HDL(IEEE Std1364)記述の一例を示す図である。CP
U21からの書き込み/読み出し信号iwreは、書き込み
時にiwre=1、読み出し時にiwre=0とする。
FIG. 9 shows the verilog of the control circuit 8 of the second embodiment.
FIG. 18 is a diagram illustrating an example of an HDL (IEEE Std1364) description. CP
The write / read signal iwre from U21 is set to iwre = 1 at the time of writing and iwre = 0 at the time of reading.

【0081】最初に書き込み/読み出しの制御について
説明する。通常または、WE0=1かつch0=1の場合、W
E1=1かつch1=1の場合は実施例1と同じである。
First, write / read control will be described. Normal or if WE0 = 1 and ch0 = 1, W
The case of E1 = 1 and ch1 = 1 is the same as in the first embodiment.

【0082】WE2=1の場合、最初にチャンネル0アド
レスレジスタ1の設定値とCPU21のアドレス値とが
一致した場合、すなわちch0=1になったとき、ST0が
セットされる。次にチャンネル1アドレスレジスタ2の
設定値とCPU21のアドレス値とが一致しch1=1に
なったとき、すなわち、ST0=1かつch1=1のとき、s
f2=1になる。sf2=1かつWE2=1のとき、強制的にwr
e=0となる。
When WE2 = 1, ST0 is set when the set value of the channel 0 address register 1 first matches the address value of the CPU 21, that is, when ch0 = 1. Next, when the set value of the channel 1 address register 2 matches the address value of the CPU 21 and ch1 = 1, that is, when ST0 = 1 and ch1 = 1, s
f2 = 1. When sf2 = 1 and WE2 = 1, force wr
e = 0.

【0083】WE3=1の場合、最初にチャンネル1アド
レスレジスタ2の設定値とCPU21のアドレス値とが
一致した場合、すなわちch1=1になったとき、ST1が
セットされる。次にチャンネル0アドレスレジスタ1の
設定値とCPU21のアドレス値とが一致しch0=1に
なったとき、すなわち、ST1=1かつch0=1のとき、s
f3=1になる。sf3=1かつWE3=1のとき、強制的にwr
e=0となる。
In the case of WE3 = 1, ST1 is set when the set value of the channel 1 address register 2 and the address value of the CPU 21 first match, that is, when ch1 = 1. Next, when the set value of the channel 0 address register 1 matches the address value of the CPU 21 and ch0 = 1, that is, when ST1 = 1 and ch0 = 1, s
f3 = 1. When sf3 = 1 and WE3 = 1, force wr
e = 0.

【0084】次に、フラグ制御について説明する。if
0,if1,if2,if3は、レジスタ9の入力信号名である。
IE0=1とIE1=1の場合は、実施例1と同様に動作す
る。
Next, the flag control will be described. if
0, if1, if2, and if3 are input signal names of the register 9.
When IE0 = 1 and IE1 = 1, the operation is the same as in the first embodiment.

【0085】IE2=1の場合、最初にチャンネル0アド
レスレジスタ1の設定値とCPU21のアドレス値とが
一致した場合、すなわちch0=1になったとき、ST0が
セットされる。次にチャンネル1アドレスレジスタ2の
設定値とCPU21のアドレス値とが一致しch1=1に
なったとき、すなわち、ST0=1かつch1=1のとき、s
f2=1になる。IE2=1かつsf2=1のとき、if2=1に
なり、フラグレジスタ9のf2がセットされる。
When IE2 = 1, ST0 is set when the set value of the channel 0 address register 1 and the address value of the CPU 21 match at first, that is, when ch0 = 1. Next, when the set value of the channel 1 address register 2 matches the address value of the CPU 21 and ch1 = 1, that is, when ST0 = 1 and ch1 = 1, s
f2 = 1. When IE2 = 1 and sf2 = 1, if2 = 1 and f2 of the flag register 9 is set.

【0086】IE3=1の場合、最初にチャンネル1アド
レスレジスタ2の設定値とCPU21のアドレス値とが
一致した場合、すなわちch1=1になったとき、ST1が
セットされる。次にチャンネル0アドレスレジスタ1の
設定値とCPU21のアドレス値とが一致しch0=1に
なったとき、すなわち、ST1=1かつch0=1のとき、s
f3=1になる。IE3=1かつsf3=1のとき、if3=1に
なり、フラグレジスタ9のf3がセットされる。
In the case of IE3 = 1, ST1 is set when the set value of the channel 1 address register 2 and the address value of the CPU 21 first match, that is, when ch1 = 1. Next, when the set value of the channel 0 address register 1 matches the address value of the CPU 21 and ch0 = 1, that is, when ST1 = 1 and ch0 = 1, s
f3 = 1. When IE3 = 1 and sf3 = 1, if3 = 1, and f3 of the flag register 9 is set.

【0087】図10は、実施例2の割り込み発生回路1
0のverilog−HDL(IEEE Std1364)記述の一例を示す図で
ある。of0,of1,of2,of3は、フラグレジスタ9の出力
信号名であり、f0=of0,f1=of1,f2=of2,f3=of3で
ある。f0 or f1 or f2 or f3=1、すなわち、of0 or o
f1 or of2 or of3=1のとき、割り込みを発生する論理
である。
FIG. 10 shows an interrupt generation circuit 1 according to the second embodiment.
11 is a diagram illustrating an example of a verilog-HDL (IEEE Std1364) description of 0. FIG. of0, of1, of2, of3 are output signal names of the flag register 9, where f0 = of0, f1 = of1, f2 = of2, and f3 = of3. f0 or f1 or f2 or f3 = 1, that is, of0 or o
When f1 or of2 or of3 = 1, this is a logic for generating an interrupt.

【0088】図11は、マイコンシステムのプログラム
の一例を示す図である。図11(a)は、メモリマップを
示し、図11(b)は、制御手順を示している。task1と
task2とは、App1の内部タスクである。この場合、
プログラムは、OS→task1→task2→OSの順序で動
作を繰り返す。task1は、E000〜E3FF(hex)をアクセス
し、task2は、E400〜E7FF(hex)をアクセスする。E000
〜E3FF(hex)とE400〜E7FF(hex)とは、連続している。こ
こでは、App1実行中に、task1がE400〜E7FF(hex)
をアクセスした場合、次のtask2が正常に実行されず、
システムが暴走する可能性があるから、task1がE400〜
E7FF(hex)をアクセスすることを禁止したいと仮定す
る。
FIG. 11 is a diagram showing an example of a program of the microcomputer system. FIG. 11A shows a memory map, and FIG. 11B shows a control procedure. task1 and
task2 is an internal task of App1. in this case,
The program repeats the operation in the order of OS → task1 → task2 → OS. task1 accesses E000 to E3FF (hex), and task2 accesses E400 to E7FF (hex). E000
~ E3FF (hex) and E400 ~ E7FF (hex) are continuous. Here, while App1 is running, task1 is E400 to E7FF (hex)
If the following is accessed, the next task2 is not executed normally,
Task1 is E400 ~
Suppose you want to prohibit access to E7FF (hex).

【0089】図11のプログラムにおいて、実施例2に
より、暴走を未然に防ぐ方法を説明する。チャンネル0
アドレスレジスタ1にtask1のプログラムが格納されて
いるアドレスの先頭番地1000(hex)を設定し、チャンネ
ル0マスクレジスタ3に7を設定する。この設定によ
り、チャンネル0は、task1のプログラムエリア(1000
〜1FFF(hex))に対して、一致信号ch0を出力するように
なる。
A method of preventing runaway from occurring in the program of FIG. 11 according to the second embodiment will be described. Channel 0
The start address 1000 (hex) of the address where the program of task 1 is stored is set in the address register 1, and 7 is set in the channel 0 mask register 3. With this setting, channel 0 is assigned to the task 1 program area (1000
-1FFF (hex)), the match signal ch0 is output.

【0090】また、チャンネル1アドレスレジスタ2に
task1のアクセス禁止領域のアドレスの先頭番地E400(h
ex)を設定し、チャンネル1マスクレジスタ4に6を設
定する。これでチャンネル1はtask1のアクセス禁止領
域(E400〜E7FF(hex))に対して一致信号ch1をセットす
るようになる。
Also, the channel 1 address register 2
The start address E400 (h
ex) is set, and 6 is set in the channel 1 mask register 4. As a result, the channel 1 sets the coincidence signal ch1 for the access prohibited area (E400 to E7FF (hex)) of task1.

【0091】コントロールレジスタ7のWE2とIE2とをセ
ットする。これで、チャンネル1のアドレスとが一致し
た後、チャンネル1の設定値とCPU21のアドレスが
一致したとき割り込みを発生し、チャンネル1の設定値
に対して書き込みを禁止する。
Set WE2 and IE2 in the control register 7. As a result, after the address of the channel 1 matches, when the set value of the channel 1 matches the address of the CPU 21, an interrupt is generated, and writing to the set value of the channel 1 is prohibited.

【0092】初めに、通常動作について説明する。プロ
グラムが実行されプロセスがOS→task1に移ると、ch
0の設置値とが一致し、ch0が出力され、ST0が立つ。そ
の後、task1は、task1のスタック,データ領域である
E000〜E3FF(hex)をアクセスする。この場合は、ch1と
一致しないから、ST0のみが立ったまま、割り込みは発
生しない。
First, the normal operation will be described. When the program is executed and the process moves from OS to task1, ch
The set value of 0 matches, ch0 is output, and ST0 is set. After that, task1 is the stack and data area of task1.
Access E000 to E3FF (hex). In this case, since there is no match with ch1, no interrupt is generated with only ST0 standing.

【0093】次に、task1からtask2に制御が移ると、
ch0の設置値が一致せず、ST0はクリアされる。その
後、task2は、task2のスタック,データ領域であるE4
00〜E7FF(hex)をアクセスする。ch1が一致しST1が立つ
が、ST0はクリアされており、sf2が立たないので、IE2
に対する割り込みフラグf2はセットされず、割り込みは
発生しない。task2の処理後、OSに戻り、task1をま
た繰り返す。
Next, when the control is shifted from task 1 to task 2,
ST0 is cleared because the set values of ch0 do not match. After that, task2 is E4, which is the stack and data area of task2.
Access 00 to E7FF (hex). Since ch1 matches and ST1 stands, ST0 is cleared and sf2 does not stand, so IE2
Is not set, and no interrupt occurs. After the processing of task2, the process returns to the OS and repeats task1.

【0094】しかし、task1実行時(ST0=1のとき)、t
ask1のスタック,データ領域であるE000〜E3FF(hex)を
アクセス時、例えば扱うデータ量が予想以上に大きくな
り、task1が、本来のデータ領域E000〜E3FF(hex)に連
続しtask2のスタック,データ領域であるE400〜E7FF(h
ex)をアクセスした場合、ch1の値と一致し、ST0=1で
あるから、sf2がセットされ、sf2=1かつIE2=1であ
り、割り込みが発生する。このとき、書き込み禁止フラ
グWE3がセットされているので、sf2がセットされたとき
のメモリ領域E400〜E7FF(hex)に対してiwreが1になっ
ても、wreが0であるから、メモリ領域E400〜E7FF(hex)
は、書き換えられない。
However, when task 1 is executed (when ST0 = 1), t
When accessing the stack and data area of ask1 such as E000 to E3FF (hex), the amount of data to be handled becomes larger than expected, for example, task1 continues to the original data area of E000 to E3FF (hex), and the stack and data of task2 The area E400 to E7FF (h
When ex) is accessed, it matches the value of ch1 and ST0 = 1, so sf2 is set, sf2 = 1 and IE2 = 1, and an interrupt occurs. At this time, since the write prohibition flag WE3 is set, even if iwre becomes 1 with respect to the memory areas E400 to E7FF (hex) when sf2 is set, wre is 0, so that the memory area E400 ~ E7FF (hex)
Is not rewritten.

【0095】割り込み処理ルーチンにおいては、task1
でアクセスを禁止しているメモリエリアに書き込みを試
みたことを感知できるので、task1の処理で異常が発生
したことが分かり、エラー処理を実行できる。また、ta
sk2のスタック,データ領域であるE400〜E7FF(hex)は
壊れていないから、エラー処理後、task2から実行を再
開することも可能である。
In the interrupt processing routine, task1
It is possible to detect that an attempt has been made to write to the memory area for which access is prohibited in step 1, so that it is known that an error has occurred in the processing of task 1 and error processing can be executed. Also, ta
Since the stack and data area E400 to E7FF (hex) of sk2 are not broken, it is possible to resume execution from task2 after error processing.

【0096】本発明により、暴走を未然に防ぎ、エラー
処理後、エラーを起こしたtaskの次のtask(この場合tas
k2)から実行を再開できるので、異常発生からすぐにマ
イコンシステムを復帰させ、マイコンシステムの信頼性
を確保できる。
According to the present invention, runaway is prevented beforehand, and after the error processing, the task next to the task that caused the error (in this case, tas
Since the execution can be resumed from k2), the microcomputer system can be restored immediately after the occurrence of the abnormality, and the reliability of the microcomputer system can be secured.

【0097】[0097]

【発明の効果】本発明によれば、割り込み発生要因のア
ドレスを複数指定できるレジスタと、アドレスが一致し
割り込みが発生したとき、その一致アドレスの書き込み
/読み出しの許可を制御する制御手段とを備えたので、
暴走の一つの原因であるメモリヘの誤ったデータ書き込
みを防ぎ、誤った書き込み試行の直後に割り込み処理を
発生させ、暴走を未然に防止できる。
According to the present invention, there are provided a register capable of designating a plurality of addresses of an interrupt occurrence factor, and a control means for controlling permission of writing / reading of the matched address when the addresses match and an interrupt occurs. So
Erroneous data writing to the memory, which is one cause of runaway, can be prevented, and an interrupt process can be generated immediately after an erroneous write attempt to prevent runaway.

【0098】また、CPUの動作モードによらず、常に
アドレスを監視し、アドレスと本発明により設置された
レジスタの内容との一致によって、記憶装置のデータ保
護および割り込み発生を制御するから、CPUのアーキ
テクチャの変更なしに、メモリ管理機能を実現できる。
Further, the address is always monitored irrespective of the operation mode of the CPU, and the data protection of the storage device and the generation of an interrupt are controlled by matching the address with the contents of the register provided according to the present invention. The memory management function can be realized without changing the architecture.

【0099】したがって、わずかの論理を追加するだけ
で、既存CPUのコア部分を変更する必要がなく、1チ
ップマイコンの一部分として容易にエンベッドできるの
で、OSなどの変更は最小限で済み、コストアップと開
発期間の増加とを抑えつつ、マイコンシステムの信頼性
を高めることが可能になる。
Therefore, it is not necessary to change the core part of the existing CPU by adding a small amount of logic, and it can be easily embedded as a part of the one-chip microcomputer. In addition, it is possible to increase the reliability of the microcomputer system while suppressing an increase in the development period.

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

【図1】従来の1チップマイコンすなわち1チップマイ
クロコントローラの構成の一例を示すブロック図であ
る。
FIG. 1 is a block diagram showing an example of a configuration of a conventional one-chip microcomputer, that is, a one-chip microcontroller.

【図2】本発明による割り込み制御回路を内蔵した1チ
ップマイコンの実施例1の構成を示すブロック図であ
る。
FIG. 2 is a block diagram showing the configuration of a first embodiment of a one-chip microcomputer incorporating an interrupt control circuit according to the present invention.

【図3】本発明による割り込み制御回路の一実施例の回
路構成を示すブロック図である。
FIG. 3 is a block diagram illustrating a circuit configuration of an embodiment of an interrupt control circuit according to the present invention.

【図4】実施例1の割り込み制御回路におけるコントロ
ールレジスタ7,フラグレジスタ9,マスクレジスタ
3,4の構成の一例を示す図である。
FIG. 4 is a diagram illustrating an example of a configuration of a control register 7, a flag register 9, and mask registers 3 and 4 in the interrupt control circuit according to the first embodiment.

【図5】実施例1の制御回路8のverilog−HDL(IEEE S
td1364)記述の一例を示す図である。
FIG. 5 shows a verilog-HDL (IEEE S) of the control circuit 8 of the first embodiment.
[td1364] It is a figure showing an example of description.

【図6】実施例1の割り込み発生回路10のverilog−H
DL(IEEE Std1364)記述の一例を示す図である。
FIG. 6 shows verilog-H of the interrupt generation circuit 10 according to the first embodiment.
FIG. 4 is a diagram illustrating an example of a DL (IEEE Std1364) description.

【図7】実施例1を適用すべきプログラムのメモリマッ
プおよびその制御手順を示す図である。
FIG. 7 is a diagram showing a memory map of a program to which the first embodiment is applied and a control procedure thereof.

【図8】実施例2の割り込み制御回路におけるコントロ
ールレジスタ7,フラグレジスタ9の構成の一例を示す
図である。
FIG. 8 is a diagram illustrating an example of a configuration of a control register 7 and a flag register 9 in the interrupt control circuit according to the second embodiment.

【図9】実施例2の制御回路8のverilog−HDL(IEEE St
d1364)記述の一例を示す図である。
FIG. 9 shows a verilog-HDL (IEEE Std) of the control circuit 8 according to the second embodiment.
Fig. d1364) is a diagram illustrating an example of the description.

【図10】実施例2の割り込み発生回路10のverilog
−HDL(IEEE Std1364)記述の一例を示す図である。
FIG. 10 shows a verilog of the interrupt generation circuit 10 according to the second embodiment.
FIG. 18 is a diagram illustrating an example of an HDL (IEEE Std1364) description.

【図11】実施例2を適用すべきプログラムのメモリマ
ップおよびその制御手順を示す図である。
FIG. 11 is a diagram showing a memory map of a program to which the second embodiment is applied and a control procedure thereof.

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

1 チャンネル0アドレスレジスタ 2 チャンネル1アドレスレジスタ 3 チャンネル0マスクレジスタ 4 チャンネル1マスクレジスタ 5 チャンネル0比較器 6 チャンネル1比較器 7 コントロールレジスタ 8 制御回路 9 フラグレジスタ 10 割り込み発生回路 21 CPU 22 I/Oポート 23 ROM 24 RAM 25 ウォッチドッグタイマ 26 アドレスバス 27 データバス 28 書き込み/読み出し制御信号 69 割り込み制御回路 70 書き込み/読み出し制御信号 71 割り込み要求信号 72 論理和回路 73 割り込み発生フラグ信号 1 Channel 0 Address Register 2 Channel 1 Address Register 3 Channel 0 Mask Register 4 Channel 1 Mask Register 5 Channel 0 Comparator 6 Channel 1 Comparator 7 Control Register 8 Control Circuit 9 Flag Register 10 Interrupt Generation Circuit 21 CPU 22 I / O Port 23 ROM 24 RAM 25 Watchdog timer 26 Address bus 27 Data bus 28 Write / read control signal 69 Interrupt control circuit 70 Write / read control signal 71 Interrupt request signal 72 OR circuit 73 Interrupt flag signal

───────────────────────────────────────────────────── フロントページの続き (72)発明者 山下 武彦 茨城県日立市幸町三丁目1番1号 株式会 社日立製作所日立工場内 Fターム(参考) 5B017 AA02 BA01 BB03 CA01 CA13 5B042 GA13 GB08 JJ06 JJ13 JJ41 KK01 KK04 5B062 AA08 AA10 DD10 JJ03  ────────────────────────────────────────────────── ─── Continuing from the front page (72) Inventor Takehiko Yamashita 3-1-1 Kochi-cho, Hitachi-shi, Ibaraki F-term in Hitachi Plant, Hitachi, Ltd. (Reference) 5B017 AA02 BA01 BB03 CA01 CA13 5B042 GA13 GB08 JJ06 JJ13 JJ41 KK01 KK04 5B062 AA08 AA10 DD10 JJ03

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 割り込み発生要因となるアドレスを指定
するアドレスレジスタと、 前記割り込み発生要因となるアドレスとCPUが指定し
たアドレスとの一致を検出する一致検出手段と、 メモリの書き込み/読み出し条件および前記CPUへの
割り込み条件を設定するコントロールレジスタと、 前記一致が検出されたときに、前記コントロールレジス
タの内容に基づき、前記メモリへの書き込み/読み出し
制御信号を出力するとともに、前記CPUへの割り込み
要求信号の発生を制御する制御手段とを含むことを特徴
とする割り込み制御回路。
An address register that specifies an address that causes an interrupt; a match detection unit that detects a match between the address that causes the interrupt and an address specified by a CPU; A control register for setting an interrupt condition to the CPU; and when the match is detected, outputting a write / read control signal to / from the memory based on the contents of the control register, and an interrupt request signal to the CPU. Control means for controlling the occurrence of the interrupt.
【請求項2】 請求項1に記載の割り込み制御回路にお
いて、 前記アドレスレジスタが指定したアドレスの一部をマス
クするマスクレジスタを備えたことを特徴とする割り込
み制御回路。
2. The interrupt control circuit according to claim 1, further comprising a mask register for masking a part of an address specified by said address register.
【請求項3】 請求項1または2に記載の割り込み制御
回路において、 前記アドレスレジスタと前記一致検出手段との組または
前記アドレスレジスタと前記マスクレジスタと前記一致
検出手段との組を複数備えたことを特徴とする割り込み
制御回路。
3. The interrupt control circuit according to claim 1, wherein a plurality of pairs of the address register and the coincidence detecting unit or a plurality of pairs of the address register, the mask register and the coincidence detecting unit are provided. An interrupt control circuit characterized in that:
【請求項4】 請求項3に記載の割り込み制御回路にお
いて、 前記制御手段が、指定した複数の割り込み発生アドレス
の一致順序に応じて割り込み発生を許可する制御手段で
あることを特徴とする割り込み制御回路。
4. The interrupt control circuit according to claim 3, wherein said control means is a control means for permitting the occurrence of an interrupt in accordance with the order of coincidence of a plurality of designated interrupt occurrence addresses. circuit.
【請求項5】 外部の回路とデータをやりとりするI/
Oポートと、CPUと、プログラムを格納するROM
と、計算結果やデータを一時的に記録する書き込み/読
み出し可能なRAMと、カウンタ値のオーバーフローに
応じてマイクロコントローラをリセットしまたは前記C
PUに対する割り込みを発生するウォッチドッグタイマ
とを有するマイクロコントローラにおいて、 割り込み発生要因となるアドレスを指定するアドレスレ
ジスタと、 前記割り込み発生要因となるアドレスと前記CPUが指
定したアドレスとの一致を検出する一致検出手段と、 前記RAMの書き込み/読み出し条件および前記CPU
への割り込み条件を設定するコントロールレジスタと、 前記一致が検出されたときに、前記コントロールレジス
タの内容に基づき、前記RAMへの書き込み/読み出し
制御信号を出力するとともに、前記CPUへの割り込み
要求信号の発生を制御する制御手段とを含むことを特徴
とするマイクロコントローラ。
5. An I / O for exchanging data with an external circuit.
O port, CPU, and ROM for storing programs
And a writable / readable RAM for temporarily recording the calculation results and data, and resetting the microcontroller in response to an overflow of the counter value, or
In a microcontroller having a watchdog timer that generates an interrupt to a PU, an address register that specifies an address that causes an interrupt, and a match that detects a match between the address that causes the interrupt and the address specified by the CPU Detecting means, write / read conditions of the RAM, and the CPU
A control register for setting an interrupt condition to the CPU; and, when the match is detected, outputting a write / read control signal to / from the RAM based on the contents of the control register, and outputting an interrupt request signal to the CPU. Control means for controlling generation.
【請求項6】 請求項5に記載のマイクロコントローラ
において、 前記アドレスレジスタが指定したアドレスの一部をマス
クするマスクレジスタを備えたことを特徴とするマイク
ロコントローラ。
6. The microcontroller according to claim 5, further comprising a mask register for masking a part of an address specified by the address register.
【請求項7】 請求項5または6に記載のマイクロコン
トローラにおいて、 前記アドレスレジスタと前記一致検出手段との組または
前記アドレスレジスタと前記マスクレジスタと前記一致
検出手段との組を複数備えたことを特徴とするマイクロ
コントローラ。
7. The microcontroller according to claim 5, wherein a plurality of sets of the address register and the match detecting means or a plurality of sets of the address register, the mask register and the match detecting means are provided. Characterized microcontroller.
【請求項8】 請求項7に記載のマイクロコントローラ
において、 前記制御手段が、指定した複数の割り込み発生アドレス
の一致順序に応じて割り込み発生を許可する制御手段で
あることを特徴とするマイクロコントローラ。
8. The microcontroller according to claim 7, wherein the control means is a control means for permitting the occurrence of an interrupt in accordance with the order of coincidence of a plurality of designated interrupt occurrence addresses.
JP11212036A 1999-07-27 1999-07-27 Interruption control circuit and microcontroller Pending JP2001043111A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11212036A JP2001043111A (en) 1999-07-27 1999-07-27 Interruption control circuit and microcontroller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11212036A JP2001043111A (en) 1999-07-27 1999-07-27 Interruption control circuit and microcontroller

Publications (1)

Publication Number Publication Date
JP2001043111A true JP2001043111A (en) 2001-02-16

Family

ID=16615817

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11212036A Pending JP2001043111A (en) 1999-07-27 1999-07-27 Interruption control circuit and microcontroller

Country Status (1)

Country Link
JP (1) JP2001043111A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7987329B2 (en) 2004-10-28 2011-07-26 Hitachi, Ltd. Storage system and method of controlling the same

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7987329B2 (en) 2004-10-28 2011-07-26 Hitachi, Ltd. Storage system and method of controlling the same

Similar Documents

Publication Publication Date Title
US7917753B2 (en) Transferring control between programs of different security levels
US6253320B1 (en) Operating system rebooting method
JP3676882B2 (en) Microprocessor and its peripheral devices
US20080046697A1 (en) Data processor
US6775734B2 (en) Memory access using system management interrupt and associated computer system
JP2004086451A (en) Semiconductor integrated circuit
JP3202497B2 (en) Information processing device
JP3723243B2 (en) Processor device and control method thereof
JP2001043111A (en) Interruption control circuit and microcontroller
JPH07311686A (en) Computer system and method for generation and processing of system management interrupt in it
JP3506920B2 (en) Method for preventing contention of storage of all instruction trace data in secondary storage device
JP4647276B2 (en) Semiconductor circuit device
JP2001188687A (en) Microcomputer
JP2723847B2 (en) Microprocessor
JP4114004B2 (en) Semiconductor integrated circuit
US7765383B2 (en) Data processing unit and data processing apparatus using data processing unit
JP2504191B2 (en) Microprocessor
JP3209144B2 (en) Microprocessor
JPH01180656A (en) Memory protecting device
JPH01201751A (en) Memory protecting device
JP2870405B2 (en) Information processing device
JP3110222B2 (en) Microcomputer
JP3047839B2 (en) Single-chip microcomputer
JPS6118045A (en) Detecting system of program runaway
WO1990005951A1 (en) Method of handling unintended software interrupt exceptions