JPH04211832A - Information processor - Google Patents
Information processorInfo
- Publication number
- JPH04211832A JPH04211832A JP3021773A JP2177391A JPH04211832A JP H04211832 A JPH04211832 A JP H04211832A JP 3021773 A JP3021773 A JP 3021773A JP 2177391 A JP2177391 A JP 2177391A JP H04211832 A JPH04211832 A JP H04211832A
- Authority
- JP
- Japan
- Prior art keywords
- register
- output
- signal
- reset
- compare register
- 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.)
- Granted
Links
- 230000002093 peripheral effect Effects 0.000 claims description 15
- 230000010365 information processing Effects 0.000 claims 4
- 230000002401 inhibitory effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 11
- 239000000872 buffer Substances 0.000 description 8
- 238000003708 edge detection Methods 0.000 description 7
- 239000000446 fuel Substances 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000002347 injection Methods 0.000 description 2
- 239000007924 injection Substances 0.000 description 2
- 230000007257 malfunction Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 101100286980 Daucus carota INV2 gene Proteins 0.000 description 1
- 101100397045 Xenopus laevis invs-b gene Proteins 0.000 description 1
- 239000013256 coordination polymer Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000034 method Methods 0.000 description 1
Abstract
Description
【0001】0001
【産業上の利用分野】本発明は周辺機器からのクロック
入力により、周辺機器の制御を行うためのパルス発生装
置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a pulse generator for controlling peripheral equipment using clock input from the peripheral equipment.
【0002】0002
【従来の技術】パルス発生装置は、自動車エンジン制御
をはじめとして、各種リアルタイム制御を行う周辺機器
制御のため広く普及している。2. Description of the Related Art Pulse generators are widely used for controlling peripheral devices that perform various real-time controls, including automobile engine control.
【0003】以下、図1,図8,図9を用い、従来技術
について説明する。図1はパルス発生装置の構成図で、
パルス発生装置100は、中央処理装置(以下、CPU
という)101、割り込み要求発生回路(以下、INT
Cという)102、周辺ハードウェア103、及び周辺
バス104より構成される。The prior art will be explained below with reference to FIGS. 1, 8, and 9. Figure 1 is a block diagram of the pulse generator.
The pulse generator 100 is a central processing unit (hereinafter referred to as CPU).
) 101, interrupt request generation circuit (hereinafter referred to as INT
102, peripheral hardware 103, and peripheral bus 104.
【0004】また、周辺ハードウェア103は、INT
C102に対し割り込み信号105を出力し、INTC
102は、これら割り込み信号の優先順位判定などを行
って、CPU101に割り込み要求信号106を出力す
る。CPU101は、割り込み要求信号を受け付けると
、予め内部、あるいは外部のメモリにプログラムしてお
いたプログラムに従い所定の処理を行う。[0004] Also, the peripheral hardware 103 includes an INT
Output interrupt signal 105 to C102, INTC
102 performs priority determination of these interrupt signals and outputs an interrupt request signal 106 to the CPU 101. Upon receiving the interrupt request signal, the CPU 101 performs predetermined processing according to a program preprogrammed in an internal or external memory.
【0005】図8は、周辺ハードウェア103の内部で
、内部カウントクロックφをカウントするフリーランニ
ング・カウンタ(以下、FRCという)501、FRC
501のカウンタ値と比較を行うコンペア・レジスタA
510〜51nと、FRC501のカウンタ値をキャッ
プチャするキャプチャ・レジスタ520と外部クロック
入力バッファ521と、入力バッファ521より入力さ
れた外部クロック入力信号のエッヂ検出回路522と、
エッヂ検出回路522により検出された外部クロックを
カウントするイベント・カウンタ523と、イベント・
カウンタ523のカウンタ値と比較を行うコンペア・レ
ジスタB524と、コンペア・レジスタB524の一致
信号525によりセットされ、コンペア・レジスタA5
10〜51nからの一致信号530〜53nによりリセ
ットされるフリップ・フロップ回路(以下、F.F.と
いう)540〜54nと、F.F540〜54nを出力
する出力バッファ550〜55nより構成される。コン
ペア・レジスタB524の一致信号525は、イベント
・カウンタ523をリセットすると共に、キャプチャ・
レジスタ520のキャプチャ・トリガ信号とINTC1
02への割り込み信号となっている。FIG. 8 shows a free running counter (hereinafter referred to as FRC) 501 that counts an internal count clock φ inside the peripheral hardware 103;
Compare register A that compares with the counter value of 501
510 to 51n, a capture register 520 that captures the counter value of the FRC 501, an external clock input buffer 521, and an edge detection circuit 522 for the external clock input signal input from the input buffer 521.
An event counter 523 that counts the external clock detected by the edge detection circuit 522;
Compare register B524 compares with the counter value of counter 523, and is set by match signal 525 of compare register B524, and compare register A5
Flip-flop circuits (hereinafter referred to as F.F.) 540-54n that are reset by match signals 530-53n from F.10-51n; It is composed of output buffers 550 to 55n that output F540 to 54n. The match signal 525 of compare register B 524 resets the event counter 523 and also resets the capture register B 524.
Capture trigger signal of register 520 and INTC1
This is an interrupt signal to 02.
【0006】図9のタイミングチャートを参照して、出
力バッファ550から出力されるパルス出力0を例にと
って動作を説明する。Referring to the timing chart of FIG. 9, the operation will be explained by taking as an example a pulse output of 0 output from the output buffer 550.
【0007】まず、外部クロックが所定数入力され、イ
ベント・カウンタ523のカウント値がコンペア・レジ
スタB524に予め設定しておいた値になり一致が起き
ると、コンペア・レジスタB524から一致信号525
が出力され、F.F540がセットされパルス出力0が
ハイ・レベル“1”になる。一致信号525はまた、キ
ャプチャ・レジスタ520のキャプチャ・トリガ信号と
なりその時のFRC501の値D0 をキャプチャ・レ
ジスタ520に取り込むと共に、イベント・カウンタ5
23をクリアし、さらにはINTC102へ割り込み信
号105を出力する。First, when a predetermined number of external clocks are input and the count value of the event counter 523 reaches the value preset in the compare register B524 and a match occurs, a match signal 525 is sent from the compare register B524.
is output, F. F540 is set and pulse output 0 becomes high level "1". The match signal 525 also becomes a capture trigger signal for the capture register 520, and the value D0 of the FRC 501 at that time is captured into the capture register 520, and the event counter 5
23 and further outputs an interrupt signal 105 to the INTC 102.
【0008】INTC102は、割り込み信号105が
入力されると優先順位等の判断処理を行ったのち、CP
U101に割り込み要求信号106を出力する。CPU
101は、割り込み要求信号106が入力されると予め
プログラムしておいたプログラムに従い割り込み処理を
行う。ここでは、キャプチャ・レジスタ520の値D0
に所望のパルス出力幅T0 に相当するFRC501
のカウント数W0 を足した値、D0 +W0 をコン
ペア・レジスタ210に書き込む、という処理を行う。[0008] When the interrupt signal 105 is input, the INTC 102 performs processing to determine the priority order, etc.
An interrupt request signal 106 is output to U101. CPU
101 performs interrupt processing according to a preprogrammed program when an interrupt request signal 106 is input. Here, the value D0 of capture register 520
FRC501 corresponding to the desired pulse output width T0
A value obtained by adding the count number W0 of , D0 +W0, is written to the compare register 210.
【0009】ここで、カウントクロックはφであるので
、T0 =W0 /φ (W0 :カウント数、φ:
FRC501カウント周波数)という関係が成り立つ。Here, since the count clock is φ, T0 = W0 /φ (W0: number of counts, φ:
FRC501 count frequency) holds true.
【0010】FRC501がカウントアップされていき
D0 +W0 の値になるとコンペア・レジスタA51
0の一致信号530が出力される。一致信号530は、
F.F540をリセットしパルス出力0をLOWレベル
“0”にする。When the FRC501 counts up and reaches the value D0 +W0, the compare register A51
A match signal 530 of 0 is output. The match signal 530 is
F. Reset F540 and set pulse output 0 to LOW level "0".
【0011】さらに外部クロック入力されて、イベント
・カウンタがカウントされると、再びコンペア・レジス
タB524との一致が起こり、F.F540はセットさ
れ、パルス出力0は再びハイ・レベル“1”となる。When the external clock is further input and the event counter is counted, a match with the compare register B524 occurs again, and the F. F540 is set and the pulse output 0 becomes high level "1" again.
【0012】以後、同様の動作を繰り返すことにより外
部クロック入力に同期したハイ幅T0 のパルス出力を
得ることが出来る。Thereafter, by repeating the same operation, it is possible to obtain a pulse output with a high width T0 synchronized with the external clock input.
【0013】[0013]
【発明が解決しようとする課題】しかし、外部入力クロ
ックの周期が短くなりコンペア・レジスタB524の一
致信号525の発生周期がパルス幅T0 よりも短くな
ってくると、すなわち第9図でTC の期間になると、
コンペア・レジスタB524の一致信号525によりF
.F540が二重にセットされると共に、割り込み処理
によりコンペア・レジスタA510がD2 +W0 か
らD3 +W0 に更新される前に、FRC501がD
2 +W0 になるコンペア・レジスタA510の値と
一致し、一致信号525が出力され、F.F540は、
リセットされてしまう。However, when the period of the external input clock becomes shorter and the generation period of the match signal 525 of the compare register B524 becomes shorter than the pulse width T0, that is, the period TC in FIG. To become and,
F by match signal 525 of compare register B524
.. F540 is set to double and FRC501 is set to D before compare register A510 is updated from D2 +W0 to D3 +W0 by interrupt processing.
2 +W0, the value of compare register A510 matches, a match signal 525 is output, and F. F540 is
It will be reset.
【0014】従って外部クロック入力周期が短くなり、
コンペア・レジスタB524の一致信号525の周期が
T0 より短くなると、一致信号525によりセットさ
れたパルス出力0が必ずしもT0 間出力されなくなれ
ため一致信号525の周期は、外部出力パルス幅T0
よりも長い必要があった。[0014] Therefore, the external clock input period becomes shorter,
When the cycle of the match signal 525 of the compare register B524 becomes shorter than T0, the pulse output 0 set by the match signal 525 is not necessarily output for T0, so the cycle of the match signal 525 becomes the external output pulse width T0.
It needed to be longer than that.
【0015】このように、従来のパルス出力装置は、外
部クロック入力周期が短くなり、イベント・カウンタに
接続されるコンペア・レジスタの一致信号の周期が、外
部出力パルス周期T0 よりも短くなると、本来外部パ
ルス出力としてハイ・レベル“1”を出力し続けたいに
もかかわらず、外部パルス出力が突然リセットされてし
まい、例えば自動車のエンジン燃料噴射制御に使用した
場合には、本来燃料を噴射し続けたい場合にもパルス出
力が突然リセットされてしまうことにより、突然燃料噴
射が得られなくなるなどの誤動作を起こす原因となる。[0015] As described above, in the conventional pulse output device, when the external clock input period becomes short and the period of the match signal of the compare register connected to the event counter becomes shorter than the external output pulse period T0, Even though you want to continue outputting a high level "1" as the external pulse output, the external pulse output is suddenly reset and, for example, when used for controlling the fuel injection of a car engine, it may not continue to inject fuel. If the pulse output is suddenly reset even when it is desired, this may cause malfunctions such as sudden inability to obtain fuel injection.
【0016】[0016]
【課題を解決するための手段】本発明による処理装置は
、中央処理装置と、前期中央処理装置に非同期に処理要
求をする割り込み要求発生回路と、周辺回路とを有し、
前記周辺回路は、外部クロック入力信号のエッヂ検出回
路と、前記エッヂ検出回路により検出されたクロックに
よりカウントをおこなうイベント・カウンタと、前記イ
ベント・カウンタのカウンタ値と比較を行う第一のコン
ペア・レジスタと、内部クロックによりカウントされる
フリーランニング・カウンタと、前記フリーランニング
・カウンタのカウンタ値と比較を行う第二のコンペア・
レジスタと、前記第一のコンペア・レジスタからの一致
信号によりセットされ、前記第二のコンペア・レジスタ
への書き込み信号によりリセットされる第一のフリップ
・フロップ回路と、前記第一のコンペア・レジスタから
の一致信号によりセットされ、前記第一のフリップ・フ
ロップ回路の出力と前記第二のコンペア・レジスタから
の一致信号によりリセットを制御される第二のフリップ
・フロップ回路とを有している。[Means for Solving the Problems] A processing device according to the present invention includes a central processing unit, an interrupt request generation circuit that asynchronously issues a processing request to the central processing unit, and a peripheral circuit,
The peripheral circuit includes an edge detection circuit for an external clock input signal, an event counter that counts based on the clock detected by the edge detection circuit, and a first compare register that performs a comparison with a counter value of the event counter. and a free-running counter counted by an internal clock, and a second comparer that compares the counter value of the free-running counter.
a first flip-flop circuit set by a match signal from the first compare register and reset by a write signal to the second compare register; and a second flip-flop circuit whose reset is controlled by the match signal from the output of the first flip-flop circuit and the second compare register.
【0017】[0017]
【実施例】以下、図面を用いて本発明の実施例を詳述す
る。Embodiments Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
【0018】まず、図1,図2,図3を用いて本発明の
一実施例を説明する。First, one embodiment of the present invention will be explained using FIGS. 1, 2, and 3.
【0019】図1はパルス発生装置の構成図で、パルス
発生装置100は、CPU101、INTC102、周
辺ハードウェア103、及び周辺バス104より構成さ
れる。FIG. 1 is a block diagram of a pulse generator, and the pulse generator 100 is composed of a CPU 101, an INTC 102, peripheral hardware 103, and a peripheral bus 104.
【0020】また、周辺ハードウェア103は、INT
C102に対し割り込み信号105を出力し、INTC
102は、これら割り込み信号の優先順位判定などを行
って、CPU101に割り込み要求信号106を出力す
る。CPU101は、割り込み要求信号を受け付けると
、予め内部、あるいは外部のメモリにプログラムしてお
いたプログラムに従い所定の処理を行う。[0020] Furthermore, the peripheral hardware 103 includes an INT
Output interrupt signal 105 to C102, INTC
102 performs priority determination of these interrupt signals and outputs an interrupt request signal 106 to the CPU 101. Upon receiving the interrupt request signal, the CPU 101 performs predetermined processing according to a program preprogrammed in an internal or external memory.
【0021】図2は、周辺ハードウェア103の内部で
、内部カウントクロックφをカウントするFRC201
、FRC201のカウント値と比較を行うコンペア・レ
ジスタA210〜21nと、FRC201のカウント値
をキャップチャするキャプチャ・レジスタ220と、外
部クロック入力バッファ221と、入力バッファ221
より入力された外部クロック入力信号のエッヂ検出回路
222と、エッヂ検出回路222により検出された外部
クロックをカウントするイベント・カウンタ223と、
イベント・カウンタ223のカウンタ値と比較を行うコ
ンペア・レジスタB224と、コンペア・レジスタB2
24の一致信号225によりセットされ、コンペア・レ
ジスタA210〜21nへの書き込み信号、またはCP
U101からのリセット信号RESETによりリセット
されるF.F226と、F.F226の出力を入力とす
るインバータ(以下、INVという)227とINV2
27の出力と一致信号230〜23nとのAND論理積
(以下、ANDという)260〜26nと、一致信号2
25によりセットされ、AND260〜26nの出力に
よりリセットされるF.F240〜24nと、F.F2
40〜24nを入力とする出力バッファ250〜25n
より構成される。コンペア・レジスタB224の一致信
号225は、イベント・カウンタ223をリセットする
と共に、キャプチャ・レジスタ220のキャプチャ・ト
リガ信号と、INTC102への割り込み信号ともなっ
ている。FIG. 2 shows an FRC 201 that counts an internal count clock φ inside the peripheral hardware 103.
, compare registers A210 to 21n that compare with the count value of FRC201, a capture register 220 that captures the count value of FRC201, an external clock input buffer 221, and an input buffer 221.
an edge detection circuit 222 for an external clock input signal input from the edge detection circuit 222; an event counter 223 for counting the external clock detected by the edge detection circuit 222;
A compare register B224 that compares with the counter value of the event counter 223, and a compare register B2
24 match signal 225, write signal to compare registers A210 to 21n, or CP
F.F. is reset by the reset signal RESET from U101. F226 and F. Inverter (hereinafter referred to as INV) 227 and INV2 whose input is the output of F226
27 and the coincidence signals 230 to 23n (hereinafter referred to as AND) 260 to 26n, and the coincidence signal 2
F.25 and reset by the outputs of AND260-26n. F240-24n and F. F2
Output buffer 250-25n with inputs 40-24n
It consists of The match signal 225 of the compare register B 224 resets the event counter 223 and also serves as a capture trigger signal for the capture register 220 and an interrupt signal to the INTC 102.
【0022】図3のタイミングチャートを参照して出力
バッファ250より出力されるパルス出力0を例にとっ
て動作を説明する。The operation will be described with reference to the timing chart of FIG. 3, taking as an example a pulse output of 0 output from the output buffer 250.
【0023】まず、外部クロックが所定数入力され、コ
ンペア・レジスタB224に予め設定しておいた値とな
り、コンペア・レジスタB224のカウント値と一致が
起きると、コンペア・レジスタB224より一致信号2
25が出力され、F.F240がセットされてパルス出
力0をハイ・レベル“1”にする。それと同時に、F.
F226をセットしINV227の出力をロウ・レベル
“0”にし、AND260〜26nの出力をロウ・レベ
ル“0”に固定することにより一致信号230〜23n
によるF.F240〜24nのリセットを禁止する。First, a predetermined number of external clocks are input and the value becomes the value set in advance in the compare register B224, and when a match occurs with the count value of the compare register B224, a match signal 2 is output from the compare register B224.
25 is output, F. F240 is set to make pulse output 0 a high level "1". At the same time, F.
Match signals 230 to 23n are set by setting F226 to make the output of INV227 low level "0" and fixing the outputs of AND260 to 26n to low level "0".
by F. Prohibits reset of F240-24n.
【0024】一致信号225はまた、キャプチャ・レジ
スタ220のキャプチャ・トリガ信号となりその時のF
RC201のカウント値D0 をキャプチャ・レジスタ
220に取り込むと共に、イベント・カウンタ223の
クリア信号、さらにはINTC102への割り込み信号
105となる。The match signal 225 also serves as a capture trigger signal for the capture register 220 at that time.
The count value D0 of the RC 201 is taken into the capture register 220, and serves as a clear signal for the event counter 223 and further as an interrupt signal 105 to the INTC 102.
【0025】INTC102は、割り込み信号105が
入力されると優先順位等の判断処理を行ったのち、CP
U101に割り込み要求信号106を出力する。[0025] When the interrupt signal 105 is input, the INTC 102 performs processing to determine the priority order, etc.
An interrupt request signal 106 is output to U101.
【0026】CPU101は、割り込み要求信号107
が入力されると予めプログラムしておいたプログラムに
従い割り込み処理を行う。ここでは、キャプチャ・レジ
スタ220の値D0 に所望のパルス出力幅T0 に相
当するFRC201のカウント数W0 を足した値、D
0 +W0 をコンペア・レジスタ210に書き込み、
という処理を行う。The CPU 101 receives an interrupt request signal 107.
When input, interrupt processing is performed according to a preprogrammed program. Here, the value D0 is the sum of the count number W0 of the FRC 201 corresponding to the desired pulse output width T0 to the value D0 of the capture register 220.
Write 0 +W0 to compare register 210,
This process is performed.
【0027】ここで、カウントクロックはφであるので
、T0 =W0 /φ (W0 :カウント数,φ:
FRC501カウント周波数)という関係が成り立つ。Here, since the count clock is φ, T0 = W0 /φ (W0: number of counts, φ:
FRC501 count frequency) holds true.
【0028】コンペア・レジスタへの書き込み信号によ
りF.F226はリセットされ、一致信号230〜23
nによるF.F240〜24nのリセットを許可する。The write signal to the compare register causes the F. F226 is reset and match signals 230-23
F. by n. Allows reset of F240-24n.
【0029】FRC201がカウントアップされていき
D0 +W0 の値になるとコンペア・レジスタA21
0の一致信号230が出力される。一致信号230は、
F.F240をリセットしパルス出力0をロウ・レベル
“0”にする。When the FRC201 counts up and reaches the value D0 +W0, the compare register A21
A match signal 230 of 0 is output. The match signal 230 is
F. Reset F240 and set pulse output 0 to low level "0".
【0030】さらに外部クロックが入力されて、イベン
ト・カウンタがカウントされ続け、再びコンペア・レジ
スタ224との一致が起こるとF・F240及びF.F
226はセットされ、パルス出力0は再びハイ・レベル
“1”となると共に一致信号230〜23nによるF.
F240〜24nのリセットを禁止する。Further, when the external clock is input and the event counter continues counting, and a match with the compare register 224 occurs again, the F.F.240 and F.F. F
226 is set, the pulse output 0 becomes high level "1" again, and F.
Prohibits reset of F240-24n.
【0031】以後、一致信号225の周期が外部出力パ
ルス幅T0 よりも長い場合には、すなわち図9でTa
、Tbに相当する場合には、同様の動作を繰り返すこと
により外部クロック入力に同期したハイ幅T0 のパル
ス出力を得ることが出来る。Thereafter, if the period of the coincidence signal 225 is longer than the external output pulse width T0, that is, in FIG.
, Tb, a pulse output with a high width T0 synchronized with the external clock input can be obtained by repeating the same operation.
【0032】また、一致信号225の周期が出力パルス
幅T0 よりも短い場合には、すなわち図9でTC の
期間では、一致信号225により、F.F240がセッ
トされ、パルス出力0がハイ・レベル“1”になると共
に、F.F226がセットされ、INV227がロウ・
レベル“0”となる。一致信号225による割り込み処
理により、コンペア・レジスタA210の値を更新し、
D2 +W0 を書き込むと、F.F226はリセット
されINV227はハイ・レベル“1”となり、一致信
号230〜23nによるF.F240〜24nのリセッ
トが許可されるが、コンペア・レジスタA210からの
一致信号230が出力される前に再び、一致信号225
が出力されるために再度F.F226がセットされ、I
NV227の出力がロウ・レベル“0”となり、F.F
240〜24nのリセットが禁止されるため、コンペア
・レジスタA210(D2 +W0 )の一致によるF
.F240のリセットは行われず、パルス出力0は、ハ
イ・レベル“1”を出力し続ける。Furthermore, when the period of the coincidence signal 225 is shorter than the output pulse width T0, that is, during the period TC in FIG. 9, the coincidence signal 225 causes the F. F240 is set, pulse output 0 becomes high level "1", and F. F226 is set and INV227 is low.
The level becomes “0”. The value of the compare register A210 is updated by the interrupt processing by the match signal 225,
When D2 +W0 is written, F. F226 is reset and INV227 becomes high level "1", and F. Resetting of F240 to F24n is allowed, but before the match signal 230 from the compare register A210 is output, the match signal 225 is reset again.
F. is output again. F226 is set and I
The output of NV227 becomes low level "0", and F. F
Since reset of 240 to 24n is prohibited, F due to match of compare register A210 (D2 +W0)
.. The F240 is not reset, and the pulse output 0 continues to output a high level "1".
【0033】従って、外部クロック入力の周期が短くな
って、一致信号225の周期がパルス幅T0 より短く
なっても、パルス出力0〜nは突然リセットされること
がないため誤動作の原因となることがない。Therefore, even if the period of the external clock input becomes shorter and the period of the coincidence signal 225 becomes shorter than the pulse width T0, the pulse outputs 0 to n will not be suddenly reset, which may cause malfunction. There is no.
【0034】次に、本発明の第2の実施例を図4に示す
。本実施例では、前実施例のF.F226、INV22
7、AND260〜26nのかわりに、一致信号225
により、セットされ各コンペア・レジスタ210〜21
nへの書き込み信号により、それぞれリセットされるF
.F400〜40nと、F.F400〜40nを入力と
するINV410〜41n、一致信号230〜23nと
INV410〜41nとのそれぞれの論理積AND42
0〜42nにより構成される。なお、図2と同様の番号
のものは、同様の機能を表す。Next, a second embodiment of the present invention is shown in FIG. In this embodiment, F. F226, INV22
7. Match signal 225 instead of AND260~26n
is set by each compare register 210-21.
F is reset by a write signal to n.
.. F400-40n and F. AND42 of INV410-41n with F400-40n as input, respective logical products of match signals 230-23n and INV410-41n
Consists of 0 to 42n. Note that the same numbers as in FIG. 2 represent similar functions.
【0035】実施例1では、複数のコンペア・レジスタ
A210〜21nのどれかひとつでも更新されれば一致
信号230〜23nによる、F.F240〜24nのリ
セットが許可されるが、本実施例では各コンペア・レジ
スタそれぞれへの書き込みが終了しなければ、対応する
パルス出力はリセットされないため、複数のパルス出力
に対しよりきめ細かく、応用範囲の広い制御を行うこと
が出来る。In the first embodiment, if any one of the plurality of compare registers A210-21n is updated, F. Although reset of F240 to F24n is permitted, in this embodiment, the corresponding pulse output is not reset unless writing to each compare register is completed. Allows for wide control.
【0036】本発明の第3の実施例を図5に示す。本実
施例では、第1実施例と比較して、セット・レジスタ7
10,AND710〜71n,AND論理積の反転信号
(以下NAND)720〜72n,AND260〜26
nの代わりにAND730〜73nが追加された形で構
成される。図2と同様の番号のものは、同様の機能を表
す。A third embodiment of the present invention is shown in FIG. In this embodiment, compared to the first embodiment, the set register 7
10, AND710~71n, AND inverted signal (hereinafter referred to as NAND) 720~72n, AND260~26
It is configured with ANDs 730 to 73n added instead of n. Similar numbers to those in FIG. 2 represent similar functions.
【0037】本実施例では、複数のパルス出力に対し図
6に示すようなシーケンシャルにパルス出力を行う場合
について述べる。In this embodiment, a case will be described in which pulse output is performed sequentially as shown in FIG. 6 for a plurality of pulse outputs.
【0038】セットレジスタ700の各ビットは各パル
ス出力0〜nに対応し、セットレジスタ700の各ビッ
トとコンペア・レジスタB224の一致信号225との
AND論理積である、AND710〜71nはF.F2
40のセット信号となっている。Each bit of the set register 700 corresponds to each pulse output 0-n, and AND710-71n is the AND of each bit of the set register 700 and the match signal 225 of the compare register B224. F2
There are 40 set signals.
【0039】コンペア・レジスタB224の一致信号2
25が発生したとき、セットレジスタ700によりAN
D710〜71nを介し選択されたF.F240〜24
nがセットされ、セットレジスタ700のセットされた
ビットに対応したパルス出力がセットされる。この時セ
ットレジスタ700のビットのうちセットされていない
ビットに対応したパルス出力はセットされない。従って
、セットレジスタ700の設定値によりAND710〜
71nを介しF.F240〜24nを選択することによ
り、任意のパルス出力に対して選択的にセットを行うこ
とが出来る。Match signal 2 of compare register B224
25 occurs, the set register 700 sets AN
Selected F.D710-71n. F240~24
n is set, and the pulse output corresponding to the set bit of set register 700 is set. At this time, pulse outputs corresponding to unset bits of the set register 700 are not set. Therefore, depending on the set value of the set register 700, AND710~
F.71n via F.71n. By selecting F240 to F24n, it is possible to selectively set any pulse output.
【0040】そこでセットレジスタ700の第nビット
をセットしておき、コンペア・レジスタB224の一致
信号225が発生するたびにセットレジスタ700の内
容を右シフトしていけば、図6に示すようなシーケンシ
ャルパルス出力を得ることが出来る。ここで、図6では
、簡単のためパルス出力を4本とし、セットレジスタ7
00を4ビットとした場合の例を示した。Therefore, if the n-th bit of the set register 700 is set and the contents of the set register 700 are shifted to the right every time the match signal 225 of the compare register B 224 is generated, the sequential output as shown in FIG. Pulse output can be obtained. Here, in FIG. 6, for simplicity, the number of pulse outputs is four, and the set register 7
An example is shown in which 00 is 4 bits.
【0041】またセットレジスタ700の内容をシフト
しなければ、テットレジスタ700のセットされている
ビットに対応したパルス出力は実施例1の場合と同様の
動作を行う。If the contents of the set register 700 are not shifted, the pulse output corresponding to the set bit of the set register 700 operates in the same manner as in the first embodiment.
【0042】図7のタイミングチャートを参照してシー
ケンシャルパルス出力を行った場合の動作について述べ
る。まず、はじめにセットレジスタ700の第nビット
をセットする。外部クロックが所定数入力され、イベン
ト・カウンタ223のカウント値がコンペア・レジスタ
B224に予め設定しておいた値となり一致が起きると
、コンペア・レジスタB224より一致信号225が出
力され、AND71nの出力が“1”となり、F.F2
4nがセットされてパルス出力nをハイ・レベル“1”
にする。それと同時に、F.F226をセットしNAN
D72nの出力をロウ・レベル“0”にし、AND73
nの出力をロウ・レベル“0”に固定することによりこ
の時点(FRC=Dn +W0 )で一致信号23nが
出力されてもF.F24nはリセットされない。この時
セットレジスタ700の第0〜(n−1)ビットは“0
”であるため、NAND720〜72(n−1)の出力
は“1”となりAND730〜73(n−1)が選択さ
れ、一致信号230〜23(n−1)によるF.F24
0〜24(n−1)のリセットは許可されている。The operation when sequential pulse output is performed will be described with reference to the timing chart of FIG. First, the nth bit of the set register 700 is set. When a predetermined number of external clocks are input and the count value of the event counter 223 becomes the value set in advance in the compare register B224 and a match occurs, a match signal 225 is output from the compare register B224, and the output of the AND71n is becomes “1”, and F. F2
4n is set and pulse output n is set to high level “1”
Make it. At the same time, F. Set F226 and NAN
Set the output of D72n to low level “0” and AND73
By fixing the output of F.n to low level "0", even if the match signal 23n is output at this point (FRC=Dn+W0), the output of F.n. F24n is not reset. At this time, the 0th to (n-1) bits of the set register 700 are “0”.
”, the output of NAND 720 to 72 (n-1) becomes “1” and AND 730 to 73 (n-1) is selected, and F.F24 by the coincidence signal 230 to 23 (n-1)
Resetting from 0 to 24 (n-1) is permitted.
【0043】一致信号225はまたキャプチャ・レジス
タ220のキャプチャ・トリガ信号となり、その時のF
RC201のカウント値D0 をキャプチャ・レジスタ
220に取り込むと共に、イベント・カウンタのクリア
信号、さらにはINTC102への割込み信号105と
なる。The match signal 225 also becomes a capture trigger signal for the capture register 220, and the current F
The count value D0 of the RC 201 is taken into the capture register 220, and becomes an event counter clear signal and further an interrupt signal 105 to the INTC 102.
【0044】INTC102は、割り込み信号105が
入力されると優先順位等の判断処理を行ったのち、CP
U101に割り込み要求信号106を出力する。[0044] When the interrupt signal 105 is input, the INTC 102 performs processing to determine the priority order, etc.
An interrupt request signal 106 is output to U101.
【0045】CPU101は、割り込み要求信号107
が入力されると予めプログラムしておいたプログラムに
従い割り込み処理を行う。ここでは、キャプチャ・レジ
スタ220の値D0 に所望のパルス出力幅T0 に相
当するFRC201のカウント数W0 を足した値、D
0 +W0 をセットレジスタ700のセットされてい
る第nビットに対応するパルス出力nのリセットタイミ
ングを設定するコンペア・レジスタ21nに書き込み、
その後セットレジスタ700を右シフトする。[0045] The CPU 101 receives an interrupt request signal 107.
When input, interrupt processing is performed according to a preprogrammed program. Here, the value D0 is the sum of the count number W0 of the FRC 201 corresponding to the desired pulse output width T0 to the value D0 of the capture register 220.
0 +W0 is written to the compare register 21n that sets the reset timing of the pulse output n corresponding to the set n-th bit of the set register 700,
Thereafter, the set register 700 is shifted to the right.
【0046】ここでカウントクロックはφであるので、
T0 =W0 /φ (W0 :カウント数φ:FR
C501カウント周波数)という関係が成り立つ。Here, since the count clock is φ,
T0 = W0 /φ (W0: Number of counts φ: FR
C501 count frequency) holds true.
【0047】コンペア・レジスタへの書き込み信号によ
りF.F226はリセットされ、NAND72nの出力
が“1”になるためAND73nが選択され、一致信号
23nによるF.F24nのリセットが許可される。The write signal to the compare register causes the F. F226 is reset and the output of NAND72n becomes "1", so AND73n is selected and F.226 is reset by the match signal 23n. F24n reset is permitted.
【0048】次にセットレジスタ700を右シフトする
が、その前にFRC201がカウントアップされていき
D0 +W0 の値になり、コンペア・レジスタA21
nの一致信号23nが出力されると、一致信号23nは
AND73nを介し、F.F24nをリセットしパルス
出力nをロウ・レベル“0”にする。もし、一致信号2
3nが出力されなければ、パルス出力nはハイ・レベル
“1”を出力し続ける。Next, the set register 700 is shifted to the right, but before that, the FRC201 is counted up and reaches the value D0 +W0, and the compare register A21 is
When the coincidence signal 23n of F.n is output, the coincidence signal 23n is passed through AND 73n, F24n is reset and the pulse output n is set to low level "0". If match signal 2
If 3n is not output, the pulse output n continues to output a high level "1".
【0049】次にセットレジスタ700を右シフトする
。このときビットnは0を入れ、セットレジスタ700
は第(n−1)ビットがセットされた状態になる。そし
て再び、外部クロックが入力されていき、イベント・カ
ウンタ223のカウント値と、コンペア・レジスタB2
24の一致が起き、一致信号225が出力され、F.F
24(n−1)がセットされ、パルス出力(n−1)が
ハイ・レベル“1”を出力すると同時に、F.F226
が再びセットされる。このときセットレジスタ700の
第nビットは、“0”となっているため、NAND72
nはF.F226によらず“1”となり、AND73n
が選択される。従ってこの時まだパルス出力nがハイ・
レベル“1”を出力していて、コンペア・レジスタA2
1nの一致がおこり一致信号23nが出力されれば、F
.F24nはリセットされ、パルス出力nは、ロウ・レ
ベル“0”となる。Next, set register 700 is shifted to the right. At this time, bit n is set to 0, and the set register 700
is in a state where the (n-1)th bit is set. Then, the external clock is input again, and the count value of the event counter 223 and the compare register B2
A match of F.24 occurs and a match signal of 225 is output. F
24 (n-1) is set and the pulse output (n-1) outputs a high level "1", and at the same time, F. F226
is set again. At this time, the nth bit of the set register 700 is “0”, so the NAND 72
n is F. It becomes “1” regardless of F226, AND73n
is selected. Therefore, at this time, the pulse output n is still high.
Compare register A2 is outputting level “1”.
If a match of 1n occurs and a match signal 23n is output, F
.. F24n is reset and the pulse output n becomes low level "0".
【0050】なおパルス出力(n−1)についての動作
はパルス出力nの場合と同様の動作をおこなうため、特
に図示しない。Note that the operation for pulse output (n-1) is not particularly illustrated because it is the same as the operation for pulse output n.
【0051】従ってこれら動作を繰り返していくことに
より、コンペア・レジスタB224の一致がおき一致信
号225が発生すると、セットレジスタ700のセット
されているビットに対応したパルス出力がハイ・レベル
“1”を出力し、これらハイ・レベル“1”を出力して
いるパルス出力のリセットタイミングの設定を行わなけ
れば、これらパルス出力がリセットされることがだいな
め、一致信号225の発生周期が外部出力パルス幅T0
よりも長い場合には、実施例1の場合と同様の動作を
複数のパルス出力に対し順次おこなっていき、シーケン
シャルパルス出力を得ることが出来る。Therefore, by repeating these operations, when a match occurs in the compare register B 224 and a match signal 225 is generated, the pulse output corresponding to the set bit of the set register 700 becomes high level "1". If the reset timing of these pulse outputs that are outputting high level "1" is not set, these pulse outputs will be reset, so the generation period of the coincidence signal 225 will be the external output pulse width. T0
If the length is longer than , sequential pulse outputs can be obtained by sequentially performing the same operation as in the first embodiment for a plurality of pulse outputs.
【0052】また、一致信号225の発生周期がパルス
出力幅T0 よみも短くなった場合は、一致信号225
が発生した時点でセットレジスタ700の第7ビットが
セットされていてパルス出力nがハイ・レベル“1”を
出力していれば、一致信号225によりF.F226が
セットされることにより、NAND72nがロウ・レベ
ル“0”となり、再度一致信号225による割込み処理
により、コンペア・レジスタA21nの値を更新しF.
F226をリセットしない限り、ハイ・レベル“1”を
出力し続け(図7、動作例2)、またセットレジスタ7
00の第7ビットがリセット“0”されていればNAN
D72nが無条件にハイ・レベルとなるためAND73
nが選択され、一致信号225の発生によりF.F22
6がセットされても関係なくパルス出力は所定幅ハイ・
レベル“1”を出力したのち、コンペア・レジスタA2
1nの一致によりF.F24nはリセットされパルス出
力nはロウ・レベル“0”となる。(図7動作例1,2
)つまり、シーケンシャルパルス出力の場合、一致信号
225の発生周期がパルス出力幅に比べ長くもても、短
くても、一致信号225が出力された時点でセットレジ
スタ700のビットのうちセット“1”されているビッ
トに対応するパルス出力は、そのパルスのリセットタイ
ミングを一致信号225が発生するごとにコンペア・レ
ジスタに設定しない限りハイ・レベル“1”を出力し続
け、リセットタイミングの設定後セットレジスタ700
のシフトにより、セットレジスタ700のビットがリセ
ット“0”されている状態で一致信号225が発生して
も、この一致信号225には左右されず所定幅ハイ・レ
ベル“1”を出力したのち、リセットされロウ・レベル
“0”となるため、複数のパルス出力に対し高精度のシ
ーケンシャルパルス制御を行うことが出来る。Furthermore, if the generation period of the coincidence signal 225 becomes shorter than the pulse output width T0, the coincidence signal 225
If the seventh bit of the set register 700 is set and the pulse output n is outputting a high level "1" at the time when the F. By setting F226, NAND72n becomes low level "0", and the value of compare register A21n is updated by interrupt processing by match signal 225 again.
Unless F226 is reset, it continues to output high level "1" (Figure 7, operation example 2), and the set register 7
If the 7th bit of 00 is reset to “0”, it is NAN.
AND73 because D72n becomes high level unconditionally.
F.n is selected and the generation of the match signal 225 causes F. F22
Regardless of whether 6 is set, the pulse output will be high for a specified width.
After outputting level “1”, compare register A2
1n match, F. F24n is reset and the pulse output n becomes low level "0". (Figure 7 Operation examples 1 and 2
) In other words, in the case of sequential pulse output, regardless of whether the generation cycle of the match signal 225 is longer or shorter than the pulse output width, the bits in the set register 700 are set to "1" at the time the match signal 225 is output. The pulse output corresponding to the bit that is set will continue to output a high level "1" unless the reset timing of that pulse is set in the compare register every time the match signal 225 is generated, and after the reset timing is set, the pulse output will continue to be output as high level "1". 700
Even if a match signal 225 is generated in a state where the bit of the set register 700 is reset to "0" due to the shift of , it is not affected by this match signal 225 and outputs a high level "1" for a predetermined width, and then Since it is reset to a low level "0", highly accurate sequential pulse control can be performed on a plurality of pulse outputs.
【0053】[0053]
【発明の効果】以上述べてきたように、本発明では外部
入力クロックの周期が出力パルス幅より短くなった場合
に、パルス出力のセット信号により、パルス出力のリセ
ットを禁止し、コンペア・レジスタの更新を行うことに
よりパルス出力のリセットを許可することにより、パル
ス出力のセット信号の直後に、コンペア・レジスタの値
が更新される前に、コンペア・レジスタの一致が起こる
ことによるパルス出力の突然のリセットが防止できる。[Effects of the Invention] As described above, in the present invention, when the period of the external input clock becomes shorter than the output pulse width, the reset of the pulse output is prohibited by the pulse output set signal, and the compare register is By allowing the pulse output to be reset by performing an update, a sudden change in the pulse output due to a compare register match occurring immediately after the pulse output's set signal but before the value in the compare register is updated can be avoided. Reset can be prevented.
【図1】パルス発生装置の概略構成図である。FIG. 1 is a schematic configuration diagram of a pulse generator.
【図2】本発明の第1実施例を示す回路図である。FIG. 2 is a circuit diagram showing a first embodiment of the present invention.
【図3】第1実施例のタイミング図である。FIG. 3 is a timing diagram of the first embodiment.
【図4】本発明の第2実施例を示す回路図である。FIG. 4 is a circuit diagram showing a second embodiment of the present invention.
【図5】本発明の第3実施例を示す回路図である。FIG. 5 is a circuit diagram showing a third embodiment of the present invention.
【図6】シーケンシャルパルスの出力例を示すタイミン
グ図である。FIG. 6 is a timing diagram showing an example of sequential pulse output.
【図7】第3実施例のタイミング図である。FIG. 7 is a timing diagram of a third embodiment.
【図8】従来例を示す回路図である。FIG. 8 is a circuit diagram showing a conventional example.
【図9】従来例のタイミング図である。FIG. 9 is a timing diagram of a conventional example.
Claims (2)
非同期に処理要求をする割り込み要求発生回路と、周辺
回路とを有する情報処理装置において、前記周辺回路は
、外部クロック入力信号のカウントをおこなうインベン
ト・カウンタと、前記イベント・カウンタのカウンタ値
と比較を行う第一のコンペア・レジスタと、内部クロッ
クによりカウントされるフリーランニング・カウンタと
、前記フリーランニング・カウンタのカウンタ値と比較
を行う第二のコンペア・レジスタと、前記第一のコンペ
ア・レジスタからの一致信号によりセットされ、前記第
二のコンペア・レジスタへの書き込み信号によりリセッ
トされる第一のフリップ・フロップ回路と、前記第一の
コンペア・レジスタからの一致信号によりセットされ、
前記第一のフリップ・フロップ回路の出力と前記第二の
コンペア・レジスタからの一致信号とによりリセットを
制御される第二のフリップ・フロップ回路とを有するこ
とを特徴とする情報処理装置。1. An information processing device comprising a central processing unit, an interrupt request generation circuit that asynchronously requests processing to the central processing unit, and a peripheral circuit, wherein the peripheral circuit counts external clock input signals. an event counter, a first compare register that compares the counter value of the event counter, a free running counter that is counted by an internal clock, and a second compare register that compares the counter value of the free running counter. a first flip-flop circuit that is set by a match signal from the first compare register and reset by a write signal to the second compare register;・Set by match signal from register,
An information processing device comprising: a second flip-flop circuit whose reset is controlled by the output of the first flip-flop circuit and a match signal from the second compare register.
数の前記第二のフリップ・フロップ回路と、複数の前記
第二のフリップ・フロップ回路から所定のフリップ・フ
ロップを選択する選択手段とを有し、前記第一のコンペ
ア・レジスタからの前記イベント・カウンタとの一致信
号により前記選択手段により選択された前記第二のフリ
ップ・フロップがセットされることを特徴とする情報処
理装置。2. The information processing device according to claim 1, comprising a plurality of said second flip-flop circuits and a selection means for selecting a predetermined flip-flop from said plurality of said second flip-flop circuits. The information processing device is characterized in that the second flip-flop selected by the selection means is set by a match signal from the first compare register with the event counter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3021773A JP2600502B2 (en) | 1990-03-28 | 1991-02-15 | Information processing device |
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2-79214 | 1990-03-28 | ||
JP7921490 | 1990-03-28 | ||
JP3021773A JP2600502B2 (en) | 1990-03-28 | 1991-02-15 | Information processing device |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH04211832A true JPH04211832A (en) | 1992-08-03 |
JP2600502B2 JP2600502B2 (en) | 1997-04-16 |
Family
ID=26358875
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP3021773A Expired - Fee Related JP2600502B2 (en) | 1990-03-28 | 1991-02-15 | Information processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2600502B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE19600539A1 (en) * | 1995-09-06 | 1997-03-13 | Mitsubishi Electric Corp | Clock generator for use with controller of external equipment |
-
1991
- 1991-02-15 JP JP3021773A patent/JP2600502B2/en not_active Expired - Fee Related
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE19600539A1 (en) * | 1995-09-06 | 1997-03-13 | Mitsubishi Electric Corp | Clock generator for use with controller of external equipment |
US5724399A (en) * | 1995-09-06 | 1998-03-03 | Mitsubishi Electric Semiconductor Software Co., Ltd. | Timer device |
DE19600539C2 (en) * | 1995-09-06 | 2003-10-16 | Mitsubishi Electric Corp | timer device |
Also Published As
Publication number | Publication date |
---|---|
JP2600502B2 (en) | 1997-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7348815B2 (en) | All-digital power-on reset device | |
US4985640A (en) | Apparatus for generating computer clock pulses | |
US5377347A (en) | Data processor for generating pulse signal in response to external clock including flipflop | |
JP2000091889A (en) | Device and method for generating pulse signal | |
JP3099927B2 (en) | Microcomputer | |
JPH04211832A (en) | Information processor | |
EP0903650B1 (en) | Timer device comprising a timer counter, a register and a coincidence detecting circuit, and method for controlling an output terminal using such timer device | |
JP2773546B2 (en) | Pulse generation circuit | |
JPH096462A (en) | Data processing system and semiconductor integrated circuit | |
KR960016809B1 (en) | Trigger signal generating circuit with trigger masking function | |
JPH08139575A (en) | Pulse output circuit | |
JPH0736512B2 (en) | Pulse output device | |
JP2643609B2 (en) | Interrupt control device | |
JPH09105777A (en) | High-speed data register for laser rangefinder | |
JPH0767288B2 (en) | Gate pulse controller for thyristor inverter | |
JPS63169813A (en) | Pulse generating circuit | |
SU853814A1 (en) | Device for monitoring pulse distributor | |
JP2960120B2 (en) | Pulse generator | |
JPH0474799B2 (en) | ||
JPH03246603A (en) | Rapid counter | |
JPH02192315A (en) | Pulse generator | |
JPH04305720A (en) | Microcomputer | |
JPH0427730B2 (en) | ||
JPH0287821A (en) | Programmable logic array | |
JPH01123329A (en) | Interrupting circuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 19961119 |
|
LAPS | Cancellation because of no payment of annual fees |