JPH0812561B2 - Pulse interval measuring device - Google Patents

Pulse interval measuring device

Info

Publication number
JPH0812561B2
JPH0812561B2 JP60208411A JP20841185A JPH0812561B2 JP H0812561 B2 JPH0812561 B2 JP H0812561B2 JP 60208411 A JP60208411 A JP 60208411A JP 20841185 A JP20841185 A JP 20841185A JP H0812561 B2 JPH0812561 B2 JP H0812561B2
Authority
JP
Japan
Prior art keywords
pulse
channel
program
request
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.)
Expired - Lifetime
Application number
JP60208411A
Other languages
Japanese (ja)
Other versions
JPS6267603A (en
Inventor
秀夫 安部
幸男 前橋
重雄 香取
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP60208411A priority Critical patent/JPH0812561B2/en
Publication of JPS6267603A publication Critical patent/JPS6267603A/en
Publication of JPH0812561B2 publication Critical patent/JPH0812561B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、外部機器の制御を行なうために入力信号の
位相差を測定するパルス間隔計測装置を内蔵した情報処
理装置に関する。
Description: TECHNICAL FIELD The present invention relates to an information processing apparatus having a pulse interval measuring device for measuring a phase difference between input signals for controlling an external device.

〔従来の技術〕[Conventional technology]

近年、マイクロコンピュータはLSI技術の進歩により
高集積化が進み、DMA、タイマ/カウンタ、シリアルイ
ンターフェース、ポート、A/D変換器などの周辺ハード
ウエアがワンチップに搭載されるようになった。その中
でも、パルス入出力装置を備えたものはVTR、ビデオデ
ィスク、CD等の民生分野およびプリンタ、プロッタ、フ
ロッピーディスクなどのOA分野の双方において、モータ
などを制御するためのものとして不可欠なものである。
特に、パルス間隔計測装置は外部機器が出力する各種の
パルス信号を計測するもので、回転数制御、回転方向制
御等の制御を行なう上で非常に重要である。
In recent years, microcomputers have been highly integrated due to the progress of LSI technology, and peripheral hardware such as DMA, timer / counter, serial interface, port, and A / D converter have been mounted on one chip. Among them, those equipped with pulse input / output devices are indispensable for controlling motors in both consumer fields such as VTRs, video disks, and CDs, and OA fields such as printers, plotters, and floppy disks. is there.
In particular, the pulse interval measuring device measures various pulse signals output from an external device, and is very important in performing control such as rotation speed control and rotation direction control.

第4図はパルス間隔計測装置を内蔵したマイクロコン
ピュータの従来例のブロック図である。
FIG. 4 is a block diagram of a conventional example of a microcomputer incorporating a pulse interval measuring device.

本従来例では、マイクロコンピュータ100はパルス入
力信号線(以下、チャネルと記す)1とチャネル2に入
力したパルスの立下がりエッジを検出し、チャネル1と
チャネル2に入力するパルスの位相差を求める。この
際、チャネル1とチャネル2に入力するパルスの相対的
な関係を知ることができるように、チャネル1の入力パ
ルスの立下がりエッジをチャネル2の入力パルスの立下
がりエッジより先に検出した場合は、位相差を正で表わ
し、チャネル2の入力パルスの立下がりエッジをチャネ
ル1の入力パルスの立下がりエッジより先に検出した場
合には、位相差を負で表わす処理を行なう。
In this conventional example, the microcomputer 100 detects the falling edges of the pulses input to the pulse input signal line (hereinafter referred to as channel) 1 and channel 2, and obtains the phase difference between the pulses input to channel 1 and channel 2. . At this time, if the falling edge of the input pulse of channel 1 is detected before the falling edge of the input pulse of channel 2 so that the relative relationship between the pulses input to channel 1 and channel 2 can be known. Performs a process of expressing the phase difference as a positive value and expressing the phase difference as a negative value when the falling edge of the input pulse of channel 2 is detected before the falling edge of the input pulse of channel 1.

マイクロコンピュータ100は、実行部101、プログラム
メモリ200、データメモリ200、割込み制御部400、パル
ス入力装置500を有し、これらは全て内部バス700を介し
て互いに接続されている。実行部101はプログラムカウ
ンタ(以下、PCと記す)102、プログラムステータスワ
ード(以下、PSWと記す)104および汎用レジスタセット
105を有する。データメモリ300には、PC102、PSW104、
汎用レジスタセット105(以下、ステータスと記す)の
内容を退避させるステータス退避領域391、前回キャプ
チャした値を一時保持するキャプチャ値格納領域351、
演算結果格納領域361、ソフトウエアフラグ領域381がソ
フトウエアによって設定されている。ソフトウエアフラ
グ領域381には、チャネル1とチャネル2に入力したパ
ルスの立下がり検出の順序を知るために、チャネル1お
よびチャネル2に対応してソフトウエアフラグ382およ
びソフトウエアフラグ383が設定され、これらのソフト
ウエアフラグ382,383は、システム起動における初期化
段階で“0"になるものとする。割込み制御部400は、後
述の立下がりエッジ検出信号線531,532を介して立下が
りエッジ検出信号を受けると、それぞれ割込み制御線40
1,402をアクティブにして実行部101に割込み要求を通知
する。
The microcomputer 100 has an execution unit 101, a program memory 200, a data memory 200, an interrupt control unit 400, and a pulse input device 500, all of which are connected to each other via an internal bus 700. The execution unit 101 includes a program counter (hereinafter referred to as PC) 102, a program status word (hereinafter referred to as PSW) 104, and a general-purpose register set.
Has 105. The data memory 300 includes PC102, PSW104,
A status save area 391 for saving the contents of the general-purpose register set 105 (hereinafter, referred to as status), a capture value storage area 351 for temporarily holding a previously captured value,
The calculation result storage area 361 and the software flag area 381 are set by software. In the software flag area 381, the software flag 382 and the software flag 383 are set in correspondence with the channel 1 and the channel 2 in order to know the order of the fall detection of the pulses input to the channel 1 and the channel 2. These software flags 382 and 383 are set to "0" at the initialization stage at system startup. When the interrupt control unit 400 receives the falling edge detection signals via the falling edge detection signal lines 531 and 532, which will be described later, the interrupt control line 40 respectively.
1, 402 is activated and the execution unit 101 is notified of the interrupt request.

パルス入力装置はチャネル1、チャネル2を介して外
部からパルス信号を入力するもので、所定のカウントク
ロックをカウントするフリーラニングカウンタFRC511,5
21と、カウントしたデータを一時保持するキャプチャレ
ジスタ512,522と、チャネル1、チャネル2のレベル検
知およびチャネル1、チャネル2に入力したパルス信号
の立下がりエッジを検出し割込み制御部400に立下がり
エッジ検出信号を出力するパルス制御回路540を有す
る。
The pulse input device inputs a pulse signal from outside via channel 1 and channel 2, and is a free running counter FRC511, 5 that counts a predetermined count clock.
21, the capture registers 512 and 522 for temporarily holding the counted data, the level detection of channel 1 and channel 2 and the falling edge of the pulse signal input to channel 1 and channel 2 to detect the falling edge in the interrupt control unit 400. It has a pulse control circuit 540 for outputting a signal.

本従来例は入力チャネル数が2本の場合であるが、外
部機器の制御対象が複数になり、パルス入力装置を多チ
ャネル化して複数の制御を同時に行なう必要が生じた場
合は、本従来例と同一構成のパルス入力装置で多チャネ
ル化される。
This conventional example is a case where the number of input channels is two, but when there are a plurality of control targets of the external device and it is necessary to make the pulse input device multi-channel and perform a plurality of controls at the same time, this conventional example The pulse input device has the same configuration as the above, but has multiple channels.

次に、第4図を参照して各ハードウエアの動作を説明
する。
Next, the operation of each hardware will be described with reference to FIG.

パルス入力装置500のパルス制御回路540はチャネル1
の立下がりエッジを検出すると、この検出タイミングに
同期してFRC511の値をキャプチャレジスタ512に格納
し、立下がりエッジ検出信号を出力して1回のキャプチ
ャ動作が終了したことを割込み制御部400に通知する。
同様に、パルス制御回路540がチャネル2の立下がりエ
ッジを検出すると、この検出タイミングに同期してFRC5
21の値をキャプチャレジスタ522に格納し、立下がりエ
ッジ検出信号532を出力する。割込み制御部400は、立下
がりエッジ検出信号531が入力すると割込み制御線401を
アクティブにし、立下がりエッジ検出信号532が入力す
ると割込み制御線402をアクティブにして実行部101に割
込みを要求する。実行部101は、通常PC102がアドレスす
るプログラムメモリ200上の命令を読出して実行し、処
理データはデータメモリ300上に格納するが、1命令の
実行が終了する毎に割込み制御線401,402をサンプル
し、インアクティブであれば、前記の動作を繰り返し、
割込み制御線401,402がアクティブであれば、キャプチ
ャしたデータを転送あるいは演算処理するキャプチャ終
了割込み処理を実行する。
The pulse control circuit 540 of the pulse input device 500 is channel 1
When the falling edge of is detected, the value of FRC511 is stored in the capture register 512 in synchronization with this detection timing, the falling edge detection signal is output, and the interrupt control unit 400 is notified that one capture operation is completed. Notice.
Similarly, when the pulse control circuit 540 detects the falling edge of channel 2, the FRC5 is synchronized with this detection timing.
The value of 21 is stored in the capture register 522, and the falling edge detection signal 532 is output. When the falling edge detection signal 531 is input, the interrupt control unit 400 activates the interrupt control line 401, and when the falling edge detection signal 532 is input, the interrupt control line 402 is activated to request the execution unit 101 for an interrupt. The execution unit 101 normally reads and executes an instruction in the program memory 200 addressed by the PC 102 and stores the processed data in the data memory 300, but samples the interrupt control lines 401 and 402 each time the execution of one instruction is completed. , If it is inactive, repeat the above operation,
If the interrupt control lines 401 and 402 are active, a capture end interrupt process for transferring or processing the captured data is executed.

次に、第5図のフローチャートを参照してソフトウェ
ア処理について説明する。
Next, the software processing will be described with reference to the flowchart of FIG.

まず、割込み制御線401がアクティブになった場合に
ついて説明する。
First, a case where the interrupt control line 401 becomes active will be described.

実行部101は、1命令の実行が終了すると割込み制御
線401,402をサンプルし、割込み制御線401,402がアクテ
ィブであれば、割込み処理に移り現在実行中のプログラ
ムの状態を保持するためにステータス情報をステータス
退避領域391に退避する(処理1)。続いて、割込み処
理プログラムが起動される。割込みサービスプログラム
は、まずソフトウエアフラグ退避領域381からソフトウ
エアフラグ382,383を読出し(処理2)、次に割込み制
御線401がアクティブかどうかをチェックし(処理
3)、割込み制御線401がアクティブであればチャネル
2に対応したソフトウエアフラグ383をチェックする
(処理4)。もし、ソフトウエアフラグ383が“0"であ
れば、パルス制御回路540はチャネル1の立下がりエッ
ジを検出する以前にはチャネル2の立下がりエッジを検
出していないので、キャプチャレジスタ512の値をキャ
プチャ値格納領域351に転送して(処理6)パルス制御
回路540がチャネル1の立下がりエッジを検出したこと
を示すソフトウエアフラグ382を“1"にする(処理
7)。その後、ステータス情報をステータス退避領域39
1から復帰して(処理8)、キャプチャ終了割込みサー
ビスプログラムを終了してメインプログラムの実行に戻
る。もし、ソフトウエアフラグ383が“1"であれば、す
でにパルス制御回路540はチャネル2の立下がりエッジ
信号を検出している。したがって、チャネル2の立下が
りエッジ検出タイミングで保持したキャプチャレジスタ
522の値はキャプチャ値格納領域351に格納されているの
で、(キャプチャ値格納領域351の値)から(キャプチ
ャレジスタ512の値)を減算し、演算結果を演算結果格
納領域361に格納し(処理9)、ソフトウエアフラグ383
を“0"にする(処理10)。この後ステータスを復帰して
(処理11)、キャプチャ終了割込みによって得られた演
算結果をもとにして処理を行なうキャプチャ完了割込み
要求を発生する(処理12)。続いて、割込み制御線402
がアクティブになった場合について述べる。この場合
は、前述した割込み制御線401がアクティブになった場
合と同様にして割込み処理プログラムが起動される。割
込みサービスプログラムは、まずソフトウエアフラグ38
1からソフトウエアフラグ382,383を読出し(処理2)、
割込みサービスプログラムでチャネル1に対応して割込
み制御線402がアクティブかどうかをチェックし(処理
3)、割込み制御線402がアクティブであればソフトウ
エアフラグ382をチェックする(処理5)。
The execution unit 101 samples the interrupt control lines 401 and 402 when the execution of one instruction is completed. If the interrupt control lines 401 and 402 are active, the execution unit 101 shifts to interrupt processing and holds the status information to hold the state of the program currently being executed. It is saved in the save area 391 (process 1). Then, the interrupt processing program is started. The interrupt service program first reads the software flags 382 and 383 from the software flag save area 381 (process 2), then checks whether the interrupt control line 401 is active (process 3), and checks whether the interrupt control line 401 is active. For example, the software flag 383 corresponding to channel 2 is checked (process 4). If the software flag 383 is “0”, the pulse control circuit 540 has not detected the falling edge of the channel 2 before detecting the falling edge of the channel 1. The captured data is transferred to the capture value storage area 351 (process 6) and the software flag 382 indicating that the pulse control circuit 540 has detected the falling edge of channel 1 is set to "1" (process 7). After that, the status information is displayed in the status save area 39
The process returns from 1 (process 8), ends the capture end interrupt service program, and returns to the execution of the main program. If the software flag 383 is "1", the pulse control circuit 540 has already detected the falling edge signal of channel 2. Therefore, the capture register held at the falling edge detection timing of channel 2
Since the value of 522 is stored in the capture value storage area 351, the value of the capture register 512 is subtracted from the value of the capture value storage area 351, and the calculation result is stored in the calculation result storage area 361. 9), software flag 383
Is set to "0" (Processing 10). After this, the status is restored (process 11), and a capture completion interrupt request for performing processing based on the operation result obtained by the capture end interrupt is generated (process 12). Then, the interrupt control line 402
Will be described when is activated. In this case, the interrupt processing program is activated in the same manner as when the interrupt control line 401 described above becomes active. The interrupt service program starts with software flag 38.
Read software flags 382 and 383 from 1 (Process 2),
The interrupt service program checks whether the interrupt control line 402 corresponding to channel 1 is active (process 3). If the interrupt control line 402 is active, the software flag 382 is checked (process 5).

