JPH0659921A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH0659921A
JPH0659921A JP4209884A JP20988492A JPH0659921A JP H0659921 A JPH0659921 A JP H0659921A JP 4209884 A JP4209884 A JP 4209884A JP 20988492 A JP20988492 A JP 20988492A JP H0659921 A JPH0659921 A JP H0659921A
Authority
JP
Japan
Prior art keywords
reset
signal
wdt
microprogram
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP4209884A
Other languages
Japanese (ja)
Inventor
Tomofumi Higashide
朋史 東出
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP4209884A priority Critical patent/JPH0659921A/en
Publication of JPH0659921A publication Critical patent/JPH0659921A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To cope with the runaway of a microprogram without providing an exclusive terminal by providing a microcomputer with a means for selecting either one of system initialization or interruption in accordance with the overflow of a watch-dog timer circuit. CONSTITUTION:A time base counter 201 in the watch-dog timer(WDT) circuit 130 counts up clocks CLK 210 and outputs a specified WDT count lock 211 from its output tap. When a WDT clear signal(WDTCLR) 214 or a reset signal (RESET) 145 is inputted to an OR gate 205, a clear signal 216 is activated and a WDT 202 is initialized. If the WDT 202 continues counting-up operation without being initialized and generates overflow, a WDTOUT active timer 203 is started and a flip flop(FF) 204 is reset.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はマイクロコンピュータに
関し、特にウォッチドッグタイマ回路を備えたマイクロ
コンピュータ(以下、マイコンと称す)に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer, and more particularly to a microcomputer equipped with a watchdog timer circuit (hereinafter referred to as "microcomputer").

【0002】[0002]

【従来の技術】従来のマイコンはウォッチドッグタイマ
回路を用いてプログラムの暴走に対処している。
2. Description of the Related Art A conventional microcomputer uses a watchdog timer circuit to cope with program runaway.

