JPH0444987B2 - - Google Patents

Info

Publication number
JPH0444987B2
JPH0444987B2 JP60087872A JP8787285A JPH0444987B2 JP H0444987 B2 JPH0444987 B2 JP H0444987B2 JP 60087872 A JP60087872 A JP 60087872A JP 8787285 A JP8787285 A JP 8787285A JP H0444987 B2 JPH0444987 B2 JP H0444987B2
Authority
JP
Japan
Prior art keywords
timer
reset
output
general
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.)
Expired - Lifetime
Application number
JP60087872A
Other languages
Japanese (ja)
Other versions
JPS61246866A (en
Inventor
Shinichi Hirose
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP60087872A priority Critical patent/JPS61246866A/en
Publication of JPS61246866A publication Critical patent/JPS61246866A/en
Publication of JPH0444987B2 publication Critical patent/JPH0444987B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/78Architectures of general purpose stored program computers comprising a single central processing unit
    • G06F15/7839Architectures of general purpose stored program computers comprising a single central processing unit with memory
    • G06F15/7842Architectures of general purpose stored program computers comprising a single central processing unit with memory on one IC chip (single chip microcontrollers)

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Microcomputers (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、シングル・チツプ・マイクロコン
ピユータ、特にその汎用タイマに関するものであ
る。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a single-chip microcomputer, and particularly to a general-purpose timer thereof.

〔従来の技術〕[Conventional technology]

第2図は従来のシングル・チツプ・マイクロコ
ンピユータの汎用タイマをウオツチドツグタイマ
として使用する場合の構成を示すブロツク図であ
り、図において1はシングル・チツプ・マイクロ
コンピユータ、2は汎用タイマ、3はタイマ入出
力端子、4はタイマ出力制御回路で、出力機能の
ときは、“0”レベルアクテイブのNチヤンネル
オープンドレイン回路が動作する。5はカウン
タ、6はタイマ機能制御レジスタ、7はCPU、
8はROM、9はRAM、10は汎用入出力回路、
11はリセツト入力端子、12は外部リセツト入
力、13はプルアツプ抵抗、14,15はワンシ
ヨツトマルチバイブレータである。
FIG. 2 is a block diagram showing the configuration when a general-purpose timer of a conventional single-chip microcomputer is used as a watchdog timer. In the figure, 1 is a single-chip microcomputer, 2 is a general-purpose timer, 3 is a timer input/output terminal, 4 is a timer output control circuit, and when in the output function, an N-channel open drain circuit with "0" level active operates. 5 is a counter, 6 is a timer function control register, 7 is a CPU,
8 is ROM, 9 is RAM, 10 is general-purpose input/output circuit,
11 is a reset input terminal, 12 is an external reset input, 13 is a pull-up resistor, and 14 and 15 are one-shot multivibrators.

次に動作について説明する。 Next, the operation will be explained.

外部リセツト入力端子12を“0”レベルにす
ると、リセツト入力端子11が“0”レベルにな
り、シングル・チツプ・マイクロコンピユータ1
は直ちにリセツト状態に移行する。このとき、プ
ログララムによつて入力機能と出力機能の切り換
えが行なわれる端子は入力機能のモードとなる。
タイマ入出力端子3も入力モードとなり、プルア
ツプ抵抗13のため、電位は“1”レベルとな
る。
When the external reset input terminal 12 is set to "0" level, the reset input terminal 11 becomes "0" level, and the single chip microcomputer 1
immediately enters the reset state. At this time, the terminal whose input function and output function are switched by the program is in the input function mode.
The timer input/output terminal 3 also enters the input mode, and because of the pull-up resistor 13, the potential becomes "1" level.

外部リセツト入力端子12を“1”レベルにす
ると、リセツト入力端子11が“1”レベルとな
り、CPU7は所定のタイミングでプログラムの
実行を開始する。このプログラムの初期設定の部
分に、汎用タイマ2の機能の設定も含まれる。タ
イマの設定は、まずタイマ機能設定レジスタ6を
操作してカウンタ5のカウント源を閉じ、次にカ
ウンタ5のカウンタそのものとリロードレジスタ
に所定のカウント数を設定し、次にタイマ機能設
定レジスタ6を再度操作してタイマ出力制御回路
4を能動してタイマ入出力端子3を出力モードに
し、カウンタ5のカウント源を内部クロツクにす
る。
When the external reset input terminal 12 is set to the "1" level, the reset input terminal 11 is set to the "1" level, and the CPU 7 starts executing the program at a predetermined timing. The initial setting part of this program also includes setting the functions of the general-purpose timer 2. To set the timer, first operate the timer function setting register 6 to close the count source of the counter 5, then set the predetermined count number in the counter itself and the reload register of the counter 5, and then close the timer function setting register 6. Operate again to activate the timer output control circuit 4, set the timer input/output terminal 3 to output mode, and set the count source of the counter 5 to the internal clock.

以上の操作で汎用タイマ2の初期設定が完了す
るが、タイマ入出力端子3の電位は“1”レベル
のままである。マイクロコンピユータ1が正常動
作中は、定期的にカウンタ5の値を書き直すプロ
グラムになつており、オーバフローは生じない
が、マイクロコンピユータ1が暴走して、カウン
タ5の値を書き直すルーチンを実行しなくなれ
ば、カウンタ5はオーバフローを生じ、タイマ入
出力端子3の出力は“0”レベルになる。
The above operations complete the initial setting of the general-purpose timer 2, but the potential of the timer input/output terminal 3 remains at the "1" level. When the microcomputer 1 is operating normally, the program is designed to periodically rewrite the value of the counter 5, and no overflow will occur. However, if the microcomputer 1 goes out of control and stops executing the routine to rewrite the value of the counter 5. , the counter 5 overflows and the output of the timer input/output terminal 3 becomes "0" level.

この変化によりワンシヨツトマルチバイブレー
タ14のQ出力端子から正のパルスが発生する。
このパルスの立下がりによつて次段のワンシヨツ
トマルチバイブレータ15の出力端子からマイ
クロコンピユータ1のリセツトに十分な幅のパル
スが発生する。これがリセツト入力端子11に伝
達され、マイクロコンピユータ1はリセツト動作
を行ない、タイマ入出力端子3は入力モードとな
つて、プルアツプ抵抗13により、電位は“1”
レベルに戻る。以下、リセツト入力端子12を
“1”レベルにした場合と同様な動作が行なわれ
る。
This change generates a positive pulse from the Q output terminal of the one-shot multivibrator 14.
As this pulse falls, a pulse with a width sufficient to reset the microcomputer 1 is generated from the output terminal of the next-stage one-shot multivibrator 15. This is transmitted to the reset input terminal 11, the microcomputer 1 performs a reset operation, the timer input/output terminal 3 becomes input mode, and the potential is set to "1" by the pull-up resistor 13.
Return to level. Thereafter, the same operation as when the reset input terminal 12 is set to the "1" level is performed.

上記の場合に外付けのワンシヨツトマルチバイ
ブレータ14,15による遅延回路を省いて、タ
イマ入出力端子3とリセツト入力端子11を連結
すると、タイマ入出力端子3の出力が“0”レベ
ルになつた途端リセツトがかかり始め、汎用タイ
マ2が入力モードになり、リセツトパルスの幅が
極めて狭くなり、リセツト回路が内部で完全な動
作を行なわなくなることがある。
In the above case, if the delay circuit using the external one-shot multivibrators 14 and 15 is omitted and the timer input/output terminal 3 and the reset input terminal 11 are connected, the output of the timer input/output terminal 3 becomes "0" level. As soon as the reset begins, the general-purpose timer 2 enters the input mode, the width of the reset pulse becomes extremely narrow, and the reset circuit may not operate completely internally.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来のシングル・チツプ・マイクロコンピユー
タは以上のように構成されていて、汎用タイマ2
をウオツチドツグタイマとして用いるためには、
遅延回路を外付けする必要があるという問題点が
あつた。
A conventional single-chip microcomputer is configured as described above, and has two general-purpose timers.
To use as a watchdog timer,
There was a problem in that it required an external delay circuit.

この発明は、上記のような従来のものの問題点
に鑑みてなされたもので、汎用タイマをウオツチ
ドツグタイマに用いる場合にも、外付けの遅延回
路を必要としないシングル・チツプ・マイクロコ
ンピユータを提供することを目的とするものであ
る。
This invention was made in view of the problems of the conventional ones as described above, and it is a single-chip microcomputer that does not require an external delay circuit even when a general-purpose timer is used as a watchdog timer. The purpose is to provide the following.

〔問題点を解決するための手段〕[Means for solving problems]

この発明に係るマイクロコンピユータは、内部
に汎用タイマ2のタイマ機能設定回路6のリセツ
トタイミングを当該マイクロコンピユータ内の他
の部分のリセツトタイミングより遅延させる遅延
回路を内蔵したものである。
The microcomputer according to the present invention has a built-in delay circuit that delays the reset timing of the timer function setting circuit 6 of the general-purpose timer 2 from the reset timing of other parts within the microcomputer.

〔作用〕[Effect]

この発明においては、カウンタ5のオーバフロ
ーが生じ、タイマ入出力端子3の出力が“0”レ
ベルになると、他の部分にリセツトがかかり始め
るが、汎用タイマ自体2にリセツトがかかるのは
内蔵遅延回路によつて遅れ、汎用タイマ2が入力
モードになるのが遅れ、内部リセツト回路が完全
に動作を行なう。
In this invention, when an overflow occurs in the counter 5 and the output of the timer input/output terminal 3 reaches the "0" level, other parts begin to be reset, but the general-purpose timer itself 2 is reset by the built-in delay circuit. , the general purpose timer 2 is delayed in entering input mode, and the internal reset circuit is fully operational.

〔実施例〕〔Example〕

第1図はこの発明の実施例を示すブロツク図で
あり、図において3,4,5,6,7,8,9,
10,11,13は第2図の同一符号が示すもの
と同一のものであり、1aはこの発明に係るマイ
クロコンピユータ、2aはこの発明に係る汎用タ
イマ、16はリセツトタイミング遅延回路であ
る。
FIG. 1 is a block diagram showing an embodiment of the present invention.
10, 11, and 13 are the same as those indicated by the same reference numerals in FIG. 2, 1a is a microcomputer according to the present invention, 2a is a general-purpose timer according to the present invention, and 16 is a reset timing delay circuit.

次に動作について説明する。 Next, the operation will be explained.

リセツト入力端子11を“0”レベルにする
と、シングル・チツプ・マイクロコンピユータ1
aは汎用タイマ2a部分を除いて直ちにリセツト
状態に移行する。汎用タイマ2aも所定の遅延の
後、リセツト状態となり、タイマ入出力端子3は
入力モードとなる。リセツト入力端子11に
“0”レベルを印加することをやめると、プルア
ツプ抵抗13の作用により、リセツト入力端子1
1電圧は“1”レベルとなり、CPU7は所定の
タイミングでプログラムの実行を開始する。
CPU7がプログラムの実行を開始する以前に、
リセツトタイミング遅延回路16の出力は、リセ
ツトを解除する状態になつている。
When reset input terminal 11 is set to “0” level, single chip microcomputer 1
A immediately shifts to the reset state except for the general-purpose timer 2a portion. After a predetermined delay, the general-purpose timer 2a also enters the reset state, and the timer input/output terminal 3 enters the input mode. When the application of the "0" level to the reset input terminal 11 is stopped, the pull-up resistor 13 causes the reset input terminal 1 to
1 voltage becomes the "1" level, and the CPU 7 starts executing the program at a predetermined timing.
Before CPU7 starts executing the program,
The output of the reset timing delay circuit 16 is in a state that releases the reset.

CPU7のプログラムの初期設定の部分に、汎
用タイマ2aの機能の設定も含まれる。タイマの
設定は従来のものの場合と全く同様に、まずタイ
マ機能設定レジスタ6を操作してカウンタ5のカ
ウント源を閉じ次にカウンタ5のカウンタそのも
のとリロードレジスタに所定のカウント数を設定
し、次にタイマ機能設定レジスタ6を再度操作し
てタイマ出力制御回路4を能動にしてタイマ入出
力端子3を出力モードにし、カウンタ5のカウン
ト源を内部クロツクとする。
The initial setting part of the program for the CPU 7 also includes setting the function of the general-purpose timer 2a. The setting of the timer is exactly the same as in the case of the conventional one. First, operate the timer function setting register 6 to close the count source of the counter 5. Next, set the predetermined count number in the counter itself and the reload register of the counter 5. Then, the timer function setting register 6 is operated again, the timer output control circuit 4 is activated, the timer input/output terminal 3 is set to the output mode, and the count source of the counter 5 is set to the internal clock.

以上の操作で汎用タイマ2aの初期設定が完了
するが、タイマ入出力端子3の電位は“1”レベ
ルのままである。マイクロコンピユータ1aが正
常動作中は、定期的にカウンタ5の値を書き直す
プログラムになつており、オーバフローは生じな
いが、マイクロコンピユータ1aが暴走して、カ
ウンタ5の値を書き直すルーチンを実行しなくな
れば、カウンタ5はオーバフローを生じ、タイマ
入出力端子3の出力は“0”レベルになる。タイ
マ入出力端子3は直接リセツト入力端子11に接
続されているため、マイクロコンピユータ1a
は、汎用タイマ2a部分を除いて直ちにリセツト
状態に移行する。汎用タイマ2aもリセツトタイ
ミング遅延回路16による遅延の後、リセツトさ
れ、タイマ入出力端子3は入力モードとなつて、
“0”レベル出力がなくなり、プルアツプ抵抗1
3の作用によつて“1”レベルに戻り、CPU7
は所定のタイミングでプログラムの実行を開始す
る。CPU7がプログラムの実行を開始する以前
に、リセツトタイミング遅延回路16の出力は、
リセツトを解除する状態になつている。以下、同
様の動作が行なわれる。
The above operations complete the initial setting of the general-purpose timer 2a, but the potential of the timer input/output terminal 3 remains at the "1" level. When the microcomputer 1a is operating normally, the program is such that it periodically rewrites the value of the counter 5, and overflow does not occur. However, if the microcomputer 1a goes out of control and stops executing the routine to rewrite the value of the counter 5. , the counter 5 overflows and the output of the timer input/output terminal 3 becomes "0" level. Since the timer input/output terminal 3 is directly connected to the reset input terminal 11, the microcomputer 1a
immediately enters the reset state except for the general-purpose timer 2a portion. The general-purpose timer 2a is also reset after a delay by the reset timing delay circuit 16, and the timer input/output terminal 3 becomes input mode.
“0” level output disappears, pull-up resistor 1
3 returns to the “1” level and CPU7
starts executing the program at a predetermined timing. Before the CPU 7 starts executing the program, the output of the reset timing delay circuit 16 is
It is now ready to release the reset. Similar operations are performed thereafter.

なお、上記実施例ではリセツトタイミング遅延
回路16が汎用タイマ2aのみのリセツトを遅延
させる例を示したが、他の入出力回路10などの
リセツトも遅延させる構成としてもよい。
Although the above embodiment shows an example in which the reset timing delay circuit 16 delays the reset of only the general-purpose timer 2a, it may also be configured to delay the reset of other input/output circuits 10, etc.

また、上記実施例ではリセツトタイミング遅延
回路16の出力は入力をある時間そのまま遅延さ
せたものであつたが、汎用タイマ2aがマイクロ
コンピユータ1a内の他のリセツトより遅れてリ
セツトされ、汎用タイマ2aの機能設定を行なう
時までに、リセツトが解除される構成であればど
のような構成にしても同様の効果を奏する。
Further, in the above embodiment, the output of the reset timing delay circuit 16 is the input that is delayed by a certain period of time, but the general-purpose timer 2a is reset later than other resets in the microcomputer 1a, and the general-purpose timer 2a is reset later than other resets in the microcomputer 1a. The same effect can be achieved regardless of the configuration as long as the reset is canceled by the time the function settings are made.

また、上記においては、リセツト回路が“0”
レベルでリセツトを行なう場合について説明した
が、“1”レベルでリセツトを行なうことにして
もよい。
In addition, in the above, the reset circuit is set to “0”.
Although the case where the reset is performed at the level has been described, the reset may be performed at the "1" level.

タイマ入出力端子3の出力形式はNチヤンネル
オープンドレイン形式に限ることなく、また、上
記実施例のように汎用タイマ2aが外部端子から
の入力機能を有するものでない場合も同様の効果
を得ることができる。
The output format of the timer input/output terminal 3 is not limited to the N-channel open drain format, and the same effect can be obtained even when the general-purpose timer 2a does not have an input function from an external terminal as in the above embodiment. can.

〔発明の効果〕〔Effect of the invention〕

以上のように、この発明によれば、汎用タイマ
をウオツチドツグタイマとして使用する場合も、
外付け回路が必要でなく、シングル・チツプ・マ
イクロコンピユータを使用するシステムの小型、
軽量化に有利で安価に構成できるという効果があ
る。
As described above, according to the present invention, even when a general-purpose timer is used as a watchdog timer,
The small size of the system, which requires no external circuitry and uses a single-chip microcomputer,
It has the advantage of being lightweight and can be constructed at low cost.

なお、従来の構造で狭いリセツトパルスでも確
実にリセツトが行なわれるように構成しても、リ
セツトを要する周辺回路を有するシステムに使用
する場合は、外部に遅延回路が必要となるが、こ
の発明によれば、ウオツチドツグタイマのリセツ
トパルスの最小時間を保証することができるの
で、外部の遅延回路がこの場合にも不要であると
いう効果がある。
Note that even if the conventional structure is configured to ensure resetting even with a narrow reset pulse, an external delay circuit is required when used in a system that has peripheral circuits that require resetting. According to this method, since the minimum time of the reset pulse of the watchdog timer can be guaranteed, an external delay circuit is not required in this case as well.

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

第1図はこの発明の一実施例を示すブロツク
図、第2図は従来のシングル・チツプ・マイクロ
コンピユータの汎用タイマをウオツチドツグタイ
マとして使用する場合の構成を示すブロツク図で
ある。 図において1aはシングル・チツプ・マイクロ
コンピユータ、2aは汎用タイマ、3はタイマ入
出力端子、4はタイマ出力制御回路、5はカウン
タ、6はタイマ機能制御レジスタ、7はCPU、
8はROM、9はRAM、10は汎用入出力回路、
11はリセツト入力端子、13はプルアツプ抵
抗、16はリセツトタイミング遅延回路である。
なお各図中同一符号は同一の部分を示すものとす
る。
FIG. 1 is a block diagram showing one embodiment of the present invention, and FIG. 2 is a block diagram showing a configuration when a general-purpose timer of a conventional single-chip microcomputer is used as a watchdog timer. In the figure, 1a is a single chip microcomputer, 2a is a general-purpose timer, 3 is a timer input/output terminal, 4 is a timer output control circuit, 5 is a counter, 6 is a timer function control register, 7 is a CPU,
8 is ROM, 9 is RAM, 10 is general-purpose input/output circuit,
11 is a reset input terminal, 13 is a pull-up resistor, and 16 is a reset timing delay circuit.
Note that the same reference numerals in each figure indicate the same parts.

Claims (1)

【特許請求の範囲】 1 1つのチツプ内に中央処理装置、メモリ装
置、および汎用タイマを集積した集積回路装置を
用いるシングル・チツプ・マイクロコンピユータ
において、 上記汎用タイマはタイマ機能設定回路により、
出力を行つたり、出力を禁止したりするように制
御されるタイマ出力端子を備え、 上記タイマ機能設定回路は通常動作時、上記中
央処理装置による操作で上記制御を行うよう動作
し、さらに上記タイマ機能設定回路はリセツト
時、上記タイマ出力端子を出力禁止状態に設定す
るよう制御し、 上記タイマ機能設定回路のリセツトタイミング
を当該マイクロコンピユータの他の部分のリセツ
トタイミングより遅延させる遅延回路を内蔵する
ことを特徴とするシングル・チツプ・マイクロコ
ンピユータ。
[Scope of Claims] 1. In a single-chip microcomputer using an integrated circuit device in which a central processing unit, a memory device, and a general-purpose timer are integrated in one chip, the general-purpose timer is configured to:
The timer function setting circuit is provided with a timer output terminal that is controlled to perform output or prohibit output, and the timer function setting circuit operates to perform the above control under operation by the central processing unit during normal operation, and The timer function setting circuit has a built-in delay circuit that controls the above-mentioned timer output terminal to be set to an output prohibited state at the time of reset, and delays the reset timing of the above-mentioned timer function setting circuit from the reset timing of other parts of the microcomputer. A single-chip microcomputer characterized by:
JP60087872A 1985-04-24 1985-04-24 Single chip microcomputer Granted JPS61246866A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60087872A JPS61246866A (en) 1985-04-24 1985-04-24 Single chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60087872A JPS61246866A (en) 1985-04-24 1985-04-24 Single chip microcomputer

Publications (2)

Publication Number Publication Date
JPS61246866A JPS61246866A (en) 1986-11-04
JPH0444987B2 true JPH0444987B2 (en) 1992-07-23

Family

ID=13926957

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60087872A Granted JPS61246866A (en) 1985-04-24 1985-04-24 Single chip microcomputer

Country Status (1)

Country Link
JP (1) JPS61246866A (en)

Also Published As

Publication number Publication date
JPS61246866A (en) 1986-11-04

Similar Documents

Publication Publication Date Title
US5448743A (en) General I/O port interrupt mechanism
JPH0444987B2 (en)
JP2648003B2 (en) Timer counter
SU1142822A1 (en) Timer
JPH0465407B2 (en)
JPH0756774A (en) Watching timer
JP2544224Y2 (en) Microcomputer time constant setting circuit
JP2683295B2 (en) Arithmetic processing unit
JPS622684Y2 (en)
JPH035948Y2 (en)
KR0155045B1 (en) How to Implement Watchdog Timers in Unmanned Security Systems
JPH027134A (en) Simplified step evaluating device for processor
JPH039057Y2 (en)
JPS6341951A (en) Microcomputer
JPH0434612A (en) Stand-by circuit
JPH0580174B2 (en)
JPH0427730B2 (en)
JPH04205193A (en) Sleep and wake-up control circuit for microcomputer
JPH0713655A (en) Semiconductor integrated circuit
JPH0425915A (en) Microcomputer
JPH0454615A (en) Peripheral controller
JPH02287840A (en) Microprocessor
JPH04175937A (en) microcomputer
JPS6218950B2 (en)
JPS60103426A (en) Microcomputer