JPS61214031A - Interruption processing method of microcomputer - Google Patents

Interruption processing method of microcomputer

Info

Publication number
JPS61214031A
JPS61214031A JP60056709A JP5670985A JPS61214031A JP S61214031 A JPS61214031 A JP S61214031A JP 60056709 A JP60056709 A JP 60056709A JP 5670985 A JP5670985 A JP 5670985A JP S61214031 A JPS61214031 A JP S61214031A
Authority
JP
Japan
Prior art keywords
output
flip
flop
input
signal
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
JP60056709A
Other languages
Japanese (ja)
Inventor
Yoshiro Tsuchiyama
吉朗 土山
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP60056709A priority Critical patent/JPS61214031A/en
Publication of JPS61214031A publication Critical patent/JPS61214031A/en
Pending legal-status Critical Current

Links

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】 産業上の利用分野 本発明はマイクロコンピュータの割込み処理方法に関す
るものであり、特にサーボ機構、ロボットなどの制御に
適した割込み処理方法である。
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention relates to an interrupt processing method for a microcomputer, and is particularly suitable for controlling servomechanisms, robots, and the like.

従来の技術 従来、サーボ機構などにおける制御、例えばモータの回
転数の精密制御は、ハードウェアにょ9実現されていた
が、近年、マイクロコンピュータの進歩により、ソフト
ウェアでも実現されるようになった。モータの制御方法
として、モータにロータリエンコーダを取付け、回転に
比例したパルスを生ぜしめ、このパルスの間隔を一定に
保つようにモータに加速及び減速指令を与えるものであ
る。したがって、この場合、パルスのタイミングをマイ
クロコンピュータ(以下マイコンと略す)が正確に知る
ことは極めて重要であり、これにより、どれだけ精密に
制御できるかが左右される。
BACKGROUND OF THE INVENTION Conventionally, control of servomechanisms, for example, precise control of the rotational speed of a motor, has been achieved by hardware, but in recent years, with advances in microcomputers, it has also been achieved by software. A method of controlling the motor is to attach a rotary encoder to the motor, generate pulses proportional to rotation, and give acceleration and deceleration commands to the motor so as to keep the intervals between the pulses constant. Therefore, in this case, it is extremely important for the microcomputer (hereinafter abbreviated as microcomputer) to accurately know the pulse timing, and this determines how precisely control can be performed.

大部分のマイコンは、パルスのタイミングを直接検出す
る機能は有していないが、例えば、インテル社の1チツ
プマイクロコンピユータ、MC896などでは、第7図
に示すように、入力信号のエツジを検出して、そのとき
のタイミングを記憶することが可能になっている。
Most microcontrollers do not have a function to directly detect pulse timing, but Intel's 1-chip microcomputer MC896, for example, detects the edges of input signals as shown in Figure 7. It is now possible to memorize the timing.

以下、第7図にもとづき説明する。各入力信号(1〜4
)は変化検出回路(701〜704)を経てFIFO(
First In First 0ut)706に入力
される。またnビットカウンタ705の出力も同様にF
 I FO706に入力されている。したがってP I
 F0706のビット幅はn+4ビツトとなる。入力1
〜4のうち何れかが変化すると入力信号値及びnビット
2進カウンタ値がFIFO706に書込まれる。すなわ
ち、FIFO706に変化した信号情報とそのときの時
刻が蓄積されることになる。F I FO706に蓄積
された情報量が増加すると割込み要求信号が出されて、
cpU(図示せず)に割込みを発生させる。割込み処理
としては、FIFO706を順に読出して、それに応じ
た処理を行なう。これにより、入力信号1〜4の変化し
た時刻を容易に知ることができる。
This will be explained below based on FIG. Each input signal (1 to 4
) is sent to FIFO (
First In First Out) 706. Similarly, the output of the n-bit counter 705 is F.
It is input to IFO706. Therefore P I
The bit width of F0706 is n+4 bits. input 1
When any one of .about.4 changes, the input signal value and the n-bit binary counter value are written to the FIFO 706. That is, the changed signal information and the time at that time are stored in the FIFO 706. When the amount of information stored in the F I FO 706 increases, an interrupt request signal is issued,
Generates an interrupt to the cpU (not shown). For interrupt processing, the FIFO 706 is read out in order and processing is performed accordingly. Thereby, the time at which the input signals 1 to 4 change can be easily known.

発明が解決しようとする問題点 さて、従来例においては、P I FO706において
、各段全てにわたって、カウンタのビット数と入力信号
の全ビット数との和のビット数が必要であった。このた
め、入力信号の種類が増加すると、P I FO706
の容量が非常に大きくなるという欠点を有している。
Problems to be Solved by the Invention In the conventional example, in the P I FO 706, the sum of the number of bits of the counter and the total number of bits of the input signal was required for all stages. Therefore, as the types of input signals increase, the P I FO706
The disadvantage is that the capacity is very large.

また、FIFOを使っているため、その段数分だけ処理
が遅れることになる。特に、殆んど同時に、優先度の異
なる入力が入った場合にも、入った時刻の順にしか処理
ができず、優先度の高い入力に対する処理が遅れないよ
うにするのは、ソフトウェアが複雑になってし捷う。
Furthermore, since FIFO is used, processing will be delayed by the number of stages. In particular, even if inputs with different priorities arrive at almost the same time, they can only be processed in the order of the time they arrived, and the software is complicated to ensure that the processing of inputs with higher priority is not delayed. I'm going to change it.

問題点を解決するための手段 上記問題点を解決するために、nピノhカウンタの値を
記憶する手段をそれぞれの入力信号に応じて設け、さら
にそれぞれの入力信号の変化したことを記憶する手段を
設け、少なくともどれかひとつの入力信号の変化により
、CPUに割込みをかけるものである。
Means for Solving the Problems In order to solve the above problems, means for storing the value of the n pino h counter is provided in accordance with each input signal, and further means for storing changes in each input signal. is provided, and an interrupt is issued to the CPU in response to a change in at least one of the input signals.

作  用 クロックを計数するnビットカウンタを有し、j個の外
部入力信号に対して、該入力信号がそれぞれ有効レベル
に変化したことを前記クロックに同期して検出する手段
をj個有し1、該検出手段よりの出力信号により前記n
ビットカウンタの出力値をそれぞれラッチするj個の出
力制御可能なnビットラッチと、前記検出手段よりの出
力信号により個々にセットされるj個の出力制御可能な
フリップフロップを有し、該フリップフロップの出力と
同リセット入力と前記nビットラッチの出力とは、マイ
クロコンピュータのデータバスにつながっており、アド
レスを指定することにより、データの読出し及び書込み
が可能になっている。さらに前記入力信号変化検出手段
よりの出力信号の論理和をとり、該論理和出力によりC
PUに割込要求を発生する手段を有するため、CPUが
割込み処理において、前記j個の7IJ ツブフロップ
の出力をデータバス上に読出して、セットされているフ
リップ70ツブに対応した処理を行なうと共に、セット
されているスリップフロップをデータバスを通してリセ
ットする。これにより、CPUは、j個の入力信号に対
してどの信号がいつ変化したかをただちにかつ容易に知
ることができるものである。
It has an n-bit counter for counting the operating clock, and has j means for detecting, in synchronization with the clock, that each of the j external input signals has changed to a valid level. , the output signal from the detection means determines the n
j number of output-controllable n-bit latches for respectively latching the output value of the bit counter, and j number of output-controllable flip-flops each set by an output signal from the detection means; The output, the reset input, and the output of the n-bit latch are connected to the data bus of the microcomputer, and data can be read and written by specifying an address. Furthermore, the output signals from the input signal change detection means are logically summed, and the
Since the CPU has a means for generating an interrupt request to the PU, in interrupt processing, the CPU reads the outputs of the j 7IJ round flops onto the data bus and performs processing corresponding to the set flip 70 round. Resets the set slip-flop through the data bus. Thereby, the CPU can immediately and easily know which signal changes and when among the j input signals.

実施例 本発明の実施例を図面に基づき説明する。第1図は本発
明の概略構成を示すブロック図である。
Embodiment An embodiment of the present invention will be described based on the drawings. FIG. 1 is a block diagram showing a schematic configuration of the present invention.

外部入力信号1〜4はそれぞれ論理微分回路1〜4に入
力され、レベル変化の検出(一種の微分)回路11にも
入力され、さらには、CPU割込み7 ・\ 回路5の出力につながっている。このため、論理]・カ
ウンタの値をラッチする。同時に微分パルスが出てもそ
れに対応するランチが同時に作動する。
External input signals 1 to 4 are input to logical differentiation circuits 1 to 4, respectively, and are also input to a level change detection (a kind of differentiation) circuit 11, and are further connected to the output of CPU interrupt 7 \ circuit 5. . Therefore, the value of the logic] counter is latched. Even if a differential pulse is generated at the same time, the corresponding launch is activated at the same time.

一方、要因フラグ11は微分パルスにより、対応するR
−Sフリップフロップがセットされる。さらに、CPU
割込み要求パルス作成回路12により能を有し、出力を
オフ状態にすることができ、データバスに直結すること
ができる。同様に要因フラグ11の出力もデータバスに
直結することができる。さらに、要因フラグ11におい
ては、データバスを通じて、フリップフロップをリセッ
トすることも可能とし、データバスは双方向である。
On the other hand, the factor flag 11 is set by the differential pulse to the corresponding R
-S flip-flop is set. Furthermore, the CPU
The interrupt request pulse generation circuit 12 has functions, can turn off the output, and can be directly connected to the data bus. Similarly, the output of the factor flag 11 can also be directly connected to the data bus. Furthermore, in the factor flag 11, it is also possible to reset the flip-flop through the data bus, and the data bus is bidirectional.

このデータバスのデータ入出力の切換えは、CPUより
アドレスを送出し、アドレスデコーダ13により、どの
ラッチの出力を有効(オン)にするか、さらに要因フラ
グのフリップフロップを読出すか、又はリセットするか
を切換えるものである。
To switch the data input/output of this data bus, the CPU sends an address, and the address decoder 13 determines which latch output is enabled (on), and whether the flip-flop of the cause flag is read or reset. This is to switch between.

以下、各ブロックの具体的構成を説明する。第2図Aは
、論理微分回路1〜4の構成を示す回路図である。この
回路はクロックと同期していない入力信号の立」二がり
を検出し、その検出時のクロックの%に相当する幅のパ
ルスを出力するものである。捷ず、入力信号はDフリッ
プフロップ21のD入力端子及びAND回路22に入力
される。
The specific configuration of each block will be explained below. FIG. 2A is a circuit diagram showing the configuration of logic differentiating circuits 1 to 4. This circuit detects the rise and fall of an input signal that is not synchronized with the clock, and outputs a pulse with a width corresponding to % of the clock at the time of detection. The input signal is input to the D input terminal of the D flip-flop 21 and the AND circuit 22 without being switched.

入力信号がHighレベルとなり、クロックが立上がれ
ば、同図Bのalに示すように、Dフリップフロップ2
1のQ出力はLowレベルになる。この状態は入力信号
が再びLowレベルになった後、クロックの立上がりが
入るまで保持される。スリップフロップ21のQ出力と
入力信号はAND回路22に入力される。したがって同
図Bに示すようにAND回路22の出力a2は、入力信
号が立上がってから、クロックに同期してQalが立下
がるまでの期間、Highレベルを保持する。AND回
路22の出力a2はDフリップフロップ23のD端子に
入力されている。このため、Dフリップ92、−。
When the input signal becomes High level and the clock rises, the D flip-flop 2 goes high, as shown by al in Figure B.
The Q output of 1 becomes Low level. This state is held until the clock rises after the input signal goes low again. The Q output of the slip-flop 21 and the input signal are input to an AND circuit 22. Therefore, as shown in FIG. 2B, the output a2 of the AND circuit 22 maintains a high level during the period from when the input signal rises to when Qal falls in synchronization with the clock. The output a2 of the AND circuit 22 is input to the D terminal of the D flip-flop 23. Therefore, D flip 92,-.

