JPS63236135A - Timer interruption system - Google Patents

Timer interruption system

Info

Publication number
JPS63236135A
JPS63236135A JP6937987A JP6937987A JPS63236135A JP S63236135 A JPS63236135 A JP S63236135A JP 6937987 A JP6937987 A JP 6937987A JP 6937987 A JP6937987 A JP 6937987A JP S63236135 A JPS63236135 A JP S63236135A
Authority
JP
Japan
Prior art keywords
timer interrupt
counter
timer interruption
timer
value
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
JP6937987A
Other languages
Japanese (ja)
Inventor
Hidenori Minamiguchi
南口 秀紀
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP6937987A priority Critical patent/JPS63236135A/en
Publication of JPS63236135A publication Critical patent/JPS63236135A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • G06F9/4825Interrupt from clock, e.g. time of day

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)

Abstract

PURPOSE:To secure a time point even in case a CPU does not always given an answer to a timer interruption by adding a readable timer interruption counter which counts the timer start frequency to a timer circuit. CONSTITUTION:The value of a timer interruption counter 8 which is read out by a counter reading means 9 is usually set at 1 each time as long as a timer interruption is requested to a central processing unit CPU3' and a timer interruption process is always started by a timer interruption signal produced by a timer interruption signal production means 7. If the preceding timer interruption is not accepted by the CPU3', the value of the counter 8 read out by the means 9 is equal to 2 since the counter 8 is counting the timer interruption signals as long as the current timer interruption is accepted and a timer interruption process is started. Then the value 2 of the counter 8 is added to the time point information stored in a memory 4 by a time point count means 11 for counting time points.

Description

【発明の詳細な説明】 概   要 cpu、メモリ、I10インタフェイス等を含むプロセ
ッサシステムにおいて、タイマ回路にタイマ起動回数を
計数する読み出し可能なタイマ割込みカウンタを設けた
ことを特徴とするタイマ割込み方式。これによりタイマ
割込みに対してCPUが必ずしも応答しない場合でも、
時刻の保障を行なうことができる。
DETAILED DESCRIPTION OF THE INVENTION Overview A timer interrupt method in a processor system including a CPU, memory, I10 interface, etc., characterized in that a timer circuit is provided with a readable timer interrupt counter for counting the number of times the timer is activated. As a result, even if the CPU does not necessarily respond to timer interrupts,
Time can be guaranteed.

産業上の利用分野 本発明はcpu、メモリ、I10インタフェイス等を含
むプロセッサシステムのタイマ割込み方式に関する。
INDUSTRIAL APPLICATION FIELD The present invention relates to a timer interrupt method for a processor system including a CPU, memory, I10 interface, etc.

マイクロコンピュータ等のプロセッサシステムは、電子
レンジなどの家電製品から産業用ロボットなどの産業製
品まで広く応用されている。通信装置、0Δ機器等の制
御はこのプロセッサシステムにより効率良く達成され、
その機能の高度化及び小型化がはかられている。これら
のプロセッサシステムは一般的にタイマ回路によるタイ
マ割込み方式を採用すると共に、タイマ回路により時刻
計数を行なうようにしている。
Processor systems such as microcomputers are widely applied from home appliances such as microwave ovens to industrial products such as industrial robots. Control of communication devices, 0Δ equipment, etc. is efficiently achieved by this processor system,
Efforts are being made to improve the functionality and miniaturize the device. These processor systems generally employ a timer interrupt method using a timer circuit, and also use the timer circuit to perform time counting.