【0003】図4は従来の一例を示すマイコンの構成図
である。図4に示すように、従来のマイコン400はC
PU401および周辺回路404を含み、これらの相互
間は内部バス405で接続されている。しかも、CPU
401はマイクロシーケンサ402と、演算処理部40
3と、命令キュー420と、プログラムカウンタ(以
下、PCという)421とを含み、内部バス405によ
り接続されている。また、周辺回路404は、ウォッチ
ドッグタイマ430,INTC431等の回路を含んで
いる。更に、CPU401におけるマイクロシーケンサ
402は、インストラクションデコーダ410と、MI
R411と、マイクロプログラムROM(以下、μRO
Mという)412と、MSTL413と、リセットエン
トリ格納部414と、セレクタ415とから構成され
る。
FIG. 4 is a block diagram of a conventional microcomputer. As shown in FIG. 4, the conventional microcomputer 400 has a C
It includes a PU 401 and a peripheral circuit 404, and these are mutually connected by an internal bus 405. Moreover, CPU
Reference numeral 401 denotes a micro sequencer 402 and an arithmetic processing unit 40.
3, an instruction queue 420, and a program counter (hereinafter referred to as a PC) 421, which are connected by an internal bus 405. In addition, the peripheral circuit 404 includes circuits such as a watchdog timer 430 and INTC431. Further, the micro sequencer 402 in the CPU 401 is provided with the instruction decoder 410 and the MI.
R411 and micro program ROM (hereinafter referred to as μRO
412, a MSTL 413, a reset entry storage unit 414, and a selector 415.

【0004】まず、PC421の示すアドレスからの命
令コードが命令キュー420に取り込まれ、インストラ
クションデコーダ410に入力される。このインストラ
クションデコーダ410は入力された命令コードをμR
OM412に格納された命令毎の実行手順(マイクロプ
ログラム)の開始番地(以下、エントリという)に変換
する。このエントリはMIR411に格納され、μRO
M412内のマイクロプログラムの開始番地を指定す
る。そして、この開始番地に格納されたマイクロプログ
ラムの内容がMSTL413に格納される。MSTL4
13に格納される内容には、処理を実行するためのマイ
コン各部の制御信号と、次に実行すべきマイクロプログ
ラムの番地情報(以下、ネクストアドレスという)とが
含まれる。
First, the instruction code from the address indicated by the PC 421 is fetched into the instruction queue 420 and input to the instruction decoder 410. The instruction decoder 410 outputs the input instruction code in μR
It is converted into the start address (hereinafter referred to as an entry) of the execution procedure (microprogram) for each instruction stored in the OM 412. This entry is stored in MIR411 and
Designate the start address of the microprogram in M412. Then, the contents of the microprogram stored at this start address are stored in the MSTL 413. MSTL4
The contents stored in 13 include a control signal of each part of the microcomputer for executing the process and address information of the micro program to be executed next (hereinafter referred to as the next address).

【0005】次に、MSTL413から出力される制御
信号に基づき演算処理部403で処理が行われる。ま
た、MSTL413はマイクロプログラムの最終ステッ
プでEND信号446を活性化する。このEND信号4
46がオフの時、リセット要求信号443が入力されて
いなければ、セレクタ415によりバスDが選択され、
MSTL413から出力されたネクスアドレスがMIR
411に格納されて命令の次のステップの処理が行われ
る。一方、END信号446がオンの時、割り込み信号
444がオフであり、リセット要求信号443が入力さ
れていなければ、セレクタ415によりバスBが選択さ
れ、次のインストラクションデコーダ410の入力がM
IR411に格納されて次命令の処理を開始する。
Next, the arithmetic processing unit 403 performs processing based on the control signal output from the MSTL 413. Also, the MSTL 413 activates the END signal 446 in the final step of the microprogram. This END signal 4
When the reset request signal 443 is not input when 46 is off, the bus D is selected by the selector 415,
The next address output from MSTL413 is MIR.
Stored in 411, the processing of the next step of the instruction is performed. On the other hand, when the END signal 446 is on, the interrupt signal 444 is off, and the reset request signal 443 is not input, the bus B is selected by the selector 415, and the input of the next instruction decoder 410 is M.
It is stored in IR 411 and processing of the next instruction is started.

【0006】ここで、入力端子RESET440にリセ
ット要求信号443が入力されると、セレクタ415に
よりバスCが選択され、リセットエントリ格納部414
から出力されたリセット命令のエントリがMIR411
に格納され、μROM412内のリセット命令に対応し
たマイクロプログラムのエントリを指定する。そして、
この開始番地に格納されたマイクロプログラムの内容が
MSTL413に格納される。演算処理部403はMS
TL413に格納されたマイクロプログラムの内容に基
づき、演算処理部403内の対応するレジスタを初期化
し、内部バス405を介してPC421にリセット後の
プログラム開始アドレスを格納する。また同時に、リセ
ット要求信号443は周辺回路404にも入力されるの
で、各周辺回路は初期化される。
When the reset request signal 443 is input to the input terminal RESET 440, the selector 415 selects the bus C and the reset entry storage unit 414 is selected.
The reset instruction entry output from MIR411
And specifies the microprogram entry corresponding to the reset instruction in the μROM 412. And
The contents of the microprogram stored in this start address are stored in MSTL413. The arithmetic processing unit 403 is an MS
Based on the contents of the microprogram stored in the TL 413, the corresponding register in the arithmetic processing unit 403 is initialized and the reset program start address is stored in the PC 421 via the internal bus 405. At the same time, since the reset request signal 443 is also input to the peripheral circuit 404, each peripheral circuit is initialized.

【0007】次に、マイクロプログラムにおける割り込
みの検出は、命令のマイクロプログラムの最終ステップ
でのみ実行する。まず、INTC431は、各周辺回路
からの割り込み要求が発生したとき、その優先順位を見
て一番高い割り込み要求を選択し、そのコードをCPU
401に受け渡すと同時に、割り込み信号444を活性
化させる。すなわち、END信号446がオンのとき、
リセット要求信号443が入力されていなければ、セレ
クタ415によりバスAが選択され、割り込みのエント
リがMIR411に入力されてマイクロプログラムの開
始番地を指定する。従って、CPU401では、割り込
みのマイクロプログラム中でINTC431から送られ
るコード情報を基にベクタアドレスを算出し読みだして
PC421に格納する。以上のように構成されているた
め、命令のマイクロプログラムの動作を乱すことなく割
り込み処理に移行することができる。
Next, detection of interrupts in the microprogram is performed only in the final step of the microprogram of instructions. First, when an interrupt request from each peripheral circuit is generated, the INTC 431 selects the highest interrupt request by looking at its priority order and assigns the code to the CPU.
At the same time as the transfer to 401, the interrupt signal 444 is activated. That is, when the END signal 446 is on,
If the reset request signal 443 has not been input, the bus A is selected by the selector 415, and the interrupt entry is input to the MIR 411 to specify the start address of the microprogram. Therefore, the CPU 401 calculates and reads a vector address based on the code information sent from the INTC 431 in the interrupt microprogram, and stores it in the PC 421. With the above configuration, it is possible to shift to interrupt processing without disturbing the operation of the instruction microprogram.

【0008】図5は図4に示すウォッチドックタイマの
構成図である。図5に示すように、ウォッチドッグタイ
マ430は、内部のシステムクロックCLK510をカ
ウントしWDTカウントクロック511を出力する13
ビットのカウンタであるタイムベースカウンタ501
と、かかるWDTカウントクロック511をカウントす
る8ビットのカウンタであるWDT502と、このWD
T502のオーバーフローを検出してカウントを開始す
る5ビットのカウンタであるWDTOUTアクティブタ
イマ503と、フリップフロップ504と、ORゲート
505とから構成されている。
FIG. 5 is a block diagram of the watchdog timer shown in FIG. As shown in FIG. 5, the watchdog timer 430 counts the internal system clock CLK510 and outputs the WDT count clock 511 13
Time base counter 501 which is a bit counter
And the WDT502, which is an 8-bit counter that counts the WDT count clock 511, and the WD
It is composed of a WDTOUT active timer 503, which is a 5-bit counter that detects the overflow of T502 and starts counting, a flip-flop 504, and an OR gate 505.

【0009】まず、タイムベースカウンタ501はCL
K510をカウントし、指定されたWDTカウントクロ
ック511を出力タップから出力する。WDT502に
スタート信号(START)514が入力されると、W
DT502はWDTカウントクロック511のカウント
動作を開始する。一方、ウォッチドックタイマクリア信
号WDTCLR513か、リセト信号RESET443
がORゲート505に入力されると、ORゲート505
の出力が“1”となり、クリア信号515が活性化さ
れ、WDT502は初期化される。
First, the time base counter 501 is CL
K510 is counted, and the designated WDT count clock 511 is output from the output tap. When the start signal (START) 514 is input to the WDT 502, W
The DT 502 starts the counting operation of the WDT count clock 511. On the other hand, the watchdog timer clear signal WDTCLR513 or the reset signal RESET443
Is input to the OR gate 505, the OR gate 505
Output becomes "1", the clear signal 515 is activated, and the WDT 502 is initialized.

【0010】次に、WDT502が初期化されずにカウ
ントアップ動作を続けオーバーフローを起こすと、WD
TOUTスタート信号445が活性化される。このWD
TOUTスタート信号445がINTC431に入力さ
れると(図4参照)、割り込み動作が起動される。
Next, if the WDT 502 is not initialized and continues the count-up operation to cause an overflow, the WD
The TOUT start signal 445 is activated. This WD
When the TOUT start signal 445 is input to the INTC 431 (see FIG. 4), the interrupt operation is activated.

【0011】従って、WDT502のオーバーフロー割
り込みでプログラムの暴走状態を検出すると、割り込み
処理の中でプログラムの暴走状態をチェックして、その
状態に対応した処理を行うことができる。しかし、この
場合は各周辺回路をシステムリセット後の状態に初期化
することができない。そのため、出力端子(WDTOU
T)441にフリップフロップ504の出力信号442
を出力し、外部で入力端子RESET440と接続する
ことにより、システムリセットをかけるという手順がと
られている。
Therefore, when the runaway state of the program is detected by the overflow interrupt of the WDT 502, it is possible to check the runaway state of the program in the interrupt processing and perform the processing corresponding to that state. However, in this case, each peripheral circuit cannot be initialized to the state after the system reset. Therefore, the output terminal (WDTOU
T) 441 outputs the output signal 442 of the flip-flop 504.
Is output and is externally connected to the input terminal RESET 440 to reset the system.

【0012】また、WDTOUTスタート信号445は
WDTOUTアクティブタイマ503と、フリップフロ
ップ504に入力される。このWDTOUTスタート信
号445により、セット・リセット型のフリップフロッ
プ504がセットされ、出力端子WDTOUT441か
ら“1”が出力される。更に、WDTOUTスタート信
号445が入力されると、WDTOUTアクティブタイ
マ503はカウントアップ動作を開始する。WDTOU
Tアクティブタイマ503は一定期間カウントし終わる
と、オーバーフローを起こし、オーバーフロー信号51
2を出力する。このオーバーフロー信号512はフリッ
プフロップ504をリセットするので、出力端子WDT
OUT441からは“0”が出力される。上述した動作
により、WDT502のオーバーフローを検出してから
一定期間後に、出力端子WDTOUT441から“1”
が出力される。このWDTOUT信号442は入力端子
RESET440に入力され、上述したリセット処理を
行う。
The WDTOUT start signal 445 is input to the WDTOUT active timer 503 and the flip-flop 504. The WDTOUT start signal 445 sets the set / reset type flip-flop 504, and "1" is output from the output terminal WDTOUT441. Further, when the WDTOUT start signal 445 is input, the WDTOUT active timer 503 starts the count-up operation. WDTOU
When the T active timer 503 finishes counting for a certain period of time, it overflows and the overflow signal 51
2 is output. This overflow signal 512 resets the flip-flop 504, so that the output terminal WDT
“0” is output from OUT441. By the operation described above, the output terminal WDTOUT441 is set to "1" after a certain period from the detection of the overflow of the WDT502.
Is output. The WDTOUT signal 442 is input to the input terminal RESET440 and performs the above-described reset process.

【0013】[0013]

【発明が解決しようとする課題】上述した従来のマイク
ロコンピュータは、プログラムの暴走やシステムの異常
を検出した場合、ウォッチドッグタイマのオーバーフロ
ー割り込みでプログラムの暴走状態を検出し、割り込み
処理の中でプログラムの暴走状態をチェックしてからそ
の状態に対応した処理を行っている。しかしながら、こ
の場合は各周辺回路をシステムリセット後の状態に初期
化することができないという欠点がある。
In the conventional microcomputer described above, when a program runaway or a system abnormality is detected, the watchdog timer overflow interrupt detects the program runaway state, and the program is executed in the interrupt process. After checking the runaway state of, the process corresponding to that state is performed. However, in this case, there is a drawback that each peripheral circuit cannot be initialized to a state after system reset.

【0014】また、命令毎のマイクロプログラムは通常
複数ステップの実行手順から構成されているので、ハー
ドウェアの状態によってはマイクロプログラムの暴走が
発生する場合もありうる。かかる場合は割り込みの発生
検出を命令毎のマイクロプログラムの最終ステップでの
み実行しているため、マイクロプログラムが最終ステッ
プまで到達しないような暴走を起こした場合には、ウォ
ッチドッグタイマ割り込みを検出することができず、マ
イクロプログラムレベルの暴走に対しては無効である。
そのため、専用の出力端子を設け、外部でリセット端子
と接続することにより、システムリセットをかけるとい
うことが行われる。従って、このマイクロコンピュータ
では、専用の出力端子が必要となり、ピン数が増えてし
まうという欠点がある。
Further, since the microprogram for each instruction is usually composed of the execution procedure of a plurality of steps, the runaway of the microprogram may occur depending on the hardware state. In such a case, detection of interrupt occurrence is executed only at the final step of the microprogram for each instruction. Therefore, if the microprogram causes a runaway that does not reach the final step, detect a watchdog timer interrupt. Cannot be performed, and is invalid for runaway at the microprogram level.
Therefore, the system reset is performed by providing a dedicated output terminal and externally connecting to the reset terminal. Therefore, this microcomputer requires a dedicated output terminal and has the disadvantage of increasing the number of pins.

【0015】さらに、かかるマイクロコンピュータはシ
ステムリセットがリセット信号の入力によりかかったの
か、あるいはウォッチドッグタイマのオーバーフローに
よりかかったのかを区別することができないという欠点
がある。
Further, such a microcomputer cannot distinguish whether the system reset is caused by the input of the reset signal or the overflow of the watchdog timer.

【0016】本発明の目的は、各周辺回路をシステムリ
セット後の状態に初期化できるようにし、マイクロプロ
グラムの暴走に対しても専用の出力端子を設けないで対
処できるようにするとともに、システムリセットをリセ
ット信号かオーバーフローかにより区別できるようにす
るマイクロコンピュータを提供することにある。
An object of the present invention is to enable each peripheral circuit to be initialized to a state after a system reset, to cope with a runaway microprogram without providing a dedicated output terminal, and to perform a system reset. Another object of the present invention is to provide a microcomputer capable of distinguishing between the reset signal and the overflow signal.

【0017】[0017]

【課題を解決するための手段】本発明のマイクロコンピ
ュータは、プログラムの暴走やシステムの異常を検知す
るウォッチドッグタイマ回路と、前記ウォッチドッグタ
イマ回路のオーバーフローによりシステムの初期化もし
くは割り込みのどちらか一方を選択する選択手段と、前
記ウォッチドッグタイマ回路のオーバーフローを検出し
たときにマイクロプログラムの開始番地を出力する出力
手段とを有して構成される。
The microcomputer of the present invention comprises a watchdog timer circuit for detecting a program runaway or a system abnormality, and either system initialization or interrupt due to overflow of the watchdog timer circuit. And a output means for outputting the start address of the microprogram when the overflow of the watchdog timer circuit is detected.

【0018】[0018]

【実施例】次に、本発明の実施例について図面を用いて
説明する。図1は本発明の第1の実施例を示すマイクロ
コンピュータのブロック図である。図1に示すように、
本実施例のマイクロコンピュータ100は、CPU10
1と、周辺回路104と、ORゲート122と、割り込
み指定ビット123と、インバータ124と、ゲート1
25,126とを含み、内部バス105で接続されてい
る。割り込み指定ビット123は内部バス105を通し
て設定可能である。
Embodiments of the present invention will now be described with reference to the drawings. FIG. 1 is a block diagram of a microcomputer showing a first embodiment of the present invention. As shown in Figure 1,
The microcomputer 100 of this embodiment includes a CPU 10
1, peripheral circuit 104, OR gate 122, interrupt designating bit 123, inverter 124, and gate 1
25 and 126, and are connected by the internal bus 105. The interrupt designation bit 123 can be set through the internal bus 105.

【0019】まず、CPU101はマイクロシケーンサ
102と、演算処理部103と、命令キュー120と、
プログラムカウンタ121とを含み、これらの相互間は
直接あるいは間接に内部バス105で接続されている。
マイクロシーケンサ102は、命令キュー120に接続
されたインストラクションデコーダ110と、MIR1
11と、マイクロプログラムROM112と、MSTL
113と、リセットエントリ格納部114と、WDTエ
ントリ格納部115と、MIR111へのデータを選択
的に供給するセレクタ116とから構成される。また、
周辺回路104は、ウォッチドッグタイマ130と、I
NTC131およびその他の周辺回路(図示省略)とで
構成される。
First, the CPU 101 includes a micro sequencer 102, an arithmetic processing unit 103, an instruction queue 120,
The program counter 121 is included, and these are directly or indirectly connected to each other by the internal bus 105.
The micro sequencer 102 includes an instruction decoder 110 connected to the instruction queue 120 and an MIR1.
11, microprogram ROM 112, MSTL
113, a reset entry storage unit 114, a WDT entry storage unit 115, and a selector 116 that selectively supplies data to the MIR 111. Also,
The peripheral circuit 104 includes a watchdog timer 130 and an I
It is composed of the NTC 131 and other peripheral circuits (not shown).

【0020】かかるCPU101において、PC121
の示すアドレスからの命令コードが命令キュー120に
取り込まれ、インストラクションデコーダ110に入力
される。このインストラクションデコーダ110は入力
された命令コードをμROM112に格納されている命
令毎のマイクロプログラムのエントリに変換する。この
エントリはMIR111に格納され、μROM112内
のマイクロプログラムの開始番地を指定する。そして、
この開始番地に格納されたマイクロプログラムの内容が
MSTL113に格納される。MSTL113に格納さ
れた内容には、処理を実行するためのマイコン各部の制
御信号と、ネクストアドレスとが含まれ、MSTL11
3から出力される制御信号に基づき演算処理部103で
処理が行われる。更に、MSTL113はマイクロプロ
グラムの最終ステップでEND信号146を活性化す
る。
In the CPU 101, the PC 121
The instruction code from the address indicated by is fetched into the instruction queue 120 and input to the instruction decoder 110. The instruction decoder 110 converts the input instruction code into a microprogram entry for each instruction stored in the μROM 112. This entry is stored in the MIR 111 and specifies the start address of the microprogram in the μROM 112. And
The contents of the microprogram stored at this start address are stored in the MSTL 113. The contents stored in the MSTL 113 include control signals for each part of the microcomputer for executing processing and the next address.
The processing is performed by the arithmetic processing unit 103 based on the control signal output from the controller 3. Further, the MSTL 113 activates the END signal 146 in the final step of the microprogram.

【0021】このEND信号146がオフの時、リセッ
ト要求信号142が入力されていなければ、セレクタ1
16によりバスDが選択され、MSTL113から出力
されたネクストアドレスがMIR111に格納されるこ
とにより、命令の次のステップの処理が行われる。逆
に、END信号146がオンの時、割り込み要求信号1
41がオフであり、リセット信号145が入力されてい
なければ、セレクタ116によりバスBが選択され、次
のインストラクションデコーダの入力がMIR111に
格納されることにより、次命令の処理を開始する。
When the END signal 146 is off and the reset request signal 142 is not input, the selector 1
The bus D is selected by 16 and the next address output from the MSTL 113 is stored in the MIR 111, whereby the processing of the next step of the instruction is performed. Conversely, when the END signal 146 is on, the interrupt request signal 1
When 41 is off and the reset signal 145 is not input, the selector 116 selects the bus B and the input of the next instruction decoder is stored in the MIR 111, so that the processing of the next instruction is started.

【0022】一方、入力端子RESET140に入力さ
れたリセット要求信号142は、リセットエントリ格納
部114に入力されるとともに、ORゲート122に入
力されるので、ORゲート122の出力が“1”とな
る。すなわち、RESET信号145が活性化される。
このRESET信号145が活性化されると、セレクタ
116によりバスCが選択され、リセットエントリ格納
部114より出力されたリセット命令のエントリがMI
R111に格納される。これにより、μROM112内
のリセット命令に対応したマイクロプログラムの開始番
地が指定され、この開始番地に格納されたマイクロプロ
グラムの内容がMST113に格納される。このMST
L113に格納されたマイクロプログラムの内容に基づ
き、演算処理部103は内部の対応するレジスタを初期
化し、PC121にリセット後のプログラム開始アドレ
スを格納する。同時に、RESET信号145は周辺回
路104に入力され、各周辺回路も初期化される。
On the other hand, since the reset request signal 142 input to the input terminal RESET140 is input to the reset entry storage section 114 and also to the OR gate 122, the output of the OR gate 122 becomes "1". That is, the RESET signal 145 is activated.
When the RESET signal 145 is activated, the bus C is selected by the selector 116 and the entry of the reset instruction output from the reset entry storage unit 114 is MI.
It is stored in R111. As a result, the start address of the microprogram corresponding to the reset instruction in the μROM 112 is designated, and the contents of the microprogram stored at this start address are stored in the MST 113. This MST
Based on the contents of the microprogram stored in L113, the arithmetic processing unit 103 initializes the corresponding internal register and stores the program start address after reset in the PC 121. At the same time, the RESET signal 145 is input to the peripheral circuit 104 and each peripheral circuit is also initialized.

【0023】次に、周辺回路104におけるINTC1
31は、各周辺からの割り込み要求信号を常にサンプリ
ングしている。従って、割り込み要求が発生したとき、
INTC131はその優先順位を見て一番高い割り込み
要求を選択し、そのコードをCPU101に受け渡すと
同時に、割り込み要求信号141を活性化させる。ここ
で、MSTL113からのEND信号146がオンのと
き、リセット要求信号142が入力されていなければ、
セレクタ116によりバスAが選択され、割り込みのエ
ントリがMIR111に格納されてマイクロプログラム
の開始番地を指定する。また、割り込みのマイクロプロ
グラム中でINTC131から送出されるコード情報を
基にベクタアドレスを算出し、読み出してPC121に
格納する。
Next, INTC1 in the peripheral circuit 104
Reference numeral 31 always samples the interrupt request signal from each peripheral. Therefore, when an interrupt request occurs,
The INTC 131 selects the highest interrupt request in view of its priority, transfers the code to the CPU 101, and at the same time activates the interrupt request signal 141. Here, when the END signal 146 from the MSTL 113 is on and the reset request signal 142 is not input,
The bus A is selected by the selector 116, the entry of the interrupt is stored in the MIR 111, and the start address of the microprogram is designated. Further, the vector address is calculated based on the code information sent from the INTC 131 in the interrupt microprogram, read out and stored in the PC 121.

【0024】上述したように、本実施例のマイクロコン
ピュータは構成されているため、命令のマイクロプログ
ラムの動作を乱すことなく割り込み処理に移行すること
ができる。
As described above, since the microcomputer of this embodiment is configured, it is possible to shift to the interrupt processing without disturbing the operation of the instruction microprogram.

【0025】図2は図1に示すウォッチドッグタイマの
構成図である。図2に示すように、ウォッチドッグタイ
マ130は、内部のシステムクロックCLK210をカ
ウントしWDTカウントクロック211を出力する13
ビットのタイムベースカウンタ201と、WDTカウン
トクロック211をカウントする8ビットのカウンタで
あるWDT202と、このWDT202のオーバーフロ
ーを検出してカウントを開始する5ビットカウンタを形
成したWDTOUTアクティブタイマ203と、WDT
OUTスタート信号212によりセットされてWDTO
UT信号143を出力する一方、WDTアクティブタイ
マ203のオーバーフロー信号213によりセットされ
るフリップフロップ204と、ウォッチドッグタイマク
リア(WDTCLR)信号214およびリセット(RE
SET)信号145の論理和をとるORケート205と
から構成されている。
FIG. 2 is a block diagram of the watchdog timer shown in FIG. As shown in FIG. 2, the watchdog timer 130 counts the internal system clock CLK210 and outputs the WDT count clock 211 13
A bit time base counter 201, an WDT 202 that is an 8-bit counter that counts the WDT count clock 211, a WDTOUT active timer 203 that forms a 5-bit counter that detects overflow of the WDT 202 and starts counting, and WDT.
WDTO set by OUT start signal 212
While outputting the UT signal 143, the flip-flop 204 set by the overflow signal 213 of the WDT active timer 203, the watchdog timer clear (WDTCLR) signal 214 and the reset (RE
SET) signal 145 and an OR gate 205 that takes the logical sum of the signals.

【0026】かかるウォッチドッグタイマ130におけ
るタイムベースカウンタ201はCLK210をカウン
トし、指定されたWDTカウントクロック211を出力
タップから出力する。また、WDT202にスタート信
号(START)215が入力されると、WDT202
はWDTカウントクロック211のカウント動作を開始
する。更に、ORゲート205にウォッチドッグタイマ
クリア信号(WDTCLR)214か、リセット信号
(RESET)145が入力されると、出力が1となる
ので、クリア信号216が活性化され、WDT202は
初期化される。
The time base counter 201 in the watch dog timer 130 counts the CLK 210 and outputs the designated WDT count clock 211 from the output tap. When the start signal (START) 215 is input to the WDT 202, the WDT 202
Starts the counting operation of the WDT count clock 211. Further, when the watchdog timer clear signal (WDTCLR) 214 or the reset signal (RESET) 145 is input to the OR gate 205, the output becomes 1, so the clear signal 216 is activated and the WDT 202 is initialized. .

【0027】一方、WDT202が初期化されずにカウ
ントアップ動作を続けてオーバーフローを起こすと、W
DTOUTスタート信号212が活性化される。このW
DTOUTスタート信号212はWDTOUTアクティ
ブタイマ203をスタートさせるだけでなく、フリップ
フロップ204にも入力されるので、セット−リセット
型のフリップフロップ204をセットし、WDTOUT
信号143に“1”を出力する。また、WDTOUTア
クティブタイマ203はWDTOUTスタート信号21
2が入力されると、カウントアップ動作を開始し、一定
期間カウントし終わると、オーバーフローを起こして、
オーバーフロー信号213を出力する。このオーバーフ
ロー信号213はフリップフロップ204をリセット
し、WDTOUT信号143を“0”にする。
On the other hand, if the WDT 202 is not initialized and continues counting up to cause an overflow, W
The DTOUT start signal 212 is activated. This W
Since the DTOUT start signal 212 not only starts the WDTOUT active timer 203 but is also input to the flip-flop 204, the set-reset type flip-flop 204 is set and WDTOUT is set.
“1” is output as the signal 143. Further, the WDTOUT active timer 203 has a WDTOUT start signal 21.
When 2 is input, the count-up operation starts, and after counting for a certain period, overflow occurs,
The overflow signal 213 is output. The overflow signal 213 resets the flip-flop 204 and sets the WDTOUT signal 143 to "0".

【0028】次に、図1に示す割り込み指定ビット12
3が“1”の場合、割り込み指定信号144はゲート1
25を開き、WDTOUT信号143はWDTエントリ
格納部115に格納されるとともに、ORゲート122
に入力されるので、そのORゲート122の出力が
“1”となり、RESET信号145が活性化される。
このRESET信号145が活性化されると、セレクタ
116によりバスCが選択され、WDTエントリ格納部
115より出力されたエントリがMIR111に格納さ
れる。すなわち、μROM112内のマイクロプログラ
ムの開始番地が指定される。そして、この開始番地に格
納されたマイクロプログラムの内容がMSTL113に
格納される。従って、演算処理部103はMSTL11
3に格納されたマイクロプログラムの内容に基づき、演
算処理部103内の対応するレジスタを初期化し、PC
121に処理終了後のプログラム開始アドレスを格納す
る。このとき、PC121に格納される開始アドレスは
リセット要求信号142によるリセット処理後のプログ
ラム開始アドレスとは異なるものである。同時に、RE
SET信号145は周辺回路104に入力されるので、
各周辺回路も初期化される。
Next, the interrupt designation bit 12 shown in FIG.
When 3 is “1”, the interrupt designation signal 144 is the gate 1
25, the WDTOUT signal 143 is stored in the WDT entry storage unit 115, and the OR gate 122 is opened.
, The output of the OR gate 122 becomes "1" and the RESET signal 145 is activated.
When the RESET signal 145 is activated, the selector 116 selects the bus C, and the entry output from the WDT entry storage unit 115 is stored in the MIR 111. That is, the start address of the microprogram in the μROM 112 is designated. Then, the contents of the microprogram stored in this start address are stored in the MSTL 113. Therefore, the arithmetic processing unit 103 uses the MSTL11
3, the corresponding registers in the arithmetic processing unit 103 are initialized based on the contents of the microprogram stored in
The program start address after processing is stored in 121. At this time, the start address stored in the PC 121 is different from the program start address after the reset processing by the reset request signal 142. At the same time, RE
Since the SET signal 145 is input to the peripheral circuit 104,
Each peripheral circuit is also initialized.

【0029】次に、割り込み指定ビット123が“0”
の場合、割り込み指定信号144はインバータ124に
より反転されてゲート126を開く。このため、WDT
OUT信号143がINTC131に入力される。この
WDTOUT信号143がINTC131に入力される
と、割り込みが起動され、割り込み要求信号141を活
性化して割り込み処理を行う。
Next, the interrupt designation bit 123 is "0".
, The interrupt designating signal 144 is inverted by the inverter 124 to open the gate 126. Therefore, WDT
The OUT signal 143 is input to the INTC 131. When the WDTOUT signal 143 is input to the INTC 131, an interrupt is activated, the interrupt request signal 141 is activated, and interrupt processing is performed.

【0030】図3は本発明の第2の実施例を示すマイク
ロコンピュータのブロック図である。図3に示すよう
に、本実施例は前述した第1の実施例と比較してCPU
301が異なり、特にその内部のマイクロシーケンサ3
02の構成が異なり、その他は同様である。そのマイク
ロシーケンサ302は、第1の実施例におけるリセット
エントリ格納部114とWDTエントリ格納部115の
代りに、エントリ生成部314とフリップフロップ31
5を用いている。
FIG. 3 is a block diagram of a microcomputer showing a second embodiment of the present invention. As shown in FIG. 3, this embodiment compares the CPU with the first embodiment described above.
301 is different, especially the micro sequencer 3 inside
The configuration of 02 is different, and the others are the same. The micro sequencer 302 has an entry generation unit 314 and a flip-flop 31 instead of the reset entry storage unit 114 and the WDT entry storage unit 115 in the first embodiment.
5 is used.

【0031】まず、リセット要求信号142が入力され
た場合の動作を説明する。RESET入力端子140に
リセット要求信号142が入力されると、セット−リセ
ット型のフリップフロップ315がリセットされ、エン
トリ生成信号347が“0”となる。このエントリ生成
信号347はエントリ生成部314に入力され、エント
リ生成部314の上位1ビットを“0”にする。エント
リ生成部314は、エントリ生成信号347によって生
成されたマイクロプログラムのエントリをセレクタ11
6に出力し、以下第1の実施例と同様のリセット処理動
作を行う。
First, the operation when the reset request signal 142 is input will be described. When the reset request signal 142 is input to the RESET input terminal 140, the set-reset type flip-flop 315 is reset and the entry generation signal 347 becomes "0". This entry generation signal 347 is input to the entry generation unit 314, and the upper 1 bit of the entry generation unit 314 is set to “0”. The entry generation unit 314 selects the entry of the microprogram generated by the entry generation signal 347 from the selector 11
Then, the reset processing operation similar to that of the first embodiment is performed.

【0032】次に、ウォッチドッグタイマ130のオー
バーフローが起こった場合の動作を説明する。このとき
は、まず割り込み指定ビット123が“1”の場合、割
り込み指定信号144がゲート125を開き、WDTO
UT信号143をフリップフロップ315に入力する。
これにより、フリップフロップ315はセットされ、エ
ントリ生成信号347を“1”にする。このエントリ生
成信号347はエントリ生成部314に入力されて、エ
ントリ生成部314の上位1ビットを“1”にする。エ
ントリ生成部314は、エントリ生成信号347によっ
て生成されたマイクロプログラムのエントリを出力す
る。以下、第1の実施例と同様のウォッチドッグタイマ
130のオーバーフローによるリセット処理動作を行
う。
Next, the operation when the watchdog timer 130 overflows will be described. At this time, first, when the interrupt designation bit 123 is "1", the interrupt designation signal 144 opens the gate 125, and the WDTO
The UT signal 143 is input to the flip-flop 315.
As a result, the flip-flop 315 is set and the entry generation signal 347 is set to "1". The entry generation signal 347 is input to the entry generation unit 314 and sets the upper 1 bit of the entry generation unit 314 to “1”. The entry generation unit 314 outputs the microprogram entry generated by the entry generation signal 347. After that, the reset processing operation due to the overflow of the watchdog timer 130 is performed as in the first embodiment.

【0033】一方、割り込み指定ビット123が“0”
の場合は、第1の実施例と同様の割り込み処理動作を行
う。
On the other hand, the interrupt designation bit 123 is "0".
In the case of, the same interrupt processing operation as in the first embodiment is performed.

【0034】以上のように、本実施例では、フリップフ
ロップ315の出力によりウォッチドッグタイマ130
のオーバーフローの場合と、リセット信号入力の場合と
のマイクロプログラムのエントリを生成しており、第1
の実施例と同様の動作をエントリ格納部が1個で行う場
合を示している。
As described above, in this embodiment, the watchdog timer 130 is controlled by the output of the flip-flop 315.
The microprogram entry is generated for the case of overflow of the
The case where one entry storage unit performs the same operation as that of the above embodiment is shown.

【0035】[0035]

【発明の効果】以上説明したように、本発明のマイクロ
コンピュータは、プログラムの暴走やシステムの異常を
検出した場合、ウォッチドッグタイマのオーバーフロー
によりマイクロプログラムのエントリを指定し、マイク
ロプログラムの処理ルーチンにはいるので、マイクロプ
ログラムが最終ステップまで到達しないような暴走を起
こした場合にも対応することができるという効果があ
る。また、本発明は専用の出力端子を設ける必要がな
く、ピン数を減らすことができるという効果がある。さ
らに、本発明はリセット信号の入力による処理と、ウォ
ッチドッグタイマのオーバーフローによる処理とでリセ
ット処理直後のプログラム開始アドレスを変えているの
で、システムリセットがどちらで行われたのかを区別す
ることができるという効果がある。
As described above, when the microcomputer of the present invention detects a program runaway or a system abnormality, the microprogram entry is designated by the overflow of the watchdog timer, and the micro program processing routine is executed. Since it exists, there is an effect that it is possible to deal with a case where the microprogram causes a runaway that does not reach the final step. Further, the present invention has an effect that the number of pins can be reduced because it is not necessary to provide a dedicated output terminal. Further, according to the present invention, since the program start address immediately after the reset processing is changed depending on the processing by the input of the reset signal and the processing by the overflow of the watchdog timer, it is possible to distinguish which is the system reset. There is an effect.

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

【図1】本発明の第1の実施例を示すマイクロコンピュ
ータのブロック図である。
FIG. 1 is a block diagram of a microcomputer showing a first embodiment of the present invention.

【図2】図1に示すウォッチドッグタイマの構成図であ
る。
FIG. 2 is a configuration diagram of a watchdog timer shown in FIG.

【図3】本発明の第2の実施例を示すマイクロコンピュ
ータのブロック図である。
FIG. 3 is a block diagram of a microcomputer showing a second embodiment of the present invention.

【図4】従来の一例を示すマイクロコンピュータのブロ
ック図である。
FIG. 4 is a block diagram of a microcomputer showing a conventional example.

【図5】図4に示すウォッチドッグタイマの構成図であ
る。
5 is a configuration diagram of the watchdog timer shown in FIG. 4. FIG.

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

100,300 マイクロコンピュータ 101,301 CPU 102,302 マイクロシーケンサ 103 演算処理部 104 周辺回路 110 インストラクションデコーダ 111 MIR 112 マイクロプログラムROM 113 MSTL 114 リセットエントリ格納部 115 WDTエントリ格納部 116 セレクタ 120 命令キュー 121 プログラムカウンタ 122 ORゲート 123 割り込み指定ビット 124 インバータ 125,126 ゲート 130 ウォッチドッグタイマ 131 INTC 140 入力端子RESET 201 タイムベースカウンタ 202 WDT 203 WDTOUTアクティブタイマ 204,315 フリップフロップ 205 ORゲート 314 エントリ生成部 100,300 Microcomputer 101,301 CPU 102,302 Microsequencer 103 Arithmetic processing section 104 Peripheral circuit 110 Instruction decoder 111 MIR 112 Microprogram ROM 113 MSTL 114 Reset entry storage section 115 WDT entry storage section 116 Selector 120 Instruction queue 121 Program counter 122 OR gate 123 Interrupt designation bit 124 Inverter 125, 126 Gate 130 Watchdog timer 131 INTC 140 Input terminal RESET 201 Time base counter 202 WDT 203 WDTOUT active timer 204, 315 Flip-flop 205 OR gate 314 Entry generator

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 プログラムの暴走やシステムの異常を検
知するウォッチドッグタイマ回路と、前記ウォッチドッ
グタイマ回路のオーバーフローによりシステムの初期化
もしくは割り込みのどちらか一方を選択する選択手段
と、前記ウォッチドッグタイマ回路のオーバーフローを
検出したときにマイクロプログラムの開始番地を出力す
る出力手段とを有することを特徴とするマイクロコンピ
ュータ。
1. A watchdog timer circuit for detecting a program runaway or a system abnormality, selection means for selecting either system initialization or interrupt due to overflow of the watchdog timer circuit, and the watchdog timer. A microcomputer having an output means for outputting a start address of a microprogram when a circuit overflow is detected.
JP4209884A 1992-08-06 1992-08-06 Microcomputer Pending JPH0659921A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4209884A JPH0659921A (en) 1992-08-06 1992-08-06 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4209884A JPH0659921A (en) 1992-08-06 1992-08-06 Microcomputer

Publications (1)

Publication Number Publication Date
JPH0659921A true JPH0659921A (en) 1994-03-04

Family

ID=16580246

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4209884A Pending JPH0659921A (en) 1992-08-06 1992-08-06 Microcomputer

Country Status (1)

Country Link
JP (1) JPH0659921A (en)

Similar Documents

Publication Publication Date Title
JP3176093B2 (en) Microprocessor interrupt controller
KR100588790B1 (en) Method and apparatus for acting on subsequent command processing in data processor
US5717851A (en) Breakpoint detection circuit in a data processor and method therefor
US4979102A (en) Microprocessor operable under direct connection to coprocessor
JP2001229031A (en) Flexible interruption controller including interruption forcing register
JPH0454255B2 (en)
JPS6218936B2 (en)
US6205414B1 (en) Methodology for emulation of multi-threaded processes in a single-threaded operating system
US5138709A (en) Spurious interrupt monitor
US7991982B2 (en) Microcomputer and encoding system for executing peripheral function instructions
US5586336A (en) Microcomputer capable of monitoring internal resources from external
JPH0659921A (en) Microcomputer
JPH0267979A (en) Testing circuit for logic circuit
EP0343668B1 (en) Normalization control system for floating point arithmetic operations
US6425047B1 (en) Process containing address decoders suited to improvements in clock speed
JPH04333141A (en) Information processor
JP2525492B2 (en) Programmable controller
JPH0397031A (en) Data processor
JPH09167117A (en) Microcomputer and real time system using the microcomputer
JPH0816434A (en) Runaway detection device
JP5012562B2 (en) Microcomputer
JPS59123933A (en) Address comparison system
JPH05143320A (en) Floating point arithmetic system and unit therefor
JP4702004B2 (en) Microcomputer
JP2636074B2 (en) Microprocessor

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19990810