ソフトウエアフラグ382が“0"であれば、パルス制御
回路540はチャネル2の立下がりエッジを検出する以前
にはチャネル1の信号の立下がりエッジを検出していな
いので、キャプチャレジスタ522の値をキャプチャ値格
納領域351に転送する(処理13)。また、パルス制御回
路540がチャネル2の立下がりエッジを検出したことを
示すソフトウエアフラグ383を“1"にし(処理14)、ス
テータスを復帰して(処理15)プログラムの実行に戻
る。ソフトウエアフラグ382が“1"であれば、チャネル
1の立下がりエッジ検出タイミングで保持したキャプチ
ャレジスタ512の値は、キャプチャ値格納領域351に格納
されているので(キャプチャレジスタ522の値)から
(キャプチャ値格納領域351の値)を減算し、演算結果
を演算結果格納領域361に格納する(処理16)。次に、
ソフトウエアフラグ382を“0"にし(処理17)、ステー
タスを復帰(処理11)した後、キャプチャ完了割込み要
求を発生する(処理12)。
If the software flag 382 is “0”, the pulse control circuit 540 has not detected the falling edge of the channel 1 signal before detecting the falling edge of the channel 2, and therefore the value of the capture register 522 is changed. Transfer to the capture value storage area 351 (process 13). Further, the pulse control circuit 540 sets the software flag 383 indicating that the falling edge of the channel 2 has been detected to "1" (process 14), restores the status (process 15), and returns to program execution. If the software flag 382 is "1", the value of the capture register 512 held at the falling edge detection timing of channel 1 is stored in the capture value storage area 351, and therefore (the value of the capture register 522) is changed to ( The value of the capture value storage area 351) is subtracted, and the calculation result is stored in the calculation result storage area 361 (process 16). next,
After the software flag 382 is set to "0" (process 17) and the status is returned (process 11), a capture completion interrupt request is generated (process 12).

