JP2517943B2 - Timer device - Google Patents

Timer device

Info

Publication number
JP2517943B2
JP2517943B2 JP62037382A JP3738287A JP2517943B2 JP 2517943 B2 JP2517943 B2 JP 2517943B2 JP 62037382 A JP62037382 A JP 62037382A JP 3738287 A JP3738287 A JP 3738287A JP 2517943 B2 JP2517943 B2 JP 2517943B2
Authority
JP
Japan
Prior art keywords
signal
data
output
register
timer
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 - Fee Related
Application number
JP62037382A
Other languages
Japanese (ja)
Other versions
JPS63204424A (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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP62037382A priority Critical patent/JP2517943B2/en
Publication of JPS63204424A publication Critical patent/JPS63204424A/en
Application granted granted Critical
Publication of JP2517943B2 publication Critical patent/JP2517943B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、外部からの入力信号をトリガーとして、
自動的にスタートするタイマ回路を使用したタイマ装置
に関する。
DETAILED DESCRIPTION OF THE INVENTION [Industrial application] The present invention uses an input signal from the outside as a trigger,
The present invention relates to a timer device using a timer circuit that starts automatically.

〔発明の概要〕[Outline of Invention]

この発明では、入力信号及びクロック信号が供給さ
れ、入力信号で規定されるタイミングから比較データ及
びクロック信号の個数で定まる所定時間後に出力信号を
発生するタイマ回路を使用したタイマ装置において、入
力信号に対して、第1の時間遅れを持つ第1の出力信号
と、入力信号に対して第2の時間遅れを持つ第2の出力
信号とを得る場合に、第1及び第2のタイマ回路に同一
の比較データがセットされ、入力信号によって、第1及
び第2のタイマ回路が同時にスタートされ、一方のタイ
マ回路から得られた所定時間後に、第1及び第2のタイ
マ回路に対して互いに異なる比較データがセットされる
もので、割り込み要因の増加が防止され、従って、処理
時間の短縮化を図るものである。
According to the present invention, an input signal and a clock signal are supplied, and in a timer device using a timer circuit that generates an output signal after a predetermined time determined by the number of comparison data and clock signals from the timing specified by the input signal, On the other hand, when the first output signal having the first time delay and the second output signal having the second time delay with respect to the input signal are obtained, they are identical to the first and second timer circuits. Comparison data is set, the first and second timer circuits are simultaneously started by the input signal, and after a predetermined time obtained from one timer circuit, different comparisons are made for the first and second timer circuits. Since data is set, the number of interrupt factors is prevented from increasing, and therefore the processing time is shortened.

〔従来の技術〕[Conventional technology]

マイクロコンピュータにおいて、第5図に示すよう
に、入力信号の立ち上がりエッジから正確な時間遅れT
(例えば900μs)を持つ出力信号を発生するために、E
TT(External Triggerble Timer)と称されるタイマ回
路を使用したタイマ装置が知られている。
In the microcomputer, as shown in FIG. 5, an accurate time delay T from the rising edge of the input signal
To generate an output signal with (eg 900 μs) E
A timer device using a timer circuit called TT (External Triggerble Timer) is known.

第6図は、従来のタイマ装置の一例を示し、第6図に
おいて、破線で囲んで示す21がタイマ回路(ETT)であ
る。ETT21には、例えばマイクロコンピュータの内部バ
ス22からの比較データが供給される。この比較データ
は、ETT21の内部のデータレジスタ23に取り込まれ、デ
ータレジスタ23から比較レジスタ24に転送される。比較
レジスタ24からの比較データが一致検出回路25に供給さ
れる。一致検出回路25には、カウンタ26の計数データが
供給され、比較データ及び計数データの両者が一致する
と、検出信号ETEが一致検出回路25から発生する。
FIG. 6 shows an example of a conventional timer device. In FIG. 6, a timer circuit (ETT) 21 is surrounded by a broken line. The ETT 21 is supplied with comparison data from the internal bus 22 of the microcomputer, for example. This comparison data is taken in by the data register 23 inside the ETT 21, and transferred from the data register 23 to the comparison register 24. The comparison data from the comparison register 24 is supplied to the match detection circuit 25. The coincidence detection circuit 25 is supplied with the count data of the counter 26, and when both the comparison data and the count data coincide with each other, a detection signal ETE is generated from the coincidence detection circuit 25.

カウンタ26には、ロジック回路29を介されたクロック
信号が供給される。ロジック回路29には、入力端子27か
らの入力信号と入力端子28からのクロック信号とが供給
され、ロジック回路29によって、入力信号の例えば立ち
上がりエッジからクロック信号がカウンタ26に供給さ
れ、カウンタ26の計数動作がスタートする。クロック信
号は、一定の周期例えば1μsの周期を有するものであ
る。比較データ及び計数データの両者は、8ビットのデ
ータである。
The clock signal via the logic circuit 29 is supplied to the counter 26. The logic circuit 29 is supplied with the input signal from the input terminal 27 and the clock signal from the input terminal 28, and the logic circuit 29 supplies the clock signal to the counter 26 from the rising edge of the input signal, for example. The counting operation starts. The clock signal has a fixed cycle, for example, a cycle of 1 μs. Both the comparison data and the count data are 8-bit data.

ETT21からの信号ETEは、Dフリップフロップ31のクロ
ック入力とされる。Dフリップフロップ31のデータ入力
として、出力レジスタ30のデータが供給される。出力レ
ジスタ30には、内部バス22からのデータが格納されてお
り、信号ETEによって、出力レジスタ30からDフリップ
フロップ31へデータが転送され、バッファ32を介して出
力端子33に出力信号が得られる。このDフリップフロッ
プ31,バッファ32は、出力ポートを構成する。
The signal ETE from ETT21 is used as a clock input to the D flip-flop 31. The data of the output register 30 is supplied as the data input of the D flip-flop 31. The data from the internal bus 22 is stored in the output register 30, the data is transferred from the output register 30 to the D flip-flop 31 by the signal ETE, and the output signal is obtained at the output terminal 33 via the buffer 32. . The D flip-flop 31 and the buffer 32 form an output port.

更に、一致検出回路25からの信号ETEが出力端子34に
取り出されると共に、比較レジスタ24及びカウンタ26に
対してロード信号として供給される。比較レジスタ24及
びカウンタ26には、信号ETEによって、所定の初期値が
ロードされる。また、ETT21からの信号ETEがCPU(図示
せず)に供給される。CPUは、信号ETEが発生すると、割
り込みプログラムを走らせる。CPUは、データレジスタ2
3へのデータの書き込みや、モードの切り替えを内部バ
ス22を通じて制御する。
Further, the signal ETE from the coincidence detection circuit 25 is taken out to the output terminal 34 and supplied to the comparison register 24 and the counter 26 as a load signal. The comparison register 24 and the counter 26 are loaded with predetermined initial values by the signal ETE. Further, the signal ETE from the ETT21 is supplied to the CPU (not shown). When the signal ETE is generated, the CPU runs the interrupt program. CPU, data register 2
The writing of data to 3 and mode switching are controlled through the internal bus 22.

第5図に示すように、入力信号に対してT(900μ
s)の遅れを持つ出力信号を得る場合の動作について、
第7図及び第8図を参照して説明する。第7図のフロー
チャートは、入力が発生する前の設備処理と、信号ETE
が発生してなされる割り込み処理との夫々の手順を示し
ている。準備処理では、データレジスタ23に比較データ
として250μsと対応する〔FA〕(16進表示)がセット
される(ステップ)。次に、比較レジスタ24にデータ
レジスタ23の内容が転送される(ステップ)。
As shown in Fig. 5, T (900μ
Regarding the operation when obtaining the output signal with the delay of s),
This will be described with reference to FIGS. 7 and 8. The flowchart in Fig. 7 shows the equipment processing before the input occurs and the signal ETE.
2 shows the respective procedures with the interrupt processing performed by the occurrence of. In the preparation process, [FA] (hexadecimal display) corresponding to 250 μs is set in the data register 23 as the comparison data (step). Next, the contents of the data register 23 are transferred to the comparison register 24 (step).

入力信号が発生すると、カウンタ26が計数動作を開始
し、カウンタ26の計数データが一致検出回路25に供給さ
れる。この計数データが〔FA〕に到達すると、一致検出
回路25から信号ETEが発生する。信号ETEは、割り込みプ
ログラムを走らせる。割り込みプログラムでは、割り込
み回路Niが2かどうか調べられる(ステップ)。(Ni
=2)の場合には、データレジスタ23に対して、150μ
sと対応する比較データ〔96〕がセットされる(ステッ
プ)。
When the input signal is generated, the counter 26 starts counting operation, and the count data of the counter 26 is supplied to the coincidence detection circuit 25. When this count data reaches [FA], the coincidence detection circuit 25 generates a signal ETE. The signal ETE runs the interrupt program. In the interrupt program, it is checked whether the interrupt circuit Ni is 2 (step). (Ni
= 2), 150μ for the data register 23
The comparison data [96] corresponding to s is set (step).

ステップにおいて(Ni≠2〕の時には、(Ni=3)
かどうか調べられる(ステップ)。割り込み回数Niが
3回目の場合には、出力レジスタ30に対してローレベル
がセットされる(ステップ)。
When (Ni ≠ 2] in the step, (Ni = 3)
You can check (step). When the number of interruptions Ni is the third, the low level is set to the output register 30 (step).

上述の動作を第8図を参照して説明すると、第8図A
が入力信号を示し、この入力信号の立ち上がりエッジか
らETT21のカウンタ26が計数動作を開始する。出力レジ
スタ30には、第8図Fに示すように、ハイレベルのデー
タがセットされている。データレジスタ23及び比較レジ
スタ24には、第8図C及び第8図Dに夫々示すように、
前以て250μsと対応する8ビットデータ〔FA〕がセッ
トされている。従って、カウンタ26の計数データが〔F
A〕になる毎に第8図Bに示す信号ETEが発生する。
The above operation will be described with reference to FIG.
Indicates an input signal, and the counter 26 of the ETT 21 starts counting operation from the rising edge of this input signal. As shown in FIG. 8F, high level data is set in the output register 30. In the data register 23 and the comparison register 24, as shown in FIGS. 8C and 8D, respectively,
In advance, 8-bit data [FA] corresponding to 250 μs has been set. Therefore, the count data of the counter 26 becomes [F
A], the signal ETE shown in FIG. 8B is generated.

2回目の信号ETEにより、データレジスタ23には、第
8図Cに示すように、比較データ〔96〕(150μs)が
セットされる。従って、3回目の信号ETEにより比較レ
ジスタ24には、新たな比較データ〔96〕がセットされ
る。この3回目の信号ETEによって、出力レジスタ30に
は、第8図Eに示すように、ローレベルがセットされ
る。
By the second signal ETE, the comparison data [96] (150 μs) is set in the data register 23 as shown in FIG. 8C. Therefore, new comparison data [96] is set in the comparison register 24 by the third signal ETE. This third signal ETE sets the output register 30 at a low level as shown in FIG. 8E.

この出力レジスタ30のデータが4回目の信号ETEによ
り、Dフリップフロップ31に取り込まれるので、第8図
Eに示すように、3回目の信号ETEが発生してから150μ
s後に、出力信号がローレベルに立ち下がる。従って、
入力信号のエッジから(T=250μs×3+150μs=90
0μs)の時間遅れを持つ出力信号を得ることができ
る。
Since the data of the output register 30 is taken in by the D flip-flop 31 by the fourth signal ETE, as shown in FIG. 8E, 150 μ after the third signal ETE is generated.
After s, the output signal falls to low level. Therefore,
From the edge of the input signal (T = 250μs × 3 + 150μs = 90
An output signal with a time delay of 0 μs can be obtained.

上述のタイマ装置は、第5図に示すように、入力信号
に対して時間遅れTを持つ一つの出力信号を得るもので
ある。より複雑な場合として、第4図に示すように、入
力信号(第4図A)に対して時間遅れT1(例えば900μ
s)を持つ第1の出力信号(第4図B)及び入力信号に
対して第2の時間遅れT2(例えば910μs)を持つ第2
の出力信号(第4図C)の両者を得る場合について説明
する。
The timer device described above obtains one output signal having a time delay T with respect to the input signal, as shown in FIG. As a more complicated case, as shown in FIG. 4, a time delay T1 (for example, 900 μ) with respect to the input signal (FIG. 4A) is used.
s) with a first output signal (FIG. 4B) and a second time delay T2 (eg 910 μs) with respect to the input signal.
The case of obtaining both of the output signals (1) and (2) in FIG. 4C will be described.

第9図は、第4図に示す関係を持つ第1及び第2の出
力信号を得るために考えられる構成の一例を示す。第6
図に示す構成に対して、出力レジスタ35,Dフリップフロ
ップ36,バッファ37が付加され、バッファ37から第2の
出力信号用の出力端子38が導出されている。
FIG. 9 shows an example of a possible configuration for obtaining the first and second output signals having the relationship shown in FIG. Sixth
An output register 35, a D flip-flop 36, and a buffer 37 are added to the configuration shown in the figure, and an output terminal 38 for the second output signal is derived from the buffer 37.

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

第9図の構成においても、前述のタイマ装置と同様の
動作により、時間遅れT1を持つ第1の出力信号に関する
制御に対して1個の信号ETEの遅れを持たせて第2の出
力信号に関する制御を行うことにより、二つの出力信号
を得ることができる。しかしながら、第4図に示す例の
ように、(T1=900μs)(T2=910μs)のように、時
間遅れT1とT2との差が小さい場合には、この時間差(10
μs)の間で出力レジスタ35の書き替えを行う必要があ
る。このことは、CPUの処理速度がかなり速いことを要
求し、上記の例のように、10μsの時間差しかない時に
は、出力レジスタ35の書き替え処理が不可能である。
In the configuration of FIG. 9 as well, by the same operation as that of the timer device described above, the control of the first output signal having the time delay T1 is delayed by one signal ETE and the control of the second output signal is performed. By controlling, two output signals can be obtained. However, as in the example shown in FIG. 4, when the difference between the time delays T1 and T2 is small, such as (T1 = 900 μs) (T2 = 910 μs), this time difference (10
It is necessary to rewrite the output register 35 between μs). This requires that the processing speed of the CPU is considerably high, and the rewriting process of the output register 35 is impossible when there is only a delay of 10 μs as in the above example.

従って、この発明の目的は、入力信号に対して、時間
差がかなり小さい遅れ時間を夫々持つ二つ又はそれ以上
の複数の出力信号を得ることができるタイマ装置を提供
することにある。
Therefore, an object of the present invention is to provide a timer device capable of obtaining two or more output signals each having a delay time with a considerably small time difference with respect to an input signal.

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

この発明では、入力信号及びクロック信号が供給さ
れ、入力信号で規定されるタイミングから比較データ及
びクロック信号の個数で定まる所定時間後に出力信号を
発生するタイマ回路(ETT)を使用したタイマ装置にお
いて、第1のタイマ回路ETT1及び第2のタイマ回路ETT2
が設けられ、第1及び第2のタイマ回路ETT1及びETT2に
同一の比較データが夫々セットされ、第1及び第2のタ
イマ回路ETT1,ETT2が入力信号によって同時にスタート
され、第1及び第2のタイマ回路ETT1,ETT2の一方から
得られた所定の時間後に、第1及び第2のタイマ回路ET
T1,ETT2に対して、互いに異なる比較データがセットさ
れ、入力信号に対して第1の時間遅れT1を持つ第1の出
力信号が得られると共に、入力信号に対して第2の時間
遅れT2を持つ第2の出力信号が得られる。
In the present invention, an input signal and a clock signal are supplied, in a timer device using a timer circuit (ETT) that generates an output signal after a predetermined time determined by the number of comparison data and clock signals from the timing specified by the input signal, First timer circuit ETT1 and second timer circuit ETT2
Is provided, the same comparison data is set in the first and second timer circuits ETT1 and ETT2, respectively, and the first and second timer circuits ETT1 and ETT2 are simultaneously started by the input signal, and the first and second timer circuits ETT1 and ETT2 are started. After a predetermined time obtained from one of the timer circuits ETT1 and ETT2, the first and second timer circuits ET
Different comparison data are set for T1 and ETT2, and a first output signal having a first time delay T1 with respect to the input signal is obtained, and a second time delay T2 with respect to the input signal is obtained. A second output signal having is obtained.

〔作用〕[Action]

二つのタイマ回路ETT1及びETT2が設けられ、夫々に対
して共通の入力信号及びクロック信号が供給され、同時
にタイマ動作が開始される。また、ETT1及びETT2に同一
の比較データが最初にセットされているので、同一のタ
イミングで信号ETE1及びETE2が発生する。第1の出力信
号の入力信号に対する時間遅れT1と第2の出力信号の入
力信号に対する時間遅れT2とが(T2>T1)とすると、最
初にセットされた同一の比較データで定まる時間が複数
回、繰り返された所定時間後にETT1及びETT2に対して、
互いに異なる比較データがセットされる。この比較デー
タによって、時間遅れT1及びT2が最終的に規定される。
Two timer circuits ETT1 and ETT2 are provided, and a common input signal and clock signal are supplied to each, and at the same time, the timer operation is started. Further, since the same comparison data is initially set in ETT1 and ETT2, the signals ETE1 and ETE2 are generated at the same timing. If the time delay T1 with respect to the input signal of the first output signal and the time delay T2 with respect to the input signal of the second output signal are (T2> T1), the time determined by the same comparison data initially set is determined a plurality of times. , ETT1 and ETT2 after repeated predetermined time,
Different comparison data are set. This comparison data finally defines the time delays T1 and T2.

この発明では、時間遅れT1後に第2の出力信号を得る
ための出力バッファの書き替えを行うのと異なり、出力
バッファを書き替えるのに充分な時間が確保され、CPU
の処理速度がさほど高速である必要がない。また、割り
込みプログラムは、一方のETT(タイマ回路)からの信
号ETEにより走るので、両方のETTの信号で割り込みプロ
グラムを走らせるのと異なり、割り込み要因が増えるこ
とを防止でき、全処理時間中に占める割り込み処理時間
を短くできる。従って、処理速度が遅いCPUの場合に他
の時間精度を要する処理ができなくなる不都合を回避す
ることができる。
According to the present invention, unlike the case where the output buffer is rewritten to obtain the second output signal after the time delay T1, sufficient time for rewriting the output buffer is secured,
Does not need to be very fast. Also, since the interrupt program runs with the signal ETE from one ETT (timer circuit), unlike the interrupt program running with both ETT signals, it is possible to prevent an increase in interrupt factors, and The occupied interrupt processing time can be shortened. Therefore, in the case of a CPU having a slow processing speed, it is possible to avoid the inconvenience that other processing requiring time accuracy cannot be performed.

〔実施例〕〔Example〕

以下、この発明の一実施例について図面を参照して説
明する。この一実施例は、第4図に示すように、入力信
号(第4図A)に対して時間遅れT1(例えば900μs)
を持つ第1の出力信号(第4図B)及び入力信号に対し
て第2の時間遅れT2(例えば910μs)を持つ第2の出
力信号(第4図C)の両者を得る場合に対してこの発明
を適用したものである。
An embodiment of the present invention will be described below with reference to the drawings. In this embodiment, as shown in FIG. 4, a time delay T1 (for example, 900 μs) with respect to the input signal (FIG. 4A) is used.
For the case where both the first output signal (FIG. 4B) having T and the second output signal (FIG. 4C) having the second time delay T2 (eg, 910 μs) with respect to the input signal are obtained. This invention is applied.

第1図に示すように、第1のタイマ回路(ETE:Extern
al Triggerble Timerと称する)1及び第2のETT2とが
設けられる。ETT1及びETT2には、内部バス3を介して比
較データがセットされる。また、入力端子4からの入力
信号及び入力端子5からの一定周期(1μs)のクロッ
ク信号がETT1及びETT2に供給される。ETTT1及びETT2
は、比較データが内部バス3からデータレジスタを介し
て比較レジスタにセットされ、また、入力信号の立ち上
がりエッジと同期したタイミングからクロック信号がカ
ウンタにより計数され、カウンタの計数値と比較レジス
タにセットされた比較データとが一致検出回路により比
較され、両者が一致する時に信号ETE1及びETE2を夫々発
生する。
As shown in FIG. 1, the first timer circuit (ETE: Extern
al Triggerble Timer) 1 and a second ETT 2 are provided. Comparison data is set in ETT1 and ETT2 via the internal bus 3. Further, the input signal from the input terminal 4 and the clock signal of a constant cycle (1 μs) from the input terminal 5 are supplied to ETT1 and ETT2. ETTT1 and ETT2
Indicates that the comparison data is set in the comparison register from the internal bus 3 via the data register, the clock signal is counted by the counter at the timing synchronized with the rising edge of the input signal, and the count value of the counter and the comparison register are set. The comparison data is compared by the coincidence detection circuit, and when they coincide with each other, signals ETE1 and ETE2 are generated respectively.

ETT1からの信号ETE1は、Dフリップフロップ10のクロ
ック入力とされる。Dフリップフロップ10のデータ入力
として、出力レジスタ8のデータが供給される。出力レ
ジスタ8には、内部バス3からのデータが格納されてお
り、信号ETE1によって、出力レジスタ8からDフリップ
フロップ10へデータが転送され、バッファ12を介して出
力端子14に第1の出力信号が得られる。このDフリップ
フロップ10,バッファ12は、出力ポートを構成する。
The signal ETE1 from ETT1 is used as a clock input to the D flip-flop 10. The data of the output register 8 is supplied as the data input of the D flip-flop 10. The data from the internal bus 3 is stored in the output register 8, the data is transferred from the output register 8 to the D flip-flop 10 by the signal ETE1, and the first output signal is output to the output terminal 14 via the buffer 12. Is obtained. The D flip-flop 10 and the buffer 12 form an output port.

更に、ETT1からの信号ETE1が出力端子6に取り出され
ると共に、ETT1のデータレジスタ及びカウンタに対して
ロード信号として供給される。比較レジスタ及びカウン
タには、信号ETE1によって、所定の初期値がロードされ
る。また、ETT1からの信号ETE1がCPU(図示せず)に供
給される。CPUは、信号ETE1が発生すると、割り込みプ
ログラムを走らせる。CPUは、ETT1及びETT2のデータレ
ジスタへのデータの書き込みや、モードの切り替えを内
部バス3を通じて制御する。
Further, the signal ETE1 from the ETT1 is taken out to the output terminal 6 and supplied to the data register and the counter of the ETT1 as a load signal. A predetermined initial value is loaded into the comparison register and the counter by the signal ETE1. Further, the signal ETE1 from ETT1 is supplied to the CPU (not shown). When the signal ETE1 is generated, the CPU runs the interrupt program. The CPU controls writing of data to the data registers of ETT1 and ETT2 and mode switching through the internal bus 3.

ETT2は、ETT1と同様の構成とされ、ETT2からの信号ET
E2が出力端子7に取り出されると共に、Dフリップフロ
ップ11のクロック入力とされる。Dフリップフロップ11
には、出力レジスタ9からのデータが供給され、Dフリ
ップフロップ11の出力信号がバッファ13を介して出力端
子15に第2の出力信号として取り出される。CPUは、ETT
1からの信号ETE1のみによる割り込みを許可し、信号ETE
2により割り込みを許可しない。
ETT2 has the same configuration as ETT1, and the signal ET from ETT2
E2 is taken out to the output terminal 7 and used as a clock input to the D flip-flop 11. D flip-flop 11
Is supplied with data from the output register 9, and the output signal of the D flip-flop 11 is taken out to the output terminal 15 via the buffer 13 as the second output signal. CPU is ETT
Enables interrupts only from signal ETE1 from 1
2 does not enable interrupts.

第4図に示すように、入力信号(第4図A)に対して
T1(900μs)の遅れを持つ第1の出力信号(第4図
B)及び入力信号に対してT2(910μs)の遅れを持つ
第2の出力信号(第4図C)を得る場合の動作につい
て、第2図及び第3図を参照して説明する。
As shown in FIG. 4, for the input signal (FIG. 4A)
Operation for obtaining the first output signal (FIG. 4B) having a delay of T1 (900 μs) and the second output signal (FIG. 4C) having a delay of T2 (910 μs) with respect to the input signal Will be described with reference to FIGS. 2 and 3.

第2図のフローチャートは、入力が発生する前の準備
処理と、信号ETE1が発生してなされる割り込み処理との
夫々の手順を示している。準備処理では、ETT1のデータ
レジスタに比較データとして250μsと対応する〔FA〕
(16進表示)がセットされる(ステップ)。同様に、
ETT2のデータレジスタに250μsと対応する〔FA〕(16
進表示)がセットされる(ステップ)。次に、ETT1の
比較レジスタにデータレジスタの内容が転送される(ス
テップ)。同様に、ETT2の比較レジスタにデータレジ
スタの内容が転送される(ステップ)。
The flowchart of FIG. 2 shows the respective steps of the preparatory processing before the input is generated and the interrupt processing performed by the generation of the signal ETE1. In the preparation process, the data register of ETT1 corresponds to 250 μs as comparison data [FA]
(Hexadecimal display) is set (step). Similarly,
Corresponds to the data register of ETT2 with 250 μs [FA] (16
Display) is set (step). Next, the contents of the data register are transferred to the comparison register of ETT1 (step). Similarly, the contents of the data register are transferred to the comparison register of ETT2 (step).

入力信号が発生すると、ETT1及びETT2のカウンタが計
数動作を開始し、カウンタの計数データが〔FA〕に到達
すると、信号ETE1及びETE2が発生する。信号ETE1のみが
割り込みプログラムを走らせる。割り込みプログラムで
は、割り込み回数Niが2かどうか調べられる(ステップ
)。(Ni=2)の場合には、ETE1のデータレジスタに
対して、150μsと対応する比較データ〔96〕がセット
される(ステップ)。次に、ETT2のデータレジスタに
160μsと対応するデータ〔A0〕がセットされる(ステ
ップ)。
When an input signal is generated, the counters of ETT1 and ETT2 start counting operation, and when the count data of the counter reaches [FA], signals ETE1 and ETE2 are generated. Only the signal ETE1 runs the interrupt program. In the interrupt program, it is checked whether the interrupt count Ni is 2 (step). In the case of (Ni = 2), the comparison data [96] corresponding to 150 μs is set in the data register of ETE1 (step). Next, in the data register of ETT2
Data [A0] corresponding to 160 μs is set (step).

ステップにおいて(Ni≠2)の時には、(Ni=3)
かどうか調べられる(ステップ)。割り込み回数Niが
3回目の場合には、出力レジスタ8に対してローレベル
がセットされる(ステップ)。次に、出力レジスタ9
に対してローレベルがセットされる(ステップ)。
When (Ni ≠ 2) in the step, (Ni = 3)
You can check (step). When the number of interruptions Ni is the third, the low level is set to the output register 8 (step). Next, the output register 9
A low level is set for (step).

上述の動作を第3図のタイムチャートを参照して説明
すると、第3図Aが入力信号を示し、この入力信号の立
ち上がりエッジからETT1及びETT2のカウンタが計数動作
を開始する。出力レジスタ8には、第3図Hに示すよう
に、ハイレベルのデータがセットされ、出力レジスタ9
には、第3図Jに示すように、ハイレベルのデータがセ
ットされている。ETT1及びETT2のデータレジスタ及び比
較レジスタには、第3図D,第3図E,第3図F及び第3図
Gに夫々示すように、前以て250μsと対応する8ビッ
トデータ〔FA〕がセットされている。従って、ETT1及び
ETT2からは、夫々のカウンタの計数データが〔FA〕にな
る毎に第3図B及び第3図Cに夫々示す信号ETE1及びET
E2が発生する。
The above operation will be described with reference to the time chart of FIG. 3. FIG. 3A shows an input signal, and the counters of ETT1 and ETT2 start counting operation from the rising edge of this input signal. High-level data is set in the output register 8 as shown in FIG.
Is set to high level data as shown in FIG. 3J. As shown in FIGS. 3D, 3E, 3F and 3G, the ETT1 and ETT2 data registers and comparison registers have 8-bit data [FA] corresponding to 250 μs in advance. Is set. Therefore, ETT1 and
From ETT2, signals ETE1 and ET shown in FIG. 3B and FIG. 3C are generated each time the count data of each counter becomes [FA].
E2 occurs.

2回目の信号ETE1により、ETT1のデータレジスタに
は、第3図Dに示すように、比較データ〔96〕(150μ
s)がセットされる。従って、3回目の信号ETE1によ
り、ETT1の比較レジスタには、新たな比較データ〔96〕
がセットされる。この3回目の信号ETE1によって、出力
レジスタ8には、第3図Hに示すように、ローレベルが
セットされる。
The second time signal ETE1 causes the data register of ETT1 to compare data [96] (150 μm) as shown in FIG. 3D.
s) is set. Therefore, the new comparison data [96] is stored in the comparison register of ETT1 by the third signal ETE1.
Is set. By this third signal ETE1, the output register 8 is set to a low level as shown in FIG. 3H.

一方、2回目の信号ETE1により、ETT2のデータレジス
タには、第3図Fに示すように、比較データ〔A0〕(16
0μs)がセットされる。従って、3回目の信号ETE1に
より、ETT2の比較レジスタには、新たな比較データ〔A
0〕がセットされる。この3回目の信号ETE1によって、
出力レジスタ9には、第3図Jに示すように、ローレベ
ルがセットされる。
On the other hand, the second time signal ETE1 causes the comparison register [A0] (16
0 μs) is set. Therefore, the third comparison signal ETE1 causes a new comparison data [A
0] is set. By this third signal ETE1,
A low level is set in the output register 9 as shown in FIG. 3J.

出力レジスタ8のデータが4回目の信号ETE1により、
Dフリップフロップ10に取り込まれるので、第3図Iに
示すように、3回目の信号ETE1が発生してから150μs
後に、第1の出力信号がローレベルに立ち下がる。従っ
て、入力信号のエッジから(T=250μs×3+150μs
=900μs)の時間遅れを持つ第1の出力信号が得られ
る。
The data of the output register 8 is changed by the fourth signal ETE1.
Since it is taken into the D flip-flop 10, as shown in FIG. 3I, 150 μs after the third signal ETE1 is generated.
After that, the first output signal falls to the low level. Therefore, from the edge of the input signal (T = 250μs × 3 + 150μs
A first output signal with a time delay of = 900 μs) is obtained.

同様に、出力レジスタ9のデータが4回目の信号ETE1
により、Dフリップフロップ11に取り込まれるので、第
3図Kに示すように、3回目の信号ETE1が発生してから
160μs後に、第3の出力信号がローレベルに立ち下が
る。従って、入力信号のエッジから(T=250μs×3
+160μs=910μs)の時間遅れを持つ第2の出力信号
が得られる。
Similarly, the data in the output register 9 is the fourth signal ETE1.
Is taken into the D flip-flop 11 by, so as shown in FIG. 3K, after the third signal ETE1 is generated.
After 160 μs, the third output signal falls to low level. Therefore, from the edge of the input signal (T = 250 μs × 3
A second output signal with a time delay of +160 μs = 910 μs) is obtained.

尚、この発明は、入力信号に対して、互いに異なる時
間遅れを持つ3個以上の出力信号を得る場合にも、この
一実施例と同様に適用することができる。
The present invention can be applied to the case where three or more output signals having mutually different time delays are obtained with respect to the input signal, similarly to this embodiment.

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

この発明は、複数のタイマ回路が共通の入力信号及び
クロック信号に同期して動作し、また、一つのタイマ回
路からの信号ETE1のみを使用して割り込みプログラムが
走る構成とされている。従って、この発明に依れば、僅
かに異なる遅れ時間を有する複数の出力信号が処理速度
が遅いCPUによって得ることができる。また、この発明
では、割り込み要因が増えないので、処理時間が長くな
ることを防止できる。
In the present invention, a plurality of timer circuits operate in synchronization with a common input signal and clock signal, and the interrupt program runs using only the signal ETE1 from one timer circuit. Therefore, according to the present invention, a plurality of output signals having slightly different delay times can be obtained by the CPU having a slow processing speed. Further, according to the present invention, since the interrupt factors do not increase, it is possible to prevent the processing time from increasing.

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

第1図はこの発明の一実施例のブロック図、第2図は一
実施例の動作を示すフローチャート、第3図は一実施例
の動作を示すタイムチャート、第4図は一実施例の入力
信号及び出力信号の関係を示す波形図、第5図はこの発
明に使用できるタイマ回路の説明に用いる波形図、第6
図はこの発明に使用できるタイマ回路のブロック図、第
7図及び第8図はこの発明に使用できるタイマ回路の説
明に用いるフローチャート及びタイムチャート、第9図
はこの発明の説明の参考に用いたタイマ装置の他の例の
ブロック図である。 図面における主要な符号の説明 1,2:ETT、3:内部バス、4:入力信号の入力端子、5:クロ
ック信号の入力端子、8,9:出力レジスタ、10,11:Dフリ
ップフロップ、14,15:出力端子。
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a flow chart showing the operation of the embodiment, FIG. 3 is a time chart showing the operation of the embodiment, and FIG. 4 is an input of the embodiment. FIG. 5 is a waveform diagram showing the relationship between signals and output signals, FIG. 5 is a waveform diagram used to explain a timer circuit usable in the present invention, and FIG.
FIG. 7 is a block diagram of a timer circuit that can be used in the present invention, FIGS. 7 and 8 are flow charts and time charts used for explaining the timer circuit that can be used in the present invention, and FIG. 9 is used as a reference for explaining the present invention. It is a block diagram of another example of a timer device. Description of main symbols in the drawings 1,2: ETT, 3: Internal bus, 4: Input signal input terminal, 5: Clock signal input terminal, 8,9: Output register, 10,11: D flip-flop, 14 , 15: Output terminal.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】入力信号及びクロック信号が供給され、上
記入力信号で規定されるタイミングから比較データ及び
上記クロック信号の個数で定まる所定時間後に出力信号
を発生するタイマ回路を使用したタイマ装置において、 第1のタイマ回路及び第2のタイマ回路を設け、上記第
1及び第2のタイマ回路に同一の比較データを夫々セッ
トし、上記第1及び第2のタイマ回路を入力信号によっ
て同時にスタートさせ、上記第1及び第2のタイマ回路
の一方から得られた所定の時間後に、上記第1及び第2
のタイマ回路に対して、互いに異なる比較データをセッ
トするようになし、上記入力信号に対して第1の時間遅
れを持つ第1の出力信号を得ると共に、上記入力信号に
対して第2の時間遅れを持つ第2の出力信号を得るよう
にしたことを特徴とするタイマ装置。
1. A timer device using a timer circuit, which is supplied with an input signal and a clock signal, and generates an output signal after a predetermined time determined by the number of the comparison data and the number of the clock signals from the timing defined by the input signal. A first timer circuit and a second timer circuit are provided, the same comparison data is set in the first and second timer circuits respectively, and the first and second timer circuits are simultaneously started by an input signal, After a predetermined time obtained from one of the first and second timer circuits, the first and second timer circuits
Different comparison data are set to the timer circuit of 1) to obtain a first output signal having a first time delay with respect to the input signal and a second time with respect to the input signal. A timer device characterized in that a second output signal having a delay is obtained.
JP62037382A 1987-02-20 1987-02-20 Timer device Expired - Fee Related JP2517943B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62037382A JP2517943B2 (en) 1987-02-20 1987-02-20 Timer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62037382A JP2517943B2 (en) 1987-02-20 1987-02-20 Timer device

