JP3264921B2 - Data transfer control device - Google Patents

Data transfer control device

Info

Publication number
JP3264921B2
JP3264921B2 JP32317590A JP32317590A JP3264921B2 JP 3264921 B2 JP3264921 B2 JP 3264921B2 JP 32317590 A JP32317590 A JP 32317590A JP 32317590 A JP32317590 A JP 32317590A JP 3264921 B2 JP3264921 B2 JP 3264921B2
Authority
JP
Japan
Prior art keywords
transfer
data
register
data transfer
address
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
JP32317590A
Other languages
Japanese (ja)
Other versions
JPH04195448A (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.)
Hitachi Ltd
Hitachi Solutions Technology Ltd
Original Assignee
Hitachi Ltd
Hitachi ULSI Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd, Hitachi ULSI Systems Co Ltd filed Critical Hitachi Ltd
Priority to JP32317590A priority Critical patent/JP3264921B2/en
Publication of JPH04195448A publication Critical patent/JPH04195448A/en
Application granted granted Critical
Publication of JP3264921B2 publication Critical patent/JP3264921B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はデータ転送制御技術さらにはメモリと入出力
装置(I/O)間のデータ転送方式に適用して特に有効な
技術に関し、例えばシングルチップマイクロコンピュー
タやダイレクトメモリアクセス(DMA)コントローラに
利用して有効な技術に関する。
Description: TECHNICAL FIELD The present invention relates to a data transfer control technique and a technique particularly effective when applied to a data transfer method between a memory and an input / output device (I / O). It relates to technology that is effective for chip microcomputers and direct memory access (DMA) controllers.

〔従来の技術〕[Conventional technology]

テータプロセッサシステムにおいて、メモリと入出力
装置(I/O)間で中央処理ユニット(CPU)を介さずに、
直接データを転送可能にするデバイスとしてたとえば、
ダイレクトメモリアクセス(DMA)コントローラが提供
されている。
In a data processor system, between memory and input / output devices (I / O) without the intervention of a central processing unit (CPU),
For example, as a device that can directly transfer data,
A direct memory access (DMA) controller is provided.

DMAコントローラは、JP−A−59−53928,JP−A−61
−198351,JP−A−63−29868,JP−A−63−163560及びJ
P−A−1−50153などに開示される様に種々の方式が提
案される。これらの日本特許公開公報のDMA転送方式
は、1回の転送要求に対し転送語数(転送回数、又はレ
ングス)レジスタ内にストアされた転送語数データの値
に対応する回数だけ、データ転送を連続して行なう方式
である。
DMA controllers are JP-A-59-53928, JP-A-61
-198351, JP-A-63-29868, JP-A-63-163560 and J
Various systems are proposed as disclosed in P-A-1-50153 and the like. In the DMA transfer method of these Japanese Patent Publications, data transfer is continuously performed for the number of times corresponding to the value of the transfer word count data stored in the transfer word count (transfer count or length) register for one transfer request. It is a method that is performed.

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

しかしながら、従来のDMAコントローラは、単にCPUが
命令を使ってデータを転送すめよりも高速に特定アドレ
ス間においてデータ転送を行なうだけのものであり、第
5図(B)に示すようにアドレス空間上において互いに
離れた位置にある2つのデータDATA1,DATA2を1回の転
送要求で転送するようなことはできなかった。そのた
め、DMA転送をポート等の周辺I/Oの複雑な制御に利用す
るようなことはできなかった。
However, the conventional DMA controller simply transfers data between specific addresses at a higher speed than the CPU simply transfers data by using an instruction. As shown in FIG. Cannot transfer two data DATA1 and DATA2 at positions separated from each other by one transfer request. Therefore, DMA transfer cannot be used for complicated control of peripheral I / O such as ports.

例えば、CPUのポートから所定の波形パルスを出力さ
せたいようなときは、DMA転送を用いてポートに定期的
に書込みを行なうことで実現できる。そのDMAの転送要
求にはタイマの割込み要求を使用するのが一般的であ
る。この場合、タイマからの転送要求によりDMAコント
ローラはポートへのデータ書込みの他、タイマのフラグ
クリアを含む条件の再設定を行なわなければならない。
ところが従来のDMAコントローラは、1回の転送要求に
対しては1回の転送しか実現できないためDMA転送によ
るパルスの出力制御を実現することができなかった。
For example, when it is desired to output a predetermined waveform pulse from a port of the CPU, it can be realized by periodically writing to the port using DMA transfer. Generally, a timer interrupt request is used for the DMA transfer request. In this case, in response to a transfer request from the timer, the DMA controller must write the data to the port and reset the conditions including clearing the timer flag.
However, the conventional DMA controller cannot realize pulse output control by DMA transfer because only one transfer can be realized for one transfer request.

本発明の目的は、転送効率の向上されたデータ転送方
法を提供することにある。
An object of the present invention is to provide a data transfer method with improved transfer efficiency.

さらに本発明の他の目的は、転送効率の向上されたデ
ータ転送方法を実現可能なダイレクトメモリアクセスコ
ントローラ及びシングルチップマイクロコンピュータを
提供することにある。
Still another object of the present invention is to provide a direct memory access controller and a single-chip microcomputer capable of realizing a data transfer method with improved transfer efficiency.

この発明の前記ならびにそのほかの目的と新規な特徴
については、本明細書の記述および添付図面から明らか
になるであろう。
The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

〔課題を解決するための手段〕[Means for solving the problem]

本願において開示される発明のうち代表的なものの概
要を説明すれば、下記のとおりである。
The outline of a representative invention among the inventions disclosed in the present application is as follows.

すなわち、本発明のデータ転送方法は、転送回数レジ
スタ内に設定された値の整数倍のデータ転送を実現でき
るデータ転送方法である。例えば、10進法にしたがう10
回という値が、転送回数レジスタに設定されたならば、
10×n(nは整数)個のデータを転送することが可能と
される。
That is, the data transfer method of the present invention is a data transfer method capable of realizing data transfer of an integral multiple of the value set in the transfer count register. For example, the decimal 10
Is set in the transfer count register,
It is possible to transfer 10 × n (n is an integer) data.

この様な転送方法を実現するため、本発明に従うダイ
レクトメモリアクセスコントローラ及びシングルチップ
マイクロコンピュータは、転送元アドレスを保持する為
の転送元アドレスレジスタと、転送先アドレスを保持す
るための転送先アドレスレジスタとを一対のアドレスレ
ジスタ群とする場合、この様なアドレスレジスタ群を複
数対含む。さらに、上記ダイレクトメモリアクセスコン
トローラや、マイクロコンピュータは、転送回数レジス
タと、転送モードを指定するための制御レジスタを含
み、上記制御レジスタは、その内部に、転送モードを識
別するためのコントロールビット(フラッグビット)を
含む。このコントロールビットは、セット状態と
(“1")とクリア状態(“0")を有し、それがセット状
態とされた場合、本発明に従うデータ転送を指定し、そ
れがクリア状態とされた場合、従来のデータ転送を指定
する。上記に記載された各レジスタは、それぞれスタテ
ィック型フリップフロップ回路などで構成することがで
きるし、また半導体メモリ内の所定のアドレス番地に設
定されることも可能である。
In order to realize such a transfer method, a direct memory access controller and a single-chip microcomputer according to the present invention include a transfer source address register for holding a transfer source address and a transfer destination address register for holding a transfer destination address. Are a pair of address register groups, a plurality of such address register groups are included. Further, the direct memory access controller or the microcomputer includes a transfer count register and a control register for designating a transfer mode. The control register includes therein a control bit (flag) for identifying the transfer mode. Bit). This control bit has a set state, ("1") and a clear state ("0"). When it is set, it specifies data transfer according to the present invention, and it is cleared. If so, specify conventional data transfer. Each of the registers described above can be configured by a static flip-flop circuit or the like, or can be set to a predetermined address in a semiconductor memory.

本発明に従うデータ転送方法の一例は以下の様にされ
る。尚、説明を簡単化するために、ダイレクトメモリア
クセスコントローラは、第1及び第2転送元アドレスレ
ジスタ、第1及び第2転送先アドレスレジスタ転送回数
レジスタ及び制御レジスタを含む場合を想定する。たと
えば、ダイレクトメモリアクセスコントローラがデータ
転送要求を受けると、まず第1転送元アドレスレジスタ
内に設定された第1転送元アドレスデータの示す、たと
えば半導体メモリのアドレスから転送すべき第1データ
が読み出されるとともに上記第1転送元アドレスデータ
が更新される。次に、上記第1データは第1転送先アド
レスレジスタ内に設定された第1転送先アドレスデータ
の示すたとえば第1データレジスタに書き込まれるとと
もに第1転送先アドレスデータが更新される。その後、
制御レジスタ内の転送モード指定コントロールビットの
状態が調べられる。
One example of the data transfer method according to the present invention is as follows. To simplify the description, it is assumed that the direct memory access controller includes first and second transfer source address registers, first and second transfer destination address registers, transfer count registers, and control registers. For example, when the direct memory access controller receives a data transfer request, first, first data to be transferred is read from, for example, an address of the semiconductor memory indicated by the first transfer source address data set in the first transfer source address register. At the same time, the first transfer source address data is updated. Next, the first data is written into, for example, a first data register indicated by the first transfer destination address data set in the first transfer destination address register, and the first transfer destination address data is updated. afterwards,
The state of the transfer mode designation control bit in the control register is checked.

もし、上記コントロールビットがセット状態とされて
いるなら、第2転送元アドレスレジスタ内の第2転送元
アドレスデータの示すたとえば半導体メモリのアドレス
から転送されるべき第2データが読みだされるとともに
第2転送元アドレスデータが更新される。次に、第2デ
ータが第2転送先アドレスレジスタ内に設定された第2
転送先アドレスデータの示すたとえば第2データレジス
タに書き込まれるとともに、第2転送先アドレスデータ
が更新される。そして、上記転送回数レジスタ内に設定
された回数データの値が1だけデクリメントされて、次
のデータ転送へと移行する。
If the control bit is set, the second data to be transferred is read out from the address of the semiconductor memory indicated by the second transfer source address data in the second transfer source address register and the second data is read out. 2 The transfer source address data is updated. Next, the second data is stored in the second transfer destination address register.
The data is written into, for example, the second data register indicated by the transfer destination address data, and the second transfer destination address data is updated. Then, the value of the count data set in the transfer count register is decremented by 1, and the process proceeds to the next data transfer.

もし、上記コントロールビットがクリア状態とされて
いるならば、第2転送元及び第2転送先アドレスレジス
タに基づくデータ転送は行なわれず、転送回数レジスタ
内に設定された回数データの値が1だけデクリメントさ
れて、次のデータ転送へと移行する。尚、このデータ転
送は、従来のデータ転送と同一である。
If the control bit is in the clear state, the data transfer based on the second transfer source and second transfer destination address registers is not performed, and the value of the count data set in the transfer count register is decremented by one. Then, the process proceeds to the next data transfer. This data transfer is the same as the conventional data transfer.

〔作 用〕(Operation)

従って、第5図(B)に示すように、メモリアドレス
空間上において互いに離れたアドレス位置にある2つの
データDATA1,DATA2を1回の転送要求で転送することが
できる。そのため、DMA転送をポート等の周辺I/Oの複雑
な制御に利用することができる。
Therefore, as shown in FIG. 5 (B), two data DATA1 and DATA2 at address positions separated from each other on the memory address space can be transferred by one transfer request. Therefore, DMA transfer can be used for complicated control of peripheral I / O such as a port.

例えば、シングルチップマイクロコンピュータの出力
ポートから所定の波形パルスを出力させるときは、本発
明のDMA転送を用いて上記出力ポートのデータレジスタ
に定期的にデータを書込むことによって、所定の波形パ
ルスの出力が実現できる。この様なDMA転送の転送要求
にはタイマの割込み要求が使用される。この場合、タイ
マからの1個の転送要求によりDMAコントローラは出力
ポートの内蔵レジスタへのデータ書込みの他、タイマの
フラグのクリア動作を含む条件の再設定を行なうことが
必要とされるから、本発明に従うデータ転送方法が有効
である。
For example, when a predetermined waveform pulse is output from an output port of a single-chip microcomputer, the data is periodically written to the data register of the output port using the DMA transfer of the present invention, so that the predetermined waveform pulse is output. Output can be realized. A timer interrupt request is used for such a DMA transfer transfer request. In this case, in response to one transfer request from the timer, the DMA controller must write the data to the internal registers of the output port and reset the conditions including the timer flag clear operation. The data transfer method according to the invention is effective.

〔実施例〕〔Example〕

第1図は本発明に従うダイレクトメモリアクセスコン
トローラ(DMAC)を含むデータプロセッサシステムを示
す。
FIG. 1 shows a data processor system including a direct memory access controller (DMAC) according to the present invention.

データプロセッサシステムは、プログラムやデータを
記憶するメモリ装置20、上記メモリ装置20内のプログラ
ムを実行し、所定のデータ処理を行なう中央処理装置
(CPU)10,データプロセッサシステムに必要とされるタ
イムインターバルを発生するためのタイマモジュール21
及びDMAC100を含む。これらの各回路10,20,21,100はシ
ステムアドレスバス110及びシステムデータバス115を介
して結合される。
The data processor system includes a memory device 20 for storing programs and data, a central processing unit (CPU) 10 for executing a program in the memory device 20 and performing predetermined data processing, and a time interval required for the data processor system. Timer module 21 for generating
And DMAC100. These circuits 10, 20, 21, 100 are connected via a system address bus 110 and a system data bus 115.

上記DMAC100は、バス&タイミング制御回路1、制御
レジスタ2、転送要求回数レジスタ3、インクリメンタ
4、テンポラリレジスタ5、転送元アドレスレジスタ6a
及び6b、転送先アドレスレジスタ7a及び7b、アドレスバ
ス8、及びデータバス9を含む。
The DMAC 100 includes a bus & timing control circuit 1, a control register 2, a transfer request count register 3, an incrementer 4, a temporary register 5, and a transfer source address register 6a.
6b, transfer destination address registers 7a and 7b, an address bus 8, and a data bus 9.

バス&タイミング制御回路1は、CPU10もしくは入出
力(I/O)デバイス30からのデータ転送要求信号DRQ1,DR
Q2またはタイマ21からの割込み要求信号TIRを受ける
と、優先順位を判定するとともに、コントロール信号CN
Tの状態に応じてバスマスタとされるCPU10からバス権を
獲得し、アクノリッジ信号DACKをバスマスタとされるCP
U10に出力する様に動作する。その結果、DMAC100は、バ
ス権の取得によってデータ転送開始状態とされるととも
に、上記バス&タイミング制御回路1はデータ転送制御
を開始する。すなわち、上記バス&タイミング制御回路
1はバスアビータの機能を有する 制御用レジスタ2はデータ転送モードや転送データの
サイズ等を指定するためのレジスタで、転送要求回数レ
ジスタ3は転送要求回数を格納するためのレジスタであ
る。インクリメンタ4は転送回数を更新したり転送アド
レスを更新(インクリメントおよびデクリメント)する
ために設けられ、テンポラリレジスタ5はメモリ又はI/
Oデバイスから読み出したデータを一旦保持するために
設けられる。
The bus & timing control circuit 1 is provided with data transfer request signals DRQ1, DRQ from the CPU 10 or the input / output (I / O) device 30.
Upon receiving the interrupt request signal TIR from Q2 or the timer 21, the priority is determined and the control signal CN is received.
According to the state of T, the bus right is acquired from the CPU 10 which is regarded as the bus master, and the acknowledgment signal DACK is transmitted to the CP which is regarded as the bus master.
Operates to output to U10. As a result, the DMAC 100 is brought into a data transfer start state by acquiring the bus right, and the bus & timing control circuit 1 starts data transfer control. That is, the bus & timing control circuit 1 has the function of a bus arbiter. The control register 2 is a register for designating the data transfer mode and the size of the transfer data. The transfer request count register 3 is for storing the transfer request count. Register. The incrementer 4 is provided for updating the number of transfers or updating (incrementing and decrementing) the transfer address.
It is provided to temporarily hold data read from the O device.

上記転送元アドレスレジスタ6a,6bは転送されるべき
データのストアされている各アドレスを指定するための
レジスタで、それぞれ異なるアドレスをストア可能であ
る。
The transfer source address registers 6a and 6b are registers for designating addresses where data to be transferred are stored, and can store different addresses.

上記転送先アドレスレジスタ7aは上記転送元アドレス
レジスタ6aによって指定されたアドレスにストアされた
データの転送先アドレスを指定する。上記転送先アドレ
スレジスタ7bは上記転送元アドレスレジスタ6bによって
指定されたアドレスにストアされたデータの転送先アド
レスを指定する。
The transfer destination address register 7a specifies a transfer destination address of the data stored at the address specified by the transfer source address register 6a. The transfer destination address register 7b specifies a transfer destination address of the data stored at the address specified by the transfer source address register 6b.

上記制御用レジスタ2は、16ビットのレジスタで、第
2図に示すように構成され、以下の制御ビットを含む。
The control register 2 is a 16-bit register, configured as shown in FIG. 2, and includes the following control bits.

コントロールビットSZ1は、転送元レジスタ6aを用い
て行なわれるデータ転送動作において、転送されるべき
データのサイズを指示する。たとえば、SZ1がクリア状
態“0"とされると、8ビット(1バイト)のデータが転
送先レジスタ7a内のアドレスデータによって指定される
アドレスにストアされる。SZ1がセット状態“1"とされ
ると、16ビット(1ワード)のデータがレジスタ7aの内
容によって指示されるアドレスにストアされる。
Control bit SZ1 indicates the size of data to be transferred in a data transfer operation performed using transfer source register 6a. For example, when SZ1 is set to the clear state “0”, 8-bit (1 byte) data is stored at the address specified by the address data in the transfer destination register 7a. When SZ1 is set to "1", 16-bit (one word) data is stored at the address indicated by the contents of the register 7a.