以上の処理により、チャネル1に入力する信号とチャ
ネル2に入力する信号の位相差を計測でき、しかも位相
差の符号により、チャネル1に入力する信号とチャネル
2に入力する信号のどちらが進んでいるか識別できる。
With the above processing, the phase difference between the signal input to channel 1 and the signal input to channel 2 can be measured, and which of the signal input to channel 1 and the signal input to channel 2 is advanced depending on the sign of the phase difference. Can be identified.

〔発明が解決しようとする問題点〕[Problems to be solved by the invention]

上述した従来のパルス間隔計測装置は、キャプチャし
た値を転送または演算する処理を割込みによるソフトウ
エア処理で実行しているため、キャプチャが行なわれる
毎にPC、PSW、汎用レジスタの退避を行ない、かつ割込
み処理の中でソフトウエアフラグによる条件分岐によっ
て割込み処理を行ない、割込み処理終了後、再びPC、PS
W、汎用レジスタを復帰する処理が必要となり、制御対
象が多くなった場合などは、PC、PSW、汎用レジスタの
退避、復帰等の処理が多くなり、実行部がこれらの本来
目的としない処理に費やす時間が多くなり、実行部の処
理能力が低下するという欠点があり、また、多くの制御
対象に対応するためにチャネルを増設すると、チャネル
数と同数のフリーランニングカウンタおよびキャプチャ
レジスタを設けねばならず、配線の複雑化等を伴なって
ハードウエア量が膨大なものになるという欠点がある。
The above-described conventional pulse interval measuring device performs the process of transferring or calculating the captured value by the software process by the interrupt, so that the PC, PSW, and the general-purpose register are saved each time the capture is performed, and During interrupt processing, interrupt processing is performed by conditional branching with a software flag, and after interrupt processing is completed, PC, PS again
W, processing to restore general-purpose registers becomes necessary, and when the number of controlled objects increases, the processing such as saving and restoring PC, PSW, general-purpose registers will increase, and the execution unit will not perform these original processing. This has the disadvantage that it consumes a lot of time and reduces the processing capacity of the execution unit.In addition, if channels are added to support many control targets, it is necessary to provide free running counters and capture registers as many as the number of channels. However, there is a drawback that the amount of hardware becomes enormous due to complicated wiring.

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

本発明のパルス間隔計測装置は、プログラムメモリ、
データメモリ、I/O要求受付部、命令実行手段、プログ
ラムカウンタ、および実行動作状態を示すプログラムス
テータスワードを備える実行部と、クロックをカウント
するカウンタ、キャプチャレジスタ、ならびに、第1お
よび第2のパルス信号を受けこれらパルス信号に予め定
められた反転エッジが現れる毎に検出信号を発生すると
ともにその時点でのカウンタの内容をキャプチャレジス
タにストアさせ、さらに予め定められた反転エッジが現
れたパルス信号とは異なるパルス信号の当該反転エッジ
が現れた時点でのレベルにもとづく論理レベルを有する
レベル信号を発生させるパルス制御回路を有するパルス
入力装置と、検出信号に応答して実行部のI/O要求受付
部に処理要求を発行するI/O要求制御部とを備え、I/O要
求受付部は処理要求にもとづきレベル信号が第1の論理
レベルのときは第1の形態を指定するマクロサービス処
理コードを第2の論理レベルのときは第2の形態を指定
するマクロサービス処理コードを命令実行手段にそれぞ
れ与え、命令実行手段はマクロサービス処理コードに応
答して、プログラムカウンタのアドレス更新を禁止して
プログラムの実行を中断しかつその時のプログラムカウ
ンタおよびプログラムステータスワードの情報をデータ
メモリに退避することなくそのままにした状態で、マク
ロサービス処理コードが第1の形態を示すときはキャプ
チャレジスタの内容をデータメモリ内のデータ転送領域
に転送し、第2の形態を示すときはデータ転送領域の内
容とキャプチャレジスタの内容とに対する演算を実行
し、その演算結果の内容をデータメモリ内のデータ転送
領域に転送し、その後、中断したプログラムの実行処理
を再開することを特徴とする。
A pulse interval measuring device of the present invention is a program memory,
An execution unit including a data memory, an I / O request reception unit, an instruction execution unit, a program counter, and a program status word indicating an execution operation state, a counter that counts clocks, a capture register, and first and second pulses When a signal is received, a detection signal is generated each time a predetermined inversion edge appears in these pulse signals, and the contents of the counter at that time are stored in a capture register, and a pulse signal in which a predetermined inversion edge appears Is a pulse input device having a pulse control circuit that generates a level signal having a logic level based on the level at the time when the inversion edge of a different pulse signal appears, and I / O request acceptance of the execution unit in response to the detection signal The I / O request control unit that issues processing requests to the I / O request receiving unit When the level signal is the first logic level, the macro service processing code designating the first form is supplied to the instruction executing means, and when the level signal is the second logic level, the macro service processing code designating the second form is supplied to the instruction executing means. The instruction executing means, in response to the macro service processing code, prohibits the address update of the program counter and interrupts the execution of the program, and the information of the program counter and the program status word at that time is not saved in the data memory as it is. In this state, when the macro service processing code indicates the first form, the contents of the capture register are transferred to the data transfer area in the data memory, and when the macro service processing code indicates the second form, the contents of the data transfer area and the capture register are transferred. The operation of the contents and is executed and the contents of the operation result are stored in the data memory. Transferred to over data transfer area, then, characterized in that it resumes execution of the program was interrupted.

このように、割込みによらずキャプチャした値を転送
あるいは演算することにより、キャプチャがキャプチャ
動作を行なう毎にPC、PSW、汎用レジスタの退避、復帰
等の処理を行なわないため、入力チャネル数が増加した
場合問題となるPC、PSW、汎用レジスタの退避、復帰等
の、本来目的としない処理に費やす時間を減らし、実行
部の使用効率を向上させることができ、また入力チャネ
ル数が増加した場合、マクロサービスチャネルを設定す
るだけで容易に多数の入力チャネルに対応でき、FRCま
たはキャプチャレジスタの増設をしないで済むため、使
用するハードウエア量を節約できる。
In this way, the number of input channels is increased because the captured value is transferred or calculated independently of interrupts, and the PC, PSW, general-purpose register save and restore processing is not performed each time the capture performs a capture operation. If you do, you can reduce the time spent for processing that is not originally intended, such as saving and restoring of PC, PSW, general-purpose registers, etc., improving the usage efficiency of the execution unit, and if the number of input channels increases, You can easily support a large number of input channels simply by setting the macro service channel, and you do not need to add an FRC or capture register, so you can save the amount of hardware used.

〔実施例〕〔Example〕

次に、本発明の実施例について図面を参照して説明す
る。
Next, embodiments of the present invention will be described with reference to the drawings.

第1図は、本発明のパルス間隔計測装置を内蔵したマ
イクロコンピュータの一実施例を示すブロック図、第2
図は第1図中のパルス入力装置600のブロック図、第3
図はパルス入力装置600のI/O要求制御部900のタイミン
グチャートである。
FIG. 1 is a block diagram showing an embodiment of a microcomputer incorporating the pulse interval measuring device of the present invention, and FIG.
FIG. 3 is a block diagram of the pulse input device 600 in FIG.
The figure is a timing chart of the I / O request control unit 900 of the pulse input device 600.

マイクロコンピュータ100は実行部101、I/O要求制御
部900、パルス入力装置600を有し、これらは内部バス70
0を介して互いに接続されている。実行部101は、プログ
ラムを格納するプログラムメモリ200、処理データを保
持するデータメモリ300、次に実行するプログラムの番
地を示すPC102、算術論理演算機能を持つ算術論理演算
ユニット(以下、ALUと記す)103、実行部全体の動作状
態を示すPSW104、処理中のデータを保持しておく汎用レ
ジスタ105、実行する命令を保持しておく命令レジスタ1
06、命令レジスタ106の内容により、実行部全体を制御
する実行制御部108、I/O要求を受付けるI/O要求受付部1
50を有する。データメモリ300は、転送領域ポインタ301
とデータ転送領域302を有する。本実施例では、転送領
域ポインタ301にはあらかじめソフトウエアでデータ転
送領域302のアドレスを格納しておく。I/O要求制御部90
0は、後述の立下がりエッジ検出信号を受けると、キャ
プチャ終了I/O要求信号線910をアクティブにして、実行
部101にパルス計測終了処理要求を通知する。
The microcomputer 100 has an execution unit 101, an I / O request control unit 900, and a pulse input device 600, which are internal buses 70.
Connected to each other through 0. The execution unit 101 includes a program memory 200 that stores a program, a data memory 300 that holds processing data, a PC 102 that indicates an address of a program to be executed next, an arithmetic logic operation unit (hereinafter referred to as ALU) having an arithmetic logic operation function. 103, PSW 104 indicating the operation state of the entire execution unit, general-purpose register 105 for holding data being processed, instruction register 1 for holding an instruction to be executed
06, an execution control unit 108 that controls the entire execution unit according to the contents of the instruction register 106, an I / O request reception unit 1 that receives an I / O request
Having 50. The data memory 300 has a transfer area pointer 301.
And a data transfer area 302. In this embodiment, the address of the data transfer area 302 is stored in advance in the transfer area pointer 301 by software. I / O request controller 90
When 0 receives a falling edge detection signal described later, it activates the capture end I / O request signal line 910 and notifies the execution unit 101 of the pulse measurement end processing request.

パルス入力装置600は、第2図に示すようにチャネル
1、チャネル2と2チャネルのパルス信号が入力するも
ので、チャネル1、チャネル2の信号線と、フリーラニ
ングカウンタ(FRC)611と、キャプチャレジスタ612
と、パルス制御回路640と、チャネル1またはチャネル
2の立下がりエッジを検出して、I/O要求制御部900にエ
ッジ検出信号を出力するためのエッジ検出信号線631
と、実行部101にチャネル信号と端子レベル信号を出力
するためのチャネル信号線632と端子レベル信号線633を
有している。
As shown in FIG. 2, the pulse input device 600 inputs the pulse signals of channel 1, channel 2 and 2 channels, the signal lines of channel 1 and channel 2, the free running counter (FRC) 611, and the capture. Register 612
An edge detection signal line 631 for detecting a falling edge of channel 1 or channel 2 and outputting an edge detection signal to the I / O request control unit 900.
And a channel signal line 632 and a terminal level signal line 633 for outputting a channel signal and a terminal level signal to the execution unit 101.

次に、第3図のタイミングチャートを参照してパルス
入力装置600とI/O要求制御部900の動作を説明する。第
3図(a)はチャネル1に入力するパルス信号の位相が
チャネル2に入力するパルス信号の位相より進んでいる
場合のタイミングチャートであり、第3図(b)は、チ
ャネル2の入力パルス信号の位相がチャネル1の入力パ
ルス信号の位相より進んでいる場合である。
Next, the operations of the pulse input device 600 and the I / O request control unit 900 will be described with reference to the timing chart of FIG. 3 (a) is a timing chart when the phase of the pulse signal input to channel 1 leads the phase of the pulse signal input to channel 2, and FIG. 3 (b) is the input pulse of channel 2 This is the case where the phase of the signal leads the phase of the input pulse signal of channel 1.

パルス制御回路640は、チャネル1またはチャネル2
への立下がりエッジ検出タイミングt1,t2,t3,t4に同期
してFRC611の値をキャプチャレジスタ612へ転送し、エ
ッジ検出信号線631をアクティブにする。また、パルス
制御回路640は、チャネル1の立下がりエッジをt1また
はt4のタイミングで検出すると、t1,t4のタイミングに
同期して、チャネル信号線632と端子レベル信号線633に
それぞれ“1"とチャネル2の端子レベルを出力し、同様
に、t2,t3のタイミングでチャネル2の立下がりエッジ
を検出すると、t2,t3のタイミングでチャネル信号線632
と端子レベル信号線633に“0"とチャネル1の端子レベ
ルを出力する。パルス制御回路640がエッジ検出信号線6
31をt1のタイミングでアクティブにすると、I/O要求制
御部900は、キャプチャ終了I/O要求信号線910をt1に続
くtaのタイミングでアクティブにして、パルス入力装置
600がキャプチャ動作を終了したことを実行部101に通知
する。I/O要求制御部900は、t2,t3,t4に続くtb,tc,tdの
タイミングにおいても同様にキャプチャ終了I/O要求信
号線910をアクティブにする。I/O要求制御部900は、他
の周辺ハードウエアからもI/O要求信号を受付けるが、
本実施例では省略する。
The pulse control circuit 640 can be used for channel 1 or channel 2.
The value of the FRC 611 is transferred to the capture register 612 in synchronization with the falling edge detection timings t1, t2, t3, and t4, and the edge detection signal line 631 is activated. When the pulse control circuit 640 detects the falling edge of channel 1 at the timing of t1 or t4, the pulse control circuit 640 outputs “1” to the channel signal line 632 and the terminal level signal line 633 in synchronization with the timing of t1 and t4. Similarly, when the terminal level of channel 2 is output and the falling edge of channel 2 is detected at the timing of t2 and t3, the channel signal line 632 is detected at the timing of t2 and t3.
And "0" and the terminal level of channel 1 are output to the terminal level signal line 633. The pulse control circuit 640 uses the edge detection signal line 6
When 31 is activated at the timing of t1, the I / O request control unit 900 activates the capture end I / O request signal line 910 at the timing of ta following t1, and the pulse input device
The execution unit 101 is notified that the 600 has completed the capture operation. The I / O request control unit 900 also activates the capture end I / O request signal line 910 at the timings tb, tc, and td following t2, t3, and t4. The I / O request control unit 900 accepts I / O request signals from other peripheral hardware as well,
It is omitted in this embodiment.

次に、実行部101の動作を説明する。 Next, the operation of the execution unit 101 will be described.

I/O要求受付部150が、キャプチャ終了I/O要求信号線9
10がアクティブになったことを検知すると、実行部101
はキャプチャ終了I/O要求処理を実行する。本実施例で
は、キャプチャ終了I/O要求を割込みによる処理ではな
く、実行部101がプログラムの実行を中断し、ステータ
ス情報を保持したまま転送あるいは演算動作を行なうこ
とにより処理する。以下、このI/O要求の処理形態をマ
クロサービスと記す。
The I / O request receiving unit 150 displays the capture end I / O request signal line 9
When detecting that 10 is activated, the execution unit 101
Executes the capture end I / O request process. In the present embodiment, the capture end I / O request is not processed by an interrupt, but is executed by the execution unit 101 interrupting the execution of the program and performing a transfer or arithmetic operation while holding the status information. Hereinafter, the processing form of this I / O request will be referred to as a macro service.

本実施例のマクロサービス処理は、以下に述べる2つ
の処理形態を持つ。
The macro service processing of this embodiment has the following two processing modes.

転送領域ポインタ301が指すデータ転送領域302にキャ
プチャレジスタ612の値を転送する。
The value of the capture register 612 is transferred to the data transfer area 302 indicated by the transfer area pointer 301.

キャプチャレジスタ612の値から転送領域ポインタ301
が指すデータ転送領域302の内容を減算し、減算結果の
符号にチャネル信号線632の値をセットした後、データ
転送領域302に転送する。
Transfer area pointer 301 from the value of capture register 612
The content of the data transfer area 302 indicated by is subtracted, the value of the channel signal line 632 is set to the sign of the subtraction result, and then the data is transferred to the data transfer area 302.

次に第1図、第2図、第3図のタイミングチャートを
参照して、マクロサービス処理を行なう際の実行部101
の動作を説明する。
Next, referring to the timing charts of FIG. 1, FIG. 2 and FIG. 3, the execution unit 101 at the time of performing macro service processing
Will be described.

実行部101は通常、プログラムメモリ200上のPC102が
指す番地から命令コードを読出し、命令レジスタ106に
転送し、実行制御部108が各種制御信号を出力して1命
令の実行を行なっており、1命令を実行する毎に次に実
行する命令の番地にPC102を更新する。I/O要求受付部15
0は、1命令の完了毎にキャプチャ終了I/O要求信号線91
0をサンプルし、インアクティブのときは上記動作を繰
り返す。
The execution unit 101 normally reads an instruction code from the address pointed to by the PC 102 on the program memory 200, transfers it to the instruction register 106, and the execution control unit 108 outputs various control signals to execute one instruction. Every time an instruction is executed, the PC 102 is updated with the address of the next instruction to be executed. I / O request reception part 15
0 indicates the capture end I / O request signal line 91 at the completion of one instruction
Samples 0, and repeats the above operation when inactive.

次に、taのタイミングでキャプチャ終了I/O要求信号
線910がアクティブになった時の実行部101の動作を説明
する。I/O要求受付部150はtaのタイミングでキャプチャ
終了I/O要求信号線910がアクティブになったことを検知
すると、taのタイミングでチャネル信号線632と端子レ
ベル信号線633をサンプルし、端子レベル信号線633がta
のタイミングにおいてハイレベルであることより、キャ
プチャ終了I/O要求が転送処理要求であることを認識
し、キャプチャレジスタ612の値の転送を行なうマクロ
サービスの処理コードを命令レジスタ106に強制的に転
送する。すなわち、前述のとおり、I/O要求受付部150は
1命令の完了毎にキャプチャ終了I/O要求信号線910をサ
ンプルしているので、同受付部150は、次の命令が命令
レジスタ106に格納される前にその内部に設けられてい
るマクロサービスの処理コードを命令レジスタ106に強
制的に転送する。命令レジスタ106にこのようにしてマ
クロサービス処理コードが格納されるので、完了制御部
は、PC102のアドレス更新を禁止し、PC102、PSW104、汎
用レジスタ105の状態を保持したまま、以下の処理を開
始する。
Next, the operation of the execution unit 101 when the capture end I / O request signal line 910 becomes active at the timing of ta will be described. When the I / O request reception unit 150 detects that the capture end I / O request signal line 910 has become active at the timing of ta, it samples the channel signal line 632 and the terminal level signal line 633 at the timing of ta, and Level signal line 633 is ta
The high level at the timing of recognizing that the capture end I / O request is a transfer processing request, and the processing code of the macro service for transferring the value of the capture register 612 is forcibly transferred to the instruction register 106. To do. That is, as described above, since the I / O request receiving unit 150 samples the capture end I / O request signal line 910 every time one instruction is completed, the receiving unit 150 sends the next instruction to the instruction register 106. Before being stored, the processing code of the macro service provided therein is forcibly transferred to the instruction register 106. Since the macro service processing code is stored in the instruction register 106 in this way, the completion control unit prohibits the address update of the PC 102 and starts the following processing while maintaining the states of the PC 102, PSW 104, and general-purpose register 105. To do.

実行制御部108は、転送領域ポインタ301の値を読出し
て、転送領域ポインタ301の指すデータ転送領域302を選
択する。
The execution control unit 108 reads the value of the transfer area pointer 301 and selects the data transfer area 302 pointed to by the transfer area pointer 301.

実行制御部108は、キャプチャレジスタ612が保持して
いるt1のタイミングにおけるFRC611の値をデータ転送領
域302へ転送する。
The execution control unit 108 transfers the value of the FRC 611 held by the capture register 612 at the timing of t1 to the data transfer area 302.

PC102のアドレス更新禁止を解除し、元のプログラム
の実行動作に戻る。
The address update prohibition of the PC 102 is released, and the original program execution operation is resumed.

次に、tbタイミングでキャプチャ終了I/O要求信号線9
10がアクティブになった時の実行部101の動作を説明す
る。I/O要求受付部150がキャプチャ終了I/O要求信号を
検知して、チャネル信号線632と端子レベル信号線633を
サンプルするまでの動作は、taのタイミングでキャプチ
ャ終了I/O要求信号線910がアクティブになった場合と同
様である。I/O要求受付部150は、端子レベル信号線633
がtbのタイミングでロウレベルであることより、キャプ
チャ終了I/O要求が演算処理要求であることを認識し、
その内部に設けられている演算を行なうマクロサービス
処理コードを命令レジスタ106に強制的に設定する。実
行制御部108は、PC102のアドレス更新を禁止してPC10
2、PSW104、汎用レジスタ105の状態を保持したまま、以
下の処理を行なう。
Next, capture end I / O request signal line 9 at tb timing
The operation of the execution unit 101 when 10 becomes active will be described. The operation until the I / O request receiving unit 150 detects the capture end I / O request signal and samples the channel signal line 632 and the terminal level signal line 633 is the capture end I / O request signal line at the timing of ta. This is the same as when the 910 becomes active. The I / O request receiving unit 150 uses the terminal level signal line 633.
Recognizes that the capture end I / O request is an arithmetic processing request, since is at the low level at the timing of tb,
The macro service processing code for performing the operation provided therein is forcibly set in the instruction register 106. The execution control unit 108 prohibits the address update of the PC 102 and
2. The following processing is performed while holding the states of PSW 104 and general-purpose register 105.

実行制御部108は、転送領域ポインタ301の値を読出し
て転送領域ポインタ301の指すデータ転送領域302を選択
する。
The execution control unit 108 reads the value of the transfer area pointer 301 and selects the data transfer area 302 pointed to by the transfer area pointer 301.

実行制御部108は、ALU103を用いてキャプチャレジス
タ612の値からデータ転送領域302の値を減算する。すな
わち、t2のタイミングにおけるFRC611の値とt1のタイミ
ングにおけるFRC611の値の差を求める。このときのALU1
03の演算状態は、PSW104の内容の変更が禁止されている
ので、PSW104には取り込まれない。
The execution control unit 108 uses the ALU 103 to subtract the value of the data transfer area 302 from the value of the capture register 612. That is, the difference between the value of FRC611 at the timing of t2 and the value of FRC611 at the timing of t1 is obtained. ALU1 at this time
The calculation state of 03 is not taken into PSW104 because changing the contents of PSW104 is prohibited.

実行制御部108は、ALU103を用いて減算結果の符号を
チャネル信号線632の値、すなわち“0"にする。
The execution control unit 108 uses the ALU 103 to set the sign of the subtraction result to the value of the channel signal line 632, that is, “0”.

実行制御部108は、符号付きの減算結果をデータ転送
領域302へ転送する。
The execution control unit 108 transfers the signed subtraction result to the data transfer area 302.

以上の処理により、t2のタイミングにおけるFRC611の
値とt1のタイミングにおけるFRC611の値の差、すなわち
T1を求めることができ、T1の符号から、チャネル1の信
号の方がチャネル2の信号より進んでいること、および
T1の値から位相差を知ることができる。そこで実行部10
1は、演算データをもとに処理を行なうためのキャプチ
ャ完了割込みを起動する。このキャプチャ完了割込にお
いては、PC102、PSW104および汎用レジスタ105の内容が
データメモリ300のスタック領域に退避され、PC102にキ
ャプチャ完了割込処理プログラムを起動するためのベク
タアドレスが指定される。かくして実行部101はプログ
ラムメモリ200に格納されているキャプチャ完了割込処
理プログラムを実行して所定の処理を行う。処理後、退
避されていたPC102、PSW104および汎用レジスタ105の内
容が復帰され、中断されていた元のプログラムに戻る。
By the above processing, the difference between the value of FRC611 at the timing of t2 and the value of FRC611 at the timing of t1, that is,
T1 can be obtained, and the sign of T1 indicates that the signal of channel 1 is ahead of the signal of channel 2, and
The phase difference can be known from the value of T1. Then the execution unit 10
1 activates the capture completion interrupt for processing based on the operation data. In this capture completion interrupt, the contents of the PC 102, PSW 104, and general-purpose register 105 are saved in the stack area of the data memory 300, and the vector address for starting the capture completion interrupt processing program is specified in the PC 102. Thus, the execution unit 101 executes the capture completion interrupt processing program stored in the program memory 200 and performs a predetermined process. After the processing, the saved contents of the PC 102, PSW 104, and general-purpose register 105 are restored, and the original program that was interrupted is restored.

tcのタイミングでキャプチャ終了I/O要求信号線910が
アクティブになった時の実行部101の動作は、前述したt
aのタイミングでキャプチャ終了I/O要求信号線910がア
クティブになった時の実行部101の動作と同様である。
また、tdのタイミングでキャプチャ終了I/O要求信号線9
10がアクティブになった時の実行部101の動作は、チャ
ネル信号線632の値が“1"であること以外は、tbのタイ
ミングでキャプチャ終了I/O要求信号線910がアクティブ
になった時の実行部101の動作と同様である。上記の動
作によって求まるT2の符号から、チャネル2の信号の方
がチャネル1の信号によりも進んでいること、およびT2
の値からチャネル1の信号とチャネル2の信号の位相差
を知ることができる。
When the capture end I / O request signal line 910 becomes active at the timing of tc, the operation of the execution unit 101 is as described above.
The operation is the same as that of the execution unit 101 when the capture end I / O request signal line 910 becomes active at the timing a.
At the timing of td, the capture end I / O request signal line 9
The operation of the execution unit 101 when 10 becomes active is when the capture end I / O request signal line 910 becomes active at the timing of tb, except that the value of the channel signal line 632 is "1". The operation is the same as that of the execution unit 101. From the code of T2 obtained by the above operation, the signal of channel 2 is ahead of the signal of channel 1, and T2
The phase difference between the channel 1 signal and the channel 2 signal can be known from the value of.

なお、本実施例において、チャネル数が増加した場合
は、それぞれのチャネルにデータ転送領域と転送領域ポ
インタを設定するだけで容易に対応が可能である。
In the present embodiment, when the number of channels is increased, it is possible to easily cope with it by setting the data transfer area and the transfer area pointer for each channel.

〔発明の効果〕〔The invention's effect〕

以上説明したように本発明は、割込みによらずにキャ
プチャした値を転送あるいは演算することにより、キャ
プチャがキャプチャ動作を行なう毎にPC、PSW、汎用レ
ジスタの退避、復帰等の処理を行なわないため、入力チ
ャネル数が増加した場合問題となるPC、PSW、汎用レジ
スタの退避、復帰等の、本来目的としない処理に費やす
時間を減らし、実行部の使用効率を向上させることがで
き、また入力チャネル数が増加した場合、マクロサービ
スチャネルを設定するだけで容易に多数の入力チャネル
に対応でき、FRCまたはキャプチャレジスタの増設をし
ないで済むため、使用するハードウエア量を節約できる
等の効果がある。
As described above, according to the present invention, the captured value is transferred or calculated without depending on the interrupt, so that the processing such as saving and restoring of the PC, PSW, and general-purpose register is not performed every time the capture performs the capture operation. , It is possible to reduce the time spent for unintended processing such as saving and restoring of PC, PSW, general-purpose registers, etc., which becomes a problem when the number of input channels increases, and improve the usage efficiency of the execution unit. When the number increases, it is possible to easily deal with a large number of input channels simply by setting the macro service channel, and it is not necessary to add an FRC or a capture register. Therefore, the amount of hardware used can be saved.

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

第1図は本発明のパネル間隔計測装置の一実施例を示す
ブロック図、第2図は第1図におけるパルス入力装置60
0とI/O要求制御部900のさらに詳細なブロック図、第3
図は本実施例における、パルス間隔計測装置の動作を示
すタイミングチャート、第4図は従来例のパルス計測装
置のブロック図、第5図は従来例における割込み処理の
フローチャートである。 1……チャネル、 2……チャネル、 100……マイクロコンピュータ、 101……実行部、 102……プログラムカウンタ(PC)、 103……算術論理演算ユニット(ALU)、 104……プログラム・ステータス・ワード(PSW)、 105……汎用レジスタ、 106……命令レジスタ、 108……実行制御部、 150……I/O要求受付部、 200……プログラムメモリ、 300……データメモリ、 301……転送領域ポインタ、 302……データ転送領域、 351……キャプチャ値格納領域、 361……演算結果格納領域、 381……ソフトウエアフラグ領域、 382……ソフトウエアフラグ(チャネル1用)、 383……ソフトウエアフラグ(チャネル2用)、 391……ステータス退避領域、 400……割込み制御部、 401,402……割込み制御線、 500……パルス入力装置、 511,521……フリーランニングカウンタ(FRC)、 512,522……キャプチャレジスタ、 531,532……立下がりエッジ検出信号線、 540……パルス制御回路、 600……パルス入力装置、 611……フリーラニングカウンタ(FRC)、 612……キャプチャレジスタ、 631……立下がりエッジ検出信号線、 632……チャネル信号線、 633……端子レベル信号線、 640……パルス制御回路、 700……内部バス、 900……I/O要求制御部、 910……キャプチャ終了I/O要求信号線。
FIG. 1 is a block diagram showing an embodiment of the panel interval measuring device of the present invention, and FIG. 2 is a pulse input device 60 in FIG.
0 and more detailed block diagram of the I / O request control unit 900, 3rd
FIG. 4 is a timing chart showing the operation of the pulse interval measuring device in the present embodiment, FIG. 4 is a block diagram of the pulse measuring device of the conventional example, and FIG. 5 is a flowchart of interrupt processing in the conventional example. 1 ... Channel, 2 ... Channel, 100 ... Microcomputer, 101 ... Execution section, 102 ... Program counter (PC), 103 ... Arithmetic and logic unit (ALU), 104 ... Program status word (PSW), 105 ... General purpose register, 106 ... Instruction register, 108 ... Execution control block, 150 ... I / O request receiving block, 200 ... Program memory, 300 ... Data memory, 301 ... Transfer area Pointer, 302 ... Data transfer area, 351 ... Capture value storage area, 361 ... Calculation result storage area, 381 ... Software flag area, 382 ... Software flag (for channel 1), 383 ... Software Flag (for channel 2), 391 ... Status save area, 400 ... Interrupt control unit, 401,402 ... Interrupt control line, 500 ... Pulse input device, 511,521 ... Free running counter (FRC), 51 2,522 …… Capture register, 531,532 …… Falling edge detection signal line, 540 …… Pulse control circuit, 600 …… Pulse input device, 611 …… Free running counter (FRC), 612… Capture register, 631 …… Rising Falling edge detection signal line, 632 ... Channel signal line, 633 ... Terminal level signal line, 640 ... Pulse control circuit, 700 ... Internal bus, 900 ... I / O request control unit, 910 ... Capture end I / O request signal line.

フロントページの続き (72)発明者 香取 重雄 東京都港区芝5丁目33番1号 日本電気株 式会社内 (56)参考文献 特開 昭60−183626(JP,A)Continued Front Page (72) Inventor Shigeo Katori 5-33-1 Shiba, Minato-ku, Tokyo Inside NEC Corporation (56) Reference JP-A-60-183626 (JP, A)

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】プログラムメモリ、データメモリ、I/O要
求受付部、命令実行手段、プログラムカウンタ、および
実行動作状態を示すプログラムステータスワードを備え
る実行部と、クロックをカウントするカウンタ、キャッ
プレジスタ、ならびに、第1および第2のパルス信号を
受けこれらパルス信号に予め定められた反転エッジが現
れる毎に検出信号を発生するとともにその時点での前記
カウンタの内容を前記キャップレジスタにストアさせ、
さらに前記予め定められた反転エッジが現れたパルス信
号とは異なるパルス信号の当該反転エッジが現れた時点
でのレベルにもとづく論理レベルを有するレベル信号を
発生させるパルス制御回路を有するパルス入力装置と、
前記検出信号に応答して前記実行部の前記I/O要求受付
部に処理要求を発行するI/O要求制御部とを備え、前記I
/O要求受付部は前記処理要求にもとづき前記レベル信号
が第1の論理レベルのときは第1の形態を指定するマク
ロサービス処理コードを第2の論理レベルのときは第2
の形態を指定するマクロサービス処理コードを前記命令
実行手段にそれぞれ与え、前記命令実行手段は前記マク
ロサービス処理コードに応答して、前記プログラムカウ
ンタのアドレス更新を禁止してプログラムの実行を中断
しかつその時の前記プログラムカウンタおよび前記プロ
グラムステータスワードの情報を前記データメモリに退
避することなくそのままにした状態で、前記マクロサー
ビス処理コードが前記第1の形態を示すときは前記キャ
プチャレジスタの内容を前記データメモリ内のデータ転
送領域に転送し、前記第2の形態を示すときは前記デー
タ転送領域の内容と前記キャプチャレジスタの内容とに
対する演算を実行し、その演算結果の内容を前記データ
メモリ内のデータ転送領域に転送し、その後、中断した
プログラムの実行処理を再開することを特徴とするパル
ス間隔計測装置。
1. A program memory, a data memory, an I / O request receiving unit, an instruction executing unit, a program counter, and an execution unit including a program status word indicating an execution operation state, a counter for counting clocks, a cap register, and Receiving a first pulse signal and a second pulse signal, generating a detection signal each time a predetermined inversion edge appears in these pulse signals, and storing the contents of the counter at that time in the cap register,
Further, a pulse input device having a pulse control circuit for generating a level signal having a logic level based on the level of the pulse signal different from the pulse signal in which the predetermined inversion edge appears, the level of the inversion edge in the pulse signal,
An I / O request control unit that issues a processing request to the I / O request receiving unit of the execution unit in response to the detection signal;
The / O request accepting unit, based on the processing request, outputs the macro service processing code designating the first form when the level signal is the first logic level and the second when the level signal is the second logic level.
The macro service processing code designating the form of the above is given to the instruction executing means, and the instruction executing means prohibits the address update of the program counter and interrupts the execution of the program in response to the macro service processing code. In the state where the information of the program counter and the program status word at that time is kept as it is without being saved in the data memory, when the macro service processing code indicates the first form, the contents of the capture register are changed to the data. Data is transferred to a data transfer area in the memory, and when the second mode is shown, an operation is performed on the content of the data transfer area and the content of the capture register, and the content of the operation result is stored in the data in the data memory. Transfer to the transfer area and then execute the interrupted program Pulse interval measuring device, characterized in that to resume management.
【請求項2】前記パルス制御装置は、前記予め定められ
た反転エッジが前記第1および第2のパルス信号のどち
らかに現れたかをその論理レベルで示すチャネル信号を
さらに発生し、前記命令実行手段は前記演算により得た
結果の符号を前記チャネル信号の論理レベルにより制御
することを特徴とする特許請求の範囲第1項記載のパル
ス間隔計測装置。
2. The pulse control device further generates a channel signal indicating by a logic level of which of the first and second pulse signals the predetermined inversion edge appears, and the instruction execution. The pulse interval measuring device according to claim 1, wherein the means controls the sign of the result obtained by the calculation according to the logical level of the channel signal.
【請求項3】前記命令実行手段は、前記プログラムを実
行するためのALUを有し、このALUを用いて前記データ転
送領域の内容と前記キャプチャレジスタの内容とに対す
る演算を実行することを特徴とする特許請求の範囲第1
項又は第2項記載のパルス間隔計測装置。
3. The instruction executing means has an ALU for executing the program, and executes an operation on the contents of the data transfer area and the contents of the capture register using the ALU. Claim 1 to
The pulse interval measuring device according to item 2 or item 2.
【請求項4】前記ALUを用いた演算は前記データ転送領
域の内容から前記キャプチャレジスタの内容を減算する
減算処理であることを特徴とする特許請求の範囲第3項
記載のパルス間隔計測装置。
4. The pulse interval measuring device according to claim 3, wherein the arithmetic operation using the ALU is a subtraction process for subtracting the contents of the capture register from the contents of the data transfer area.
JP60208411A 1985-09-19 1985-09-19 Pulse interval measuring device Expired - Lifetime JPH0812561B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60208411A JPH0812561B2 (en) 1985-09-19 1985-09-19 Pulse interval measuring device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60208411A JPH0812561B2 (en) 1985-09-19 1985-09-19 Pulse interval measuring device

Publications (2)

Publication Number Publication Date
JPS6267603A JPS6267603A (en) 1987-03-27
JPH0812561B2 true JPH0812561B2 (en) 1996-02-07

Family

ID=16555792

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60208411A Expired - Lifetime JPH0812561B2 (en) 1985-09-19 1985-09-19 Pulse interval measuring device

Country Status (1)

Country Link
JP (1) JPH0812561B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2504044B2 (en) * 1987-03-31 1996-06-05 日本電気株式会社 Pulse measuring device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS52128028A (en) * 1976-04-20 1977-10-27 Nec Corp Universal timing control method of data processing unit
JPS55143632A (en) * 1979-04-24 1980-11-10 Fujitsu Ltd Timer constitution system
JPS5944649B2 (en) * 1979-10-26 1984-10-31 沖電気工業株式会社 timer circuit
JPS6073748A (en) * 1983-09-30 1985-04-25 Toshiba Corp Internal timer circuit system

Also Published As

Publication number Publication date
JPS6267603A (en) 1987-03-27

Similar Documents

Publication Publication Date Title
EP0313097B1 (en) Microcomputer system including master processor and slave processor
EP0363889B1 (en) Vector processor using buffer for preparing vector data
JP2661222B2 (en) Pulse output device
JPH0812561B2 (en) Pulse interval measuring device
US20050228917A1 (en) Novel structure and method for interrupt detection and processing
JPH0632051B2 (en) Information processing equipment
US5307488A (en) System interruption apparatus
JP3047534B2 (en) Low power consumption system
JP2984670B1 (en) Timer circuit
SU1485240A1 (en) Address space extender
JPS63155330A (en) Microprogram controller
JPS62175853A (en) Interface control system
JPS61294555A (en) Detecting method for program runaway
JPH0373900B2 (en)
JPH04312111A (en) Data processor
JPH087608B2 (en) Pulse output device
JPH02112054A (en) Data processor
JPS59172055A (en) Memory control circuit
JPH0438526A (en) Microcomputer
JPH0531775B2 (en)
EP0266799A2 (en) Single chip microcomputer having multi-timer function
JPH04242845A (en) Data processor
JPS63233455A (en) Microprocessor
JPS63182750A (en) Device for supporting development of microcomputer
JPS6349946A (en) Arithmetic processing unit