Publications (2)

Publication Number Publication Date
JPS63204424A JPS63204424A (en) 1988-08-24
JP2517943B2 true JP2517943B2 (en) 1996-07-24

Family

ID=12495974

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62037382A Expired - Fee Related JP2517943B2 (en) 1987-02-20 1987-02-20 Timer device

Country Status (1)

Country Link
JP (1) JP2517943B2 (en)

Also Published As

Publication number Publication date
JPS63204424A (en) 1988-08-24

Similar Documents

Publication Publication Date Title
US4503490A (en) Distributed timing system
CN112363763A (en) Data processing method, device and computer readable storage medium
KR100264925B1 (en) Microcomputer
US4712072A (en) Timer apparatus
JP3099927B2 (en) Microcomputer
JP2517943B2 (en) Timer device
US5940599A (en) Data processor
JP2625249B2 (en) Frame detection circuit
JP2624388B2 (en) DMA device
JP2512119B2 (en) Microprocessor
SU792574A1 (en) Synchronizing device
JPS61501661A (en) Parallel synchronous operation
JPH04308909A (en) Pulse generator
SU847310A1 (en) Device for synchronizing information exchange system
SU1280631A1 (en) Device for connecting information sources with common bus
JPH03161883A (en) Microprocessor
SU1200270A1 (en) Device for controlling step-by-step operation of microprocessor
SU1434419A1 (en) Information input device
JPH01276240A (en) Timer counter
JPS6265155A (en) Digital data processing arbitration system
JPH05282069A (en) Timer device
JPH02280263A (en) Microprocessor
JPH02192315A (en) Pulse generator
JPH04305720A (en) Microcomputer
JPH04143833A (en) Timer circuit for microcomputer

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees