JP3737144B2 - Interrupt request circuit and interrupt request processing method - Google Patents

Interrupt request circuit and interrupt request processing method Download PDF

Info

Publication number
JP3737144B2
JP3737144B2 JP23129794A JP23129794A JP3737144B2 JP 3737144 B2 JP3737144 B2 JP 3737144B2 JP 23129794 A JP23129794 A JP 23129794A JP 23129794 A JP23129794 A JP 23129794A JP 3737144 B2 JP3737144 B2 JP 3737144B2
Authority
JP
Japan
Prior art keywords
data
interrupt request
circuit
flip
output
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.)
Expired - Fee Related
Application number
JP23129794A
Other languages
Japanese (ja)
Other versions
JPH0895801A (en
Inventor
浩二 鈴木
充也 大家
仁 小西
浩二 山岡
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.)
Honda Motor Co Ltd
Oki Electric Industry Co Ltd
Original Assignee
Honda Motor Co Ltd
Oki Electric Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honda Motor Co Ltd, Oki Electric Industry Co Ltd filed Critical Honda Motor Co Ltd
Priority to JP23129794A priority Critical patent/JP3737144B2/en
Publication of JPH0895801A publication Critical patent/JPH0895801A/en
Application granted granted Critical
Publication of JP3737144B2 publication Critical patent/JP3737144B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【産業上の利用分野】
本発明は、マイコン等に使用される割り込み要求回路およびこの割り込み要求回路が示す割り込み要求の処理方法に関するものである。
【0002】
【従来の技術】
マイコン等に使用される割り込み要求回路は、所定の機能を有する周辺回路(たとえばカウンタ、A/D変換回路等)からの割り込み要求信号を受信し、受信したこの割り込み要求信号に対応する割り込み要求出力信号を中央演算処理装置(以下CPUとする。)に出力するものである。この割り込み要求回路は、対応する周辺回路から出力された割り込み要求信号に応答してセットされる複数のフリップフロップを有する。CPUは、フリップフロップの状態がリセット状態からセット状態に変化した時、セット状態に変化したこのフリップフロップの出力を割り込み要求出力信号として受信する。そしてCPUは、セット状態に変化したこのフリップフロップに対応する周辺回路に関する割り込み処理を行う。その後CPUは、セット状態にあるフリップフロップをリセット状態に戻すクリア動作を行う。このクリア動作により、割り込み要求回路は、割り込み処理が終了したことを示す。従ってCPUは、この割り込み要求回路の状態を検出することにより、周辺回路に割り込み要求が存在するかどうかを判断できる。そしてもし割り込み要求が存在する場合は、CPUは対応する割り込み処理を実行した後、上述のクリア動作を行う。
【0003】
【発明が解決しようとする課題】
しかしながら、割り込み要求はCPUの動作とは非同期にしかも複数発生する可能性がある。従って、CPUが最初の割り込み要求に対する処理を実行している間に、次の割り込み要求が発生した場合、最初の割り込み要求に対するクリア動作により次の割り込み要求も同時にクリアされてしまう可能性がある。すなわち、上述の割り込み要求回路では、CPUに対する割り込み要求が無視されてしまう可能性がある。
【0004】
【課題を解決するための手段】
本発明の割り込み要求回路は、上述の問題点を解決するために、割り込み要求信号に応答して割り込み要求が発生していることを示す第1のデータを保持するデータ保持回路と、第2及び第3のデータが与えられるバスラインと、このバスラインとデータ保持回路との間に接続され、第1のデータと第2のデータとに応答してデータ保持回路が保持する第1のデータを維持するデータを出力し、第1のデータと第3のデータとに応答してデータ保持回路が保持する第1のデータをクリアするデータを出力する論理回路とを設けたものである。
【0005】
また本発明の割り込み要求の処理方法は、所定のデータ保持回路に割り込み要求信号を与えこのデータ保持回路に第1のデータを記憶させるステップと、この第1のデータを記憶したデータ保持回路に第2のデータを与えると同時にこのデータ保持回路を除く全てのデータ保持回路に第1のデータを与えるステップとを施したものである。
【0006】
【作用】
本発明によれば、割り込み要求があることを示すデータを記憶しているデータ保持回路のうち、割り込み要求が受け付けられたデータ保持回路にのみ第1のデータを与え、その他のデータ保持回路に第2のデータを与えることにより、結果として割り込み要求が受け付けられていないデータ保持回路のデータはクリアされずに維持される。
【0007】
【実施例】
図1は、本発明の割り込み要求回路の一実施例を示す図である。
【0008】
以下、本発明の割り込み要求回路の一実施例の構成を説明する。
【0009】
本発明の割り込み要求回路は、割り込み要求入力端子137,139,141,143及び145の各々に対応したフリップフロップ101,103,105,107及び109と、アンドゲート111,113,115,117及び119とを有している。
【0010】
割り込み要求入力端子137〜145は、割り込みの要因を有する回路からの割り込み要求信号を受信する端子である。例えば、割り込み要求入力端子137は、アナログディジタル変換回路(以下、A/D変換回路とする。)に接続されており、A/D変換回路からの割り込み要求信号を受信する。割り込み要求入力端子139は、入出力回路(以下、I/O回路とする。)に接続されており、I/O回路からの割り込み要求信号を受信する。このように、各割り込み要求入力端子は、各割り込み要求入力端子に対応した専用の回路からの割り込み要求信号を受信する。
【0011】
データ入力端子147,149,151及び153は、フリップフロップ101,103,105,107及び109の各々に対応している。また、これらデータ入力端子147〜153は、データ出力端子157,159,161,163及び165の各々に対応している。そして、これらデータ入力端子147〜153は、対応したデータ出力端子157〜165とともに双方向データ線に接続されている。例えば、データ入力端子147は、データ出力端子157とともに図示しない1本目の双方向データ線に接続されている。データ入力端子149は、データ出力端子159とともに図示しない2本目の双方向データ線に接続されている。本実施例では、データバスが8本のデータ線で構成されているものとして説明する。従って、本実施例では、フリップフロップが8個、データ入力端子及びデータ出力端子が各々8個として説明する。また、フリップフロップに対応する各構成、例えばアンドゲート111〜119も8個として説明する。(説明を容易にするため、図面においては、フリップフロップ及びこのフリップフロップに対応する各構成は、5個のみを図示する。)
フリップフロップ101は、割り込み要求入力端子137に接続されたセット端子と、アンドゲート111の出力端子に接続されたデータ入力端子Dと、アンドゲート111の一方の入力端子に接続されたデータ出力端子Qと、リセット端子167に接続されたリセット端子Rと、アンドゲート121の出力端子に接続されたゲート端子Gとを有する。フリップフロップ101のデータ出力端子Qは、さらにゲート回路125及び割り込み要求信号出力回路135に接続されている。その他のフリップフロップ103〜109の各々も、フリップフロップ101と同様に、対応した割り込み要求入力端子139〜145、アンドゲート113〜119、リセット端子167、アンドゲート121、ゲート回路127〜133及び割り込み要求信号出力回路135に接続されている。これらのフリップフロップは、データ入力端子Dに与えられたデータを保持する機能を有する。従って、これらフリップフロップは8ビットのレジスタもしくはラッチ回路として機能する。(以下、これら8個のフリップフロップを1単位で考えるときは、8個のフリップフロップを割り込み要求レジスタと称す。)
ゲート回路125〜133は、対応した各フリップフロップのデータ出力端子Qに接続された入力端子と、対応した各割り込み要求出力端子157〜165に接続された出力端子と、アンドゲート123の出力端子に接続された制御端子とを有する。
【0012】
アンドゲート121は、アドレスデコーダから出力された書き込みアドレス信号と中央演算装置(以下、CPUとする。)から出力された書き込み許可信号WRを入力し、各フリップフロップに書き込み信号を出力する。
【0013】
アンドゲート123は、アドレスデコーダから出力された読み出しアドレス信号とCPUから出力された読み出し許可信号RDを入力し、各ゲート回路125〜133に読み出し信号を出力する。
【0014】
割り込み要求信号出力回路135は、各フリップフロップのデータ出力端子Qに現れるデータの変化を検出して、割り込み要求出力信号をCPUに出力する。
【0015】
以上説明した図1に示す回路は、図2に示すシステムの一部である。
【0016】
以下、本発明の割り込み要求回路の図2に示すシステムにおける位置付け及びシステムの構成について説明する。
【0017】
図1に示した本発明の割り込み要求回路は、図2において符号201または203を付与した部分である。なお、図1と同一の構成には、図1で付与した符号と同一の符号を付与している。
【0018】
割り込み要求回路201は、8ビットの双方向データバス221を介して8ビットのデータバス217に接続されている。この双方向データバス221を構成している8本のデータ線は、図1におけるデータ入力端子147〜155に各々接続されている。さらにこの8本のデータ線は、データ出力端子157〜165にも各々接続されている。
【0019】
A/D変換回路209は、内部に割り込み要因が発生したとき割り込み要求信号を割り込み要求回路201に出力する。A/D変換回路209から出力されたこの割り込み要求信号は、図1における割り込み要求入力端子137に与えられる。
【0020】
I/O回路211は、内部に割り込み要因が発生したとき割り込み要求信号を割り込み要求回路201に出力する。I/O回路211から出力されたこの割り込み要求信号は、図1における割り込み要求入力端子139に与えられる。
【0021】
I/O回路213は、内部に割り込み要因が発生したとき割り込み要求信号を割り込み要求回路201に出力する。I/O回路213から出力されたこの割り込み要求信号は、図1における割り込み要求入力端子141に与えられる。
【0022】
ランダムアクセスメモリ回路215(以下、RAMとする。)は、内部に割り込み要因が発生したとき割り込み要求信号を割り込み要求回路203に出力する。この割り込み要求回路203は、割り込み要求回路201と同様の構成である。従って、RAM215から出力された割り込み要求信号は、図示しない割り込み要求回路203中の割り込み要求入力端子のうちの1つに与えられる。
【0023】
CPU205は、書き込み許可信号WR及び読み出し許可信号RDを出力する。またCPU205は、割り込み要求回路201および203のいずれかを選択するためのアドレス信号をアドレスバス219に出力する。さらにCPU205は、割り込み要求回路201及び203から出力された割り込み要求出力信号を、割り込み要求出力線224を介して受信する。さらにCPU205は、割り込み要求回路201及び203が示す割り込み要求をクリアするためのデータを生成し、このデータをデータバス217を介して割り込み要求回路201及び203へ与える。
【0024】
アドレスデコーダ207は、CPU205が出力したアドレス信号をデコードして、割り込み要求回路201を選択する選択信号をアンドゲート123と121へ、もしくは割り込み要求回路203を選択する選択信号をアンドゲート223と225へ出力する。
【0025】
アンドゲート123は、CPU205から出力された読み出し許可信号RDと、アドレスデコーダ207から出力された割り込み要求回路201を選択するための選択信号とを入力し、割り込み要求回路201へ読み出し信号を出力する。
【0026】
アンドゲート121は、書き込み許可信号WRと、アドレスデコーダ207から出力された割り込み要求回路201を選択するための選択信号とを入力し、割り込み要求回路201へ書き込み信号を出力する。
【0027】
割り込み要求回路203への書き込み及び読み出し信号の出力は、アンドゲート223及び225を介して行われる。割り込み要求回路203への書き込み及び読み出し信号の出力の動作は、割り込み要求回路201に関する動作と同様である。
【0028】
次に、図1及び図2に示す本発明の割り込み要求回路の動作を図3のタイムチャートを用いて説明する。図3のタイムチャートは、紙面の左から右に向かって時間が経過しているものである。図3の上部には割り込み要求レジスタ(前述した8個のフリップフロップ)が保持しているデータの内容を示す図が配置され、下部にはCPU内のレジスタが保持している内容を示す図が配置されている。
【0029】
(割り込み要因A発生)
まず各フリップフロップで構成された割り込み要求レジスタが、リセット端子167に与えられたリセット信号によって初期設定されているとする。すなわち、各フリップフロップは、各データ出力端子Qからデータ0を出力する。(データ0は例えば0Vであり、データ1は例えば5Vである。)
次にA/D変換回路209が例えば外部から与えられたアナログデータをディジタルデータに変換するという割り込み要因Aを発生する。この割り込み要因Aは、割り込み要求信号として割り込み要求回路201内の割り込み要求入力端子137に与えられる。割り込み要求入力端子137に与えられた割り込み要求信号は、フリップフロップ101のセット端子Sに与えられるので、フリップフロップ101のデータ出力端子Qから出力されるデータは0から1に変化する。今その他の周辺回路には、割り込み要因が存在していないので、フリップフロップ103〜109はセットされない。従って、フリップフロップ103〜109のデータ出力端子Qから出力されるデータは0である。図3の上部に示すように、割り込み要求レジスタの内容は、結果として(10000000)となる。
【0030】
(割り込み要求出力信号発生)
フリップフロップ101のデータ出力端子Qが0から1に変化すると、割り込み要求信号出力回路135はこの変化を検出し、CPU205へ割り込み要求出力信号を出力する。CPU205は、この割り込み要求出力信号を受信することによって、何れかの回路に割り込み要因が発生したことを認識する。次にCPU205は、割り込み要因が発生している回路を特定し、その割り込み要因を受け付けるべきか、受け付けるとしたらいつ受け付けるのか等を判断する。
【0031】
(割り込み要求レジスタのデータ読み出し)
まずCPU205は、割り込み要求回路201内の割り込み要求レジスタの内容を読み出すために、読み出し許可信号RDを出力するとともに、割り込み要求回路201を選択するアドレス信号をアドレスバス219へ出力する。アドレスデコーダ207は、CPUから出力されたアドレス信号をデコードし割り込み要求回路201を選択する選択信号を出力する。アンドゲート123は、この選択信号と読み出し許可信号RDに応答して読み出し信号を出力する。一方アンドゲート121は書き込み許可信号WRが出力されていないので、書き込み信号を出力しない。また、CPU205は割り込み要求回路203を選択していないので、アンドゲート223及び225はディスエーブル状態である。
【0032】
ゲート回路125〜133は、アンドゲート123から出力された読み出し信号に応答してオン状態になり、各フリップフロップ101〜109のデータ出力端子Qと、各フリップフロップ101〜109の各々に対応するデータ出力端子157〜165との間を電気的に導通させる。フリップフロップ101のデータ出力端子Qはデータ1を出力しているのでデータ出力端子157にデータ1が与えられ、その他のフリップフロップ103〜109のデータ出力端子Qはデータ0を出力しているのでデータ出力端子159〜165にはデータ0が与えられる。データ出力端子157〜165に与えられた各データは、双方向データバス221を介してデータバス217に与えられる。そしてCPU205は、データバス217に与えられたこの8ビットのデータをCPU205内のレジスタに読み込む。今データバス217は、(10000000)になっているので、CPU205は割り込み要求回路201内の割り込み要求レジスタの内容が(10000000)であることを認識する。すなわちCPU205は、割り込み要因Aが、A/D変換回路209で発生したことを認識する。
【0033】
CPU205は、この割り込み要因Aが、CPU205が現在実行しているメインの処理に優先するかどうか判断する。もしこの割り込み要因Aが、現在実行している処理よりも優先度が高いものであれば、CPU205は直ちにあるいは、現在の処理を終了させた後直ちにアナログデータをディジタルデータに変換する処理フローに入る。すなわちCPU205は、メインの処理フロー中にA/D変換処理を割り込ませる。ここで、割り込み処理を実行するタイミングは、プログラムによって異なるため、割り込みの要求があった後の他の処理を行った後でも良い。ここでは、CPU205は、現在の処理を終了させた後直ちにA/D変換処理を行うフローに入る。A/D変換回路209は、CPU205が制御するA/D変換フローにしたがって、図示しない周辺回路から与えられたアナログデータをディジタルデータに変換する。変換されたディジタルデータは、CPU205の命令によって、データバス217を介して例えばRAM215へ転送される。
【0034】
(割り込み要求レジスタのクリア(割り込み要因Bが発生していない場合))
CPU205は、割り込み処理を終了させた後、割り込み要因Aに対応するフリップフロップ101の出力をクリアする動作を開始する。まず、CPU205は(01111111)というデータを生成し、CPU内の8ビットのレジスタにデータ(01111111)を書き込む。すなわちCPU205は、割り込み要因Aに対応するビットのみがデータ0、その他のビットがデータ1であるようなクリアデータを作成し、そのクリアデータをCPU205内のレジスタに記憶させる。続いてCPU205は、このクリアデータをデータバス217へ出力する。データバス217に与えられたクリアデータは、双方向データバス221を介して割り込み要求回路201のデータ入力端子147〜155に与えられる。今、フリップフロップ101はデータ1を、フリップフロップ103〜109はデータ0を出力しているので、アンドゲート111のみが開いている。従って、データ入力端子147に与えられたデータ0は、アンドゲート111を通過してフリップフロップ101のデータ入力端子Dに与えられる。アンドゲート113〜119は、全て閉じているので、各フリップフロップ103〜109のデータ入力端子Dは、データ入力端子149〜155に与えられたデータに関わらずデータ0が与えられる。なお、割り込み要求回路203についても、同様にクリアデータが与えられる。しかし後述するように、CPU205は割り込み要求回路203を選択しないので、このクリアデータは割り込み要求回路203の動作には何ら影響しない。
【0035】
続いてCPU205は、割り込み要求レジスタの割り込み要因Aに対応するデータをクリアするために、書き込み許可信号WRを出力するとともに、割り込み要求回路201を選択するアドレス信号をアドレスバス219へ出力する。アドレスデコーダ207は、CPUから出力されたアドレス信号をデコードし割り込み要求回路201を選択する選択信号を出力する。アンドゲート121は、この選択信号と書き込み許可信号WRに応答して書き込み信号を出力する。一方アンドゲート123は読み出し許可信号RDが出力されていないので、読み出し信号を出力しない。また、CPU205は割り込み要求回路203を選択していないので、アンドゲート223及び225はディスエーブル状態である。
【0036】
書き込み信号が各フリップフロップ101〜109のゲート端子Gに与えられると、各フリップフロップ101〜109はデータ入力端子Dに与えられたデータを取り込み、取り込んだデータをデータ出力端子Qに出力する。ここで、フリップフロップ101のデータ入力端子Dにはデータ0が与えられているので、フリップフロップ101は、ゲート端子Gに与えられた書き込み信号に応答してデータ0を出力する。他のフリップフロップ103〜109も同様に、各ゲート端子Gに与えられた書き込み信号に応答してデータ0を出力する。以上のように割り込み要求回路201内の割り込み要求レジスタの出力は、(10000000)から(00000000)へ変化する。すなわち、割り込み要求レジスタの割り込み要因Aに対応するデータがクリアされたことになる。以上は、割り込みレジスタをクリアする前に他の割り込み要因が発生しなかった場合の動作について説明したが、以下他の割り込み要因が発生した場合の動作について説明する。
【0037】
(割り込み要因B発生)
割り込み要因Aが発生した後、この割り込み要因Aに対応する割り込み要求レジスタのデータをクリアする前に、I/O回路213が内部に異常があることを示す割り込み要因Bを発生したとする。この割り込み要因Bは、割り込み要求信号として割り込み要求回路201内の割り込み要求入力端子141に与えられる。割り込み要求入力端子141に与えられた割り込み要求信号は、フリップフロップ105のセット端子Sに与えられるので、フリップフロップ105のデータ出力端子Qから出力されるデータは0から1に変化する。今A/D変換回路209で発生した割り込み要因Aによって、フリップフロップ101のみデータ1を出力しているので、割り込み要求レジスタの内容は結果として(10100000)となる。
【0038】
(割り込み要求出力信号発生)
フリップフロップ105のデータ出力端子Qが0から1に変化すると、割り込み要求信号出力回路135はこの変化を検出し、CPU205へ割り込み要求出力信号を出力する。CPU205は、この割り込み要求出力信号を受信することによって、何れかの回路に割り込み要因が発生したことを認識する。次にCPU205は、割り込み要因が発生している回路を特定し、その割り込み要因を受け付けるべきか、受け付けるとしたらいつ受け付けるのか等を判断する。今CPU205は、割り込み要因Aに対応する割り込み要求レジスタのデータをクリアする動作を行おうとしているので、この判断は割り込み要求レジスタのデータをクリアした後に行われる。
【0039】
(割り込み要求レジスタのクリア)
CPU205は、割り込み要因Aに関する割り込み処理を終了させた後、割り込み要因Aに対応するフリップフロップ101の出力をクリアする動作を開始する。まず、CPU205は(01111111)というデータを生成し、CPU内の8ビットのレジスタにデータ(01111111)を書き込む。すなわちCPU205は、割り込み要因Aに対応するビットのみがデータ0、その他のビットがデータ1であるようなクリアデータを作成し、そのクリアデータをCPU205内のレジスタに記憶させる。続いてCPU205は、このクリアデータをデータバス217へ出力する。データバス217に与えられたクリアデータは、双方向データバス221を介して割り込み要求回路201のデータ入力端子147〜155に与えられる。今、フリップフロップ101及び105はデータ1を、フリップフロップ103及び107〜109はデータ0を出力しているので、アンドゲート111及び115のみが開いている。従って、データ入力端子147に与えられたデータ0は、アンドゲート111を通過してフリップフロップ101のデータ入力端子Dに与えられる。また、データ入力端子151に与えられたデータ1は、アンドゲート115を通過してフリップフロップ105のデータ入力端子Dに与えられる。アンドゲート113及び117〜119は閉じているので、フリップフロップ103及び107〜109のデータ入力端子Dは、データ入力端子149及び153〜155に与えられたデータに関わらずデータ0が与えられる。なお、割り込み要求回路203についても、同様にクリアデータが与えられる。しかし後述するように、CPU205は割り込み要求回路203を選択しないので、このクリアデータは割り込み要求回路203の動作には何ら影響しない。
【0040】
続いてCPU205は、割り込み要求レジスタの割り込み要因Aに対応するデータをクリアするために、書き込み許可信号WRを出力するとともに、割り込み要求回路201を選択するアドレス信号をアドレスバス219へ出力する。アドレスデコーダ207は、CPUから出力されたアドレス信号をデコードし割り込み要求回路201を選択する選択信号を出力する。アンドゲート121は、この選択信号と書き込み許可信号WRに応答して書き込み信号を出力する。一方アンドゲート123は読み出し許可信号RDが出力されていないので、読み出し信号を出力しない。また、CPU205は割り込み要求回路203を選択していないので、アンドゲート223及び225はディスエーブル状態である。
【0041】
書き込み信号が各フリップフロップ101〜109のゲート端子Gに与えられると、各フリップフロップ101〜109はデータ入力端子Dに与えられたデータを取り込み、取り込んだデータをデータ出力端子Qに出力する。ここで、フリップフロップ101のデータ入力端子Dにはデータ0が与えられているので、フリップフロップ101は、ゲート端子Gに与えられた書き込み信号に応答してデータ0を出力する。またフリップフロップ105のデータ入力端子Dにはデータ1が与えられているので、フリップフロップ105は、ゲート端子Gに与えられた書き込み信号に応答してデータ1を出力する。フリップフロップ103及び107〜109は、各ゲート端子Gに与えられた書き込み信号に応答してデータ0を出力する。以上のように割り込み要求回路201内の割り込み要求レジスタの出力は、(10100000)から(00100000)へ変化する。すなわち、割り込み要求レジスタの割り込み要因Bに対応するデータがクリアされずに、割り込み要因Aに対応するデータのみクリアされる。
【0042】
(割り込み要求レジスタのデータ読み出し)
次にCPU205は、先に割り込み要求回路201から出力された割り込み要求出力信号に基づき、割り込み要因が発生している回路を特定するために、割り込み要求回路201へアクセスする。そしてCPU205は、その割り込み要因を受け付けるべきか、受け付けるとしたらいつ受け付けるのか等を判断する。
【0043】
まずCPU205は、割り込み要求回路201内の割り込み要求レジスタの内容を読み出すために、読み出し許可信号RDを出力するとともに、割り込み要求回路201を選択するアドレス信号をアドレスバス219へ出力する。アドレスデコーダ207は、CPUから出力されたアドレス信号をデコードし割り込み要求回路201を選択する選択信号を出力する。アンドゲート123は、この選択信号と読み出し許可信号RDに応答して読み出し信号を出力する。一方アンドゲート121は書き込み許可信号WRが出力されていないので、書き込み信号を出力しない。また、CPU205は割り込み要求回路203を選択していないので、アンドゲート223及び225はディスエーブル状態である。
【0044】
ゲート回路125〜133は、アンドゲート123から出力された読み出し信号に応答してオン状態になり、各フリップフロップ101〜109のデータ出力端子Qと、各フリップフロップ101〜109の各々に対応するデータ出力端子157〜165との間を電気的に導通させる。フリップフロップ105のデータ出力端子Qはデータ1を出力しているので、データ出力端子161にデータ1が与えられ、フリップフロップ101,103及び107〜109のデータ出力端子Qはデータ0を出力しているのでデータ出力端子157,159及び163〜165にはデータ0が与えられる。
【0045】
データ出力端子157〜165に与えられた各データは、双方向データバス221を介してデータバス217に与えられる。そしてCPU205は、データバス217に与えられたこの8ビットのデータをCPU205内のレジスタに読み込む。今データバス217は、(00100000)になっているので、CPU205は割り込み要求回路201内の割り込み要求レジスタの内容が(00100000)であることを認識する。すなわちCPU205は、新たに割り込み要因Bが、I/O回路213で発生したことを認識する。CPU205は、この割り込み要因Bが、CPU205が現在実行している処理に優先するかどうか判断する。もしこの割り込み要因Bが、現在実行している処理よりも優先度が高いものであれば、CPU205は直ちに割り込み要因Bに関する処理フローに入る。すなわちCPU205は、メインの処理フロー中に割り込み要因Bに関する処理を割り込ませる。ここでは、割り込み要因Bに関する処理は直ちに実行することとする。
【0046】
CPU205は、割り込み要因BによりI/O回路213が異常によって使用できなくなったものと判断する。そしてCPU205は、以後I/O回路211を使用する命令が与えられたときは、I/O回路211が使用されるように処理フローの変更の処理を行う。
【0047】
(割り込み要求レジスタのクリア)
続いて、CPU205は割り込み要因Bに対応するフリップフロップ105の出力をクリアする動作を開始する。まず、CPU205は(11011111)というデータを生成し、CPU内の8ビットのレジスタにデータ(11011111)を書き込む。すなわちCPU205は、割り込み要因Bに対応するビットのみがデータ0、その他のビットがデータ1であるようなクリアデータを作成し、そのクリアデータをCPU205内のレジスタに記憶させる。続いてCPU205は、このクリアデータをデータバス217へ出力する。データバス217に与えられたクリアデータは、双方向データバス221を介して割り込み要求回路201のデータ入力端子147〜155に与えられる。今、フリップフロップ105はデータ1を、フリップフロップ101,103及び107〜109はデータ0を出力しているので、アンドゲート115のみが開いている。しかしデータ入力端子151に与えられたデータは0であるので、フリップフロップ105のデータ入力端子Dにはデータ0が与えられる。またアンドゲート111,113及び117〜119は閉じているので、フリップフロップ101,103及び107〜109のデータ入力端子Dは、データ入力端子147,149及び153〜155に与えられたデータに関わらずデータ0が与えられる。なお、割り込み要求回路203についても、同様にクリアデータが与えられる。しかし、CPU205は割り込み要求回路203を選択しないので、このクリアデータは割り込み要求回路203の動作には何ら影響しない。
【0048】
続いてCPU205は、割り込み要求レジスタの割り込み要因Bに対応するデータをクリアするために、書き込み許可信号WRを出力するとともに、割り込み要求回路201を選択するアドレス信号をアドレスバス219へ出力する。アドレスデコーダ207は、CPUから出力されたアドレス信号をデコードし割り込み要求回路201を選択する選択信号を出力する。アンドゲート121は、この選択信号と書き込み許可信号WRに応答して書き込み信号を出力する。一方アンドゲート123は読み出し許可信号RDが出力されていないので、読み出し信号を出力しない。また、CPU205は割り込み要求回路203を選択していないので、アンドゲート223及び225はディスエーブル状態である。
【0049】
書き込み信号が各フリップフロップ101〜109のゲート端子Gに与えられると、各フリップフロップ101〜109はデータ入力端子Dに与えられたデータを取り込み、取り込んだデータをデータ出力端子Qに出力する。ここで、全てのフリップフロップ101〜109のデータ入力端子Dにはデータ0が与えられているので、各フリップフロップ101〜109は各ゲート端子Gに与えられた書き込み信号に応答してデータ0を出力する。
【0050】
以上のように割り込み要求回路201内の割り込み要求レジスタの出力は、(00100000)から(00000000)へ変化する。すなわち、割り込み要求レジスタの割り込み要因Bに対応するデータがクリアされる。
【0051】
この時点で割り込み要求レジスタの出力は全て0になるので、CPU205は、周辺回路からの割り込み要求が存在しないと判断する。従ってCPU205は、中断していたメインの処理フローへ復帰する。
【0052】
以上説明した本発明の一実施例によれば、以下のような利点がある。
【0053】
CPUへの割り込み要求は、CPUの動作とは非同期にしかも複数発生する。しかし本発明によれば、上述のようにCPUが割り込み要因Aに関する割り込み処理を行っている間に、新たに他の周辺回路からの割り込み要因Bが発生した場合であっても、割り込み要因Bに対応するフリップフロップの出力はクリアされない。従って、CPUは割り込み要因Aに関するクリア動作の終了後も、割り込み要因Bが発生していることを認識できる。したがって、割り込み要因Bに関する割り込み処理は無視されずに実行される。
【0054】
また本発明におけるクリアデータの構成は、クリアしたい割り込み要因に対応するフリップフロップに与えられた第1のデータと、他のフリップフロップすなわち他の割り込み要因に対応するフリップフロップおよび割り込み要因が発生していないフリップフロップに一律に与えられた第2のデータとによって構成されている。従ってCPUが生成するクリアデータは、第2のデータで構成された複数のビットのうちの1ビットのみを第1のデータに変更するだけで生成できる。よって、クリアデータの生成に必要な時間はわずかであり、クリアデータの生成によってCPUの動作速度を低下させることはない。
【0055】
また、本発明によれば、割り込み要求回路が示す割り込み要求(割り込み要求レジスタの出力)のクリア動作は、データバスに転送されるデータによって実行される。つまり、本発明によれば、発生した割り込み要因に対応するフリップフロップのみを選択的にクリアするための割り込みクリアセレクタ等といった専用の回路を必要としない。従って、システム全体としての回路規模を増大することなく、確実に割り込みの処理を実行できる。
【0056】
次に、本発明の割り込み要求回路の他の実施例の構成を説明する。
【0057】
図4は、本発明の割り込み要求回路の他の実施例の構成を示す図である。なお図4において、図1と同一の構成には同一符号を付与している。
【0058】
図4に示す割り込み要求回路と図1に示す割り込み要求回路との違いは、各割り込み要求入力端子137〜145が各フリップフロップ101〜109のリセット端子Rに各々接続されている点、リセット端子167がフリップフロップ101〜109のセット端子Sに接続されている点、オアゲート401〜409が各フリップフロップ101〜109のデータ端子Dに各々接続されている点である。その他の構成は図1と同様である。また、図2のシステムにおける図4の割り込み要求回路の位置づけについても、図1と図2との関係と同様であるので特に説明しない。
【0059】
次に、図4に示す本発明の割り込み要求回路の動作を図5のタイムチャートを用いて説明する。図4に示す割り込み要求回路の動作と図1に示す割り込み要求回路の動作との違いは、周辺回路に割り込み要因が発生したときフリップフロップのデータ出力端子Qがデータ0を出力するという点である。
【0060】
(割り込み要因A発生)
まず各フリップフロップで構成された割り込み要求レジスタが、リセット端子167に与えられたリセット信号によって初期設定されているとする。すなわち、各フリップフロップは、各データ出力端子Qからデータ1を出力する。(データ0は例えば0Vであり、データ1は例えば5Vである。)
次にA/D変換回路209が例えば外部から与えられたアナログデータをディジタルデータに変換するという割り込み要因Aを発生する。この割り込み要因Aは、割り込み要求信号として割り込み要求回路201内の割り込み要求入力端子137に与えられる。割り込み要求入力端子137に与えられた割り込み要求信号は、フリップフロップ101のリセット端子Rに与えられるので、フリップフロップ101のデータ出力端子Qから出力されるデータは1から0に変化する。今その他の周辺回路には、割り込み要因が存在していないので、フリップフロップ103〜109はリセットされない。従って、フリップフロップ103〜109のデータ出力端子Qから出力されるデータは1のままである。図5の上部に示すように、割り込み要求レジスタの内容は、結果として(01111111)となる。
【0061】
(割り込み要求出力信号発生)
フリップフロップ101のデータ出力端子Qが1から0に変化すると、割り込み要求信号出力回路135はこの変化を検出し、CPU205へ割り込み要求出力信号を出力する。CPU205は、この割り込み要求出力信号を受信することによって、何れかの回路に割り込み要因が発生したことを認識する。次にCPU205は、割り込み要因が発生している回路を特定し、その割り込み要因を受け付けるべきか、受け付けるとしたらいつ受け付けるのか等を判断する。
【0062】
(割り込み要求レジスタのデータ読み出し)
まずCPU205は、割り込み要求回路201内の割り込み要求レジスタの内容を読み出すために、読み出し許可信号RDを出力するとともに、割り込み要求回路201を選択するアドレス信号をアドレスバス219へ出力する。アドレスデコーダ207は、CPUから出力されたアドレス信号をデコードし割り込み要求回路201を選択する選択信号を出力する。アンドゲート123は、この選択信号と読み出し許可信号RDに応答して読み出し信号を出力する。一方アンドゲート121は書き込み許可信号WRが出力されていないので、書き込み信号を出力しない。また、CPU205は割り込み要求回路203を選択していないので、アンドゲート223及び225はディスエーブル状態である。
【0063】
ゲート回路125〜133は、アンドゲート123から出力された読み出し信号に応答してオン状態になり、各フリップフロップ101〜109のデータ出力端子Qと、各フリップフロップ101〜109の各々に対応するデータ出力端子157〜165との間を電気的に導通させる。フリップフロップ101のデータ出力端子Qはデータ0を出力しているのでデータ出力端子157にデータ0が与えられ、その他のフリップフロップ103〜109のデータ出力端子Qはデータ1を出力しているのでデータ出力端子159〜165にはデータ1が与えられる。データ出力端子157〜165に与えられた各データは、双方向データバス221を介してデータバス217に与えられる。そしてCPU205は、データバス217に与えられたこの8ビットのデータをCPU205内のレジスタに読み込む。今データバス217は、(01111111)になっているので、CPU205は割り込み要求回路201内の割り込み要求レジスタの内容が(01111111)であることを認識する。すなわちCPU205は、割り込み要因Aが、A/D変換回路209で発生したことを認識する。
【0064】
CPU205は、この割り込み要因Aが、CPU205が現在実行しているメインの処理に優先するかどうか判断する。もしこの割り込み要因Aが、現在実行している処理よりも優先度が高いものであれば、CPU205は直ちにあるいは、現在の処理を終了させた後直ちにアナログデータをディジタルデータに変換する処理フローに入る。すなわちCPU205は、メインの処理フロー中にA/D変換処理を割り込ませる。ここで、割り込み処理を実行するタイミングは、プログラムによって異なるため、割り込みの要求があった後の他の処理を行った後でも良い。ここでは、CPU205は、現在の処理を終了させた後直ちにA/D変換処理を行うフローに入る。A/D変換回路209は、CPU205が制御するA/D変換フローにしたがって、図示しない周辺回路から与えられたアナログデータをディジタルデータに変換する。変換されたディジタルデータは、CPU205の命令によって、データバス217を介して例えばRAM215へ転送される。
【0065】
(割り込み要求レジスタのクリア(割り込み要因Bが発生していない場合))
CPU205は、割り込み処理を終了させた後、割り込み要因Aに対応するフリップフロップ101の出力をクリアする動作を開始する。まず、CPU205は(10000000)というデータを生成し、CPU内の8ビットのレジスタにデータ(10000000)を書き込む。すなわちCPU205は、割り込み要因Aに対応するビットのみがデータ1、その他のビットがデータ0であるようなクリアデータを作成し、そのクリアデータをCPU205内のレジスタに記憶させる。続いてCPU205は、このクリアデータをデータバス217へ出力する。データバス217に与えられたクリアデータは、双方向データバス221を介して割り込み要求回路201のデータ入力端子147〜155に与えられる。今、フリップフロップ101はデータ0を出力しているので、データ入力端子147に与えられたデータ1は、オアゲート401を通過してフリップフロップ101のデータ入力端子Dに与えられる。フリップフロップ103〜109はデータ1を出力しているので、データ入力端子149〜155に与えられたデータ0は、オアゲート403〜409を通過して各フリップフロップ103〜109のデータ入力端子Dに与えられる。なお、割り込み要求回路203についても、同様にクリアデータが与えられる。しかし後述するように、CPU205は割り込み要求回路203を選択しないので、このクリアデータは割り込み要求回路203の動作には何ら影響しない。
【0066】
続いてCPU205は、割り込み要求レジスタの割り込み要因Aに対応するデータをクリアするために、書き込み許可信号WRを出力するとともに、割り込み要求回路201を選択するアドレス信号をアドレスバス219へ出力する。アドレスデコーダ207は、CPUから出力されたアドレス信号をデコードし割り込み要求回路201を選択する選択信号を出力する。アンドゲート121は、この選択信号と書き込み許可信号WRに応答して書き込み信号を出力する。一方アンドゲート123は読み出し許可信号RDが出力されていないので、読み出し信号を出力しない。また、CPU205は割り込み要求回路203を選択していないので、アンドゲート223及び225はディスエーブル状態である。
【0067】
書き込み信号が各フリップフロップ101〜109のゲート端子Gに与えられると、各フリップフロップ101〜109はデータ入力端子Dに与えられたデータを取り込み、取り込んだデータをデータ出力端子Qに出力する。ここで、フリップフロップ101のデータ入力端子Dにはデータ1が与えられているので、フリップフロップ101は、ゲート端子Gに与えられた書き込み信号に応答してデータ1を出力する。他のフリップフロップ103〜109も同様に、各ゲート端子Gに与えられた書き込み信号に応答してデータ1を出力する。以上のように割り込み要求回路201内の割り込み要求レジスタの出力は、(01111111)から(11111111)へ変化する。すなわち、割り込み要求レジスタの割り込み要因Aに対応するデータがクリアされたことになる。以上は、割り込みレジスタをクリアする前に他の割り込み要因が発生しなかった場合の動作について説明したが、以下他の割り込み要因が発生した場合の動作について説明する。
【0068】
(割り込み要因B発生)
割り込み要因Aが発生した後、この割り込み要因Aに対応する割り込み要求レジスタのデータをクリアする前に、I/O回路213が内部に異常があることを示す割り込み要因Bを発生したとする。この割り込み要因Bは、割り込み要求信号として割り込み要求回路201内の割り込み要求入力端子141に与えられる。割り込み要求入力端子141に与えられた割り込み要求信号は、フリップフロップ105のリセット端子Rに与えられるので、フリップフロップ105のデータ出力端子Qから出力されるデータは1から0に変化する。今A/D変換回路209で発生した割り込み要因Aによって、フリップフロップ101のみデータ0を出力しているので、割り込み要求レジスタの内容は結果として(01011111)となる。
【0069】
(割り込み要求出力信号発生)
フリップフロップ105のデータ出力端子Qが1から0に変化すると、割り込み要求信号出力回路135はこの変化を検出し、CPU205へ割り込み要求出力信号を出力する。CPU205は、この割り込み要求出力信号を受信することによって、何れかの回路に割り込み要因が発生したことを認識する。次にCPU205は、割り込み要因が発生している回路を特定し、その割り込み要因を受け付けるべきか、受け付けるとしたらいつ受け付けるのか等を判断する。今CPU205は、割り込み要因Aに対応する割り込み要求レジスタのデータをクリアする動作を行おうとしているので、この判断は割り込み要求レジスタのデータをクリアした後に行われる。
【0070】
(割り込み要求レジスタのクリア)
CPU205は、割り込み要因Aに関する割り込み処理を終了させた後、割り込み要因Aに対応するフリップフロップ101の出力をクリアする動作を開始する。まず、CPU205は(10000000)というデータを生成し、CPU内の8ビットのレジスタにデータ(10000000)を書き込む。すなわちCPU205は、割り込み要因Aに対応するビットのみがデータ1、その他のビットがデータ0であるようなクリアデータを作成し、そのクリアデータをCPU205内のレジスタに記憶させる。続いてCPU205は、このクリアデータをデータバス217へ出力する。データバス217に与えられたクリアデータは、双方向データバス221を介して割り込み要求回路201のデータ入力端子147〜155に与えられる。今、フリップフロップ101はデータ0を出力しているので、フリップフロップ101のデータ入力端子Dにはデータ1が与えられる。フリップフロップ105も同様にデータ0を出力しているが、データ入力端子151にはデータ0が与えられているので、フリップフロップ105のデータ入力端子Dにはデータ0が与えられる。フリップフロップ103及び107〜109はデータ1を出力しているので、フリップフロップ103及び107〜109のデータ入力端子Dにはデータ入力端子149及び153〜155に与えられたデータに関わらずデータ1が与えられる。なお、割り込み要求回路203についても、同様にクリアデータが与えられる。しかし後述するように、CPU205は割り込み要求回路203を選択しないので、このクリアデータは割り込み要求回路203の動作には何ら影響しない。
【0071】
続いてCPU205は、割り込み要求レジスタの割り込み要因Aに対応するデータをクリアするために、書き込み許可信号WRを出力するとともに、割り込み要求回路201を選択するアドレス信号をアドレスバス219へ出力する。アドレスデコーダ207は、CPUから出力されたアドレス信号をデコードし割り込み要求回路201を選択する選択信号を出力する。アンドゲート121は、この選択信号と書き込み許可信号WRに応答して書き込み信号を出力する。一方アンドゲート123は読み出し許可信号RDが出力されていないので、読み出し信号を出力しない。また、CPU205は割り込み要求回路203を選択していないので、アンドゲート223及び225はディスエーブル状態である。
【0072】
書き込み信号が各フリップフロップ101〜109のゲート端子Gに与えられると、各フリップフロップ101〜109はデータ入力端子Dに与えられたデータを取り込み、取り込んだデータをデータ出力端子Qに出力する。ここで、フリップフロップ101のデータ入力端子Dにはデータ1が与えられているので、フリップフロップ101は、ゲート端子Gに与えられた書き込み信号に応答してデータ1を出力する。またフリップフロップ105のデータ入力端子Dにはデータ0が与えられているので、フリップフロップ105は、ゲート端子Gに与えられた書き込み信号に応答してデータ0を出力する。フリップフロップ103及び107〜109は、各ゲート端子Gに与えられた書き込み信号に応答してデータ1を出力する。以上のように割り込み要求回路201内の割り込み要求レジスタの出力は、(01011111)から(11011111)へ変化する。すなわち、割り込み要求レジスタの割り込み要因Bに対応するデータがクリアされずに、割り込み要因Aに対応するデータのみクリアされる。
【0073】
(割り込み要求レジスタのデータ読み出し)
次にCPU205は、先に割り込み要求回路201から出力された割り込み要求出力信号に基づき、割り込み要因が発生している回路を特定するために、割り込み要求回路201へアクセスする。そしてCPU205は、その割り込み要因を受け付けるべきか、受け付けるとしたらいつ受け付けるのか等を判断する。
【0074】
まずCPU205は、割り込み要求回路201内の割り込み要求レジスタの内容を読み出すために、読み出し許可信号RDを出力するとともに、割り込み要求回路201を選択するアドレス信号をアドレスバス219へ出力する。アドレスデコーダ207は、CPUから出力されたアドレス信号をデコードし割り込み要求回路201を選択する選択信号を出力する。アンドゲート123は、この選択信号と読み出し許可信号RDに応答して読み出し信号を出力する。一方アンドゲート121は書き込み許可信号WRが出力されていないので、書き込み信号を出力しない。また、CPU205は割り込み要求回路203を選択していないので、アンドゲート223及び225はディスエーブル状態である。
【0075】
ゲート回路125〜133は、アンドゲート123から出力された読み出し信号に応答してオン状態になり、各フリップフロップ101〜109のデータ出力端子Qと、各フリップフロップ101〜109の各々に対応するデータ出力端子157〜165との間を電気的に導通させる。フリップフロップ105のデータ出力端子Qはデータ0を出力しているので、データ出力端子161にデータ0が与えられ、フリップフロップ101,103及び107〜109のデータ出力端子Qはデータ1を出力しているのでデータ出力端子157,159及び163〜165にはデータ1が与えられる。
【0076】
データ出力端子157〜165に与えられた各データは、双方向データバス221を介してデータバス217に与えられる。そしてCPU205は、データバス217に与えられたこの8ビットのデータをCPU205内のレジスタに読み込む。今データバス217は、(11011111)になっているので、CPU205は割り込み要求回路201内の割り込み要求レジスタの内容が(11011111)であることを認識する。すなわちCPU205は、新たに割り込み要因Bが、I/O回路213で発生したことを認識する。CPU205は、この割り込み要因Bが、CPU205が現在実行している処理に優先するかどうか判断する。もしこの割り込み要因Bが、現在実行している処理よりも優先度が高いものであれば、CPU205は直ちに割り込み要因Bに関する処理フローに入る。すなわちCPU205は、メインの処理フロー中に割り込み要因Bに関する処理を割り込ませる。ここでは、割り込み要因Bに関する処理は直ちに実行することとする。
【0077】
CPU205は、割り込み要因BによりI/O回路213が異常によって使用できなくなったものと判断する。そしてCPU205は、以後I/O回路211を使用する命令が与えられたときは、I/O回路211が使用されるように処理フローの変更の処理を行う。
【0078】
(割り込み要求レジスタのクリア)
続いて、CPU205は割り込み要因Bに対応するフリップフロップ105の出力をクリアする動作を開始する。まず、CPU205は(00100000)というデータを生成し、CPU内の8ビットのレジスタにデータ(00100000)を書き込む。すなわちCPU205は、割り込み要因Bに対応するビットのみがデータ1、その他のビットがデータ0であるようなクリアデータを作成し、そのクリアデータをCPU205内のレジスタに記憶させる。続いてCPU205は、このクリアデータをデータバス217へ出力する。データバス217に与えられたクリアデータは、双方向データバス221を介して割り込み要求回路201のデータ入力端子147〜155に与えられる。今、フリップフロップ105はデータ0を出力しているので、フリップフロップ101のデータ入力端子Dにはオアゲート405を介してデータ1が与えられる。フリップフロップ101,103及び107〜109はデータ1を出力しているので、フリップフロップ101,103及び107〜109のデータ入力端子Dにはデータ入力端子147,149及び153〜155に与えられたデータに関わらずデータ1が与えられる。なお、割り込み要求回路203についても、同様にクリアデータが与えられる。しかし後述するように、CPU205は割り込み要求回路203を選択しないので、このクリアデータは割り込み要求回路203の動作には何ら影響しない。
【0079】
続いてCPU205は、割り込み要求レジスタの割り込み要因Bに対応するデータをクリアするために、書き込み許可信号WRを出力するとともに、割り込み要求回路201を選択するアドレス信号をアドレスバス219へ出力する。アドレスデコーダ207は、CPUから出力されたアドレス信号をデコードし割り込み要求回路201を選択する選択信号を出力する。アンドゲート121は、この選択信号と書き込み許可信号WRに応答して書き込み信号を出力する。一方アンドゲート123は読み出し許可信号RDが出力されていないので、読み出し信号を出力しない。また、CPU205は割り込み要求回路203を選択していないので、アンドゲート223及び225はディスエーブル状態である。
【0080】
書き込み信号が各フリップフロップ101〜109のゲート端子Gに与えられると、各フリップフロップ101〜109はデータ入力端子Dに与えられたデータを取り込み、取り込んだデータをデータ出力端子Qに出力する。ここで、全てのフリップフロップ101〜109のデータ入力端子Dにはデータ1が与えられているので、各フリップフロップ101〜109は各ゲート端子Gに与えられた書き込み信号に応答してデータ1を出力する。
【0081】
以上のように割り込み要求回路201内の割り込み要求レジスタの出力は、(11011111)から(11111111)へ変化する。すなわち、割り込み要求レジスタの割り込み要因Bに対応するデータがクリアされる。
【0082】
この時点で割り込み要求レジスタの出力は全て1になるので、CPU205は、周辺回路からの割り込み要求が存在しないと判断する。従ってCPU205は、中断していたメインの処理フローへ復帰する。
【0083】
以上のように図4に示したオアゲートを用いた割り込み要求回路は、各フリップフロップのデータ出力端子Qから出力されたデータが0の場合に割り込み要求が発生したことを示す回路である。一方図1に示したアンドゲートを用いた割り込み要求回路は、各フリップフロップのデータ出力端子Qから出力されたデータが1の場合に割り込み要求が発生したことを示す回路である。これら2つの割り込み要求回路の動作は基本的には同じであるため、設計者はマイコン等のシステム(プログラム)開発の際に、両者のいずれか有利な方を選択することができる。すなわち、2種の割り込み要求回路を提供することによりマイコン等のシステム全体の特性を考慮した設計が可能になる。
【0084】
次に、図1に示した割り込み要求回路の変形例を図6を用いて説明する。
【0085】
図6に示す回路は、アンドゲートを内部に取り込んだフリップフロップである。すなわち図6に示すフリップフロップは、図1に示した各フリップフロップの前段に接続されたアンドゲートを省略した回路である。
【0086】
但し、図1で示した書き込み信号Gは、図6においては相補信号を使用し(例えばインバータで、書き込み信号Gを反転させて書き込み信号反転Gを生成している。)、データ出力端子Qに出力される信号も相補信号を使用している。
【0087】
また、図6においては、図1で示した各フリップフロップのリセット端子Rに相当するリセット端子反転Rを使用している。
【0088】
図6のフリップフロップ回路は、トランジスタM1,M2で構成され書き込み信号G(書き込み信号反転G)に応答してデータ入力端子Dに与えられたデータを転送するトランスファーゲート601と、トランジスタM3,M4で構成され書き込み信号G(書き込み信号反転G)に応答してデータ出力端子Qに与えられたデータを転送するトランスファーゲート603と、リセット端子反転Rに与えられるリセット信号が与えられるトランジスタM10,M12と、セット端子Sに与えられるセット信号が与えられるトランジスタM5,M11とを有している。さらにフリップフロップ回路は、トランジスタM13,M14で構成され、入力端子がデータ出力端子反転Qに接続され、出力端子がデータ出力端子Qに接続されたインバータ605と、データ出力端子Qに与えられたデータが与えられるトランジスタM7,M8とトランスファーゲート601及びトランスファーゲート603の出力が与えられるトランジスタM6,M9とを有している。
【0089】
次に図6に示すフリップフロップ回路の動作を説明する。
【0090】
(リセット動作)
リセット端子反転Rに“L”レベルのリセット信号が与えられると、トランジスタM10がオンするので電源電位(“H”レベル)がデータ出力端子反転Qに与えられる。データ出力端子反転Qが“H”レベルになるとインバータ605の出力は“L”レベルになる。一方、トランジスタM12はオフするので接地電位(“L”レベル)とデータ出力端子反転Qとの間の経路が電気的に遮断される。このようにデータ出力端子Qが“L”レベルになりフリップフロップ回路がリセットされる。
【0091】
(割り込み要求を受ける動作)
次に割り込み要求を受ける動作、すなわちセット動作について説明する。
【0092】
セット端子Sに“H”レベルの割り込み要求信号が与えられると、トランジスタM11がオンするのでトランジスタM12のドレイン電位がデータ出力端子反転Qに与えられる。このときリセット端子反転Rが“H”レベルである、すなわちリセット動作中ではないとするとトランジスタM12はオンしているので、トランジスタM12のドレイン電位は“L”レベルになっている。従って、データ出力端子反転Qは“L”レベルになる。インバータ605は、データ出力端子反転Qに与えられた“L”レベルを反転し、データ出力端子Qを“H”レベルにする。
【0093】
一方、トランジスタM5はオフするので電源電位とデータ出力端子反転Qとの間の経路が電気的に遮断される。なおリセット動作中でないならばトランジスタM10はオフしているので、電源電位とデータ出力端子反転Qとの間のいかなる経路も電気的に遮断されることになる。
【0094】
このようにデータ出力端子Qが“H”レベルになりフリップフロップ回路がセットされる。よってこのフリップフロップ回路は、このフリップフロップ回路に接続された周辺回路に割り込み要求が発生していることを示す。
【0095】
(割り込み要求をクリアする動作)
次に割り込み要求をクリアする動作(データ書き込み動作)、つまりデータ端子Dに与えられたデータをデータ出力端子Q、反転Qに伝達する動作もしくはデータ出力端子Q、反転Qに与えられたデータを保持する動作について説明する。
【0096】
まずデータ出力端子Q及びデータ出力端子反転Qの状態がそれぞれ“L”レベル、“H”レベルである場合、すなわちこのフリップフロップ回路に接続された周辺回路に割り込み要求が発生していない場合のデータ書き込み動作について説明する。
【0097】
データ出力端子Qが“L”レベルであるとトランジスタM7はオンし、トランジスタM8はオフする。このときセット端子Sは“L”レベルであり(セット動作中ではない)、リセット端子反転Rは“H”レベルである(リセット動作中ではない)とすると、トランジスタM5がオンするのでデータ出力端子反転Qは“H”レベルになる。なおトランジスタM10,M11はオフしており、トランジスタM12はオンしている。従って、トランジスタM10を通して“H”レベルは伝達されない。また、トランジスタM8,M11がオフしているので、接地電位とデータ出力端子反転Qとの間の経路は遮断されており、データ出力端子反転Qには“L”レベルは伝達されない。
【0098】
ここで、書き込み信号Gが“L”レベル(書き込み信号反転Gは“H”レベルである。)であると、トランスファーゲート601がオフし、トランスファーゲート603がオンするので、データ出力端子Qの“L”レベルがトランジスタM6,M9のゲートに転送される。すると先にオンしているトランジスタM7に加えてトランジスタM6もオンし、電源電位がトランジスタM6を通してデータ出力端子反転Qに与えられる。
【0099】
次に書き込み信号Gが“H”レベル(書き込み信号反転Gは“L”レベルである。)に変化すると、トランスファーゲート601がオンし、トランスファーゲート603がオフするので、今度はデータ入力端子Dに与えられたデータがトランジスタM6,M9のゲートに転送される。ここでデータ入力端子Dに与えられたデータが“L”レベルであるとするとトランジスタM6,M9の状態は以前の状態、すなわち書き込み信号Gが“L”レベル(書き込み信号反転Gは“H”レベルである。)であった時の状態と変わらない。従って、データ出力端子Q、反転Qの状態は変化しない。(もともとリセット状態にあったフリップフロップは、データ0が書き込まれても状態は変化しない。)
一方、データ入力端子Dに与えられたデータが“H”レベルであるとするとトランジスタM6がオフし、トランジスタM9がオンする。しかしながら、トランジスタM8がオフしているため、トランジスタM9のドレインに接地電位が伝達されてもデータ出力端子反転Qには“L”レベルが伝達されない。従って、データ出力端子Q、反転Qの状態は変化しない。
【0100】
以上のようにこのフリップフロップ回路は、データ出力端子Qに与えられたデータが0、データ出力端子反転Qに与えられたデータが1である場合には、データ出力端子Q及びデータ出力端子反転Qに与えられたデータがデータ入力端子Dに与えられたデータによって変化しない回路である。すなわちこのフリップフロップ回路は、外部から与えられたデータ1が書き込まれない回路である。
【0101】
次にデータ出力端子Q及びデータ出力端子反転Qの状態がそれぞれ“H”レベル、“L”レベルである場合、すなわちこのフリップフロップ回路に接続された周辺回路に割り込み要求が発生している場合のデータ書き込み動作について説明する。
【0102】
データ出力端子Qが“H”レベルであるとトランジスタM7はオフし、トランジスタM8はオンする。ここで、書き込み信号Gが“L”レベル(書き込み信号反転Gは“H”レベルである。)であると、トランスファーゲート601がオフし、トランスファーゲート603がオンするので、データ出力端子Qの“H”レベルがトランジスタM6,M9のゲートに転送される。するとトランジスタM6がオフし、トランジスタM9がオンする。このときセット端子Sは“L”レベルであり(セット動作中ではない)、リセット端子反転Rは“H”レベルである(リセット動作中ではない)とすると、トランジスタM5及びM12がオンし、トランジスタM10,M11はオフする。従って、データ出力端子反転QにはトランジスタM8,M9,M12を通して“L”レベルが伝達される。データ出力端子反転Qに与えられたこの“L”レベルは、インバータ605で反転されてデータ出力端子Qに与えられる。つまりフリップフロップ回路は、データ1を保持する。
【0103】
次に書き込み信号Gが“H”レベル(書き込み信号反転Gは“L”レベルである。)に変化すると、トランスファーゲート601がオンし、トランスファーゲート603がオフするので、今度はデータ入力端子Dに与えられたデータがトランジスタM6,M9のゲートに転送される。ここでデータ入力端子Dに与えられたデータが“L”レベルであるとするとトランジスタM6がオフからオンに変化し、トランジスタM9がオンからオフに変化する。従って、電源電位がトランジスタM5,M6を通してデータ出力端子反転Qに伝達される。そしてインバータ605はデータ出力端子反転Qのレベルを反転し、データ出力端子Qを“L”レベルにする。なおトランジスタM9がオフするので、接地電位とデータ出力端子反転Qとの間の経路は電気的に遮断される。
【0104】
一方、データ入力端子Dに与えられたデータが“H”レベルであるとすると、トランジスタM6がオフし、トランジスタM9がオンする。すなわちトランジスタM6,M9の状態は、書き込み信号Gが“L”レベル(書き込み信号反転Gは“H”レベルである。)であった時の状態と変わらない。従って、データ出力端子Q、反転Qの状態は変化しない。(もともとセット状態にあったフリップフロップは、データ1が書き込まれても状態は変化しない。)
このようにこのフリップフロップ回路は、データ出力端子Qに与えられたデータが1、データ出力端子反転Qに与えられたデータが0である場合には、データ入力端子Dに0を与えることによってのみそのデータ出力端子Qの状態を変化させることができる回路である。
【0105】
以上の書き込み動作に基づき、クリア対象であるフリップフロップ回路にのみデータ0を書き込み、クリア対象ではないフリップフロップ回路にはデータ1を書き込むことによって、クリア対象であるフリップフロップ回路のみに対する割り込み要求のクリア動作が実行できる。
【0106】
図6に示したフリップフロップ回路は、トランジスタM7,M8を追加することによって、図1に示したフリップフロップとアンドゲートとからなる回路と同様の動作を実現できる。具体的には図6に示したフリップフロップ回路は、図1の回路と同様の動作を実現するために、図1の回路よりもMOSトランジスタを4つ削減できる。従って、IC化する際、回路面積が小さい割り込み要求回路を提供することができる。
【0107】
次に、図4に示した割り込み要求回路の変形例を図7を用いて説明する。
【0108】
図7に示す回路は、オアゲートを内部に取り込んだフリップフロップである。すなわち図7に示すフリップフロップは、図4に示した各フリップフロップの前段に接続されたオアゲートを省略した回路である。
【0109】
但し、図4で示した書き込み信号Gは、図7においては相補信号を使用し(例えばインバータで、書き込み信号Gを反転させて書き込み信号反転Gを生成している。)、データ出力端子Qに出力される信号も相補信号を使用している。
【0110】
また、図7においては、図4で示した各フリップフロップのリセット端子Rに相当するリセット端子反転Rを使用している。
【0111】
図7に示すフリップフロップ回路と図6に示すフリップフロップ回路との構成の差異は、トランジスタM7,M8の接続関係のみである。図6に示すフリップフロップ回路では、トランジスタM6とトランジスタM7が並列に接続されているのに対し、図7に示すフリップフロップ回路では、直列に接続されている。また図6に示すフリップフロップ回路では、トランジスタM8とトランジスタM9が直列に接続されているのに対し、図7に示すフリップフロップ回路では、並列に接続されている。
【0112】
次に図7に示すフリップフロップ回路の動作を説明する。
【0113】
このフリップフロップ回路のリセット動作及びセット動作は、図6に示すフリップフロップ回路と同じであるので省略する。
【0114】
(割り込み要求をクリアする動作)
次に割り込み要求をクリアする動作(データ書き込み動作)、つまりデータ端子Dに与えられたデータをデータ出力端子Q、反転Qに伝達する動作もしくはデータ出力端子Q、反転Qに与えられたデータを保持する動作について説明する。
【0115】
まずデータ出力端子Q及びデータ出力端子反転Qの状態がそれぞれ“L”レベル、“H”レベルである場合、すなわちこのフリップフロップ回路に接続された周辺回路に割り込み要求が発生している場合のデータ書き込み動作について説明する。
【0116】
データ出力端子Qが“L”レベルであるとトランジスタM7はオンし、トランジスタM8はオフする。ここで、書き込み信号Gが“L”レベル(書き込み信号反転Gは“H”レベルである。)であると、トランスファーゲート601がオフし、トランスファーゲート603がオンするので、データ出力端子Qの“L”レベルがトランジスタM6,M9のゲートに転送され、トランジスタM6がオンし、トランジスタM9がオフする。このときセット端子Sは“L”レベルであり(セット動作中ではない)、リセット端子反転Rは“H”レベルである(リセット動作中ではない)とすると、トランジスタM5がオンする。従って、データ出力端子反転Qは、トランジスタM5,M6,M7を通して“H”レベルになる。データ出力端子反転Qに与えられたこの“H”レベルは、インバータ605で反転されてデータ出力端子Qに与えられる。なおトランジスタM10,M11はオフしており、トランジスタM12はオンしている。従って、データ出力端子反転QにはトランジスタM10を通して“H”レベルは伝達されない。また、トランジスタM8,M11がオフしているので、接地電位とデータ出力端子反転Qとの間の経路は遮断されており、データ出力端子反転Qには“L”レベルは伝達されない。
【0117】
次に書き込み信号Gが“H”レベル(書き込み信号反転Gは“L”レベルである。)に変化すると、トランスファーゲート601がオンし、トランスファーゲート603がオフするので、今度はデータ入力端子Dに与えられたデータがトランジスタM6,M9のゲートに転送される。ここでデータ入力端子Dに与えられたデータが“L”レベルであるとするとトランジスタM6,M9の状態は以前の状態、すなわち書き込み信号Gが“L”レベル(書き込み信号反転Gは“H”レベルである。)であった時の状態と変わらない。従って、データ出力端子Q、反転Qの状態は変化しない。
【0118】
一方、データ入力端子Dに与えられたデータが“H”レベルであるとすると、トランジスタM6がオフし、トランジスタM9がオンする。従って、“L”レベルがトランジスタM9,M12を通してデータ出力端子反転Qに伝達される。インバータ605は、データ出力端子反転Qに与えられたこの“L”レベルを反転し、データ出力端子Qを“H”レベルにする。
【0119】
次にデータ出力端子Q及びデータ出力端子反転Qの状態がそれぞれ“H”レベル、“L”レベルである場合、すなわちこのフリップフロップ回路に接続された周辺回路に割り込み要求が発生していない場合のデータ書き込み動作について説明する。
【0120】
データ出力端子Qが“H”レベルであるとトランジスタM7はオフし、トランジスタM8はオンする。ここで、書き込み信号Gが“L”レベル(書き込み信号反転Gは“H”レベルである。)であると、トランスファーゲート601がオフし、トランスファーゲート603がオンするので、データ出力端子Qの“H”レベルがトランジスタM6,M9のゲートに転送され、トランジスタM6がオフし、トランジスタM9がオンする。このときセット端子Sは“L”レベルであり(セット動作中ではない)、リセット端子反転Rは“H”レベルである(リセット動作中ではない)とすると、トランジスタM12がオンする。従って、データ出力端子反転Qは、トランジスタM8,M9及びM12を通して“L”レベルになる。インバータ605は、データ出力端子反転Qに与えられたこの“L”レベルを反転し、データ出力端子Qを“H”レベルにする。なおトランジスタM10,M11はオフしている。従って、データ出力端子反転QにはトランジスタM10を通して“H”レベルは伝達されない。
【0121】
次に書き込み信号Gが“H”レベル(書き込み信号反転Gは“L”レベルである。)に変化すると、トランスファーゲート601がオンし、トランスファーゲート603がオフするので、今度はデータ入力端子Dに与えられたデータがトランジスタM6,M9のゲートに転送される。ここでデータ入力端子Dに与えられたデータが“L”レベルであるとすると、トランジスタM6がオフからオンに変化し、トランジスタM9がオンからオフへ変化する。しかしながら、トランジスタM7がオフしているので、データ出力端子反転Qには“H”レベルが伝達されない。
【0122】
一方、データ入力端子Dに与えられたデータが“H”レベルであるとすると、トランジスタM6,M9の状態は以前の状態、すなわち書き込み信号Gが“L”レベル(書き込み信号反転Gは“H”レベルである。)であった時の状態と変わらない。従って、データ出力端子Q、反転Qの状態は変化しない。
【0123】
このようにこのフリップフロップ回路は、データ出力端子Qに与えられたデータが0、データ出力端子反転Qに与えられたデータが1である場合には、データ入力端子Dに1を与えることによってのみそのデータ出力端子Qの状態を変化させることができる回路である。
【0124】
以上の書き込み動作に基づき、クリア対象であるフリップフロップ回路にのみデータ1を書き込み、クリア対象ではないフリップフロップ回路にはデータ0を書き込むことによって、クリア対象であるフリップフロップ回路のみに対する割り込み要求のクリア動作が実行できる。
【0125】
図7に示したフリップフロップ回路は、トランジスタM7,M8を追加することによって、図4に示したフリップフロップとオアゲートとからなる回路と同様の動作を実現できる。具体的には図7に示したフリップフロップ回路は、図4の回路と同様の動作を実現するために、図4の回路よりもMOSトランジスタを4つ削減できる。従って、IC化する際、回路面積が小さい割り込み要求回路を提供することができる。
【0126】
【発明の効果】
以上詳細に説明したように、本発明による割り込み要求処理方法は、第1の入力端子に第1のデータを与えてこの第1の入力端子に対応した出力端子に与えられた割り込み要求出力を維持させ、第1の入力端子に第2のデータを与えて第1の入力端子に対応した出力端子に与えられた割り込み要求出力をクリアするようにしたので、CPUへの割り込み要求がCPUの動作とは非同期にしかも複数発生しても、後から発生した割り込み要求に関する処理を確実に実行できる。
【0127】
また、本発明による割り込み要求回路は、データを転送するための複数本のバスラインの各々に対応しこのバスラインに転送されるデータを受信する複数の第1の入力端子と、この複数本のバスラインの各々に対応し割り込み要求信号が与えられる複数の第2の入力端子と、この第2の入力端子の各々に対応した複数の出力端子とを有するので、割り込み要求回路が示す割り込み要求のクリア動作は、データバスに転送されるデータによって実行できる。すなわち本発明によれば、割り込みクリアセレクタ等といった専用の回路を必要としないので、システム全体としての回路規模を増大することなく、確実に割り込みの処理を実行できる。
【図面の簡単な説明】
【図1】本発明の割り込み要求回路の一実施例を示す図である。
【図2】本発明の割り込み要求回路を取り込んだシステムの一実施例を示す図である。
【図3】図1及び図2に示す本発明の割り込み要求回路の動作を説明するタイムチャートである。
【図4】本発明の割り込み要求回路の他の実施例を示す図である。
【図5】図2及び図4に示す本発明の割り込み要求回路の動作を説明するタイムチャートである。
【図6】本発明の割り込み要求回路のフリップフロップの変形例を示す図である。
【図7】本発明の割り込み要求回路のフリップフロップの変形例を示す図である。
【符号の説明】
101,103,105,107,109 フリップフロップ
111,113,115,117,119 アンドゲート
137,139,141,143,145 割り込み要求入力端子
147,149,151,153,155 データ入力端子
157,159,161,163,165 データ出力端子
[0001]
[Industrial application fields]
The present invention relates to an interrupt request circuit used for a microcomputer or the like and an interrupt request processing method indicated by the interrupt request circuit.
[0002]
[Prior art]
An interrupt request circuit used for a microcomputer or the like receives an interrupt request signal from a peripheral circuit having a predetermined function (for example, a counter, an A / D conversion circuit, etc.), and outputs an interrupt request corresponding to the received interrupt request signal The signal is output to a central processing unit (hereinafter referred to as CPU). The interrupt request circuit has a plurality of flip-flops set in response to an interrupt request signal output from a corresponding peripheral circuit. When the state of the flip-flop changes from the reset state to the set state, the CPU receives the output of the flip-flop that has changed to the set state as an interrupt request output signal. Then, the CPU performs an interrupt process related to the peripheral circuit corresponding to the flip-flop changed to the set state. Thereafter, the CPU performs a clear operation for returning the flip-flop in the set state to the reset state. By this clear operation, the interrupt request circuit indicates that the interrupt process has been completed. Therefore, the CPU can determine whether or not there is an interrupt request in the peripheral circuit by detecting the state of the interrupt request circuit. If there is an interrupt request, the CPU performs the above-described clear operation after executing the corresponding interrupt process.
[0003]
[Problems to be solved by the invention]
However, a plurality of interrupt requests may occur asynchronously with the operation of the CPU. Therefore, if the next interrupt request is generated while the CPU executes processing for the first interrupt request, the next interrupt request may be cleared simultaneously by the clear operation for the first interrupt request. That is, in the above-described interrupt request circuit, an interrupt request to the CPU may be ignored.
[0004]
[Means for Solving the Problems]
In order to solve the above problem, an interrupt request circuit of the present invention includes a data holding circuit that holds first data indicating that an interrupt request is generated in response to an interrupt request signal, The bus line to which the third data is applied, and the first data held between the bus line and the data holding circuit and held by the data holding circuit in response to the first data and the second data. A logic circuit that outputs data to be maintained and outputs data that clears the first data held by the data holding circuit in response to the first data and the third data is provided.
[0005]
According to the interrupt request processing method of the present invention, an interrupt request signal is supplied to a predetermined data holding circuit and the first data is stored in the data holding circuit, and the data holding circuit storing the first data has a first step. And the step of giving the first data to all the data holding circuits except the data holding circuit.
[0006]
[Action]
According to the present invention, among the data holding circuits storing data indicating that there is an interrupt request, the first data is given only to the data holding circuit for which the interrupt request is accepted, and the other data holding circuits are supplied with the first data. As a result, the data of the data holding circuit in which the interrupt request is not accepted is maintained without being cleared.
[0007]
【Example】
FIG. 1 is a diagram showing an embodiment of an interrupt request circuit according to the present invention.
[0008]
The configuration of an embodiment of the interrupt request circuit according to the present invention will be described below.
[0009]
The interrupt request circuit of the present invention includes flip-flops 101, 103, 105, 107 and 109 corresponding to the interrupt request input terminals 137, 139, 141, 143 and 145, and AND gates 111, 113, 115, 117 and 119, respectively. And have.
[0010]
The interrupt request input terminals 137 to 145 are terminals that receive an interrupt request signal from a circuit having an interrupt factor. For example, the interrupt request input terminal 137 is connected to an analog / digital conversion circuit (hereinafter referred to as an A / D conversion circuit), and receives an interrupt request signal from the A / D conversion circuit. The interrupt request input terminal 139 is connected to an input / output circuit (hereinafter referred to as an I / O circuit) and receives an interrupt request signal from the I / O circuit. Thus, each interrupt request input terminal receives an interrupt request signal from a dedicated circuit corresponding to each interrupt request input terminal.
[0011]
Data input terminals 147, 149, 151, and 153 correspond to the flip-flops 101, 103, 105, 107, and 109, respectively. The data input terminals 147 to 153 correspond to the data output terminals 157, 159, 161, 163, and 165, respectively. These data input terminals 147 to 153 are connected to bidirectional data lines together with corresponding data output terminals 157 to 165. For example, the data input terminal 147 is connected to the first bidirectional data line (not shown) together with the data output terminal 157. The data input terminal 149 is connected to a second bidirectional data line (not shown) together with the data output terminal 159. In the present embodiment, description will be made on the assumption that the data bus is composed of eight data lines. Therefore, in this embodiment, description will be made assuming that there are eight flip-flops, eight data input terminals, and eight data output terminals. In addition, each configuration corresponding to the flip-flop, for example, AND gates 111 to 119 will be described as eight. (For ease of explanation, in the drawing, only five flip-flops and respective components corresponding to the flip-flops are illustrated.)
The flip-flop 101 includes a set terminal connected to the interrupt request input terminal 137, a data input terminal D connected to the output terminal of the AND gate 111, and a data output terminal Q connected to one input terminal of the AND gate 111. A reset terminal R connected to the reset terminal 167, and a gate terminal G connected to the output terminal of the AND gate 121. The data output terminal Q of the flip-flop 101 is further connected to the gate circuit 125 and the interrupt request signal output circuit 135. Similarly to the flip-flop 101, each of the other flip-flops 103 to 109 also has corresponding interrupt request input terminals 139 to 145, AND gates 113 to 119, a reset terminal 167, an AND gate 121, gate circuits 127 to 133, and interrupt requests. The signal output circuit 135 is connected. These flip-flops have a function of holding data applied to the data input terminal D. Therefore, these flip-flops function as 8-bit registers or latch circuits. (Hereinafter, when these eight flip-flops are considered as one unit, the eight flip-flops are referred to as interrupt request registers.)
The gate circuits 125 to 133 are connected to the input terminal connected to the data output terminal Q of each corresponding flip-flop, the output terminal connected to each corresponding interrupt request output terminal 157 to 165, and the output terminal of the AND gate 123. Connected control terminals.
[0012]
The AND gate 121 receives a write address signal output from the address decoder and a write permission signal WR output from a central processing unit (hereinafter referred to as CPU), and outputs a write signal to each flip-flop.
[0013]
The AND gate 123 receives the read address signal output from the address decoder and the read permission signal RD output from the CPU, and outputs a read signal to each of the gate circuits 125 to 133.
[0014]
The interrupt request signal output circuit 135 detects a change in data appearing at the data output terminal Q of each flip-flop, and outputs an interrupt request output signal to the CPU.
[0015]
The circuit shown in FIG. 1 described above is a part of the system shown in FIG.
[0016]
The positioning of the interrupt request circuit of the present invention in the system shown in FIG. 2 and the system configuration will be described below.
[0017]
The interrupt request circuit of the present invention shown in FIG. 1 is a portion to which reference numeral 201 or 203 is given in FIG. In addition, the same code | symbol as the code | symbol provided in FIG. 1 is provided to the structure same as FIG.
[0018]
The interrupt request circuit 201 is connected to an 8-bit data bus 217 via an 8-bit bidirectional data bus 221. The eight data lines constituting the bidirectional data bus 221 are connected to data input terminals 147 to 155 in FIG. Further, these eight data lines are also connected to data output terminals 157 to 165, respectively.
[0019]
The A / D conversion circuit 209 outputs an interrupt request signal to the interrupt request circuit 201 when an interrupt factor occurs inside. The interrupt request signal output from the A / D conversion circuit 209 is applied to the interrupt request input terminal 137 in FIG.
[0020]
The I / O circuit 211 outputs an interrupt request signal to the interrupt request circuit 201 when an interrupt factor occurs inside. The interrupt request signal output from the I / O circuit 211 is applied to the interrupt request input terminal 139 in FIG.
[0021]
The I / O circuit 213 outputs an interrupt request signal to the interrupt request circuit 201 when an interrupt factor occurs inside. The interrupt request signal output from the I / O circuit 213 is applied to the interrupt request input terminal 141 in FIG.
[0022]
The random access memory circuit 215 (hereinafter referred to as RAM) outputs an interrupt request signal to the interrupt request circuit 203 when an interrupt factor occurs inside. The interrupt request circuit 203 has the same configuration as the interrupt request circuit 201. Therefore, the interrupt request signal output from the RAM 215 is applied to one of interrupt request input terminals in the interrupt request circuit 203 (not shown).
[0023]
The CPU 205 outputs a write permission signal WR and a read permission signal RD. The CPU 205 outputs an address signal for selecting one of the interrupt request circuits 201 and 203 to the address bus 219. Further, the CPU 205 receives the interrupt request output signals output from the interrupt request circuits 201 and 203 via the interrupt request output line 224. Further, the CPU 205 generates data for clearing the interrupt request indicated by the interrupt request circuits 201 and 203, and provides this data to the interrupt request circuits 201 and 203 via the data bus 217.
[0024]
The address decoder 207 decodes the address signal output from the CPU 205 and outputs a selection signal for selecting the interrupt request circuit 201 to the AND gates 123 and 121, or a selection signal for selecting the interrupt request circuit 203 to the AND gates 223 and 225. Output.
[0025]
The AND gate 123 inputs the read permission signal RD output from the CPU 205 and the selection signal for selecting the interrupt request circuit 201 output from the address decoder 207, and outputs a read signal to the interrupt request circuit 201.
[0026]
The AND gate 121 receives the write permission signal WR and the selection signal for selecting the interrupt request circuit 201 output from the address decoder 207, and outputs a write signal to the interrupt request circuit 201.
[0027]
Write and read signal output to the interrupt request circuit 203 are performed via AND gates 223 and 225. The operations of writing to the interrupt request circuit 203 and outputting a read signal are the same as the operations related to the interrupt request circuit 201.
[0028]
Next, the operation of the interrupt request circuit of the present invention shown in FIGS. 1 and 2 will be described with reference to the time chart of FIG. In the time chart of FIG. 3, time elapses from the left to the right of the page. The upper part of FIG. 3 is a diagram showing the contents of data held in the interrupt request register (the above-described eight flip-flops), and the lower part is a figure showing the contents held by the registers in the CPU. Has been placed.
[0029]
(Interrupt factor A occurs)
First, it is assumed that an interrupt request register composed of flip-flops is initialized by a reset signal supplied to the reset terminal 167. That is, each flip-flop outputs data 0 from each data output terminal Q. (Data 0 is, for example, 0V, and data 1 is, for example, 5V.)
Next, the A / D conversion circuit 209 generates an interrupt factor A for converting analog data given from the outside into digital data, for example. This interrupt factor A is given to the interrupt request input terminal 137 in the interrupt request circuit 201 as an interrupt request signal. Since the interrupt request signal applied to the interrupt request input terminal 137 is applied to the set terminal S of the flip-flop 101, the data output from the data output terminal Q of the flip-flop 101 changes from 0 to 1. Since there are no interrupt factors in the other peripheral circuits, the flip-flops 103 to 109 are not set. Therefore, the data output from the data output terminal Q of the flip-flops 103 to 109 is zero. As shown in the upper part of FIG. 3, the content of the interrupt request register is (10000000) as a result.
[0030]
(Interrupt request output signal generation)
When the data output terminal Q of the flip-flop 101 changes from 0 to 1, the interrupt request signal output circuit 135 detects this change and outputs an interrupt request output signal to the CPU 205. The CPU 205 recognizes that an interrupt factor has occurred in any of the circuits by receiving this interrupt request output signal. Next, the CPU 205 identifies a circuit in which an interrupt factor has occurred, and determines whether or not to accept the interrupt factor and when to accept it.
[0031]
(Reading data from the interrupt request register)
First, the CPU 205 outputs a read permission signal RD and an address signal for selecting the interrupt request circuit 201 to the address bus 219 in order to read the contents of the interrupt request register in the interrupt request circuit 201. The address decoder 207 decodes the address signal output from the CPU and outputs a selection signal for selecting the interrupt request circuit 201. The AND gate 123 outputs a read signal in response to the selection signal and the read permission signal RD. On the other hand, the AND gate 121 does not output the write signal because the write permission signal WR is not output. Since the CPU 205 does not select the interrupt request circuit 203, the AND gates 223 and 225 are in a disabled state.
[0032]
The gate circuits 125 to 133 are turned on in response to the read signal output from the AND gate 123, and the data output terminals Q of the flip-flops 101 to 109 and the data corresponding to the flip-flops 101 to 109, respectively. Electrical connection is established between the output terminals 157 to 165. Since the data output terminal Q of the flip-flop 101 outputs data 1, data 1 is given to the data output terminal 157, and the data output terminals Q of the other flip-flops 103 to 109 output data 0. Data 0 is applied to the output terminals 159 to 165. Each data applied to the data output terminals 157 to 165 is applied to the data bus 217 via the bidirectional data bus 221. The CPU 205 reads the 8-bit data supplied to the data bus 217 into a register in the CPU 205. Since the data bus 217 is now (10000000), the CPU 205 recognizes that the content of the interrupt request register in the interrupt request circuit 201 is (10000000). That is, the CPU 205 recognizes that the interrupt factor A has occurred in the A / D conversion circuit 209.
[0033]
The CPU 205 determines whether or not the interrupt factor A has priority over the main process that the CPU 205 is currently executing. If the interrupt factor A has a higher priority than the currently executed process, the CPU 205 immediately enters the process flow for converting analog data to digital data immediately after finishing the current process. . That is, the CPU 205 interrupts the A / D conversion process during the main process flow. Here, since the timing of executing the interrupt processing varies depending on the program, it may be after other processing is performed after an interrupt request is made. Here, the CPU 205 enters a flow in which A / D conversion processing is performed immediately after ending the current processing. The A / D conversion circuit 209 converts analog data given from a peripheral circuit (not shown) into digital data in accordance with an A / D conversion flow controlled by the CPU 205. The converted digital data is transferred to, for example, the RAM 215 via the data bus 217 in accordance with an instruction from the CPU 205.
[0034]
(Clear interrupt request register (when interrupt factor B has not occurred))
After completing the interrupt processing, the CPU 205 starts an operation of clearing the output of the flip-flop 101 corresponding to the interrupt factor A. First, the CPU 205 generates data (01111111) and writes the data (01111111) to an 8-bit register in the CPU. That is, the CPU 205 creates clear data in which only the bit corresponding to the interrupt factor A is data 0 and the other bits are data 1, and stores the clear data in a register in the CPU 205. Subsequently, the CPU 205 outputs this clear data to the data bus 217. Clear data applied to the data bus 217 is applied to the data input terminals 147 to 155 of the interrupt request circuit 201 via the bidirectional data bus 221. Since the flip-flop 101 is outputting data 1 and the flip-flops 103 to 109 are outputting data 0, only the AND gate 111 is open. Therefore, the data 0 given to the data input terminal 147 passes through the AND gate 111 and is given to the data input terminal D of the flip-flop 101. Since the AND gates 113 to 119 are all closed, the data input terminals D of the flip-flops 103 to 109 are given data 0 regardless of the data given to the data input terminals 149 to 155. Note that clear data is similarly applied to the interrupt request circuit 203. However, as will be described later, since the CPU 205 does not select the interrupt request circuit 203, the clear data does not affect the operation of the interrupt request circuit 203 at all.
[0035]
Subsequently, the CPU 205 outputs a write permission signal WR and outputs an address signal for selecting the interrupt request circuit 201 to the address bus 219 in order to clear data corresponding to the interrupt factor A in the interrupt request register. The address decoder 207 decodes the address signal output from the CPU and outputs a selection signal for selecting the interrupt request circuit 201. The AND gate 121 outputs a write signal in response to the selection signal and the write permission signal WR. On the other hand, the AND gate 123 does not output the read signal because the read permission signal RD is not output. Since the CPU 205 does not select the interrupt request circuit 203, the AND gates 223 and 225 are in a disabled state.
[0036]
When the write signal is applied to the gate terminals G of the flip-flops 101 to 109, the flip-flops 101 to 109 capture the data applied to the data input terminal D and output the captured data to the data output terminal Q. Here, since data 0 is given to the data input terminal D of the flip-flop 101, the flip-flop 101 outputs data 0 in response to the write signal given to the gate terminal G. Similarly, the other flip-flops 103 to 109 output data 0 in response to a write signal applied to each gate terminal G. As described above, the output of the interrupt request register in the interrupt request circuit 201 changes from (10000000) to (00000000). That is, the data corresponding to the interrupt factor A in the interrupt request register is cleared. The operation in the case where another interrupt factor has not occurred before clearing the interrupt register has been described above, but the operation in the case where another interrupt factor has occurred will be described below.
[0037]
(Interrupt factor B occurs)
Assume that after the occurrence of the interrupt factor A and before the data in the interrupt request register corresponding to the interrupt factor A is cleared, the I / O circuit 213 generates an interrupt factor B indicating that there is an abnormality inside. This interrupt factor B is given as an interrupt request signal to the interrupt request input terminal 141 in the interrupt request circuit 201. Since the interrupt request signal applied to the interrupt request input terminal 141 is applied to the set terminal S of the flip-flop 105, the data output from the data output terminal Q of the flip-flop 105 changes from 0 to 1. Since only the flip-flop 101 outputs data 1 due to the interrupt factor A generated in the A / D conversion circuit 209, the content of the interrupt request register is (10100000) as a result.
[0038]
(Interrupt request output signal generation)
When the data output terminal Q of the flip-flop 105 changes from 0 to 1, the interrupt request signal output circuit 135 detects this change and outputs an interrupt request output signal to the CPU 205. The CPU 205 recognizes that an interrupt factor has occurred in any of the circuits by receiving this interrupt request output signal. Next, the CPU 205 identifies a circuit in which an interrupt factor has occurred, and determines whether or not to accept the interrupt factor and when to accept it. Since the CPU 205 is about to clear the data in the interrupt request register corresponding to the interrupt factor A, this determination is made after clearing the data in the interrupt request register.
[0039]
(Clear interrupt request register)
After completing the interrupt processing related to the interrupt factor A, the CPU 205 starts an operation of clearing the output of the flip-flop 101 corresponding to the interrupt factor A. First, the CPU 205 generates data (01111111) and writes the data (01111111) to an 8-bit register in the CPU. That is, the CPU 205 creates clear data in which only the bit corresponding to the interrupt factor A is data 0 and the other bits are data 1, and stores the clear data in a register in the CPU 205. Subsequently, the CPU 205 outputs this clear data to the data bus 217. Clear data applied to the data bus 217 is applied to the data input terminals 147 to 155 of the interrupt request circuit 201 via the bidirectional data bus 221. Since the flip-flops 101 and 105 output data 1 and the flip-flops 103 and 107 to 109 output data 0, only the AND gates 111 and 115 are open. Therefore, the data 0 given to the data input terminal 147 passes through the AND gate 111 and is given to the data input terminal D of the flip-flop 101. The data 1 applied to the data input terminal 151 passes through the AND gate 115 and is applied to the data input terminal D of the flip-flop 105. Since the AND gates 113 and 117 to 119 are closed, data 0 is supplied to the data input terminals D of the flip-flops 103 and 107 to 109 regardless of the data supplied to the data input terminals 149 and 153 to 155. Note that clear data is similarly applied to the interrupt request circuit 203. However, as will be described later, since the CPU 205 does not select the interrupt request circuit 203, the clear data does not affect the operation of the interrupt request circuit 203 at all.
[0040]
Subsequently, the CPU 205 outputs a write permission signal WR and outputs an address signal for selecting the interrupt request circuit 201 to the address bus 219 in order to clear data corresponding to the interrupt factor A in the interrupt request register. The address decoder 207 decodes the address signal output from the CPU and outputs a selection signal for selecting the interrupt request circuit 201. The AND gate 121 outputs a write signal in response to the selection signal and the write permission signal WR. On the other hand, the AND gate 123 does not output the read signal because the read permission signal RD is not output. Since the CPU 205 does not select the interrupt request circuit 203, the AND gates 223 and 225 are in a disabled state.
[0041]
When the write signal is applied to the gate terminals G of the flip-flops 101 to 109, the flip-flops 101 to 109 capture the data applied to the data input terminal D and output the captured data to the data output terminal Q. Here, since data 0 is given to the data input terminal D of the flip-flop 101, the flip-flop 101 outputs data 0 in response to the write signal given to the gate terminal G. Further, since data 1 is given to the data input terminal D of the flip-flop 105, the flip-flop 105 outputs data 1 in response to the write signal given to the gate terminal G. The flip-flops 103 and 107 to 109 output data 0 in response to a write signal given to each gate terminal G. As described above, the output of the interrupt request register in the interrupt request circuit 201 changes from (10100000) to (00100000). That is, only the data corresponding to the interrupt factor A is cleared without clearing the data corresponding to the interrupt factor B of the interrupt request register.
[0042]
(Reading data from the interrupt request register)
Next, the CPU 205 accesses the interrupt request circuit 201 in order to identify the circuit in which the interrupt factor has occurred based on the interrupt request output signal output from the interrupt request circuit 201 previously. Then, the CPU 205 determines whether or not to accept the interrupt factor and when to accept it.
[0043]
First, the CPU 205 outputs a read permission signal RD and an address signal for selecting the interrupt request circuit 201 to the address bus 219 in order to read the contents of the interrupt request register in the interrupt request circuit 201. The address decoder 207 decodes the address signal output from the CPU and outputs a selection signal for selecting the interrupt request circuit 201. The AND gate 123 outputs a read signal in response to the selection signal and the read permission signal RD. On the other hand, the AND gate 121 does not output the write signal because the write permission signal WR is not output. Since the CPU 205 does not select the interrupt request circuit 203, the AND gates 223 and 225 are in a disabled state.
[0044]
The gate circuits 125 to 133 are turned on in response to the read signal output from the AND gate 123, and the data output terminals Q of the flip-flops 101 to 109 and the data corresponding to the flip-flops 101 to 109, respectively. Electrical connection is established between the output terminals 157 to 165. Since data output terminal Q of flip-flop 105 outputs data 1, data 1 is applied to data output terminal 161, and data output terminals Q of flip-flops 101, 103 and 107-109 output data 0. Therefore, data 0 is given to the data output terminals 157, 159 and 163 to 165.
[0045]
Each data applied to the data output terminals 157 to 165 is applied to the data bus 217 via the bidirectional data bus 221. The CPU 205 reads the 8-bit data supplied to the data bus 217 into a register in the CPU 205. Since the data bus 217 is now (00100000), the CPU 205 recognizes that the content of the interrupt request register in the interrupt request circuit 201 is (00100000). That is, the CPU 205 recognizes that an interrupt factor B is newly generated in the I / O circuit 213. The CPU 205 determines whether or not this interrupt factor B has priority over the process that the CPU 205 is currently executing. If this interrupt factor B has a higher priority than the currently executed process, the CPU 205 immediately enters the processing flow for the interrupt factor B. That is, the CPU 205 interrupts the processing related to the interrupt factor B during the main processing flow. Here, the processing related to the interrupt factor B is immediately executed.
[0046]
The CPU 205 determines that the I / O circuit 213 cannot be used due to an abnormality due to the interrupt factor B. Then, when an instruction to use the I / O circuit 211 is subsequently given, the CPU 205 performs processing flow change processing so that the I / O circuit 211 is used.
[0047]
(Clear interrupt request register)
Subsequently, the CPU 205 starts an operation of clearing the output of the flip-flop 105 corresponding to the interrupt factor B. First, the CPU 205 generates data (11011111) and writes the data (11011111) to an 8-bit register in the CPU. That is, the CPU 205 creates clear data in which only the bit corresponding to the interrupt factor B is data 0, and the other bits are data 1, and stores the clear data in a register in the CPU 205. Subsequently, the CPU 205 outputs this clear data to the data bus 217. Clear data applied to the data bus 217 is applied to the data input terminals 147 to 155 of the interrupt request circuit 201 via the bidirectional data bus 221. Since the flip-flop 105 outputs data 1 and the flip-flops 101, 103 and 107 to 109 output data 0, only the AND gate 115 is open. However, since data supplied to the data input terminal 151 is 0, data 0 is supplied to the data input terminal D of the flip-flop 105. Since the AND gates 111, 113 and 117 to 119 are closed, the data input terminals D of the flip-flops 101, 103 and 107 to 109 are independent of the data given to the data input terminals 147, 149 and 153 to 155. Data 0 is given. Note that clear data is similarly applied to the interrupt request circuit 203. However, since the CPU 205 does not select the interrupt request circuit 203, this clear data does not affect the operation of the interrupt request circuit 203 at all.
[0048]
Subsequently, the CPU 205 outputs a write permission signal WR and outputs an address signal for selecting the interrupt request circuit 201 to the address bus 219 in order to clear data corresponding to the interrupt factor B in the interrupt request register. The address decoder 207 decodes the address signal output from the CPU and outputs a selection signal for selecting the interrupt request circuit 201. The AND gate 121 outputs a write signal in response to the selection signal and the write permission signal WR. On the other hand, the AND gate 123 does not output the read signal because the read permission signal RD is not output. Since the CPU 205 does not select the interrupt request circuit 203, the AND gates 223 and 225 are in a disabled state.
[0049]
When the write signal is applied to the gate terminals G of the flip-flops 101 to 109, the flip-flops 101 to 109 capture the data applied to the data input terminal D and output the captured data to the data output terminal Q. Here, since data 0 is given to the data input terminals D of all the flip-flops 101 to 109, each flip-flop 101 to 109 receives data 0 in response to a write signal given to each gate terminal G. Output.
[0050]
As described above, the output of the interrupt request register in the interrupt request circuit 201 changes from (00100000) to (00000000). That is, the data corresponding to the interrupt factor B in the interrupt request register is cleared.
[0051]
At this time, the outputs of the interrupt request registers all become 0, so the CPU 205 determines that there is no interrupt request from the peripheral circuit. Therefore, the CPU 205 returns to the interrupted main processing flow.
[0052]
According to the embodiment of the present invention described above, there are the following advantages.
[0053]
A plurality of interrupt requests to the CPU are generated asynchronously with the operation of the CPU. However, according to the present invention, even when the interrupt factor B is newly generated from another peripheral circuit while the CPU is performing the interrupt processing related to the interrupt factor A as described above, The corresponding flip-flop output is not cleared. Therefore, the CPU can recognize that the interrupt factor B is generated even after the clear operation related to the interrupt factor A is completed. Therefore, the interrupt process related to the interrupt factor B is executed without being ignored.
[0054]
In the clear data configuration according to the present invention, the first data given to the flip-flop corresponding to the interrupt factor to be cleared, the other flip-flop, that is, the flip-flop corresponding to the other interrupt factor and the interrupt factor are generated. The second data is uniformly given to the non-flip-flops. Therefore, the clear data generated by the CPU can be generated only by changing only one bit of the plurality of bits constituted by the second data to the first data. Therefore, the time required for generating the clear data is very short, and the operation speed of the CPU is not reduced by generating the clear data.
[0055]
According to the present invention, the clear operation of the interrupt request (output of the interrupt request register) indicated by the interrupt request circuit is executed by the data transferred to the data bus. That is, according to the present invention, a dedicated circuit such as an interrupt clear selector for selectively clearing only the flip-flop corresponding to the generated interrupt factor is not required. Therefore, interrupt processing can be executed reliably without increasing the circuit scale of the entire system.
[0056]
Next, the configuration of another embodiment of the interrupt request circuit of the present invention will be described.
[0057]
FIG. 4 is a diagram showing the configuration of another embodiment of the interrupt request circuit of the present invention. In FIG. 4, the same components as those in FIG.
[0058]
The difference between the interrupt request circuit shown in FIG. 4 and the interrupt request circuit shown in FIG. 1 is that the interrupt request input terminals 137 to 145 are connected to the reset terminals R of the flip-flops 101 to 109, respectively. Are connected to the set terminals S of the flip-flops 101 to 109, and OR gates 401 to 409 are connected to the data terminals D of the flip-flops 101 to 109, respectively. Other configurations are the same as those in FIG. Also, the positioning of the interrupt request circuit of FIG. 4 in the system of FIG. 2 is the same as the relationship between FIG. 1 and FIG.
[0059]
Next, the operation of the interrupt request circuit of the present invention shown in FIG. 4 will be described with reference to the time chart of FIG. The difference between the operation of the interrupt request circuit shown in FIG. 4 and the operation of the interrupt request circuit shown in FIG. 1 is that the data output terminal Q of the flip-flop outputs data 0 when an interrupt factor occurs in the peripheral circuit. .
[0060]
(Interrupt factor A occurs)
First, it is assumed that an interrupt request register composed of flip-flops is initialized by a reset signal supplied to the reset terminal 167. That is, each flip-flop outputs data 1 from each data output terminal Q. (Data 0 is, for example, 0V, and data 1 is, for example, 5V.)
Next, the A / D conversion circuit 209 generates an interrupt factor A for converting analog data given from the outside into digital data, for example. This interrupt factor A is given to the interrupt request input terminal 137 in the interrupt request circuit 201 as an interrupt request signal. Since the interrupt request signal applied to the interrupt request input terminal 137 is applied to the reset terminal R of the flip-flop 101, the data output from the data output terminal Q of the flip-flop 101 changes from 1 to 0. Since there are no interrupt factors in the other peripheral circuits, the flip-flops 103 to 109 are not reset. Therefore, the data output from the data output terminal Q of the flip-flops 103 to 109 remains at 1. As shown in the upper part of FIG. 5, the content of the interrupt request register is (01111111) as a result.
[0061]
(Interrupt request output signal generation)
When the data output terminal Q of the flip-flop 101 changes from 1 to 0, the interrupt request signal output circuit 135 detects this change and outputs an interrupt request output signal to the CPU 205. The CPU 205 recognizes that an interrupt factor has occurred in any of the circuits by receiving this interrupt request output signal. Next, the CPU 205 identifies a circuit in which an interrupt factor has occurred, and determines whether or not to accept the interrupt factor and when to accept it.
[0062]
(Reading data from the interrupt request register)
First, the CPU 205 outputs a read permission signal RD and an address signal for selecting the interrupt request circuit 201 to the address bus 219 in order to read the contents of the interrupt request register in the interrupt request circuit 201. The address decoder 207 decodes the address signal output from the CPU and outputs a selection signal for selecting the interrupt request circuit 201. The AND gate 123 outputs a read signal in response to the selection signal and the read permission signal RD. On the other hand, the AND gate 121 does not output the write signal because the write permission signal WR is not output. Since the CPU 205 does not select the interrupt request circuit 203, the AND gates 223 and 225 are in a disabled state.
[0063]
The gate circuits 125 to 133 are turned on in response to the read signal output from the AND gate 123, and the data output terminals Q of the flip-flops 101 to 109 and the data corresponding to the flip-flops 101 to 109, respectively. Electrical connection is established between the output terminals 157 to 165. Since the data output terminal Q of the flip-flop 101 outputs data 0, data 0 is given to the data output terminal 157, and the data output terminals Q of the other flip-flops 103 to 109 output data 1, so that data Data 1 is applied to the output terminals 159 to 165. Each data applied to the data output terminals 157 to 165 is applied to the data bus 217 via the bidirectional data bus 221. The CPU 205 reads the 8-bit data supplied to the data bus 217 into a register in the CPU 205. Since the data bus 217 is now (01111111), the CPU 205 recognizes that the content of the interrupt request register in the interrupt request circuit 201 is (01111111). That is, the CPU 205 recognizes that the interrupt factor A has occurred in the A / D conversion circuit 209.
[0064]
The CPU 205 determines whether or not the interrupt factor A has priority over the main process that the CPU 205 is currently executing. If the interrupt factor A has a higher priority than the currently executed process, the CPU 205 immediately enters the process flow for converting analog data to digital data immediately after finishing the current process. . That is, the CPU 205 interrupts the A / D conversion process during the main process flow. Here, since the timing of executing the interrupt processing varies depending on the program, it may be after other processing is performed after an interrupt request is made. Here, the CPU 205 enters a flow in which A / D conversion processing is performed immediately after ending the current processing. The A / D conversion circuit 209 converts analog data given from a peripheral circuit (not shown) into digital data in accordance with an A / D conversion flow controlled by the CPU 205. The converted digital data is transferred to, for example, the RAM 215 via the data bus 217 in accordance with an instruction from the CPU 205.
[0065]
(Clear interrupt request register (when interrupt factor B has not occurred))
After completing the interrupt processing, the CPU 205 starts an operation of clearing the output of the flip-flop 101 corresponding to the interrupt factor A. First, the CPU 205 generates data (10000000) and writes the data (10000000) to an 8-bit register in the CPU. That is, the CPU 205 creates clear data in which only the bit corresponding to the interrupt factor A is data 1 and the other bits are data 0, and stores the clear data in a register in the CPU 205. Subsequently, the CPU 205 outputs this clear data to the data bus 217. Clear data applied to the data bus 217 is applied to the data input terminals 147 to 155 of the interrupt request circuit 201 via the bidirectional data bus 221. Now, since the flip-flop 101 is outputting data 0, the data 1 given to the data input terminal 147 passes through the OR gate 401 and is given to the data input terminal D of the flip-flop 101. Since the flip-flops 103 to 109 output the data 1, the data 0 given to the data input terminals 149 to 155 passes through the OR gates 403 to 409 and is given to the data input terminals D of the flip-flops 103 to 109. It is done. Note that clear data is similarly applied to the interrupt request circuit 203. However, as will be described later, since the CPU 205 does not select the interrupt request circuit 203, the clear data does not affect the operation of the interrupt request circuit 203 at all.
[0066]
Subsequently, the CPU 205 outputs a write permission signal WR and outputs an address signal for selecting the interrupt request circuit 201 to the address bus 219 in order to clear data corresponding to the interrupt factor A in the interrupt request register. The address decoder 207 decodes the address signal output from the CPU and outputs a selection signal for selecting the interrupt request circuit 201. The AND gate 121 outputs a write signal in response to the selection signal and the write permission signal WR. On the other hand, the AND gate 123 does not output the read signal because the read permission signal RD is not output. Since the CPU 205 does not select the interrupt request circuit 203, the AND gates 223 and 225 are in a disabled state.
[0067]
When the write signal is applied to the gate terminals G of the flip-flops 101 to 109, the flip-flops 101 to 109 capture the data applied to the data input terminal D and output the captured data to the data output terminal Q. Here, since data 1 is given to the data input terminal D of the flip-flop 101, the flip-flop 101 outputs data 1 in response to the write signal given to the gate terminal G. Similarly, the other flip-flops 103 to 109 output data 1 in response to a write signal applied to each gate terminal G. As described above, the output of the interrupt request register in the interrupt request circuit 201 changes from (01111111) to (11111111). That is, the data corresponding to the interrupt factor A in the interrupt request register is cleared. The operation in the case where another interrupt factor has not occurred before clearing the interrupt register has been described above, but the operation in the case where another interrupt factor has occurred will be described below.
[0068]
(Interrupt factor B occurs)
Assume that after the occurrence of the interrupt factor A and before the data in the interrupt request register corresponding to the interrupt factor A is cleared, the I / O circuit 213 generates an interrupt factor B indicating that there is an abnormality inside. This interrupt factor B is given as an interrupt request signal to the interrupt request input terminal 141 in the interrupt request circuit 201. Since the interrupt request signal applied to the interrupt request input terminal 141 is applied to the reset terminal R of the flip-flop 105, the data output from the data output terminal Q of the flip-flop 105 changes from 1 to 0. Since only the flip-flop 101 outputs data 0 due to the interrupt factor A generated in the A / D conversion circuit 209, the content of the interrupt request register is (01011111) as a result.
[0069]
(Interrupt request output signal generation)
When the data output terminal Q of the flip-flop 105 changes from 1 to 0, the interrupt request signal output circuit 135 detects this change and outputs an interrupt request output signal to the CPU 205. The CPU 205 recognizes that an interrupt factor has occurred in any of the circuits by receiving this interrupt request output signal. Next, the CPU 205 identifies a circuit in which an interrupt factor has occurred, and determines whether or not to accept the interrupt factor and when to accept it. Since the CPU 205 is about to clear the data in the interrupt request register corresponding to the interrupt factor A, this determination is made after clearing the data in the interrupt request register.
[0070]
(Clear interrupt request register)
After completing the interrupt processing related to the interrupt factor A, the CPU 205 starts an operation of clearing the output of the flip-flop 101 corresponding to the interrupt factor A. First, the CPU 205 generates data (10000000) and writes the data (10000000) to an 8-bit register in the CPU. That is, the CPU 205 creates clear data in which only the bit corresponding to the interrupt factor A is data 1 and the other bits are data 0, and stores the clear data in a register in the CPU 205. Subsequently, the CPU 205 outputs this clear data to the data bus 217. Clear data applied to the data bus 217 is applied to the data input terminals 147 to 155 of the interrupt request circuit 201 via the bidirectional data bus 221. Since the flip-flop 101 is outputting data 0 now, data 1 is given to the data input terminal D of the flip-flop 101. Similarly, the flip-flop 105 outputs data 0, but since data 0 is given to the data input terminal 151, data 0 is given to the data input terminal D of the flip-flop 105. Since the flip-flops 103 and 107 to 109 output the data 1, the data input terminal D of the flip-flops 103 and 107 to 109 has the data 1 regardless of the data given to the data input terminals 149 and 153 to 155. Given. Note that clear data is similarly applied to the interrupt request circuit 203. However, as will be described later, since the CPU 205 does not select the interrupt request circuit 203, the clear data does not affect the operation of the interrupt request circuit 203 at all.
[0071]
Subsequently, the CPU 205 outputs a write permission signal WR and outputs an address signal for selecting the interrupt request circuit 201 to the address bus 219 in order to clear data corresponding to the interrupt factor A in the interrupt request register. The address decoder 207 decodes the address signal output from the CPU and outputs a selection signal for selecting the interrupt request circuit 201. The AND gate 121 outputs a write signal in response to the selection signal and the write permission signal WR. On the other hand, the AND gate 123 does not output the read signal because the read permission signal RD is not output. Since the CPU 205 does not select the interrupt request circuit 203, the AND gates 223 and 225 are in a disabled state.
[0072]
When the write signal is applied to the gate terminals G of the flip-flops 101 to 109, the flip-flops 101 to 109 capture the data applied to the data input terminal D and output the captured data to the data output terminal Q. Here, since data 1 is given to the data input terminal D of the flip-flop 101, the flip-flop 101 outputs data 1 in response to the write signal given to the gate terminal G. Since data 0 is applied to the data input terminal D of the flip-flop 105, the flip-flop 105 outputs data 0 in response to the write signal applied to the gate terminal G. The flip-flops 103 and 107 to 109 output data 1 in response to a write signal given to each gate terminal G. As described above, the output of the interrupt request register in the interrupt request circuit 201 changes from (0101111) to (11011111). That is, only the data corresponding to the interrupt factor A is cleared without clearing the data corresponding to the interrupt factor B of the interrupt request register.
[0073]
(Reading data from the interrupt request register)
Next, the CPU 205 accesses the interrupt request circuit 201 in order to identify the circuit in which the interrupt factor has occurred based on the interrupt request output signal output from the interrupt request circuit 201 previously. Then, the CPU 205 determines whether or not to accept the interrupt factor and when to accept it.
[0074]
First, the CPU 205 outputs a read permission signal RD and an address signal for selecting the interrupt request circuit 201 to the address bus 219 in order to read the contents of the interrupt request register in the interrupt request circuit 201. The address decoder 207 decodes the address signal output from the CPU and outputs a selection signal for selecting the interrupt request circuit 201. The AND gate 123 outputs a read signal in response to the selection signal and the read permission signal RD. On the other hand, the AND gate 121 does not output the write signal because the write permission signal WR is not output. Since the CPU 205 does not select the interrupt request circuit 203, the AND gates 223 and 225 are in a disabled state.
[0075]
The gate circuits 125 to 133 are turned on in response to the read signal output from the AND gate 123, and the data output terminals Q of the flip-flops 101 to 109 and the data corresponding to the flip-flops 101 to 109, respectively. Electrical connection is established between the output terminals 157 to 165. Since data output terminal Q of flip-flop 105 outputs data 0, data 0 is applied to data output terminal 161, and data output terminals Q of flip-flops 101, 103 and 107-109 output data 1. Therefore, data 1 is supplied to the data output terminals 157, 159 and 163 to 165.
[0076]
Each data applied to the data output terminals 157 to 165 is applied to the data bus 217 via the bidirectional data bus 221. The CPU 205 reads the 8-bit data supplied to the data bus 217 into a register in the CPU 205. Since the data bus 217 is now (11011111), the CPU 205 recognizes that the content of the interrupt request register in the interrupt request circuit 201 is (11011111). That is, the CPU 205 recognizes that an interrupt factor B is newly generated in the I / O circuit 213. The CPU 205 determines whether or not this interrupt factor B has priority over the process that the CPU 205 is currently executing. If this interrupt factor B has a higher priority than the currently executed process, the CPU 205 immediately enters the processing flow for the interrupt factor B. That is, the CPU 205 interrupts the processing related to the interrupt factor B during the main processing flow. Here, the processing related to the interrupt factor B is immediately executed.
[0077]
The CPU 205 determines that the I / O circuit 213 cannot be used due to an abnormality due to the interrupt factor B. Then, when an instruction to use the I / O circuit 211 is subsequently given, the CPU 205 performs processing flow change processing so that the I / O circuit 211 is used.
[0078]
(Clear interrupt request register)
Subsequently, the CPU 205 starts an operation of clearing the output of the flip-flop 105 corresponding to the interrupt factor B. First, the CPU 205 generates data (00100000) and writes the data (00100000) to an 8-bit register in the CPU. That is, the CPU 205 creates clear data in which only the bit corresponding to the interrupt factor B is data 1 and the other bits are data 0, and stores the clear data in a register in the CPU 205. Subsequently, the CPU 205 outputs this clear data to the data bus 217. Clear data applied to the data bus 217 is applied to the data input terminals 147 to 155 of the interrupt request circuit 201 via the bidirectional data bus 221. Now, since the flip-flop 105 is outputting data 0, data 1 is given to the data input terminal D of the flip-flop 101 via the OR gate 405. Since the flip-flops 101, 103, and 107 to 109 output data 1, the data input terminals 147, 149, and 153 to 155 are supplied to the data input terminal D of the flip-flops 101, 103, and 107 to 109, respectively. Regardless, data 1 is given. Note that clear data is similarly applied to the interrupt request circuit 203. However, as will be described later, since the CPU 205 does not select the interrupt request circuit 203, the clear data does not affect the operation of the interrupt request circuit 203 at all.
[0079]
Subsequently, the CPU 205 outputs a write permission signal WR and outputs an address signal for selecting the interrupt request circuit 201 to the address bus 219 in order to clear data corresponding to the interrupt factor B in the interrupt request register. The address decoder 207 decodes the address signal output from the CPU and outputs a selection signal for selecting the interrupt request circuit 201. The AND gate 121 outputs a write signal in response to the selection signal and the write permission signal WR. On the other hand, the AND gate 123 does not output the read signal because the read permission signal RD is not output. Since the CPU 205 does not select the interrupt request circuit 203, the AND gates 223 and 225 are in a disabled state.
[0080]
When the write signal is applied to the gate terminals G of the flip-flops 101 to 109, the flip-flops 101 to 109 capture the data applied to the data input terminal D and output the captured data to the data output terminal Q. Here, since data 1 is given to the data input terminals D of all flip-flops 101 to 109, each flip-flop 101 to 109 receives data 1 in response to a write signal given to each gate terminal G. Output.
[0081]
As described above, the output of the interrupt request register in the interrupt request circuit 201 changes from (11011111) to (11111111). That is, the data corresponding to the interrupt factor B in the interrupt request register is cleared.
[0082]
Since all outputs of the interrupt request register are 1 at this time, the CPU 205 determines that there is no interrupt request from the peripheral circuit. Therefore, the CPU 205 returns to the interrupted main processing flow.
[0083]
As described above, the interrupt request circuit using the OR gate shown in FIG. 4 is a circuit indicating that an interrupt request is generated when the data output from the data output terminal Q of each flip-flop is 0. On the other hand, the interrupt request circuit using an AND gate shown in FIG. 1 is a circuit indicating that an interrupt request has occurred when the data output from the data output terminal Q of each flip-flop is 1. Since the operations of these two interrupt request circuits are basically the same, the designer can select either one of them when developing a system (program) such as a microcomputer. That is, by providing two types of interrupt request circuits, it is possible to design in consideration of the characteristics of the entire system such as a microcomputer.
[0084]
Next, a modification of the interrupt request circuit shown in FIG. 1 will be described with reference to FIG.
[0085]
The circuit shown in FIG. 6 is a flip-flop that incorporates an AND gate. That is, the flip-flop shown in FIG. 6 is a circuit in which the AND gate connected to the preceding stage of each flip-flop shown in FIG. 1 is omitted.
[0086]
However, the write signal G shown in FIG. 1 uses a complementary signal in FIG. 6 (for example, the write signal G is generated by inverting the write signal G with an inverter) and applied to the data output terminal Q. The output signal also uses a complementary signal.
[0087]
Further, in FIG. 6, a reset terminal inversion R corresponding to the reset terminal R of each flip-flop shown in FIG. 1 is used.
[0088]
The flip-flop circuit of FIG. 6 includes transistors M1 and M2, and includes a transfer gate 601 that transfers data applied to a data input terminal D in response to a write signal G (write signal inversion G), and transistors M3 and M4. A transfer gate 603 configured to transfer data applied to the data output terminal Q in response to the write signal G (write signal inversion G); transistors M10 and M12 to which a reset signal applied to the reset terminal inversion R is applied; It has transistors M5 and M11 to which a set signal applied to the set terminal S is applied. Further, the flip-flop circuit includes transistors M13 and M14, an inverter 605 whose input terminal is connected to the data output terminal inversion Q, and whose output terminal is connected to the data output terminal Q, and the data supplied to the data output terminal Q. Transistors M7 and M8 and transistors M6 and M9 to which outputs of the transfer gate 601 and the transfer gate 603 are applied.
[0089]
Next, the operation of the flip-flop circuit shown in FIG. 6 will be described.
[0090]
(Reset operation)
When an “L” level reset signal is applied to the reset terminal inversion R, the transistor M10 is turned on, so that the power supply potential (“H” level) is applied to the data output terminal inversion Q. When the data output terminal inversion Q becomes “H” level, the output of the inverter 605 becomes “L” level. On the other hand, since the transistor M12 is turned off, the path between the ground potential (“L” level) and the data output terminal inversion Q is electrically cut off. In this way, the data output terminal Q becomes “L” level and the flip-flop circuit is reset.
[0091]
(Operation that receives an interrupt request)
Next, an operation for receiving an interrupt request, that is, a set operation will be described.
[0092]
When an “H” level interrupt request signal is applied to the set terminal S, the transistor M11 is turned on, so that the drain potential of the transistor M12 is applied to the data output terminal inversion Q. At this time, if the reset terminal inversion R is at the “H” level, that is, if the reset operation is not being performed, the transistor M12 is on, so the drain potential of the transistor M12 is at the “L” level. Therefore, the data output terminal inversion Q becomes “L” level. The inverter 605 inverts the “L” level given to the data output terminal inversion Q and sets the data output terminal Q to the “H” level.
[0093]
On the other hand, since the transistor M5 is turned off, the path between the power supply potential and the data output terminal inversion Q is electrically cut off. If the reset operation is not being performed, the transistor M10 is turned off, so that any path between the power supply potential and the data output terminal inversion Q is electrically cut off.
[0094]
In this way, the data output terminal Q becomes “H” level and the flip-flop circuit is set. Therefore, this flip-flop circuit indicates that an interrupt request is generated in the peripheral circuit connected to this flip-flop circuit.
[0095]
(Operation to clear interrupt request)
Next, an operation to clear the interrupt request (data write operation), that is, an operation to transmit the data given to the data terminal D to the data output terminal Q and the inversion Q or hold the data given to the data output terminal Q and the inversion Q The operation to be performed will be described.
[0096]
First, the data when the data output terminal Q and the data output terminal inversion Q are at the “L” level and “H” level, respectively, that is, when no interrupt request is generated in the peripheral circuit connected to the flip-flop circuit. A write operation will be described.
[0097]
When the data output terminal Q is at the “L” level, the transistor M7 is turned on and the transistor M8 is turned off. At this time, if the set terminal S is at the “L” level (not in the set operation) and the reset terminal inversion R is at the “H” level (not in the reset operation), the transistor M5 is turned on, so the data output terminal The inversion Q becomes “H” level. The transistors M10 and M11 are off and the transistor M12 is on. Therefore, the “H” level is not transmitted through the transistor M10. Further, since the transistors M8 and M11 are off, the path between the ground potential and the data output terminal inversion Q is cut off, and the “L” level is not transmitted to the data output terminal inversion Q.
[0098]
Here, if the write signal G is at “L” level (the write signal inversion G is at “H” level), the transfer gate 601 is turned off and the transfer gate 603 is turned on. The L ″ level is transferred to the gates of the transistors M6 and M9. Then, in addition to the transistor M7 that has been turned on, the transistor M6 is also turned on, and the power supply potential is applied to the data output terminal inversion Q through the transistor M6.
[0099]
Next, when the write signal G changes to “H” level (the write signal inversion G is “L” level), the transfer gate 601 is turned on and the transfer gate 603 is turned off, so that the data input terminal D is now turned on. The given data is transferred to the gates of the transistors M6 and M9. Here, assuming that the data applied to the data input terminal D is at “L” level, the transistors M6 and M9 are in the previous state, that is, the write signal G is at “L” level (the write signal inversion G is at “H” level). It is the same as when it was. Therefore, the state of the data output terminal Q and the inversion Q does not change. (The flip-flop that was originally in the reset state does not change even if data 0 is written.)
On the other hand, if the data applied to the data input terminal D is at “H” level, the transistor M6 is turned off and the transistor M9 is turned on. However, since the transistor M8 is off, the “L” level is not transmitted to the data output terminal inversion Q even if the ground potential is transmitted to the drain of the transistor M9. Therefore, the state of the data output terminal Q and the inversion Q does not change.
[0100]
As described above, in the flip-flop circuit, when the data applied to the data output terminal Q is 0 and the data applied to the data output terminal inversion Q is 1, the data output terminal Q and the data output terminal inversion Q This is a circuit in which the data given to is not changed by the data given to the data input terminal D. That is, this flip-flop circuit is a circuit to which data 1 given from the outside is not written.
[0101]
Next, when the state of the data output terminal Q and the data output terminal inversion Q is “H” level and “L” level, respectively, that is, when an interrupt request is generated in the peripheral circuit connected to the flip-flop circuit. A data write operation will be described.
[0102]
When the data output terminal Q is at “H” level, the transistor M7 is turned off and the transistor M8 is turned on. Here, if the write signal G is at “L” level (the write signal inversion G is at “H” level), the transfer gate 601 is turned off and the transfer gate 603 is turned on. The H ″ level is transferred to the gates of the transistors M6 and M9. Then, the transistor M6 is turned off and the transistor M9 is turned on. At this time, if the set terminal S is at the “L” level (not in the set operation) and the reset terminal inversion R is at the “H” level (not in the reset operation), the transistors M5 and M12 are turned on. M10 and M11 are turned off. Therefore, the “L” level is transmitted to the data output terminal inversion Q through the transistors M8, M9, and M12. The “L” level applied to the data output terminal inversion Q is inverted by the inverter 605 and applied to the data output terminal Q. That is, the flip-flop circuit holds data 1.
[0103]
Next, when the write signal G changes to “H” level (the write signal inversion G is “L” level), the transfer gate 601 is turned on and the transfer gate 603 is turned off, so that the data input terminal D is now turned on. The given data is transferred to the gates of the transistors M6 and M9. Here, when the data applied to the data input terminal D is at “L” level, the transistor M6 changes from OFF to ON, and the transistor M9 changes from ON to OFF. Therefore, the power supply potential is transmitted to the data output terminal inversion Q through the transistors M5 and M6. The inverter 605 inverts the level of the data output terminal inversion Q and sets the data output terminal Q to the “L” level. Since the transistor M9 is turned off, the path between the ground potential and the data output terminal inversion Q is electrically cut off.
[0104]
On the other hand, if the data applied to the data input terminal D is at “H” level, the transistor M6 is turned off and the transistor M9 is turned on. That is, the states of the transistors M6 and M9 are the same as when the write signal G is at the “L” level (the write signal inversion G is at the “H” level). Therefore, the state of the data output terminal Q and the inversion Q does not change. (The flip-flop that was originally in the set state does not change even if data 1 is written.)
In this way, this flip-flop circuit is only provided by giving 0 to the data input terminal D when the data given to the data output terminal Q is 1 and the data given to the data output terminal inversion Q is 0. The circuit can change the state of the data output terminal Q.
[0105]
Based on the above write operation, data 0 is written only to the flip-flop circuit to be cleared, and data 1 is written to the flip-flop circuit that is not to be cleared, thereby clearing the interrupt request for only the flip-flop circuit to be cleared. The action can be performed.
[0106]
The flip-flop circuit shown in FIG. 6 can realize the same operation as the circuit composed of the flip-flop and the AND gate shown in FIG. 1 by adding the transistors M7 and M8. Specifically, the flip-flop circuit shown in FIG. 6 can reduce the number of MOS transistors by four compared with the circuit of FIG. 1 in order to realize the same operation as the circuit of FIG. Therefore, an interrupt request circuit having a small circuit area can be provided when integrated into an IC.
[0107]
Next, a modification of the interrupt request circuit shown in FIG. 4 will be described with reference to FIG.
[0108]
The circuit shown in FIG. 7 is a flip-flop in which an OR gate is incorporated. That is, the flip-flop shown in FIG. 7 is a circuit in which the OR gate connected to the preceding stage of each flip-flop shown in FIG. 4 is omitted.
[0109]
However, the write signal G shown in FIG. 4 uses a complementary signal in FIG. 7 (for example, the write signal G is inverted by inverting the write signal G with an inverter), and is applied to the data output terminal Q. The output signal also uses a complementary signal.
[0110]
In FIG. 7, the reset terminal inversion R corresponding to the reset terminal R of each flip-flop shown in FIG. 4 is used.
[0111]
The difference in configuration between the flip-flop circuit shown in FIG. 7 and the flip-flop circuit shown in FIG. 6 is only the connection relationship between the transistors M7 and M8. In the flip-flop circuit shown in FIG. 6, the transistor M6 and the transistor M7 are connected in parallel, whereas in the flip-flop circuit shown in FIG. 7, they are connected in series. In the flip-flop circuit shown in FIG. 6, the transistors M8 and M9 are connected in series, whereas in the flip-flop circuit shown in FIG. 7, they are connected in parallel.
[0112]
Next, the operation of the flip-flop circuit shown in FIG. 7 will be described.
[0113]
The reset operation and set operation of this flip-flop circuit are the same as those of the flip-flop circuit shown in FIG.
[0114]
(Operation to clear interrupt request)
Next, an operation to clear the interrupt request (data write operation), that is, an operation to transmit the data given to the data terminal D to the data output terminal Q and the inversion Q or hold the data given to the data output terminal Q and the inversion Q The operation to be performed will be described.
[0115]
First, data when the data output terminal Q and the data output terminal inversion Q are at the “L” level and “H” level, respectively, that is, when an interrupt request is generated in the peripheral circuit connected to the flip-flop circuit. A write operation will be described.
[0116]
When the data output terminal Q is at the “L” level, the transistor M7 is turned on and the transistor M8 is turned off. Here, if the write signal G is at “L” level (the write signal inversion G is at “H” level), the transfer gate 601 is turned off and the transfer gate 603 is turned on. The L ″ level is transferred to the gates of the transistors M6 and M9, the transistor M6 is turned on, and the transistor M9 is turned off. At this time, if the set terminal S is at the “L” level (not in the set operation) and the reset terminal inversion R is in the “H” level (not in the reset operation), the transistor M5 is turned on. Therefore, the data output terminal inversion Q becomes “H” level through the transistors M5, M6, and M7. This “H” level applied to the data output terminal inversion Q is inverted by the inverter 605 and applied to the data output terminal Q. The transistors M10 and M11 are off and the transistor M12 is on. Accordingly, the “H” level is not transmitted to the data output terminal inversion Q through the transistor M10. Further, since the transistors M8 and M11 are off, the path between the ground potential and the data output terminal inversion Q is cut off, and the “L” level is not transmitted to the data output terminal inversion Q.
[0117]
Next, when the write signal G changes to “H” level (the write signal inversion G is “L” level), the transfer gate 601 is turned on and the transfer gate 603 is turned off, so that the data input terminal D is now turned on. The given data is transferred to the gates of the transistors M6 and M9. Here, assuming that the data applied to the data input terminal D is at “L” level, the transistors M6 and M9 are in the previous state, that is, the write signal G is at “L” level (the write signal inversion G is at “H” level). It is the same as when it was. Therefore, the state of the data output terminal Q and the inversion Q does not change.
[0118]
On the other hand, if the data applied to the data input terminal D is at “H” level, the transistor M6 is turned off and the transistor M9 is turned on. Accordingly, the “L” level is transmitted to the data output terminal inversion Q through the transistors M9 and M12. The inverter 605 inverts the “L” level given to the data output terminal inversion Q and sets the data output terminal Q to the “H” level.
[0119]
Next, when the data output terminal Q and the data output terminal inversion Q are at the “H” level and “L” level, respectively, that is, when an interrupt request is not generated in the peripheral circuit connected to the flip-flop circuit. A data write operation will be described.
[0120]
When the data output terminal Q is at “H” level, the transistor M7 is turned off and the transistor M8 is turned on. Here, if the write signal G is at “L” level (the write signal inversion G is at “H” level), the transfer gate 601 is turned off and the transfer gate 603 is turned on. The H ″ level is transferred to the gates of the transistors M6 and M9, the transistor M6 is turned off, and the transistor M9 is turned on. At this time, if the set terminal S is at the “L” level (not in the set operation) and the reset terminal inversion R is at the “H” level (not in the reset operation), the transistor M12 is turned on. Therefore, the data output terminal inversion Q becomes “L” level through the transistors M8, M9 and M12. The inverter 605 inverts the “L” level given to the data output terminal inversion Q and sets the data output terminal Q to the “H” level. Transistors M10 and M11 are off. Accordingly, the “H” level is not transmitted to the data output terminal inversion Q through the transistor M10.
[0121]
Next, when the write signal G changes to “H” level (the write signal inversion G is “L” level), the transfer gate 601 is turned on and the transfer gate 603 is turned off, so that the data input terminal D is now turned on. The given data is transferred to the gates of the transistors M6 and M9. Here, when the data applied to the data input terminal D is at “L” level, the transistor M6 changes from OFF to ON, and the transistor M9 changes from ON to OFF. However, since the transistor M7 is off, the “H” level is not transmitted to the data output terminal inversion Q.
[0122]
On the other hand, if the data applied to the data input terminal D is at “H” level, the transistors M6 and M9 are in the previous state, that is, the write signal G is at “L” level (the write signal inversion G is “H”). The level is the same as when it was). Therefore, the state of the data output terminal Q and the inversion Q does not change.
[0123]
In this way, this flip-flop circuit is only provided by giving 1 to the data input terminal D when the data given to the data output terminal Q is 0 and the data given to the data output terminal inversion Q is 1. The circuit can change the state of the data output terminal Q.
[0124]
Based on the above write operation, data 1 is written only to the flip-flop circuit to be cleared, and data 0 is written to the flip-flop circuit that is not to be cleared, thereby clearing the interrupt request for only the flip-flop circuit to be cleared. The action can be performed.
[0125]
The flip-flop circuit shown in FIG. 7 can realize the same operation as the circuit composed of the flip-flop and the OR gate shown in FIG. 4 by adding the transistors M7 and M8. Specifically, the flip-flop circuit shown in FIG. 7 can reduce the number of MOS transistors by four compared to the circuit of FIG. 4 in order to realize the same operation as the circuit of FIG. Therefore, an interrupt request circuit having a small circuit area can be provided when integrated into an IC.
[0126]
【The invention's effect】
As described in detail above, the interrupt request processing method according to the present invention provides the first data to the first input terminal and maintains the interrupt request output given to the output terminal corresponding to the first input terminal. Since the second data is given to the first input terminal and the interrupt request output given to the output terminal corresponding to the first input terminal is cleared, the interrupt request to the CPU Even if multiple occurrences occur asynchronously, it is possible to reliably execute processing related to an interrupt request that occurs later.
[0127]
The interrupt request circuit according to the present invention corresponds to each of a plurality of bus lines for transferring data, a plurality of first input terminals for receiving data transferred to the bus lines, Since there are a plurality of second input terminals to which an interrupt request signal is applied corresponding to each of the bus lines and a plurality of output terminals corresponding to each of the second input terminals, the interrupt request circuit indicated by the interrupt request circuit The clear operation can be executed by data transferred to the data bus. That is, according to the present invention, since a dedicated circuit such as an interrupt clear selector is not required, interrupt processing can be reliably executed without increasing the circuit scale of the entire system.
[Brief description of the drawings]
FIG. 1 is a diagram showing an embodiment of an interrupt request circuit according to the present invention.
FIG. 2 is a diagram showing an embodiment of a system incorporating an interrupt request circuit according to the present invention.
FIG. 3 is a time chart for explaining the operation of the interrupt request circuit of the present invention shown in FIGS. 1 and 2;
FIG. 4 is a diagram showing another embodiment of the interrupt request circuit according to the present invention.
5 is a time chart for explaining the operation of the interrupt request circuit of the present invention shown in FIGS. 2 and 4. FIG.
FIG. 6 is a diagram showing a modification of the flip-flop of the interrupt request circuit according to the present invention.
FIG. 7 is a diagram showing a modification of the flip-flop of the interrupt request circuit according to the present invention.
[Explanation of symbols]
101, 103, 105, 107, 109 flip-flop
111, 113, 115, 117, 119 Andgate
137, 139, 141, 143, 145 Interrupt request input terminals
147, 149, 151, 153, 155 Data input terminals
157, 159, 161, 163, 165 Data output terminal