フロップ23のQ出力は、同図Bのd3のごとく、1ク
ロック期間のみLowレベルとなる。さらにDフリップ
フロップ23のQ出力とクロックと一1NOR回路24
に入力することにより、クロックの半分の間だけHig
hレベルになる出力を得る。このようにして、入力信号
の立下がりを検出して、対応するパルスを出力すること
ができる。
The Q output of the flop 23 is at a low level for only one clock period, as shown at d3 in FIG. Furthermore, the Q output of the D flip-flop 23, the clock and the -1NOR circuit 24
High for only half the clock by inputting
Obtain an output that becomes h level. In this way, a falling edge of the input signal can be detected and a corresponding pulse can be output.

次に第3図A (d nビットラッチの構成を示す回路
図である。nビットカウンタの出力Q1.Q2  ・・
・・QnはそれぞれDフリップフロップ30〜34のD
端子に接続されている。−勇者りフリップ70ツブ30
〜34のクロック端子Tへは、第2図で説明した論理微
分回路の出力パルスが入ってくる。したがって、微分パ
ルスが立上がると、各Dフリップフロップ30〜34は
、そのときのカウンタ出力値Q1. Q2.・・・・・
・Qn をランチし、各Q端子からはその保持値が読出
せる。この微分パルスは同図Bに示すようにカウンタの
クロックとは逆相になっているため、カウンタ値が変化
するタイミーングとは重ならないようになっている。さ
て、10 、 各フリップフロップ3o〜34の出力端子Qは全て、3
ステートバンフ736〜40を介してデータバスに接続
されている。3ステートバツフア36〜4oの制御入力
は、ラッチ読出しアドレス信号により制御される。すな
わち、このラッチを選択する信号を出した時のみ、Dフ
リップフロップ30〜34の出力値がデータバスD1〜
Dnにのることになる。
Next, FIG. 3A (d) is a circuit diagram showing the configuration of an n-bit latch. Outputs Q1, Q2 of the n-bit counter
...Qn is the D of each D flip-flop 30 to 34
connected to the terminal. - Brave flip 70 Tsubu 30
The output pulse of the logic differentiator circuit explained in FIG. 2 enters the clock terminal T of .about.34. Therefore, when the differential pulse rises, each D flip-flop 30-34 outputs the counter output value Q1. Q2.・・・・・・
- Qn is launched, and its held value can be read from each Q terminal. As shown in FIG. 2B, this differential pulse has a phase opposite to that of the counter clock, so that it does not overlap with the timing at which the counter value changes. Now, 10, the output terminals Q of each flip-flop 3o to 34 are all 3
It is connected to the data bus via state banffs 736-40. The control inputs of three-state buffers 36-4o are controlled by latch read address signals. That is, only when a signal to select this latch is issued, the output values of the D flip-flops 30 to 34 are transferred to the data buses D1 to D1.
It will be on Dn.

第4図は要因フラグの構成を示す回路図である。FIG. 4 is a circuit diagram showing the configuration of the factor flag.

第2図で示した論理微分回路の各出力は、それぞれに対
応したRSフリップフロップ41〜44の各S端子に入
力される。したがって、論理微分回路よりの出力パルス
が入ると、対応するRSフリップフロップがセットされ
る。各R8フリップフロップ41〜44の出力Qはそれ
ぞれ3ステートバツフア46〜48を介してデータバス
に接続されている。3ステートバツフアの制御端子には
、要因フラグ読出しアドレス信号が接続され、要因フラ
グの読出しを選択するアドレスを送出することにより、
各R3フリップフロップの出力Qのデ117、。
Each output of the logic differentiator shown in FIG. 2 is input to each S terminal of the corresponding RS flip-flops 41 to 44. Therefore, when an output pulse from the logic differentiator is input, the corresponding RS flip-flop is set. The output Q of each R8 flip-flop 41-44 is connected to a data bus via 3-state buffers 46-48, respectively. A factor flag read address signal is connected to the control terminal of the 3-state buffer, and by sending an address for selecting read of the factor flag,
117 of the output Q of each R3 flip-flop.

一タは、データバス」二に載せられる。さらにデータバ
スの各ラインはANDゲート49〜52に入力されてい
る。各ANDゲート49〜52のもう一方の入力は、書
込み許可信号が入力されている。
One data is placed on the second data bus. Furthermore, each line of the data bus is input to AND gates 49-52. A write permission signal is input to the other input of each AND gate 49-52.

この書込み許可信号は、AND回路63に書込みパルス
信号と、要因フラグ書込みアドレス信号を入力し、その
出力信号として得られるものである。
This write permission signal is obtained as an output signal by inputting a write pulse signal and a factor flag write address signal to an AND circuit 63.

すなわち、要因フラグ書込みアドレスを送出し、データ
バス上に、リセットするRSフリップフロップに対応す
るビットをHighにしたデータを送出して、書込みパ
ルス信号を立上げると、RSフリップフロップ41〜4
4のうち任意のものをリセットすることができるもので
ある。
That is, when the cause flag write address is sent out, data with the bit corresponding to the RS flip-flop to be reset set to High is sent out on the data bus, and the write pulse signal is raised, the RS flip-flops 41 to 4
Any one of the four can be reset.

第6図AはCPtJ割込み要求信号作成回路の一例を示
す回路図であり、特に1チツプマイクロコンピユータに
追加する場合の構成例である。第2図で示した各論理微
分回路の出力信号をOR回路6oに入力し、合成微分パ
ルス信号を得る。マイコンの種類によっては、この合成
微分パルスを直接、割込み要求信号として用いることが
できるものもある。ただ、1チツプマイクロコンビコー
タに追加する場合、この微分パルスでは、幅が狭すぎて
、CPUに割込みがかからない場合がある。
FIG. 6A is a circuit diagram showing an example of a CPtJ interrupt request signal generation circuit, and is particularly a configuration example when added to a 1-chip microcomputer. The output signals of each logic differentiator circuit shown in FIG. 2 are inputted to an OR circuit 6o to obtain a composite differentiated pulse signal. Depending on the type of microcomputer, this composite differential pulse may be used directly as an interrupt request signal. However, when adding it to a 1-chip microcombicoater, the width of this differential pulse may be too narrow to cause an interrupt to the CPU.

それは、CPUにノイズ等で割込みがかからないように
するため、割込パルスの幅が狭い場合は、割込みを受付
けないようにするものである。したがって、この場合、
割込み要求パルスの幅を拡げてやる必要がある。OR回
路63、Tフリップフロッグ61.62で構成されるセ
ルフストップカウンタはそのための回路である。z−1
、カウンタは停止状態にあるものとする。すなわち、T
フリップフロップ62の出力Q b 2 ハHigh 
V ヘルにあるものとする。この信号はOR回路63に
入力されているため、OR回路63の出力b3はHig
hレベルになり、Tフリップフロップ61は反転するこ
とができない。したがってカウンタは動作しない。ここ
で、合成微分パルスb 1 カHighレベルになると
、Tフリップフロップ61.62をリセットする。この
ため、Tフリップフロップ61の出力Qba、同62の
出力b2は全てLowレベ13、、−フ ルになる。このため、OR回路63により禁止されてい
たクロック入力は、Tフリップフロップ61に入力され
る。この入力b3が2度立下がりを経るとTクリップフ
ロンプロ2の出力Qb2はHighレベルになるので、
Highレベルになるト、再ヒクロノク入力がTフリソ
ゲフロップ61に入力されなくなり、カウンタは停止す
る。したがってTフリップフロップ62の出力Qb2は
この期間だけLowレベルに保たれる。第5図Bにこの
タイミングを示す。合成微分パルスがクロックに同期し
ていなければ、得られる出力パルス幅は1クロツク相当
と2クロツク相当との間になり、常に同じ幅になるとは
限らないが、本発明では特に問題にはならない。同図B
においても、tlとt2とは明らかに等しくはなってい
ない。これは、回路を簡略化するため、OR回路63に
入力するクロックとして、nビットカウンタの出力値を
用いているためである。この信号を用いることにより、
Tフリップフロップの個数が2ケで済んでいるものであ
る。このように、比較的遅いクロックを用いる14 、 ことにより、パルス幅を拡張することができ、ノイズと
は明らかに区別のできる割込要求パルスが作成される。
In order to prevent the CPU from being interrupted by noise or the like, if the width of the interrupt pulse is narrow, the interrupt is not accepted. Therefore, in this case,
It is necessary to widen the width of the interrupt request pulse. A self-stop counter composed of an OR circuit 63 and T flip-flops 61 and 62 is a circuit for this purpose. z-1
, the counter is assumed to be in a stopped state. That is, T
Output Q b 2 of flip-flop 62 High
V shall be in Hell. Since this signal is input to the OR circuit 63, the output b3 of the OR circuit 63 is High.
h level, and the T flip-flop 61 cannot be inverted. Therefore, the counter does not work. Here, when the composite differential pulse b 1 reaches a high level, the T flip-flops 61 and 62 are reset. Therefore, the output Qba of the T flip-flop 61 and the output b2 of the T flip-flop 62 are all at Low level 13, . . . -full. Therefore, the clock input that was prohibited by the OR circuit 63 is input to the T flip-flop 61. When this input b3 falls twice, the output Qb2 of the T-clip front pro 2 becomes High level, so
When the level becomes High, the input signal is no longer input to the T-flash flip flop 61, and the counter stops. Therefore, the output Qb2 of the T flip-flop 62 is kept at Low level only during this period. FIG. 5B shows this timing. If the synthesized differential pulse is not synchronized with the clock, the resulting output pulse width will be between the equivalent of one clock and the equivalent of two clocks, and the width will not always be the same, but this does not pose a particular problem in the present invention. Figure B
Also, tl and t2 are clearly not equal. This is because the output value of the n-bit counter is used as the clock input to the OR circuit 63 in order to simplify the circuit. By using this signal,
The number of T flip-flops is only two. Thus, by using a relatively slow clock 14, the pulse width can be extended, creating an interrupt request pulse that is clearly distinguishable from noise.

第6図は、これまで述べてきたハードウェアにおける、
CPUにおける割込み処理手順を示すフローチャートで
ある。CPUが割込みを受理すると、まず、要因フラグ
を読出し、何の信号によって割込みを受理したのかを調
べる。(ブロック7o0)次に読出した要因フラグによ
り、各フリップフロップを調べ、そのフリップフロップ
がセットされていれば、その要因に応じた処理を行なう
。まず、ブロックγ1において、要因1(入力1に対応
)のフリップフロップがセットされていれば、ブロック
72でその要因に対する処理(例えば、対応するnビッ
トラッチ値を読出し、前回の値との差を求め、パルス周
期を算出するなどの処理)を行ない、ブロック73で要
因1のフリップフロップをリセットする。ブロック71
において要因1のフリップフロップがセットされていな
ければ、何もせずにブロックア4に進む。ブロック74
,75゜15. 76において、要因2に対して、要因1と同様の処理を
行なう。同様の処理を全ての要因に対して行ない、CP
Uは割込み処理を終了する。特にこの場合、同時に多く
の要因が入った場合でも、優先度の高い要因から処理を
行なうことが容易にできる。第6図の例では、要因1が
最も高い優先度になるものである。
Figure 6 shows the hardware described so far.
3 is a flowchart showing an interrupt processing procedure in a CPU. When the CPU accepts an interrupt, it first reads the cause flag and checks what signal caused the interrupt to be accepted. (Block 7o0) Next, each flip-flop is checked using the read factor flag, and if the flip-flop is set, processing is performed according to the factor. First, in block γ1, if the flip-flop of factor 1 (corresponding to input 1) is set, block 72 processes the factor (for example, reads the corresponding n-bit latch value and calculates the difference from the previous value). (processing such as calculating the pulse period), and in block 73, the flip-flop of factor 1 is reset. block 71
If the flip-flop of factor 1 is not set in , the process proceeds to blocker 4 without doing anything. block 74
,75°15. At 76, the same processing as for factor 1 is performed on factor 2. Similar processing is performed for all factors, and CP
U ends the interrupt processing. Particularly in this case, even if many factors enter at the same time, processing can be easily performed starting from the factor with the highest priority. In the example of FIG. 6, factor 1 has the highest priority.

発明の詳細 な説明した通り、本発明は、従来例の欠点を克服するも
のである。まず、入力信号の増加に対して、フリップフ
ロップの増加が少なくなる。これは従来は(n十j)X
j個必要であったが、本発明では(n+1 )Xi個と
少ない数で実現できる。(nはカウンタ及びラッチのビ
ット数、jは入力信号の個数である。) さらに本発明では、各々記憶している時刻(力処理を先
に行なうなどの処理が可能であり、高精度な制御分野へ
の適用が容易であるなど多くの効果を奏するものである
DETAILED DESCRIPTION OF THE INVENTION As described above, the present invention overcomes the drawbacks of the prior art. First, the number of flip-flops increases less as the input signal increases. This is conventionally (n + j)
j pieces were required, but in the present invention, it can be realized with a small number of (n+1)Xi pieces. (n is the number of bits of the counter and latch, and j is the number of input signals.) Furthermore, in the present invention, it is possible to perform processing such as performing force processing first, which enables highly accurate control. It has many effects, such as being easy to apply in various fields.

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

第1図は、本発明の実施例のハードウェア構成を示すブ
ロック図、第2図Aは第1図における論理微分回路の構
成例を示す回路図、同図Bはそのタイミング図、第3図
Aは第1図におけるnビットラッチの回路図、同図Bは
そのタイミング図、第4図は第1図における要因フラグ
の構成例を示す回路図、第5図Aは第1図におけるCP
U割込要求パルス作成回路の回路図、同図Bはそのタイ
ミング図、第6図はCPUの割込み処理手順を示すフロ
ーチャート、第7図は従来例におけるハードウェア構成
を示すブロック図である。 1.2,3.4・・・・論理微分回路、5・・・・・・
nビ、トカウンタ、6171 ’1i1110.、、、
、、 nビットラッチ、11・・・・・・要因フラグ、
12・・・・ CPU割込み要求パルス作成回路。
FIG. 1 is a block diagram showing the hardware configuration of an embodiment of the present invention, FIG. 2A is a circuit diagram showing an example of the configuration of the logic differential circuit in FIG. 1, FIG. A is a circuit diagram of the n-bit latch in FIG. 1, B is its timing diagram, FIG. 4 is a circuit diagram showing an example of the configuration of the factor flag in FIG. 1, and FIG. 5A is a circuit diagram of the n-bit latch in FIG.
FIG. 6 is a circuit diagram of a U interrupt request pulse generating circuit, FIG. 6 is a timing diagram thereof, FIG. 6 is a flowchart showing a CPU interrupt processing procedure, and FIG. 7 is a block diagram showing a hardware configuration in a conventional example. 1.2, 3.4...Logic differential circuit, 5...
n bi, counter, 6171'1i1110. ,,,
,, n-bit latch, 11... factor flag,
12...CPU interrupt request pulse generation circuit.

Claims (1)

【特許請求の範囲】[Claims] クロックを計数する、nビットカウンタを有し、j個の
外部入力信号に対して、該入力信号がそれぞれ有効レベ
ルに変化したことを前記クロックに同期して検出する手
段をj個有し、該検出手段よりの出力信号により、前記
nビットカウンタの出力値をそれぞれラッチするj個の
出力制御可能なnビットラッチと、前記検出手段の出力
信号により個々にセットされるj個の出力制御可能なフ
リップフロップを有し、該フリップフロップの出力と同
リセット入力と前記nビットラッチの出力とは、双方向
のデータバスに結線され、それぞれアドレスを指定する
ことにより読出し及び書込みできるように設定され、前
記入力信号変化検出手段よりの出力信号の論理和をとり
、該論理和出力によりCPUに割込み要求を発生する手
段を有し、CPUは割込み処理において前記1個のフリ
ップフロップの内容をデータバスより読出し、セットさ
れているフリップフロップに対応した割込み処理を行な
うと共に、データバスによりセットされているフリップ
フロップをリセットすることを特徴とするマイクロコン
ピュータの割込み処理方法。
It has an n-bit counter that counts clocks, and has j means for detecting, in synchronization with the clock, that each of j external input signals has changed to a valid level, and j number of output-controllable n-bit latches that each latch the output value of the n-bit counter by the output signal from the detection means; and j number of output-controllable latches that are individually set by the output signal of the detection means. It has a flip-flop, and the output of the flip-flop, its reset input, and the output of the n-bit latch are connected to a bidirectional data bus, and are set so that they can be read and written by specifying an address, respectively. It has means for calculating the logical sum of the output signals from the input signal change detecting means and generating an interrupt request to the CPU based on the logical sum output, and the CPU receives the contents of the one flip-flop from the data bus in interrupt processing. An interrupt processing method for a microcomputer, characterized in that interrupt processing corresponding to a read and set flip-flop is performed, and the set flip-flop is reset by a data bus.
JP60056709A 1985-03-20 1985-03-20 Interruption processing method of microcomputer Pending JPS61214031A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60056709A JPS61214031A (en) 1985-03-20 1985-03-20 Interruption processing method of microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60056709A JPS61214031A (en) 1985-03-20 1985-03-20 Interruption processing method of microcomputer

Publications (1)

Publication Number Publication Date
JPS61214031A true JPS61214031A (en) 1986-09-22

Family

ID=13035003

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60056709A Pending JPS61214031A (en) 1985-03-20 1985-03-20 Interruption processing method of microcomputer

Country Status (1)

Country Link
JP (1) JPS61214031A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08129491A (en) * 1994-10-31 1996-05-21 Nec Corp Interruption control system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08129491A (en) * 1994-10-31 1996-05-21 Nec Corp Interruption control system

Similar Documents

Publication Publication Date Title
US4308500A (en) Incremental encoder for measuring positions of objects such as rotating shafts
JPH0743653B2 (en) Interrupt controller
JP2569589B2 (en) Counter circuit
JPS6266322A (en) Data bus buffer control circuit
JPS61214031A (en) Interruption processing method of microcomputer
EP0628913A1 (en) Interrupt signal detection circuit
JPH0442606B2 (en)
US4896288A (en) Programmable controller input module
US6166507A (en) Disk drive system
JP3093374B2 (en) Interrupt controller
JPH04285815A (en) Position counter circuit of rotary encoder
JP2000180210A (en) Encoder pulse generator
JPS5947364B2 (en) Preamble detection device
JP3248369B2 (en) Rotary body position detection circuit
JP2959446B2 (en) Memory monitoring circuit
JP2964738B2 (en) Pulse arithmetic processing unit
JPS638513A (en) Absolute encoder
JP3212332B2 (en) Multi-axis position detector
SU1182489A1 (en) Device for accelerating and braking motor of actuating mechanism
JPS62172265A (en) Rotation direction determination method
JPS6251525B2 (en)
JPS6161060A (en) Two-phase pulse directivity discriminating circuit
JPS5914797B2 (en) coordinate input device
JPH04227551A (en) Access control circuit
JPH01212026A (en) Pulse counting system