コントロールビットSI1は転送元アドレスレジスタ6a
内にストアされたアドレスデータをインクリメントする
か否かを指定する。SI1がクリア状態“0"とされると、
レジスタ6a内のアドレスデータはインクリメントされ
ず、ソースアドレス固定モードのデータ転送が実行され
る。SI1がセット状態“1"とされ、かつ、上記SZ1がクリ
ア状態“0"とされると、データ転送終了後、レジスタ6a
内のアドレスデータが+1だけインクリメンタ4によっ
て更新される。SI1がセット状態“1"とされ、かつ、SZ1
がセット状態“1"とされると、データ転送終了後、レジ
スタ6a内のアドレスデータが+2だけインクリメンタ4
によって更新される。
The control bit SI1 is the source address register 6a
Specifies whether or not to increment the address data stored in. When SI1 is cleared to “0”,
The address data in the register 6a is not incremented, and the data transfer in the fixed source address mode is performed. When SI1 is set to "1" and SZ1 is cleared to "0", register 6a
Is updated by the incrementer 4 by +1. SI1 is set to “1” and SZ1
Is set to "1", the address data in the register 6a is incremented by +2 after the data transfer is completed.
Will be updated by

コントロールビットDI1は、転送先アドレスレジスタ7
a内のアドレスデータをインクリメントするか否かを指
定する。DI1がクリア状態“0"とされると、レジスタ7a
内のアドレスデータはインクリメントされず、ディステ
ィネションアドレス固定モードのデータ転送が実行され
る。DI1がセット状態“1"とされ、かつ、SZ1が“0"とさ
れると、データ転送終了後、レジスタ7a内のアドレスデ
ータが+1だけインクリメンタ4によって更新される。
DI1が“1"とされ、かつ、SZ1が“1"とされると、データ
転送終了後、レジスタ7a内のアドレスデータが+2だけ
インクリメンタ4によって更新される。
The control bit DI1 is set in the transfer destination address register 7
Specifies whether to increment the address data in a. When DI1 is cleared to “0”, register 7a
Is not incremented, and data transfer in the destination address fixed mode is executed. When DI1 is set to "1" and SZ1 is set to "0", the address data in the register 7a is updated by +1 by the incrementer 4 after the data transfer is completed.
When DI1 is set to "1" and SZ1 is set to "1", the address data in the register 7a is updated by +2 by the incrementer 4 after the data transfer is completed.

コントロールビットFG1は、本発明を特徴ずけるフラ
ッグであり、転送元及び転送先アドレスレジスタ6b及び
7bにもとづくデータ転送が、転送元及び転送先アドレス
レジスタ6a及び7aにもとづくデータ転送の終了後、実行
されるか否かを指定する。
The control bit FG1 is a flag characterizing the present invention, and the transfer source and transfer destination address registers 6b and
Specifies whether or not the data transfer based on 7b is to be executed after the data transfer based on the transfer source and transfer destination address registers 6a and 7a is completed.

コントロールビットSZ2は、転送元レジスタ6aを用い
て行なわれるデータ転送動作において、転送されるべき
データのサイズを指示する。たとえば、SZ2がクリア状
態“0"とされると、8ビット(1バイト)のデータが転
送先レジスタ7b内のアドレスデータによって指定される
アドレスにストアされる。SZ2がセット状態“1"とされ
ると、16ビット(1ワード)のデータがレジスタ7bの内
容によって指示されるアドレスにストアされる。
Control bit SZ2 indicates the size of data to be transferred in a data transfer operation performed using transfer source register 6a. For example, if SZ2 is set to the clear state "0", 8-bit (1 byte) data is stored at the address specified by the address data in the transfer destination register 7b. When SZ2 is set to "1", 16-bit (one word) data is stored at the address indicated by the contents of the register 7b.

コントロールビットSI2は、転送元アドレスレジスタ6
b内にストアされたアドレスデータをインクリメントす
るか否かを指定する。SI2がクリア状態“0"とされる
と、レジスタ6b内のアドレスデータはインクリメントさ
れず、ソースアドレス固定モードのデータ転送が実行さ
れる。SI2がセット状態“1"とされ、かつ、上記SZ2が
“0"とされると、データ転送終了後、レジスタ6b内のア
ドレスデータが+1だけインクリメンタ4によって更新
される。SI2が“1"とされ、かつ、SZ2が“1"とされる
と、データ転送終了後、レジスタ6b内のアドレスデータ
が+2だけインクリメンタ4によって更新される。
The control bit SI2 is set in the transfer source address register 6
Specifies whether to increment the address data stored in b. When SI2 is set to the clear state “0”, the address data in the register 6b is not incremented, and the data transfer in the fixed source address mode is executed. When SI2 is set to "1" and SZ2 is set to "0", the address data in the register 6b is updated by +1 by the incrementer 4 after the data transfer is completed. When SI2 is set to "1" and SZ2 is set to "1", the address data in the register 6b is updated by +2 by the incrementer 4 after the data transfer is completed.

コントロールビットDI2は、転送先アドレスレジスタ7
b内のアドレスデータをインクリメントするか否かを指
定する。DI2がクリア状態“0"とされると、レジスタ7b
内のアドレスデータはインクリメントされず、ディステ
ィネションアドレス固定モードのデータ転送が実行され
る。DI2がセット状態“1"とされ、かつ、SZ2が“0"とさ
れると、データ転送終了後、レジスタ7b内のアドレスデ
ータが+1だけインクリメンタ4によって更新される。
DI2が“1"とされ、かつ、SZ2が“1"とされると、データ
転送終了後、レジスタ7b内のアドレスデータが+2だけ
インクリメンタ4によって更新される。
The control bit DI2 is set in the transfer destination address register 7.
Specifies whether to increment the address data in b. When DI2 is cleared to “0”, register 7b
Is not incremented, and data transfer in the destination address fixed mode is executed. When DI2 is set to "1" and SZ2 is set to "0", the address data in the register 7b is updated by +1 by the incrementer 4 after the data transfer is completed.
When DI2 is set to "1" and SZ2 is set to "1", the address data in the register 7b is updated by +2 by the incrementer 4 after the data transfer is completed.

コントロールビットFG2は、コントロールビットFG1同
様本発明を特徴ずけるフラッグである。
The control bit FG2 is a flag which characterizes the present invention similarly to the control bit FG1.

コントロールビットFG1のクリア状態“0"は、転送元
アドレスレジスタ6a及び転送先アドレスレジスタ7aにも
とづくデータ転送のみの実行を定義する。コントロール
ビットFG1のセット状態“1"は転送元アドレスレジスタ6
a及び転送先アドレスレジスタ7aに基づくデータ転送の
終了後、ひきつづき転送元アドレスレジスタ6b及び転送
先アドレスレジスタ7bに基づくデータ転送を実行するこ
とを定義する。
The clear state “0” of the control bit FG1 defines execution of only data transfer based on the transfer source address register 6a and the transfer destination address register 7a. The set state “1” of the control bit FG1 is the source address register 6
After the completion of the data transfer based on the transfer destination address register 7a and the transfer destination address register 7a, the data transfer based on the transfer source address register 6b and the transfer destination address register 7b is defined.

一方、コントロールビットFG2のクリア状態“0"は、
転送元及び転送先アドレスレジスタ6b及び7bに基づくデ
ータ転送の終了後、転送元及び転送先アドレスレジスタ
6a及び7aに基づくデータ転送に次の処理が移行されるこ
とを定義する。コントロールビットFG2のセット状態
“1"は、たとえば、第2図に示される制御レジスタ2の
7ビットから5ビットに上述の様なSZ1(SZ2),SI1(SI
2)及びDI1(DI2)と同様な定義がされ、かつ、さらに
第3転送元及び第3転送先アドレスレジスタが第1図の
DMAC100内に設けられている場合、転送元及び転送先ア
ドレスデータ6b及び7bに基づくデータ転送終了後、ひき
つづき第3転送元及び第3転送先アドレスレジスタに基
づくデータ転送が行なわれることを定義する。したがっ
て、第1図に示すようなDMAC100においては、コントロ
ールビットFG2のセット状態“1"は禁止される。尚、第
2図において7ビットから0ビットの“−”は未定とさ
れている状態を示している。
On the other hand, the clear state “0” of the control bit FG2 is
After the end of the data transfer based on the source and destination address registers 6b and 7b, the source and destination address registers
It defines that the next processing is transferred to the data transfer based on 6a and 7a. The set state "1" of the control bit FG2 is determined by, for example, setting the 7th to 5th bits of the control register 2 shown in FIG. 2 to SZ1 (SZ2) and SI1 (SI
2) and DI1 (DI2) are defined in the same manner, and the third transfer source and third transfer destination address registers are
When provided in the DMAC 100, it is defined that after the data transfer based on the transfer source and transfer destination address data 6b and 7b, the data transfer based on the third transfer source and third transfer destination address register is performed. Therefore, in the DMAC 100 as shown in FIG. 1, the set state "1" of the control bit FG2 is prohibited. In FIG. 2, "-" of the 7th bit to the 0th bit indicates a state that is undecided.

上記転送要求回数レジスタ3内にストアされた転送要
求回数データのデクリメントタイミングは、上記コント
ロールビットFG1及びFG2の状態によって制御される。FG
1がクリア状態“0"とされていると、転送元及び転送先
アドレスレジスタ6a及び7aにもとづくデータ転送が1回
行なわれた後、上記回数データは、インクリメンタ4に
よって−1だけデクリメントされる。FG1がセット状態
“1"とされ、かつ、FG2がクリア状態“0"とされている
と、転送元及び転送先アドレスレジスタ6a及び7aにもと
づくデータ転送及び転送元及び転送先アドレスレジスタ
6b及び7bにもとづくデータ転送が連続して1回づつ行な
われた後、上記回数データはインクリメンタ4によって
−1だけデクリメントされる。
The decrement timing of the transfer request count data stored in the transfer request count register 3 is controlled by the state of the control bits FG1 and FG2. FG
If 1 is set to the clear state "0", after the data transfer based on the transfer source and transfer destination address registers 6a and 7a is performed once, the count data is decremented by -1 by the incrementer 4. . When FG1 is set to "1" and FG2 is cleared to "0", the data transfer and the source and destination address registers based on the source and destination address registers 6a and 7a
After the data transfer based on 6b and 7b is performed one by one continuously, the data of the number of times is decremented by -1 by the incrementer 4.

したがって、FG1がクリア状態“0"とされている場
合、第6図に示される様なタイミングで転送要求回数レ
ジスタ3内のデータのデクリメントが実行される。尚図
中、Aで示される部分は、転送元及び転送先アドレスレ
ジスタ6a,7aにもとづくデータ転送を示す。
Therefore, when the FG1 is in the clear state "0", the data in the transfer request count register 3 is decremented at the timing shown in FIG. In the drawing, the portion indicated by A indicates data transfer based on the transfer source and transfer destination address registers 6a and 7a.

一方、FG1がセット状態“1"とされている場合、第7
図に示される様なタイミングで転送要求回数レジスタ3
内のデータのデクリメントが実行される。尚第7図にお
いて、Aで示される部分はレジスタ6a,7aに基づくデー
タ転送を、Bで示される部分はレジスタ6b,7bに基づく
データ転送をそれぞれ示している。
On the other hand, when FG1 is set to “1”, the seventh
At the timing shown in the figure, the transfer request count register 3
Is decremented. In FIG. 7, a portion indicated by A indicates data transfer based on the registers 6a and 7a, and a portion indicated by B indicates data transfer based on the registers 6b and 7b.

バス&タイミング制御回路1は、第2図に示すような
配列で設定された制御レジスタ2の各コントロールビッ
トの状態を制御コードと見なし、左側から順次読み出し
て解読し、インクリメンタ4,アドレスレジスタ6a,7a及
び6b,7bやテンポラリレジスタ5等をシーケンシャルに
動作させる制御信号を出力する。それによって、データ
転送が実行される。
The bus & timing control circuit 1 regards the state of each control bit of the control register 2 set in an arrangement as shown in FIG. 2 as a control code, sequentially reads and decodes the state from the left side, and increments the incrementer 4 and the address register 6a. , 7a and 6b, 7b, the temporary register 5 and the like are sequentially output. Thereby, data transfer is performed.

次に、上記DMAコントローラ100により第5図(A)の
様な従来のデータ転送及び第5図(B)の様な各々独立
したアドレス間のデータ転送を実行する場合の動作手順
について説明する。
Next, a description will be given of an operation procedure when the DMA controller 100 executes the conventional data transfer as shown in FIG. 5A and the data transfer between independent addresses as shown in FIG. 5B.

このようなデータ転送を実行する場合、CPU10は転送
開始直前もしくはイニシャライズ時に予めDMAコントロ
ーラDMAC内の制御用レジスタ2内に対応する転送モード
を書き込むとともに、転送要求回数レジスタ3に転送要
求回数を、また、アドレスレジスタ6a及び6b,7bに転送
元アドレスデータSA1及びSA2をアドレスレジスタ7aと7b
に転送先のアドレスデータDA1及びDA2をそれぞれ設定す
る。尚、第5図(A)の様なデータ転送先の場合は、レ
ジスタ6b,7bは使用されないので、それらへのデータSA
2,DA2の書き込みは行なわない。
When executing such data transfer, the CPU 10 writes the corresponding transfer mode in the control register 2 in the DMA controller DMAC immediately before the start of transfer or at the time of initialization, and sets the transfer request count in the transfer request count register 3 and the transfer request count in the transfer request count register 3. The transfer source address data SA1 and SA2 are stored in the address registers 6a and 6b and 7b, respectively.
Are respectively set to the address data DA1 and DA2 of the transfer destination. In the case of the data transfer destination as shown in FIG. 5 (A), since the registers 6b and 7b are not used, the data SA
2, Writing of DA2 is not performed.

そして、バス&タイミング制御回路1がCPU10からの
転送要求DRQ1もしくはタイマモジュール21からの割込み
要求TIRを受けると、バス&タイミング制御回路1がバ
スマスタであるCPU10からバス権を獲得する。そして、
バス&タイミング制御回路1は、上記制御用レジスタ2
内のコード(SZ1,SI1,DI1)を左側から順次読み出して
解読し、先ず第1転送元アドレスレジスタ6a内のアドレ
スデータSA1をアドレスバス8上に出力するとともに、
リードライト信号R/Wをリード状態“H"にアサートし
て、リード側のデバイス(この場合メモリ20)をアクセ
スする。これによってメモリ20から読み出された例えば
1バイトのデータDATA1はデータバス9を介して一旦テ
ンポラリレジスタ5に格納される。次に、DMAコントロ
ーラは第1転送先アドレスレジスタ7a内のアドレスデー
タDA1をアドレスバス8上に出力するとともに、リード
ライト信号R/Wをライト状態(“L")に変化させてライ
ト側の(例えばタイマモジュール)内のデータレジスタ
をアクセスし、テンポラリレジスタ5内のデータDATA1
をデータバス9上に出力する。そして、制御レジスタ3
のコントロールビットSI1及びDI1の状態に従って、レジ
スタ6a及び7aのアドレスデータSA1及びDA1がインクリメ
ントされたり、インクリメントされなかったりする。こ
れによって転送元及び転送先アドレスレジスタ6a,7aに
基づく1回目のデータ転送が終了する。
When the bus & timing control circuit 1 receives the transfer request DRQ1 from the CPU 10 or the interrupt request TIR from the timer module 21, the bus & timing control circuit 1 acquires the bus right from the CPU 10, which is the bus master. And
The bus & timing control circuit 1 includes the control register 2
The codes (SZ1, SI1, DI1) are sequentially read and decoded from the left side, and first, address data SA1 in the first transfer source address register 6a is output onto the address bus 8, and
Assert the read / write signal R / W to the read state “H” to access the read-side device (the memory 20 in this case). Thus, for example, 1-byte data DATA1 read from the memory 20 is temporarily stored in the temporary register 5 via the data bus 9. Next, the DMA controller outputs the address data DA1 in the first transfer destination address register 7a onto the address bus 8, and changes the read / write signal R / W to the write state (“L”) to change the write side (“L”). For example, the data register in the timer module is accessed, and the data DATA1 in the temporary register 5 is accessed.
Is output on the data bus 9. And control register 3
Depending on the state of the control bits SI1 and DI1, the address data SA1 and DA1 of the registers 6a and 7a may or may not be incremented. Thus, the first data transfer based on the transfer source and transfer destination address registers 6a and 7a is completed.

次に、バス&タイミング制御回路1は制御用レジスタ
2内のフラグFG1を調べてクリア状態“0"なら転送を終
了し、レジスタ3内の回数データがインクリメンタ4で
−1だけデクリメントされて、レジスタ3内に書き込ま
れる。したがって、第5図(A)に示される様なデータ
転送が実施されることになる。一方、フラグFG1がセッ
ト状態“1"に設定されていると、フラグFG1の次のコー
ド(SZ2,SI2,DI2)を読み出して2回目の転送を開始す
る。すなわち、先ず第2転送先アドレスレジスタ6b内の
アドレスSA2をアドレスバス8に出力してメモリからた
とえば、1バイトのデータDATA2を読み出してテンポラ
リレジスタ5に入れ、次に第2転送先アドレスレジスタ
7b内のアドレスDATA2を出力して所望のタイマモジュー
ル21内のコントロールレジスタにテンポラリレジスタ5
内のデータDATA2を書き込む。それから、バス&タイミ
ング制御回路1はフラグFG2を調べてそれがクリア状態
“0"ならバス権を開放し、転送を終了して、転送要求回
数レジスタ3内の回数データがインクリメンタ4に送ら
れてデクリメント(−1)されてから元のレジスタ3へ
書き込まれる。
Next, the bus & timing control circuit 1 checks the flag FG1 in the control register 2 and terminates the transfer if it is in the clear state "0". The count data in the register 3 is decremented by -1 by the incrementer 4, and Written in register 3. Therefore, data transfer as shown in FIG. 5A is performed. On the other hand, if the flag FG1 is set to "1", the code (SZ2, SI2, DI2) next to the flag FG1 is read and the second transfer is started. That is, first, the address SA2 in the second transfer destination address register 6b is output to the address bus 8, and for example, 1-byte data DATA2 is read from the memory and put into the temporary register 5, and then the second transfer destination address register
7b, the address DATA2 is output, and the temporary register 5 is stored in the control register in the desired timer module 21.
Write the data DATA2 in. Then, the bus & timing control circuit 1 checks the flag FG2. If the flag FG2 is in the clear state "0", the bus right is released, the transfer is completed, and the count data in the transfer request count register 3 is sent to the incrementer 4. After decrement (−1), the data is written to the original register 3.

このようにして、割込み要求DRQ1,2又はTIRが入力さ
れるごとにDMAC100はデータ転送を繰り返し、転送要求
回数レジスタ3の値が「0」になるとDMAC100はその旨
をCPU10へ知らせる。CPU10は転送元アドレスレジスタ6
a,6b,7a及び7bのアドレスデータを書き換えてI/Oデバイ
スに転送すべきデータを変更したり、回数レジスタ3や
制御用レジスタ2の値を設定し直す。
In this way, the DMAC 100 repeats data transfer each time the interrupt request DRQ1, 2 or TIR is input, and when the value of the transfer request number register 3 becomes "0", the DMAC 100 notifies the CPU 10 to that effect. CPU 10 sets transfer source address register 6
The data to be transferred to the I / O device is changed by rewriting the address data of a, 6b, 7a and 7b, and the values of the count register 3 and the control register 2 are reset.

第5図(B)の様なデータ転送方式は、特に、シング
ルチップマイクロコンピュータの外部端子から所定の波
形を有するパルスを出力させる場合に利用することがで
きる。この場合、第1図に2点鎖線で囲まれた内部の領
域がシリコンの様な1つの単結晶半導体基板(chip)内
に形成されていると見なされるとともに、配線X及び外
部端子Yが存在すると見なされる。尚、図中には外部端
子Y以外の外部端子は記入されていないが、実際のシン
グルチップマイクロコンピュータは、端子Y以外に複数
の外部端子を有することは、当業者にとって容易に理解
されるだろう。
The data transfer method as shown in FIG. 5B can be used particularly when a pulse having a predetermined waveform is output from an external terminal of a single-chip microcomputer. In this case, it is considered that the internal region surrounded by the two-dot chain line in FIG. 1 is formed in one single crystal semiconductor substrate (chip) such as silicon, and the wiring X and the external terminal Y exist. Will be considered. Although no external terminals other than the external terminal Y are shown in the drawing, those skilled in the art can easily understand that an actual single-chip microcomputer has a plurality of external terminals other than the terminal Y. Would.

以下、本発明のデータ転送の利用方法が述べられる。 Hereinafter, a method of using data transfer according to the present invention will be described.

まず、タイマモジュールは第8図に示すような、フリ
ランニングカウンタ(FRC)200を含む。FRT200は、その
内部にクロック信号φ受けてクロック数をカウントする
16ビットのアップ・カウンタによって構成されたフリラ
ンニング・カウンタFRC202,上記FRC202のカウント値と
比較されるべきデータをストアするアウトプット・コン
ペア・レジスタ(OCR)204,上記FRCとOCRのそれぞれの
値を比較し、両者が一致したとき一致信号Cを出力する
比較回路(COMP)206,上記FRTの動作制御の為のタイマ
コントロールレジスタ(TCR)208及びタイマコントロー
ル/ステータスレジスタ(TCSR)、及びタイマコントロ
ールロジック(TCL)212を含む。上記FRC,OCR,TCR及びT
CSRはそれぞれリード・ライト可能なレジスタであり、
そのリード動作及びライト動作はリード/ライト信号
(R/W)によって制御される。また上記FRC,OCR,TCR及び
TCSRはそれぞれデータバス110に結合されるとともに、
アドレスバス115上のアドレス信号をデコードするアド
レスデコーダ214から出力される選択信号SEL0〜SEL3に
よって、選一的に選択される。
First, the timer module includes a free running counter (FRC) 200 as shown in FIG. The FRT 200 receives the clock signal φ inside and counts the number of clocks
A free running counter FRC202 constituted by a 16-bit up counter, an output compare register (OCR) 204 for storing data to be compared with the count value of the above FRC202, and a value of each of the above FRC and OCR. A comparison circuit (COMP) 206 for comparing and outputting a coincidence signal C when both coincide, a timer control register (TCR) 208 and a timer control / status register (TCSR) 208 for controlling the operation of the FRT, and a timer control logic. (TCL) 212. FRC, OCR, TCR and T above
CSR is a readable / writable register.
The read operation and the write operation are controlled by a read / write signal (R / W). In addition, FRC, OCR, TCR and
Each TCSR is coupled to the data bus 110,
Selection is made selectively by selection signals SEL0 to SEL3 output from an address decoder 214 that decodes an address signal on the address bus 115.

TCR208はその内部にアウトプットコンペア信号FTOの
出力を許可するか否かを指定するアウトプットイネーブ
ルフラッグ、及びCOMP206から一致信号Cが発生したと
きタイマ割込み要求TIRの出力を許可するか否かを指示
するアウトプットインタラプトイネーブルフラッグを含
む。TCSR210は一致信号Cにより、アウトプットコンペ
ア信号FTOの出力レベルを指定するアウトプットレベル
コントロールフラッグを含む。
The TCR 208 internally has an output enable flag for specifying whether to permit output of the output compare signal FTO, and instructing whether to permit the output of the timer interrupt request TIR when the match signal C is generated from the COMP 206. Output interrupt enable flag. The TCSR 210 includes an output level control flag for designating the output level of the output compare signal FTO by the coincidence signal C.

上記TCL212は、アウトプットコンペアイネーブルフラ
ッグのセット状態“1"で、上記一致信号Cを上記COMP20
6から受けると、アウトプットレベルコントロールフラ
ッグによって指定された出力レベルを有するFTO信号を
出力する様に動作する。また、アウトプットレベルコン
トロールフラッグがクリア状態“0"とされると、FTO信
号はD−レベルにされ、そのフラッグがセット状態とさ
れると、FTO信号はハイレベルとされる。上記TCL212
は、アウトプットインターラプトイネーブルフラッグが
セット状態“1"で、上記一致信号を受けると、たとえば
ハイレベルのTIR信号を出力するように動作する。
When the output compare enable flag is set to “1”, the TCL 212 outputs the match signal C to the COMP20.
Upon receiving from step 6, it operates to output an FTO signal having the output level specified by the output level control flag. When the output level control flag is set to the clear state "0", the FTO signal is set to the D-level, and when the flag is set to the set state, the FTO signal is set to the high level. TCL212 above
When the output interrupt enable flag is set to "1" and the above match signal is received, it operates to output, for example, a high-level TIR signal.

第8図は、上記FRTによって制御される被制御デバイ
スとして、たとえば、プリンター300内のステップモー
ター302を例示的に示している。すなわち、上記FTO信号
で、上記モーター302の回転数及び/又はトルクを制御
しようとする例が述べられる。
FIG. 8 exemplarily shows, for example, a stepping motor 302 in the printer 300 as a controlled device controlled by the FRT. That is, an example is described in which the rotation speed and / or the torque of the motor 302 is controlled by the FTO signal.

第9図は、データ転送の順番及びシングルチップマイ
クロコンピュータのアドレス空間とデータ転送の順番と
の間の関係が示される。このデータ転送において、DMAC
100内の制御レジスタ2、転送元及び転送先アドレスレ
ジスタ6a,6b,7a7bは、表1の様に初期設定され、タイマ
割込(TIR)がDMACに入力されるごと に、データ転送先 が実行されていく。
FIG. 9 shows the order of data transfer and the relationship between the address space of the single-chip microcomputer and the order of data transfer. In this data transfer, DMAC
The control register 2 and the source and destination address registers 6a, 6b, 7a7b in 100 are initialized as shown in Table 1, and each time a timer interrupt (TIR) is input to the DMAC. To the data transfer destination Is being executed.

第10図は、第9図に示したデータ転送FRT200動作波形
図及びFTO信号の出力レベルの関係が示される。
FIG. 10 shows the relationship between the operation waveform diagram of the data transfer FRT200 shown in FIG. 9 and the output level of the FTO signal.

図中において、太い実線はFRC202のカウントアップ状
態を示し、2点鎖線はOCR204の値を示し、上記2点鎖点
の矢印はOCR204の値の変更を示し、点線はOCR204の内容
とFRC202のカウント値の一致点すなわち、TIRの出力さ
れるタイミングを示し、FTOは外部端子Yから出力され
るFTO信号の出力レベルを示す。理解を容易とするため
に、図中に、CPU10の動作期間とデータ転送期間との時
間配分が示されている。CPU動作期間はCPU EX.と示さ
れ、CPU10がデータ処理プログラムを実行していること
を示す。,…はデータ転送を示し、Jは、アドレス
レジスタ6bのアドレスのインンリメント動作を、Kは回
数レジスタ3のデクリメント動作を示す。
In the figure, the thick solid line indicates the count-up state of the FRC 202, the two-dot chain line indicates the value of the OCR 204, the two-dot chain arrow indicates a change in the value of the OCR 204, and the dotted line indicates the contents of the OCR 204 and the count of the FRC 202. The value coincidence point, that is, the timing at which the TIR is output, and FTO indicates the output level of the FTO signal output from the external terminal Y. For ease of understanding, the figure shows the time distribution between the operation period of the CPU 10 and the data transfer period. The CPU operation period is indicated as CPU EX., Which indicates that the CPU 10 is executing the data processing program. ,... Indicate data transfer, J indicates an increment operation of the address of the address register 6b, and K indicates a decrement operation of the count register 3.

これによって、シングルチップマイクロコンピュータ
の外部端子Yから所定の波形パルス(FTO)を出力さ
せ、しかもそのパルスを所望の回数だけ出力させた後に
パルスの幅を変えたりすることができる。従って、これ
をステップモータ302の制御パルスの形成に利用すると
初めは回転度が徐々に速くなり、途中から一定速度にな
るようにステップモータ302を制御するようなことが可
能となることは当業者にとって容易に理解されるであろ
う。
As a result, it is possible to output a predetermined waveform pulse (FTO) from the external terminal Y of the single-chip microcomputer, and change the pulse width after outputting the pulse a desired number of times. Therefore, if this is used for forming a control pulse of the step motor 302, it is possible to control the step motor 302 so that the degree of rotation gradually increases at first, and then becomes constant at a certain speed. Will be easily understood by

なお、上記実施例では制御用レジスタ2が1つだけ設
けられているが、上記制御用レジスタ2と転送先および
転送元アドレスレジスタ6a〜7bの組を複数チャネル分設
け、複数の独立したデータ転送を行なえるようにしても
よい。
In the above embodiment, only one control register 2 is provided. However, a set of the control register 2 and the transfer destination and transfer source address registers 6a to 7b is provided for a plurality of channels, and a plurality of independent data transfer is performed. May be performed.

また、転送要求回数レジスタ3の代わりもしくはこれ
とともに転送語数等を設定する転送回数レジスタを設
け、ブロック転送等における転送回数を入れるようにし
てもよい。
Further, a transfer number register for setting the number of words to be transferred or the like may be provided instead of or together with the transfer request number register 3, and the number of transfers in block transfer or the like may be entered.

次に本発明をシングルチップマイクロコンピュータに
適用し、上記データ転送をマイクロプログラムで実現で
きるようにした実施例について説明する。
Next, an embodiment in which the present invention is applied to a single-chip microcomputer so that the data transfer can be realized by a microprogram will be described.

第3図には、本発明が適用されるシングルチップマイ
クロコンピュータ102の構成例が、また第4図にはメモ
リーI/O間のデータ転送を可能にするマイクロプログラ
ムの制御手順の一例が示されている。
FIG. 3 shows an example of the configuration of a single-chip microcomputer 102 to which the present invention is applied, and FIG. 4 shows an example of a microprogram control procedure for enabling data transfer between memory I / Os. ing.

第3図においては、11はマイクロプログラム制御方式
の制御部と演算器やレジスタ類を含む実行ユニットから
なるマイクロプロセッサ、12はプログラマブルな内蔵タ
イマ、13はタイマ割込みTIRや外部デバイスからの割込
み要求IRQを受けて優先順位を決定する割込み制御回
路、14はバス権を獲得したり、外部デバイスに対する制
御信号を形成したりするバスアビータの機能を含むバス
&タイミンング制御回路である。
In FIG. 3, reference numeral 11 denotes a microprocessor comprising a control unit of a microprogram control system and an execution unit including a computing unit and registers, 12 a programmable internal timer, 13 a timer interrupt TIR and an interrupt request IRQ from an external device. An interrupt control circuit 14 that receives the request and determines the priority order is a bus & timing control circuit including a bus arbiter function for acquiring a bus right and forming a control signal for an external device.

また、15は出力ポート、16はアドレスデコーダDEC
で、この実施例ではポート15内に出力状態を制御するた
めのデータレジスタDRが2つ設けられている。このデー
タレジスタDR1とDR2はカスケード接続されており、1段
目のデータレジスタDR1はCPU11からの制御信号によって
データバス19上のデータを読込み、2段目のデータレジ
スタDR2はタイマ12からの信号CMによって1段目のデー
タレジスタDR2内のデータを取込むように構成されてい
る。
15 is an output port, 16 is an address decoder DEC
In this embodiment, two data registers DR for controlling the output state are provided in the port 15. The data registers DR1 and DR2 are cascaded, and the first-stage data register DR1 reads data on the data bus 19 by a control signal from the CPU 11, and the second-stage data register DR2 is a signal CM from the timer 12. Is configured to take in the data in the data register DR2 of the first stage.

さらに、この実施例ではアドレスバス18およびデータ
バス19に接続される外部メモリ(RAM)20内の所定アド
レス領域に第1図に示されている制御レジスタ2と、転
送要求回数レジスタ3および転送元アドレスレジスタ6
a,6bと転送先アドレスレジスタ7a,7bが割り当てられ
て、第4図に示すようなマイクロプログラム制御フロー
によって、メモリ20とI/O間のデータ転送を実行するよ
うに構成されている。
Further, in this embodiment, the control register 2 shown in FIG. 1, the transfer request number register 3 and the transfer source are stored in a predetermined address area in an external memory (RAM) 20 connected to the address bus 18 and the data bus 19. Address register 6
a, 6b and transfer destination address registers 7a, 7b are allocated to execute data transfer between the memory 20 and the I / O by a microprogram control flow as shown in FIG.

次に、タイマ割込みによって外部のメモリ20から上記
ポート15のレジスタにデータを転送して所定パルスを出
力させる場合の手順を第4図のフローチャートを用いて
説明する。
Next, a procedure for transferring data from the external memory 20 to the register of the port 15 by a timer interrupt and outputting a predetermined pulse will be described with reference to the flowchart of FIG.

タイマ12から割込み制御回路13に対してタイマ割込み
TIRが入ると、割込み制御回路13はバス&タイミング制
御回路14へバス要求信号BRを送る。バス&タイミング回
路14はバス権を獲得し、CPU11にアクノリッジ信号ACKを
出力する。CPU11はデータ転送のための割込み(DTCIR
Q)かそれ以外の割込みか判定する(ステップS1)。デ
ータ転送割込みDTCIRQの場合、ステップS2へ進みベクタ
領域から対応するデータ転送の為の割込みベクタ(DTC
ベクタ)すなわちメモリ20内に入っている制御用レジス
タ2のアドレスをCPU11が読み込むとともに、そのアド
レスを使ってメモリ20をアクセスし制御用レジスタ2の
内容(転送モード(SZ1,SI1,DI1)等)を読み込む(ス
テップS3)。そして、CPU11はデータのサイズ(SZ1)と
転送モード(SI1,DI1)を解読し、先ずメモリ20内の転
送元アドレスレジスタ6aとされるアドレスにストアされ
たソースアドレスを読み込むとともに、そのソースアド
レスをアドレスバス18上に出力し、それによって、CPU1
はメモリ20をアクセスして転送されるべきデータを読み
込む(ステップS4,S5)。それから、CPUは上記ステップ
S3で読み込んだ転送モード(SI1)から転送元アドレス
を更新すべきか否か判定する(ステップS6)。ポート15
よりモータの駆動パルスを出力させるような場合には、
出力状態をタイマ割込みTIRの度に反転させる必要があ
るので転送元アドレスをインクリメントまたはデクリメ
ントすることになる。この場合には、ステップS6からS7
へ移行して、サイズ指定部(SZ1)に応じて転送元アド
レスにプラス1またはプラス2を行なってそれを転送元
アドレスレジスタ6aに書き込む。(ステップS8)。
Timer interrupt from timer 12 to interrupt control circuit 13
When the TIR is input, the interrupt control circuit 13 sends a bus request signal BR to the bus & timing control circuit 14. The bus & timing circuit 14 acquires the bus right and outputs an acknowledge signal ACK to the CPU 11. CPU 11 interrupts data transfer (DTCIR
It is determined whether the interrupt is Q) or another interrupt (step S1). In the case of the data transfer interrupt DTCIRQ, the process proceeds to step S2, where the interrupt vector (DTC
Vector), that is, the CPU 11 reads the address of the control register 2 contained in the memory 20, and accesses the memory 20 using the address to access the contents of the control register 2 (transfer mode (SZ1, SI1, DI1), etc.). Is read (step S3). Then, the CPU 11 decodes the data size (SZ1) and the transfer mode (SI1, DI1), first reads the source address stored in the address of the memory 20 as the transfer source address register 6a, and reads the source address. Output on the address bus 18, thereby
Reads the data to be transferred by accessing the memory 20 (steps S4 and S5). Then the CPU goes to the above steps
It is determined whether the transfer source address should be updated based on the transfer mode (SI1) read in S3 (step S6). Port 15
If you want to output more motor drive pulses,
Since the output state needs to be inverted each time the timer interrupt TIR occurs, the transfer source address is incremented or decremented. In this case, steps S6 to S7
Then, the source address is incremented by one or two in accordance with the size designation section (SZ1), and is written to the source address register 6a. (Step S8).

それから、CPU11はメモリ20内の転送先アドレスレジ
スタ7a内にストアされたデスティネションアドレスを読
み込むとともにそのデスティネションアドレスをアドレ
スバス18上に出力する。その時、ステップS5で読み込ん
だ転送すべきデータをデータバス19上に出力する(ステ
ップS9,S10)。バス19上に出力されたデスティネション
アドレスがポート15を指定するものであるときは、デコ
ーダ16によってポート15内のデータレジスタDR1の選択
信号SEL1が形成され、バス19上のデータがデータレジス
タDR1に格納される。
Then, the CPU 11 reads the destination address stored in the transfer destination address register 7a in the memory 20 and outputs the destination address onto the address bus 18. At this time, the data to be transferred read in step S5 is output onto the data bus 19 (steps S9 and S10). When the destination address output on the bus 19 designates the port 15, the selection signal SEL1 of the data register DR1 in the port 15 is formed by the decoder 16, and the data on the bus 19 is transferred to the data register DR1. Is stored in

その後、ステップS3で制御用レジスタ2から読み込ん
だ転送モードDI1に基づいて転送先アドレスを更新する
か否か判定する(ステップS11)。タイマ割込みで出力
ポートを制御する場合、転送先アドレスは固定であるた
め、この場合にはステップS11からS14へジャンプし、制
御用レジスタ2内の終了フラグFG1がセット状態か“1"
か否か調べられる。FG1が“1"のときはステップS4へ戻
って2回目の転送を開始する。2回目の転送では、メモ
リ20内のアドレスレジスタ6b,7bを使用してタイマ12内
の時間レジスタ(第8図のOCR)(パルス幅に対応して
いる)を設定するためのデータをメモリ20から転送すべ
く、ステップS4〜S14を繰り返す。この場合、モータの
回転速度を変えるようなときはステップS6からS7へ移行
して転送元アドレスを更新し、回転速度を一定に保つと
きは転送元アドレスの更新は行なわないようにすればよ
い。
Thereafter, it is determined whether or not to update the transfer destination address based on the transfer mode DI1 read from the control register 2 in step S3 (step S11). When the output port is controlled by a timer interrupt, the transfer destination address is fixed. In this case, the process jumps from step S11 to S14, and the end flag FG1 in the control register 2 is set to “1” or “1”.
Is checked. When FG1 is "1", the process returns to step S4 to start the second transfer. In the second transfer, data for setting the time register (OCR in FIG. 8) (corresponding to the pulse width) in the timer 12 using the address registers 6b and 7b in the memory 20 is stored in the memory 20. Steps S4 to S14 are repeated to transfer from. In this case, when changing the rotation speed of the motor, the process proceeds from step S6 to S7 to update the transfer source address, and when the rotation speed is kept constant, the transfer source address may not be updated.

2回目のデータ転送が終了すると、終了フラグFG2が
チェックされ、クリア状態“0"ならステップS15へ進
み、メモリ20から転送要求回数レジスタ3の内容(DTC
R)を読み込んでデクリメントしてから元のレジスタ3
のアドレス内にデクリメントされた値を書き込む(ステ
ップS16,S17)。その後、レジスタ3の値(転送要求回
数DTCR)が「0」になったか否か判定する(ステップS1
8)そして、「0」でないときはそのまま次のタイマ割
込みTIRが来るのを待ち、タイマ割込みTIRが入ると上記
手順S1〜S18を繰り返し、同一の転送モードでポート15
の出力状態を制御する。
When the second data transfer is completed, the end flag FG2 is checked. If the clear state is “0”, the process proceeds to step S15, and the contents of the transfer request count register 3 (DTC
R) is read and decremented before register 3
The decremented value is written in the address (steps S16 and S17). Thereafter, it is determined whether or not the value of the register 3 (the number of transfer requests DTCR) has become "0" (step S1).
8) If it is not "0", wait for the next timer interrupt TIR as it is, and when the timer interrupt TIR is received, repeat the above steps S1 to S18, and perform port 15 in the same transfer mode.
Control the output state of

一方、ステップS18で転送要求回数が「0」になった
と判定すると、ステップS21へ移行し、別の割込み処理
を開始する。ポート15から出力されるモータの駆動パル
スを制御するような場合には、この割込み処理で制御用
レジスタ2を書き換えて転送モードを変えたりすること
ができる。
On the other hand, if it is determined in step S18 that the number of transfer requests has become “0”, the flow shifts to step S21 to start another interrupt process. In the case of controlling the drive pulse of the motor output from the port 15, the transfer mode can be changed by rewriting the control register 2 by this interrupt processing.

このような手順により、例えばステップモータが回転
を開始してから1000個目のパルスまでパルス幅を徐々に
大きくして回転速度を次第に増加させ、その後はパルス
幅すなわち回転速度を一定とするようにパルス幅の一定
なパルスを連続的に出力させるようなモータの制御が可
能となる。
By such a procedure, for example, the pulse width is gradually increased from the start of rotation of the step motor to the 1000th pulse to gradually increase the rotation speed, and thereafter, the pulse width, that is, the rotation speed is kept constant. It is possible to control the motor so as to continuously output a pulse having a constant pulse width.

なお、上記実施例のシングルチップマイクロコンピュ
ータでは、制御用レジスタ2や転送元、転送先アドレス
レジスタ6a〜7bを外部のメモリ20内に用意するとした
が、シングルチップマイクロコンピュータが内蔵RAMを
有する場合には、その中に用意しておくようにしてもよ
いことはいうまでもない。
In the single-chip microcomputer of the above embodiment, the control register 2 and the transfer source and transfer destination address registers 6a to 7b are prepared in the external memory 20, but when the single-chip microcomputer has a built-in RAM, Needless to say, it may be prepared in such a case.

以上説明したように上記実施例は、転送元アドレスと
転送先アドレスを設定可能なアドレスレジスタの組を2
組用意するとともに、転送方法を指定するため用意され
た制御用レジスタ内に上記アドレスレジスタ組のうち一
方のみを使用する転送モードと両方を使用する転送モー
ドを区別するビット(FG1)を設け、上記制御用レジス
タの制御コードを解読しながらデータ転送のための制御
信号を形成させるようにしたので、転送元アドレスと転
送先アドレスを2つずつ設定できるため、1回の転送要
求で2回の各々独立したアドレス間のデータ転送が可能
となる。また、制御用レジスタ内に1回転送と2回転送
を区別するビット(FG1)が設けられているため、新た
に可能となった上記2回転送の他、従来の1回の転送要
求で1回の転送を行なうDMAコントローラの機能を保障
することができるという効果がある。
As described above, in the above embodiment, the set of the address register capable of setting the transfer source address and the transfer destination address is two.
A bit (FG1) for distinguishing between a transfer mode using only one of the address register sets and a transfer mode using both of the above address register sets is provided in a control register prepared for designating a transfer method. Since the control signal for data transfer is formed while decoding the control code of the control register, the transfer source address and the transfer destination address can be set two by two. Data transfer between independent addresses becomes possible. Further, since a bit (FG1) for distinguishing between one-time transfer and two-time transfer is provided in the control register, in addition to the above-mentioned two-time transfer newly enabled, one-time transfer in the conventional one-time transfer request. This has the effect that the function of the DMA controller that performs the transfer twice can be guaranteed.

以上本発明者によってなされた発明を実施例に基づき
具体的に説明したが、本発明は上記実施例に限定される
ものではなく、その要旨を逸脱しない範囲で種々変更可
能であることはいうまでもない。例えば上記第1の実施
例ではCPUと別個のチップ上に形成されたDMAコントロー
ラを想定して説明したが、本発明はシングルチップマイ
クロコンピュータ内蔵のDMAコントローラに適用するこ
とも可能である。
Although the invention made by the inventor has been specifically described based on the embodiments, the present invention is not limited to the above-described embodiments, and various changes can be made without departing from the gist of the invention. Nor. For example, in the first embodiment, the DMA controller formed on a separate chip from the CPU has been described. However, the present invention can be applied to a DMA controller built in a single-chip microcomputer.

以上の説明では主として本発明者によってなされた発
明をその背景となった利用分野であるDMAコントローラ
およびシングルチップマイクロコンピュータに適用した
ものについて説明したがこの発明はそれに限定されるも
のでなく、データ転送機能を有する半導体回路一般に利
用することができる。
In the above description, the invention made by the inventor was mainly applied to a DMA controller and a single-chip microcomputer, which are the fields of application that served as the background. However, the present invention is not limited to this. It can be generally used for semiconductor circuits having functions.

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

本願において開示される発明のうち代表的なものによ
って得られる効果を簡単に説明すれば下記のとおりであ
る。
The following is a brief description of an effect obtained by a representative one of the inventions disclosed in the present application.

すなわち、1回の転送要求で2回の各々特立したアド
レス間のデータ転送ができるようなDMAコントローラが
提供でき、また、シングルチップマイコンにおいてDMA
転送によるパルスの出力制御が可能となる。
In other words, it is possible to provide a DMA controller that can perform data transfer between two special addresses twice with one transfer request.
The output control of the pulse by the transfer becomes possible.

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

第1図は本発明をDMAコントローラに適用した場合の一
実施例を示すブロック図、 第2図はその制御用レジスタの構成例を示す図、 第3図は本発明をシングルチップマイクロコンピュータ
に適用した場合に一実施例を示すブロック図、 第4図はマイクロプログラムによるデータ転送制御手順
を示すフローチャート、 第5図(A)は従来のDMAコントローラによるデータ転
送方式を示すメモリマップ、 第5図(B)は発明のDMAコントローラによるデータ転
送方式を示すメモリマップ、 第6図はコントロールビットFG1が“0"とされた場合の
回数レジスタのデクリメントタイミングを示し、 第7図はコントロールビットFG1が“1"とされた場合の
回数レジスタのデクリメントタイミングを示し、 第8図はフリランニングカウンタの構成及び被制御装置
を示し、 第9図はデータ転送の順序を示し、 第10図は、第9図のデータ転送における動作波形図を示
す。 11……マイクロプロセッサ、15……ポート、16……デコ
ーダ、DR1,DR2……データレジスタ。
FIG. 1 is a block diagram showing an embodiment in which the present invention is applied to a DMA controller, FIG. 2 is a diagram showing a configuration example of a control register, and FIG. 3 is an application of the present invention to a single-chip microcomputer. FIG. 4 is a flowchart showing a data transfer control procedure by a microprogram, FIG. 5 (A) is a memory map showing a data transfer method by a conventional DMA controller, and FIG. FIG. 6B is a memory map showing a data transfer method by the DMA controller of the present invention. FIG. 6 shows the decrement timing of the count register when the control bit FG1 is set to "0". FIG. 8 shows the configuration of the free running counter and the controlled device. Shown, FIG. 9 shows a sequence of data transfer, FIG. 10 shows an operation waveform diagram in the data transfer of Figure 9. 11: Microprocessor, 15: Port, 16: Decoder, DR1, DR2: Data register.

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭62−267847(JP,A) 特開 平2−72464(JP,A) 特開 平2−259861(JP,A) 特開 昭54−124644(JP,A) 特開 平2−176844(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 13/28 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-62-267847 (JP, A) JP-A-2-72464 (JP, A) JP-A-2-259861 (JP, A) JP-A-54-267 124644 (JP, A) JP-A-2-176844 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) G06F 13/28

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】第1転送元アドレスをストアするための第
1記憶手段、 第1転送先アドレスをストアするための第2記憶手段、 第2転送元アドレスをストアするための第3記憶手段、 第2転送先アドレスをストアするための第4記憶手段、 転送要求回数データをストアするための第5記憶手段、 データ転送を制御するための制御手段を含み、 上記制御手段は、 上記第1、第2記憶手段を用いた第1データ転送を制御
するための第1制御ビット、 上記第3、第4記憶手段を用いた第2データ転送を制御
するための第2制御ビット、 一方の状態が上記第1データ転送を繰り返して行われる
ことを示し、かつ、他方の状態が上記第1及び第2デー
タ転送がそれぞれ1回ずつ連続して実行されることを示
す第3制御ビットを持ち、 上記第3制御ビットが上記一方の状態とされている時、
上記第1データ転送を上記転送要求回数を示す回数行
い、 上記第3制御ビットが上記他方の状態とされている時、
上記第1及び第2データ転送の連続転送を上記転送要求
回数を示す回数を行うようにすることを特徴とするデー
タ転送制御装置。
A first storage unit for storing a first transfer source address; a second storage unit for storing a first transfer destination address; a third storage unit for storing a second transfer source address; A fourth storage unit for storing a second transfer destination address, a fifth storage unit for storing transfer request count data, and a control unit for controlling data transfer, the control unit comprising: A first control bit for controlling the first data transfer using the second storage means; a second control bit for controlling the second data transfer using the third and fourth storage means; A third control bit indicating that the first data transfer is repeatedly performed, and the other state has a third control bit indicating that the first and second data transfers are respectively performed continuously once each; 3rd control When the unit is in one of the above states,
The first data transfer is performed a number of times indicating the number of transfer requests, and when the third control bit is in the other state,
A data transfer control device, wherein the continuous transfer of the first and second data transfer is performed a number of times indicating the number of transfer requests.
【請求項2】請求項1において、 上記転送要求回数は、 上記第3制御ビットが一方の状態とされている時、第1
データ転送が行われた後、1デクリメントされ、 上記第3制御ビットが他方の状態とされている時、第1
及び第2データ転送が連続して行われた後、1デクリメ
ントされこることを特徴とするデータ転送制御装置。
2. The method according to claim 1, wherein the number of transfer requests is equal to the first number when the third control bit is in one state.
After the data transfer is performed, the value is decremented by one, and when the third control bit is in the other state, the first
And a data transfer control device which is decremented by one after the second data transfer is continuously performed.
【請求項3】請求項3において、 上記データ転送制御装置は、中央処理ユニットを含む1
チップデータプロセッサ内に内蔵され、 データ転送要求に対して、上記データ転送制御装置が応
答する第1動作と、上記中央処理ユニットが応答する第
2動作とを含むことを特徴とするデータ転送制御装置。
3. The data transfer control device according to claim 3, wherein the data transfer control device includes a central processing unit.
A data transfer control device built in a chip data processor, comprising: a first operation in which the data transfer control device responds to a data transfer request; and a second operation in which the central processing unit responds to a data transfer request. .
JP32317590A 1990-11-28 1990-11-28 Data transfer control device Expired - Lifetime JP3264921B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP32317590A JP3264921B2 (en) 1990-11-28 1990-11-28 Data transfer control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP32317590A JP3264921B2 (en) 1990-11-28 1990-11-28 Data transfer control device

Publications (2)

Publication Number Publication Date
JPH04195448A JPH04195448A (en) 1992-07-15
JP3264921B2 true JP3264921B2 (en) 2002-03-11

Family

ID=18151915

Family Applications (1)

Application Number Title Priority Date Filing Date
JP32317590A Expired - Lifetime JP3264921B2 (en) 1990-11-28 1990-11-28 Data transfer control device

Country Status (1)

Country Link
JP (1) JP3264921B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3841810B2 (en) 2002-09-30 2006-11-08 株式会社ルネサステクノロジ Data processor
JP2007128336A (en) * 2005-11-04 2007-05-24 Nec Corp Parallel register access device and system lsi

Also Published As

Publication number Publication date
JPH04195448A (en) 1992-07-15

Similar Documents

Publication Publication Date Title
US4514808A (en) Data transfer system for a data processing system provided with direct memory access units
US5642489A (en) Bridge between two buses of a computer system with a direct memory access controller with accessible registers to support power management
US5212795A (en) Programmable DMA controller
US5107415A (en) Microprocessor which automatically rearranges the data order of the transferred data based on predetermined order
US5826106A (en) High performance multifunction direct memory access (DMA) controller
US3962682A (en) Split low order internal address bus for microprocessor
EP0428111A2 (en) Data transfer control method and data processor using the same
JPS61148563A (en) Data transfer system and data transfer
EP0212637B1 (en) Mircrocomputer
JPH05250305A (en) Data transfer control system
EP0355462B1 (en) Dedicated service processor with inter-channel communication features
KR970003321B1 (en) System using microprocessor address lines coprocessor selection within a multi-coprocessor apparatus
JP3619532B2 (en) Semiconductor integrated circuit device
US4016546A (en) Bus switch coupling for series-coupled address bus sections in a microprocessor
JP2845433B2 (en) Integrated circuit device
JPS5844558A (en) N-channel mos semiconductor processor
US5410721A (en) System and method for incrementing a program counter
US4037204A (en) Microprocessor interrupt logic
US4004281A (en) Microprocessor chip register bus structure
US4030079A (en) Processor including incrementor and program register structure
US4040035A (en) Microprocessor having index register coupled to serial-coupled address bus sections and to data bus
JP3264921B2 (en) Data transfer control device
US4032896A (en) Microprocessor having index register coupled to serial-coupled address bus sections and to data bus
EP0331487B1 (en) Data transfer control system
US5317750A (en) Microcontroller peripheral expansion bus for access to internal special function registers

Legal Events

Date Code Title Description
S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313117

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071228

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081228

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081228

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091228

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101228

Year of fee payment: 9

EXPY Cancellation because of completion of term