JPH0150927B2 - - Google Patents

Info

Publication number
JPH0150927B2
JPH0150927B2 JP57211135A JP21113582A JPH0150927B2 JP H0150927 B2 JPH0150927 B2 JP H0150927B2 JP 57211135 A JP57211135 A JP 57211135A JP 21113582 A JP21113582 A JP 21113582A JP H0150927 B2 JPH0150927 B2 JP H0150927B2
Authority
JP
Japan
Prior art keywords
circuit
transfer
timer
time
byte
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
Application number
JP57211135A
Other languages
Japanese (ja)
Other versions
JPS59100926A (en
Inventor
Kenzo Nakabashi
Mitsuru Kuga
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP57211135A priority Critical patent/JPS59100926A/en
Publication of JPS59100926A publication Critical patent/JPS59100926A/en
Publication of JPH0150927B2 publication Critical patent/JPH0150927B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom

Description

【発明の詳細な説明】 発明の技術分野 本発明はマイクロプロセツサを用いた処理装置
において、処理のために必要なタイミングを設定
するためのタイマ回路に関するものである。
DETAILED DESCRIPTION OF THE INVENTION Technical Field of the Invention The present invention relates to a timer circuit for setting timing necessary for processing in a processing device using a microprocessor.

従来技術と問題点 マイクロプロセツサを用いた処理装置において
は、その処理を遂行するためにその処理内容によ
つて異なるタイミングを設定するための、種々の
タイマを必要とすることが多い。一般にはこのよ
うなタイマは、マイクロプロセツサに対して一定
時間ごとに割込みをかけ、これを時間基準として
用いてその回数をソフトウエアで計数することに
よつて、所定のタイミングを設定するようにして
いる。しかしながらこの場合の割込み時間として
は、マイクロプロセツサの処理能力を低下させな
い程度の比較的大きな値、例えば数十ms程度が
選ばれることが多く、従つてこのようなタイマに
よつて得られる時間値としては例えば秒単位とい
るような値に限られる。そのため上記の基準時間
より短いタイマや、基準時間の整数倍にならない
時間値を必要とするタイマ、および時間値の上下
限の許容範囲が狭いタイマを必要とする場合に
は、この方式のタイマを使用することができず、
別にハードウエアによつて構成したタイマを設け
なければならない。
Prior Art and Problems Processing devices using microprocessors often require various timers to set different timings depending on the processing content in order to carry out the processing. Generally, such a timer sets a predetermined timing by interrupting the microprocessor at regular intervals and using this as a time reference to count the number of interrupts using software. ing. However, in this case, the interrupt time is often chosen to be a relatively large value that does not reduce the processing capacity of the microprocessor, for example, several tens of milliseconds, and therefore the time value obtained by such a timer is For example, it is limited to values such as seconds. Therefore, if you need a timer that is shorter than the above reference time, a timer that requires a time value that is not an integral multiple of the reference time, or a timer that has a narrow tolerance range for the upper and lower limits of the time value, use this method of timer. cannot be used,
A separate timer configured by hardware must be provided.

第1図は従来から用いられているハードウエア
によるタイマ回路の構成を示している。同図にお
いて、1は基準クロツク源、2は計数回路であ
る。
FIG. 1 shows the configuration of a conventionally used hardware timer circuit. In the figure, 1 is a reference clock source and 2 is a counting circuit.

第1図において、計数回路2はマイクロプロセ
ツサから与えられる計数開始信号に応じて、基準
クロツク源1の一定周期の基準クロツクを計数し
て、設定された計数値に達したとき計数終了フラ
グをオンにしてマイクロプロセツサに通知する。
計数設定値はソフトウエアによつて設定可能とす
ることもでき、またマイクロプロセツサに対する
通知は割込みによつてもよい。
In FIG. 1, a counting circuit 2 counts the constant cycle reference clock of a reference clock source 1 in response to a counting start signal given from a microprocessor, and sets a counting end flag when a set count value is reached. Turn on and notify the microprocessor.
The count setting value may be settable by software, and notification to the microprocessor may be made by interrupt.

第1図に示された従来のタイマ回路は、計数回
路と、計数回路とマイクロプロセツサとの間で計
数値の設定、計数開始および計数終了の指示、通
知等を行うためのインターフエース回路が必要で
あり、ハードウエアの複雑化と規模の増大を免れ
ない。
The conventional timer circuit shown in Fig. 1 includes a counting circuit and an interface circuit between the counting circuit and the microprocessor for setting the count value, instructing and notifying the start and end of counting, etc. This is necessary and inevitably increases the complexity and scale of the hardware.

このように従来のタイマはソフトウエアによる
とハードウエアによるとを問わず、いずれも欠点
の多いものであつた。
As described above, conventional timers, whether they are based on software or hardware, have many drawbacks.

発明の目的 本発明はこのような従来技術の問題点を解決し
ようとするものであつて、その目的は、ダイレク
トメモリアクセス(以下DMAと略す)転送機能
を持つ処理装置において、短い時間値でも正確に
設定することができ、また各種の異なる時間値を
設定する上で融通性に富んでおり、かつタイマを
構成するためのハードウエアの増加を最小限に抑
えることができるタイマ回路を提供することにあ
る。
Purpose of the Invention The present invention is intended to solve the problems of the prior art, and its purpose is to provide accurate processing even for short time values in a processing device having a direct memory access (hereinafter abbreviated as DMA) transfer function. To provide a timer circuit which can be set to various time values, has great flexibility in setting various different time values, and can minimize the increase in hardware for configuring the timer. It is in.

発明の実施例 第2図は本発明のタイマ回路の原理的構成を示
し、5はDMM回路、6は切替スイツチ、7は基
準クロツク源、8は周辺回路である。
Embodiments of the Invention FIG. 2 shows the basic configuration of a timer circuit of the present invention, in which 5 is a DMM circuit, 6 is a changeover switch, 7 is a reference clock source, and 8 is a peripheral circuit.

DMA機能は通常、周辺回路とメモリとの間の
データ転送をマイクロプロセツサ内のレジスタを
介さずに直接行うことによつて、データ転送に要
する時間を短縮するために用いられるものであ
る。一方、マイクロプロセツサを用いた処理回路
において必要とするタイマは、通常、ある処理か
ら次の処理までの間の時間を規定するために用い
られるものであり、従つてタイマが必要となる場
合にはデータ転送を終了し動作停止の状態である
ことが多い。このような点に着目して、DMA回
路がデータ転送を行つていない期間にDMA回賂
路を利用してタイマとしての動作を行わせること
ができる。
The DMA function is generally used to reduce the time required for data transfer by directly transferring data between peripheral circuits and memory without going through registers within the microprocessor. On the other hand, timers required in processing circuits using microprocessors are usually used to specify the time between one process and the next, so when a timer is needed, often has finished data transfer and is in a stopped state. Focusing on this point, the DMA circuit can be used to operate as a timer during a period when the DMA circuit is not transferring data.

第2図において切替スイツチ6は通常は周辺回
路8の側に切替えられていて、DMA回路5は周
辺回路8から送られる転送要求信号に応じて転送
動作を行つている。タイマとしての動作を行う場
合は、例えば図示されないマイクロプロセツサか
ら計時開始信号が与えられると、切替スイツチ6
は基板クロツク源7の側に切替えられて、基準ク
ロツクによつて作られた一定周期(t)の転送要
求信号によつて1バイトごと転送動作を行い、所
定バイト数の転送終了によつて所定の時間経過を
知ることができる。
In FIG. 2, the changeover switch 6 is normally switched to the peripheral circuit 8 side, and the DMA circuit 5 performs a transfer operation in response to a transfer request signal sent from the peripheral circuit 8. When operating as a timer, for example, when a clock start signal is given from a microprocessor (not shown), the changeover switch 6
is switched to the board clock source 7 side, and performs a transfer operation byte by byte in response to a transfer request signal of a fixed period (t) generated by the reference clock, and when the transfer of a predetermined number of bytes is completed, a predetermined transfer operation is performed. You can know the passage of time.

この場合、DMA回路に設定する転送バイト数
をNとすれば、転送開始から転送終了までの時間
はNtであり、転送バイト数Nを任意に設定する
ことによつて任意の時間値を設定可能なタイマ回
路を実現できる。また転送要求信号の周期tは1
バイトのデータを転送可能な時間であつて、通常
十分短い時間である。
In this case, if the number of transfer bytes set in the DMA circuit is N, the time from the start of transfer to the end of transfer is Nt, and any time value can be set by arbitrarily setting the number of transfer bytes N. A timer circuit can be realized. Also, the period t of the transfer request signal is 1
This is the time in which a byte of data can be transferred, and is usually a sufficiently short time.

このように第2図のタイマ回路によれば、短い
時間値を設定できるとともに、時間値の設定上融
通性に富んだタイマか得られ、またタイマを構成
するためのハードウエアの増加も僅かである。こ
の際必要とする基準クロツツク源は処理装置内に
ある他のクロツクで代用でき、省略することも可
能である。
In this way, according to the timer circuit shown in Fig. 2, a short time value can be set, a timer with great flexibility in setting the time value can be obtained, and there is only a slight increase in the hardware required to configure the timer. be. The reference clock source required at this time can be replaced by another clock in the processing device, or can be omitted.

第3図は本発明のタイマ回路の一実施例の構成
を示している。同図において11はDMA回路、
12は切替ゲート、13はマイクロプロセツサ
(MPU)、14はメモリ、15は周辺回路、16
はバスである。DMA回路11は転送バイト数カ
ウンタ21、アドレス発生回路22およびバス制
御回路23からなつている。
FIG. 3 shows the configuration of an embodiment of the timer circuit of the present invention. In the figure, 11 is a DMA circuit;
12 is a switching gate, 13 is a microprocessor (MPU), 14 is a memory, 15 is a peripheral circuit, 16
is a bus. The DMA circuit 11 consists of a transfer byte number counter 21, an address generation circuit 22, and a bus control circuit 23.

第3図において、タイマとしての動作開始に先
立つてマイクロプロセツサ13はアドレス発生回
路22にアドレスの初期値を設定するとともに、
転送バイト数カウンタ21に転送バイト数を設定
する。計時開始信号を与えられ転送要求信号を受
信すると、バス制御回路23はマイクロプロセツ
サ13に対してバス占有要求信号を送り、マイク
ロプロセツサ13はバス16の使用状態に応じて
許可信号をバス制御回路23に返送する。基準ク
ロツク源からの転送要求信号に応じてバス制御回
路23はゲート12を制御し、これによつてアド
レス発生回路22からメモリ14に転送アドレス
が設定され、周辺回路15からメモリ14に対し
てデータが転送される。転送バイト数カウンタ2
1は1バイト転送ごとに減算し、同時にアドレス
発生回路22は1バイト転送ごとに加算してメモ
リ14におけるアドレスを順次変更し、このよう
にしてデータの転送が設定バイト数行われる。バ
イト数設定カウンタ21の設定値が0になると、
計時終了を示す信号を発生し、これによつてデー
タ転送動作が終了するとともにタイマとしての動
作が終了する。なおデータの転送はメモリ14か
ら周辺回路15に対して行つてもよい。
In FIG. 3, prior to starting operation as a timer, the microprocessor 13 sets an initial address value in the address generation circuit 22, and
The number of transferred bytes is set in the transferred byte number counter 21. When the clock start signal is given and the transfer request signal is received, the bus control circuit 23 sends a bus occupancy request signal to the microprocessor 13, and the microprocessor 13 sends a permission signal to the bus control circuit according to the usage status of the bus 16. It is sent back to the circuit 23. The bus control circuit 23 controls the gate 12 in response to a transfer request signal from the reference clock source, thereby setting a transfer address from the address generation circuit 22 to the memory 14, and transmitting data from the peripheral circuit 15 to the memory 14. is transferred. Transfer bytes counter 2
1 is subtracted every time 1 byte is transferred, and at the same time, the address generation circuit 22 adds it every time 1 byte is transferred to sequentially change the address in the memory 14. In this way, data is transferred for the set number of bytes. When the setting value of the byte number setting counter 21 becomes 0,
A signal indicating the end of time measurement is generated, thereby ending the data transfer operation and the operation as a timer. Note that data may be transferred from the memory 14 to the peripheral circuit 15.

このようなデータ転送は、所定の周期を有する
クロツクによつて行われ、従つて転送バイト数カ
ウンタに設定されたバイト数の転送終了によつ
て、所望のタイマ値を設定できる。転送終了をマ
イクロプロセツサ13に通知する方法としては、
バス制御回路23からマイクロプロセツサ13に
割込みをかけてもよく、または転送バイト数カウ
ンタに設定値が0になつたことを示すフラグを立
てて、マイクロプロセツサ13がこれを定期的に
読み取ることによつて知るようにしてもよい。な
お上述の動作におけるデータ転送はDMA回路に
おけるカウンタを動作させるのが目的であるか
ら、必ずしも実際のデータを転送する必要がない
ことは言うまでもない。
Such data transfer is performed by a clock having a predetermined cycle, and therefore, a desired timer value can be set upon completion of transfer of the number of bytes set in the transfer byte number counter. The method of notifying the microprocessor 13 of the completion of transfer is as follows.
The bus control circuit 23 may issue an interrupt to the microprocessor 13, or a flag may be set in the transfer byte number counter indicating that the set value has become 0, and the microprocessor 13 may periodically read this. It may also be known by Note that the purpose of the data transfer in the above operation is to operate the counter in the DMA circuit, so it goes without saying that it is not necessarily necessary to transfer actual data.

発明の効果 以上説明したように本発明のタイマ回路によれ
ば、DMA転送機能を持つ処理装置において、デ
ータ転送を行わない時期に、DMA回路に基準ク
ロツクを供給してDMA動作を行わせ、所定バイ
ト数の転送動作終了によつて所要の時間経過を示
す出力を得ることができるようにしたので、短い
時間値でも正確に設定することができるととも
に、各種の異なる時間値を設定する上の融通性に
富んでおり、かつタイマを構成するために既存の
回路に対して必要とするハードウエアの増加を最
小限に抑えることができる。
Effects of the Invention As explained above, according to the timer circuit of the present invention, in a processing device having a DMA transfer function, a reference clock is supplied to the DMA circuit to perform a DMA operation when no data transfer is performed, and the timer circuit performs a predetermined DMA operation. Since it is now possible to obtain an output indicating the required time elapsed upon completion of the transfer operation of the number of bytes, it is possible to accurately set even short time values, and it also provides flexibility in setting various different time values. It is highly versatile and can minimize the increase in hardware required for existing circuitry to configure the timer.

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

第1図は従来のタイマ回路の構成を示す図、第
2図は本発明のタイマ回路の原理的構成を示す
図、第3図は本発明のタイマ回路の一実施例の構
成を示す図である。 1…基準クロツク源、2…計数回路、5…ダイ
レクトメモリアクセス(DMA)回路、6…基準
クロツク源、7…周辺回路、11…ダイレクトメ
モリアクセス(DMA)回路、12…切替ゲー
ト、13…マイクロプロセツサCMPU)、14…
メモリ、15…周辺回路、16…バス、21…転
送バイト数カウンタ、22…アドレス発生回路、
23…バス制御回路。
FIG. 1 is a diagram showing the configuration of a conventional timer circuit, FIG. 2 is a diagram showing the principle configuration of the timer circuit of the present invention, and FIG. 3 is a diagram showing the configuration of an embodiment of the timer circuit of the present invention. be. DESCRIPTION OF SYMBOLS 1... Reference clock source, 2... Counting circuit, 5... Direct memory access (DMA) circuit, 6... Reference clock source, 7... Peripheral circuit, 11... Direct memory access (DMA) circuit, 12... Switching gate, 13... Micro Processor CMPU), 14...
Memory, 15... Peripheral circuit, 16... Bus, 21... Transfer byte number counter, 22... Address generation circuit,
23...Bus control circuit.

Claims (1)

【特許請求の範囲】[Claims] 1 転送バイト数を計数する転送バイト数カウン
タを有し該転送バイト数カウンタに予め設定され
たバイト数のデータを転送要求信号に応じて1バ
イトずつ転送するDMA回路を具えた処理装置に
おいて、該DMA回路が計時開始信号を与えられ
たとき基準クロツクより作成された転送要求信号
ごとに1バイトの転送動作を行つて前記転送バイ
ト数カウンタに設定されたバイト数の転送終了時
計時終了を示す信号を発生することによつてタイ
マとしての動作を行うことを特徴とするタイマ回
路。
1. In a processing device including a transfer byte number counter that counts the number of transferred bytes and a DMA circuit that transfers a preset number of bytes of data to the transfer byte number counter one byte at a time in response to a transfer request signal, When the DMA circuit is given a clock start signal, it performs a 1-byte transfer operation for each transfer request signal generated from the reference clock, and a signal indicating the end of the clock time when the number of bytes set in the transfer byte number counter is completed. A timer circuit that operates as a timer by generating .
JP57211135A 1982-11-30 1982-11-30 Timer circuit Granted JPS59100926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP57211135A JPS59100926A (en) 1982-11-30 1982-11-30 Timer circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP57211135A JPS59100926A (en) 1982-11-30 1982-11-30 Timer circuit

Publications (2)

Publication Number Publication Date
JPS59100926A JPS59100926A (en) 1984-06-11
JPH0150927B2 true JPH0150927B2 (en) 1989-11-01

Family

ID=16600963

Family Applications (1)

Application Number Title Priority Date Filing Date
JP57211135A Granted JPS59100926A (en) 1982-11-30 1982-11-30 Timer circuit

Country Status (1)

Country Link
JP (1) JPS59100926A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200810523A (en) * 2005-12-23 2008-02-16 Nxp Bv An AV renderer peripheral with dual interrupt lines for staggered interrupts

Also Published As

Publication number Publication date
JPS59100926A (en) 1984-06-11

Similar Documents

Publication Publication Date Title
US5551044A (en) Method and apparatus for interrupt/SMI# ordering
KR960032138A (en) Microcomputer
JPS61105486A (en) Timer device
JPH0150927B2 (en)
US20030094983A1 (en) Method and device for synchronising integrated circuits
JP2517943B2 (en) Timer device
JPH0240754A (en) Dma unit
JPS629418A (en) Timer control system
JPH0341812A (en) Duty ratio variable pulse generating circuit
JP2953713B2 (en) Semiconductor integrated circuit
SU792254A1 (en) Apparatus for interruption of programme
JPS6269352A (en) Microprocessor
JP2716203B2 (en) Information processing device
JPS6074818A (en) Pulse counter
SU1633405A1 (en) Priority signal selection device
JPH01216626A (en) Pulse count circuit
JPS6010355A (en) Measuring system of activity ratio of central processing unit
JPH056225B2 (en)
JPS59224927A (en) Time division multiplex digital counter circuit
JPH0427730B2 (en)
JPS6157144A (en) Data transfer rate controller
JPH0628197A (en) Control system for acceptance of switching request signal
JPS6291039A (en) Transmission control system
JPH06187065A (en) Clock switching circuit
JPS6168620A (en) Resetting controller