従来の技術 従来のタイマ割込み方式は、一定時刻毎に発生するタイ
マ割込み信号をプロセッサのCPU及びフリップフロッ
プ回路に入力し、プロセッサの割込み起動回数より時刻
計数を行なっていた。これを第4図に示す。発撮器1に
より発振されたクロックaを分周器2により適当な周波
数に分周し、例えば1秒間隔のタイマ割込み信号すを形
成する。
2. Description of the Related Art In the conventional timer interrupt system, a timer interrupt signal generated at fixed time intervals is input to the CPU and flip-flop circuit of a processor, and time is counted based on the number of interrupt activations of the processor. This is shown in FIG. A clock a generated by an oscillator 1 is divided into an appropriate frequency by a frequency divider 2 to form a timer interrupt signal having an interval of, for example, one second.

分周器2からのタイマ割込み信号はタイマ割込みのため
にCPU3に入力されると共に、フリップフロップ5に
も入力される。CPU3はタイマ割込みルーチンを起動
すると、データバスドライバ6にリード信号Cを送出し
、データバスドライバ6によりフリップフロップ5の内
容dを読み出してからCP LJ 3の制御によりフリ
ップフロップ5をクリアする。データバスドライバ6に
より読み出されたフリップフロップ5の内容eは、メモ
リ4上の時刻情報に加算され時刻計数を行なうようにな
っている。
The timer interrupt signal from the frequency divider 2 is input to the CPU 3 for timer interrupt, and is also input to the flip-flop 5. When the CPU 3 starts the timer interrupt routine, it sends a read signal C to the data bus driver 6, reads the content d of the flip-flop 5 by the data bus driver 6, and then clears the flip-flop 5 under the control of the CP LJ 3. The contents e of the flip-flop 5 read out by the data bus driver 6 are added to the time information on the memory 4 to perform time counting.

水力式は、一定時刻毎に発生するタイマ割込みに対して
プロセッサが必ず応答しなければならなかった。その理
由としては、プロセッサがタイマ割込みに対して必ず応
答しないと、時刻の計数にとりこぼしが発生し時刻のず
れを生じるためである。
In the hydraulic type, the processor had to always respond to timer interrupts that occurred at regular intervals. The reason for this is that if the processor does not always respond to a timer interrupt, there will be a drop in time counting, resulting in a time lag.

発明が解決しようとする問題点 しかしながら上述した従来のタイマ割込み方式において
は、プロセッサの処理の都合上割込みが受付られなかっ
た場合には、割込みの起動がなされずに1回抜けること
になる。これはタイマ回路に7リツプフロツブ5を使用
しているためであり、割込みの起動がなされない場合に
はフリップフロップ5の内容は読み出されず、次のタイ
マ割込み信号がフリップ70ツブ5に入力した場合でも
フリップフロップ5の出力は依然として1であるからで
ある。このように従来のタイマ割込み方式では、割込み
の起動がされずに例えば1回抜けることにより、時刻に
ずれを生じるという欠点があった。
Problems to be Solved by the Invention However, in the above-described conventional timer interrupt method, if an interrupt is not accepted due to processor processing, the interrupt is not activated and exits once. This is because the timer circuit uses the flip-flop 5, and if the interrupt is not activated, the contents of the flip-flop 5 will not be read out, even if the next timer interrupt signal is input to the flip-flop 5. This is because the output of flip-flop 5 is still 1. As described above, the conventional timer interrupt method has the disadvantage that, for example, if the interrupt is exited once without being activated, a time lag occurs.

ここでいう割込みが受付られなかった場合とは、(イ)
別の割込み処理ルーチンの処理が長びいた場合、(ロ)
処理の都合上、ある時間帯だけ割込み禁止の状態にプロ
グラムしている場合が当てはまる。
The case where the interrupt is not accepted here means (a)
If the processing of another interrupt handling routine takes a long time, (b)
This applies to cases where interrupts are programmed to be disabled only during a certain period of time for processing reasons.

本発明はこのような点に鑑みなされたものであり、その
目的とするところは、タイマ割込みに対してプロセッサ
が必ず応答しなくても、時刻の保障が行なえるタイマ割
込み方式を提供することである。
The present invention has been made in view of these points, and its purpose is to provide a timer interrupt method that can guarantee time even if the processor does not always respond to timer interrupts. be.

問 点を解沖するための手段 第1図は本発明の原理ブロック図を示して43す、本発
明のタイマ割込み方式は、タイマ割込み信号発生手段7
により一定時刻毎に発生されるタイマ割込み信号により
1づつインクリメントされるタイマ割込みカウンタ8と
、中央処理装置3′がタイマ割込み受付時にタイマ割込
みカウンタ8の値を読ませるカウンタリード手段9と、
読み出されたタイマ割込みカウンタ8の値をメモリ4上
の時刻情報に加tマシ時刻計数を行なう時刻計数手段1
1と、カウンタリード手段10によりタイマ割込みカウ
ンタ8の値を読み出してからタイマ割込みカウンタ8の
値をクリアするカウンタクリア手段10とから構成され
る。
Means for Solving the Problems Figure 1 shows a block diagram of the principle of the present invention.
a timer interrupt counter 8 that is incremented by one by a timer interrupt signal generated at regular intervals; and a counter read means 9 that causes the central processing unit 3' to read the value of the timer interrupt counter 8 when accepting a timer interrupt.
Time counting means 1 which adds the read value of the timer interrupt counter 8 to the time information stored in the memory 4 and counts the time by t.
1, and a counter clearing means 10 for reading the value of the timer interrupt counter 8 by the counter reading means 10 and then clearing the value of the timer interrupt counter 8.

なおりウンタリード手段9、カウンタクリア手段10及
び時刻計数手段11は予めプログラムされている中央処
理装置3′の機能を手段として取出したものである。
The counter read means 9, the counter clear means 10, and the time counting means 11 are derived from the functions of the central processing unit 3' which are programmed in advance.

作−m−m 通常、タイマ割込み信号発生手段7により発生されたタ
イマ割込み信号により、タイマ割込みが中央処理装置3
′に要求されて必ずタイマ割込み処理が起動されたなら
ば、カウンタリード手段9により読み出したタイマ割込
みカウンタ8の値は毎回1である。もし前回のタイマ割
込みが中央処理装置3′により受付けられなかった場合
、タイマ割込みカウンタ8はタイマ割込み信号を計数し
ているので、今回のタイマ割込みが受付けられタイマ割
込み処理が起動されたとすると、カウンタリード手段9
により読み出されたタイマ割込みカウンタ8の値は2で
あり、この値を時刻計数手段11によりメモリ4上の時
刻情報に加算し時刻計数を行なう。
Normally, the timer interrupt is generated by the timer interrupt signal generated by the timer interrupt signal generating means 7, and the timer interrupt is generated by the central processing unit 3.
If the timer interrupt processing is always started as requested by ', the value of the timer interrupt counter 8 read by the counter read means 9 will be 1 every time. If the previous timer interrupt was not accepted by the central processing unit 3', the timer interrupt counter 8 is counting the timer interrupt signals, so if the current timer interrupt is accepted and timer interrupt processing is started, the counter Lead means 9
The value of the timer interrupt counter 8 read out is 2, and this value is added to the time information on the memory 4 by the time counting means 11 to perform time counting.

即ち本発明のタイマ割込み方式によると、タイマ割込み
が起動されずにとりこぼした時刻情報を、タイマ割込み
カウンタ8で保障していることになる。
That is, according to the timer interrupt method of the present invention, the timer interrupt counter 8 guarantees time information that is missed because the timer interrupt is not activated.

大−」L−ヨ 以下本発明を図面に示寸実施例に基づいて詳細に説明す
ることにする。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will now be described in detail based on embodiments shown in the drawings.

第2図は本発明一実施例のブロック図を示しており、第
4図に示した従来例のフリップフロップ5の代わりにタ
イマ割込みカウンタ8を設けたことを特徴とする。第2
図の実施例において、第1図の原理図に示したカウンタ
リード手段9、カウンタクリア手段10及び時刻計数手
段11はCPU3のソフトで形成されているため、各々
手段としては取り出して記載してないことに注意された
い。
FIG. 2 shows a block diagram of an embodiment of the present invention, which is characterized in that a timer interrupt counter 8 is provided in place of the flip-flop 5 of the conventional example shown in FIG. Second
In the illustrated embodiment, the counter read means 9, counter clear means 10, and time counting means 11 shown in the principle diagram of FIG. Please note that.

発1トにより発振されたクロックaは、分周2S2によ
り適当な周波数に分周され、例えば1秒毎のタイマ割込
み信号すが形成される。タイマ割込み信号すはCPU3
に入力され、CPUヘタ47割込みを要求すると同時に
タイマ割込みカウンタ8にも入力され、タイマ割込みカ
ウンタ8は0より1つインクリメントされ1となる。こ
のとぎCPU3がタイマ割込み処理を行なった場合には
、データバスドライバ6によりタイマ割込みカウンタ8
の値fを読み出し、CPU3が管理しているメモリ4上
の時刻情報にこのカウンタの値を加算し時刻計数を行な
う。
The clock a oscillated by the oscillator 1 is divided into an appropriate frequency by the frequency divider 2S2 to form a timer interrupt signal every second, for example. Timer interrupt signal CPU3
, and at the same time as requesting an interrupt to the CPU 47, it is also input to the timer interrupt counter 8, and the timer interrupt counter 8 is incremented by one from 0 to 1. When the CPU 3 performs timer interrupt processing, the timer interrupt counter 8 is set by the data bus driver 6.
The value f of the counter is read out, and the value of this counter is added to the time information on the memory 4 managed by the CPU 3 to perform time counting.

一方、CPU3がタイマ割込み処理を行なわなかった場
合には、次のタイマ割込み信号発生時にタイマ割込みカ
ウンタ8はさらに1つインクリメン1−されて2となる
。このときタイマ割込みルーチンが起動されれば、CP
tJ3はデータバスドライバ6にカウンタリード信号C
を送出してタイマ割込みカウンタ8の値2を読み出し、
この2をメモリ4上の時刻情報に加算し時刻計数を行な
う。
On the other hand, if the CPU 3 does not perform timer interrupt processing, the timer interrupt counter 8 is further incremented by one to 2 when the next timer interrupt signal is generated. If the timer interrupt routine is activated at this time, the CP
tJ3 is the counter read signal C to the data bus driver 6.
and read the value 2 of timer interrupt counter 8,
This 2 is added to the time information on the memory 4 to perform time counting.

このようにCPLJ3によりタイマ割込みルーチンが起
動されなかった場合にも、タイマ割込みカウンタ8によ
りタイマ割込み信号回数を計数しているので、次にタイ
マ割込み処理が起動されたときにこのタイマ割込みカウ
ンタ8の内容を読み出すことができ、この内容をメモリ
4の時刻情報に加算し正しい時刻計数を行なうことがで
きる。
Even if the timer interrupt routine is not activated by CPLJ3, the number of timer interrupt signals is counted by the timer interrupt counter 8, so the next time the timer interrupt processing is activated, the timer interrupt counter 8 will be counted. The contents can be read out and added to the time information in the memory 4 to perform correct time counting.

なおいうまでもないが、CPU3は、各タイマ割込みル
ーチンでタイマ割込みカウンタ8の内容を読み出し、次
いでタイマ割込みカウンタ8のクリアを行なうようにプ
ログラムされているものとする。
Needless to say, it is assumed that the CPU 3 is programmed to read the contents of the timer interrupt counter 8 in each timer interrupt routine, and then clear the timer interrupt counter 8.

次に上述した実施例の作用を第3図に示すフローチャー
トを参照して説明することにする。
Next, the operation of the above-described embodiment will be explained with reference to the flowchart shown in FIG.

まずステップ101において、初期設定としてタイマ割
込みカウンタ8をクリアし、ステップ102においてタ
イマ割込みが発生したか否かを判断する。タイマ割込み
が発生した場合にはタイマ割込みカウンタ8を1つイン
クリメントすると共に、ステップ104においてタイマ
割込み信号をCPtJ3へ発信する。次いでステップ1
05に進んでタイマ周期以内に割込み処理をしたか否か
判断し、割込み処理をした場合にはステップ106に進
んでタイマ割込みカウンタ8の値を読み出し、ステップ
107で読み出しだカウンタ値とメモリ4上の内部時刻
情報を加算し、ステップ108でタイマ割込みカウンタ
8をクリアする。
First, in step 101, the timer interrupt counter 8 is cleared as an initial setting, and in step 102, it is determined whether or not a timer interrupt has occurred. When a timer interrupt occurs, the timer interrupt counter 8 is incremented by one, and a timer interrupt signal is transmitted to CPtJ3 in step 104. Then step 1
05, it is determined whether or not an interrupt has been processed within the timer period. If the interrupt has been processed, the process proceeds to step 106, where the value of the timer interrupt counter 8 is read, and in step 107, the read counter value and the memory 4 are stored. The timer interrupt counter 8 is cleared in step 108.

一方ステップ105においてタイマ周期以内に割込み処
理が起動されなかった場合には、ステップ103でタイ
マ割込みカウンタ8の値はざらに1つインクリメントさ
れて2となる。このようにタイマ周期以内にタイマ割込
みルーチンが起動されなかった場合には、タイマ割込み
信号が発生する毎にタイマ割込みカウンタ8の値は1つ
づつ増加し、次にタイマ割込みルーチンが起動されたと
きにタイマ割込みカウンタ8の値が読み出され(ステッ
プ106) 、ステップ107で読み出しだカウンタ値
と内部時刻情報が加算されることになる。
On the other hand, if the interrupt processing is not activated within the timer cycle in step 105, the value of the timer interrupt counter 8 is roughly incremented by one to 2 in step 103. In this way, if the timer interrupt routine is not activated within the timer period, the value of the timer interrupt counter 8 increases by 1 each time a timer interrupt signal is generated, and the next time the timer interrupt routine is activated, The value of the timer interrupt counter 8 is read out (step 106), and the read counter value and internal time information are added in step 107.

発明の効果 本発明は以上詳述したように構成したので、タイマ割込
みカウンタによりタイマ割込みの回数を計数し、この計
数値を内部R刻情報に加算することができるため、タイ
マ割込みに対してプロセッサが必ずしも応答しない場合
でも、時刻の保障を行なうことができるという効果を奏
する。
Effects of the Invention Since the present invention is configured as described in detail above, the number of timer interrupts can be counted by the timer interrupt counter and this counted value can be added to the internal R clock information. This has the effect that the time can be guaranteed even if the terminal does not necessarily respond.

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

第1図は本発明の原理ブロック図、 第2図は本発明の実施例を示すブロック図、第3図は本
発明実施例の作用を示すフローチャート、 第4図は従来のタイマ割込み方式の構成を示すブロック
図である。 1・・・発振器、     2・・・分周器、3・・・
CPU、       4・・・メモリ、5・・・フリ
ップフロップ、 6・・・データバスドライバ、 7・・・タイマ割込み信号発生手段、 8・・・タイマ割込みカウンタ、 9・・・カウンタリード手段、 10・・・カウンタクリア手段、 11・・・時刻計数手段。 本蟹ヲ月原理フ゛ロッグ図 第1図 i− 享ε   オ々己  イタ1J 第2図 父亦巴イ列のフロー+ダート 従 来 例 第4図
Fig. 1 is a block diagram of the principle of the present invention, Fig. 2 is a block diagram showing an embodiment of the present invention, Fig. 3 is a flowchart showing the operation of the embodiment of the present invention, and Fig. 4 is the configuration of a conventional timer interrupt method. FIG. 1... Oscillator, 2... Frequency divider, 3...
CPU, 4...Memory, 5...Flip-flop, 6...Data bus driver, 7...Timer interrupt signal generation means, 8...Timer interrupt counter, 9...Counter read means, 10 ... Counter clearing means, 11... Time counting means. This crab moon principle diagram Fig. 1 I - Kyu ε Ooki Ita 1 J Fig. 2 Flow of father and hand row + dart Conventional example Fig. 4

Claims (1)

【特許請求の範囲】 少なくとも中央処理装置(3′)と、メモリ(4)と、
一定時刻毎にタイマ割込み信号を発生するタイマ割込み
信号発生手段(7)とを備えたプロセッサシステムにお
いて、 タイマ割込み信号により1づつインクリメントされるタ
イマ割込みカウンタ(8)と、 前記中央処理装置(3′)がタイマ割込み受付時に前記
タイマ割込みカウンタ(8)の値を読ませるカウンタリ
ード手段(9)と、 読み出されたタイマ割込みカウンタの値を前記メモリ(
4)上の時刻情報に加算し時刻計数を行なう時刻計数手
段(11)と、 前記カウンタリード手段(9)によりタイマ割込みカウ
ンタ値を読み出してから該タイマ割込みカウンタの値(
8)をクリアするカウンタクリア手段(10)とを備え
たことを特徴とするタイマ割込み方式。
[Claims] At least a central processing unit (3'), a memory (4),
A processor system comprising a timer interrupt signal generating means (7) that generates a timer interrupt signal at regular time intervals, a timer interrupt counter (8) that is incremented by 1 by the timer interrupt signal, and the central processing unit (3'). ) reads the value of the timer interrupt counter (8) when the timer interrupt counter (8) is received by the timer interrupt counter;
4) A time counting means (11) that performs time counting by adding to the above time information, and a timer interrupt counter value read out by the counter reading means (9) and then reading the timer interrupt counter value (
8) A timer interrupt method characterized by comprising a counter clearing means (10) for clearing the counter clearing means (10).
JP6937987A 1987-03-24 1987-03-24 Timer interruption system Pending JPS63236135A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6937987A JPS63236135A (en) 1987-03-24 1987-03-24 Timer interruption system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6937987A JPS63236135A (en) 1987-03-24 1987-03-24 Timer interruption system

Publications (1)

Publication Number Publication Date
JPS63236135A true JPS63236135A (en) 1988-10-03

Family

ID=13400876

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6937987A Pending JPS63236135A (en) 1987-03-24 1987-03-24 Timer interruption system

Country Status (1)

Country Link
JP (1) JPS63236135A (en)

Similar Documents

Publication Publication Date Title
JPS61249143A (en) Interruption circuit
JPS63236135A (en) Timer interruption system
JPS61105486A (en) Timer device
JPS62145411A (en) System reset control system
JPH0427730B2 (en)
JPS6228837A (en) Interruption signal control system
KR880000515Y1 (en) Switching signal control circuit
JPS61241848A (en) Fault detecting circuit for electronic computer
JPS6350903B2 (en)
JPS60262252A (en) Monitor system for runaway of microprocessor
JPH04266148A (en) Input/output control system
JPH09237205A (en) Program runaway detection device
JPS62133509A (en) Timer method
JPS61109127A (en) Timer counter
JPS5911936B2 (en) data
JPH01149637A (en) System for monitoring polling control response
JPH03240830A (en) Microcontroller
JPH0150927B2 (en)
JPS60250445A (en) Watchdog timer
JPS58181388A (en) Program managing method of remote monitor controller
JPH04151706A (en) Cpu reset circuit
JPH01292438A (en) Interruption processor
JPS6277658A (en) Runaway preventing circuit for central processing unit
JPS62131756A (en) Triac controller
JPH01216626A (en) Pulse count circuit