Claims (6)

割り込み要求信号が入力され、前記割り込み要求信号に応答して、割り込み要求があることを示す第1のデータを保持し、保持した前記第1のデータを割り込み要求出力回路へ出力する複数のデータ保持回路と、
論理の異なる第2および第3のデータを含む複数のビットデータが与えられるバスラインと、
前記データ保持回路から出力される前記第1のデータと、前記バスラインに与えられた前記第2、若しくは、前記第3のデータとが入力される複数の論理回路とを有し、
前記論理回路は、前記第1のデータと前記第2のデータとに応答して前記データ保持回路が保持する前記第1のデータを維持するデータを前記データ保持回路に出力し、
また、前記第1のデータと前記第3のデータとに応答して前記データ保持回路が保持する前記第1のデータをクリアするデータを前記データ保持回路に出力することを特徴とする割り込み要求回路。
In response to the interrupt request signal, the first data indicating that there is an interrupt request is held, and the held first data is output to the interrupt request output circuit. Circuit,
A bus line to which a plurality of bit data including second and third data having different logics are provided ;
A plurality of logic circuits to which the first data output from the data holding circuit and the second or third data given to the bus line are input;
The logic circuit outputs data for maintaining the first data held by the data holding circuit in response to the first data and the second data to the data holding circuit,
And an interrupt request circuit for outputting data for clearing the first data held by the data holding circuit to the data holding circuit in response to the first data and the third data. .
前記第1及び第2のデータの論理レベルは1であり、前記第3のデータの論理レベルは0であることを特徴とする請求項1記載の割り込み要求回路。  2. The interrupt request circuit according to claim 1, wherein the logic level of the first data and the second data is 1, and the logic level of the third data is 0. 前記論理回路は、アンドゲートであることを特徴とする請求項1または2のいずれかに記載の割り込み要求回路。  3. The interrupt request circuit according to claim 1, wherein the logic circuit is an AND gate. 割り込み要求信号が入力され、前記割り込み要求信号に応答して、割り込み要求があることを示す第1のデータを保持し、保持した前記第1のデータを割り込み要求出力回路へ出力する複数のデータ保持回路と、
論理の異なる第2および第3のデータを含む複数のビットデータが与えられるバスラインと、
前記データ保持回路から出力される前記第1のデータと、前記バスラインに与えられた前記第2、若しくは、前記第3のデータとが入力される複数の論理回路とを有する割り込み要求回路を用いた割り込み要求の処理方法において、
所定の前記データ保持回路に割り込み要求信号を与え当該データ保持回路に前記第1のデータを記憶させる第1のステップと、
前記論理回路により、前記第1のデータと前記第2のデータとに応答して前記データ保持回路が保持する前記第1のデータを維持するデータを前記データ保持回路に出力し、また、前記第1のデータと前記第3のデータとに応答して前記データ保持回路が保持する前記第1のデータをクリアするデータを前記データ保持回路に出力する第2のステップとを有することを特徴とする割り込み要求の処理方法。
In response to the interrupt request signal, the first data indicating that there is an interrupt request is held, and the held first data is output to the interrupt request output circuit. Circuit,
A bus line to which a plurality of bit data including second and third data having different logics are provided ;
An interrupt request circuit having a plurality of logic circuits to which the first data output from the data holding circuit and the second or third data given to the bus line are input is used. In the interrupt request processing method
A first step of giving an interrupt request signal to the predetermined data holding circuit and storing the first data in the data holding circuit;
The logic circuit outputs data for maintaining the first data held by the data holding circuit in response to the first data and the second data to the data holding circuit, and And a second step of outputting data for clearing the first data held by the data holding circuit to the data holding circuit in response to the first data and the third data. How to handle interrupt requests.
割り込み要求信号に応答して、割り込み要求が発生していることを示す第1のデータを保持し、かつ、中央処理演算装置に前記データを出力する複数のデータ保持回路を備えた割り込み要求回路において、
前記中央処理演算装置から出力される論理の異なる第2及び第3のデータを含む複数のビットデータが与えられるバスラインと、
前記データ保持回路から出力される前記第1のデータと、前記バスラインに与えられた第2、若しくは、第3のデータとが入力される複数の論理回路とを有し、
前記中央演算処理装置は、保持された前記第1のデータに関する割り込み処理が終了した前記データ保持回路に対応する前記論理回路には、第3のデータを、また、当該データ保持回路を除く全ての前記データ保持回路に対応する前記論理回路には、第2データを与えるようなビットデータを出力するとともに、
該論理回路は、前記第1のデータと前記第2のデータとに応答して前記データ保持回路が保持する前記第1のデータを維持するデータを前記データ保持回路に出力し、前記第1のデータと前記第3のデータとに応答して前記データ保持回路が保持する前記第1のデータをクリアするデータを前記データ保持回路に出力することを特徴とする割り込み要求回路。
In an interrupt request circuit comprising a plurality of data holding circuits for holding first data indicating that an interrupt request is generated in response to an interrupt request signal and outputting the data to a central processing unit ,
A bus line to which a plurality of bit data including second and third data having different logics output from the central processing unit is provided ;
A plurality of logic circuits to which the first data output from the data holding circuit and the second or third data given to the bus line are input;
The central processing unit stores third data in the logic circuit corresponding to the data holding circuit for which the interrupt processing related to the held first data has been completed, and all the data except the data holding circuit. The logic circuit corresponding to the data holding circuit outputs bit data that gives second data, and
The logic circuit outputs, to the data holding circuit, data that maintains the first data held by the data holding circuit in response to the first data and the second data, An interrupt request circuit that outputs data for clearing the first data held by the data holding circuit to the data holding circuit in response to data and the third data.
中央処理演算装置から出力される書込み信号が与えられたときに、前記論理回路の出力に応じて前記データ保持回路に保持された前記第1のデータがクリアされることを特徴とする請求項5記載の割り込み要求回路。  6. The first data held in the data holding circuit is cleared according to an output of the logic circuit when a write signal output from a central processing unit is given. The interrupt request circuit described.
JP23129794A 1994-09-27 1994-09-27 Interrupt request circuit and interrupt request processing method Expired - Fee Related JP3737144B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23129794A JP3737144B2 (en) 1994-09-27 1994-09-27 Interrupt request circuit and interrupt request processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23129794A JP3737144B2 (en) 1994-09-27 1994-09-27 Interrupt request circuit and interrupt request processing method

Publications (2)

Publication Number Publication Date
JPH0895801A JPH0895801A (en) 1996-04-12
JP3737144B2 true JP3737144B2 (en) 2006-01-18

Family

ID=16921412

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23129794A Expired - Fee Related JP3737144B2 (en) 1994-09-27 1994-09-27 Interrupt request circuit and interrupt request processing method

Country Status (1)

Country Link
JP (1) JP3737144B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6510480B1 (en) 1998-08-25 2003-01-21 Matsushita Electric Industrial Co., Ltd. Data transfer circuit and data processing method using data transfer circuit for handling interruption processing

Also Published As

Publication number Publication date
JPH0895801A (en) 1996-04-12

Similar Documents

Publication Publication Date Title
JPH0258649B2 (en)
US4835684A (en) Microcomputer capable of transferring data from one location to another within a memory without an intermediary data bus
US6327508B1 (en) Programmable state machine
JPH0769791B2 (en) Microprocessor
US5535379A (en) Timer apparatus capable of writing identical data to a plurality of timers built in a microcomputer
JP3737144B2 (en) Interrupt request circuit and interrupt request processing method
KR950009271B1 (en) Information processing system
US5742842A (en) Data processing apparatus for executing a vector operation under control of a master processor
US4802089A (en) Status flag handling in a digital data processing system
KR910001708B1 (en) Central processing unit
US4888685A (en) Data conflict prevention for processor with input/output device
JPS63244393A (en) Storage device equipped with parallel input/output circuit
US6211802B1 (en) Semiconductor integrated circuit for performing data transfer
JPS63226735A (en) Register circuit
JPH08241296A (en) Semiconductor integrated circuit
JPS60181851A (en) Partial writing control system
US6510480B1 (en) Data transfer circuit and data processing method using data transfer circuit for handling interruption processing
US4757504A (en) Polyphase parity generator circuit
US5179678A (en) Address/control signal input circuit for a cache controller which clamps the address/control signals to predetermined logic level clamp signal is received
JPH04241622A (en) Microprocessor
JPH0418634A (en) Data processor
JPS6258018B2 (en)
JP2546002B2 (en) Parity circuit
US20030217203A1 (en) DMA circuit with bit handling function
KR0179856B1 (en) Basic Cell Circuit of Register File

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040106

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040304

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040308

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040601

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040727

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20050301

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050428

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20050527

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20051018

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20051026

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081104

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091104

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091104

Year of fee payment: 4

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313115

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091104

Year of fee payment: 4

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees