JP2871171B2 - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JP2871171B2
JP2871171B2 JP3152681A JP15268191A JP2871171B2 JP 2871171 B2 JP2871171 B2 JP 2871171B2 JP 3152681 A JP3152681 A JP 3152681A JP 15268191 A JP15268191 A JP 15268191A JP 2871171 B2 JP2871171 B2 JP 2871171B2
Authority
JP
Japan
Prior art keywords
data
transfer
dma
block
control
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
JP3152681A
Other languages
Japanese (ja)
Other versions
JPH04260955A (en
Inventor
勝巳 三浦
裕子 三平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP3152681A priority Critical patent/JP2871171B2/en
Publication of JPH04260955A publication Critical patent/JPH04260955A/en
Application granted granted Critical
Publication of JP2871171B2 publication Critical patent/JP2871171B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Bus Control (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明はマイクロコンピュータに
関し、特にダイレクトメモリアクセス(DMA)コント
ローラを内蔵したマイクロコンピュータに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer, and more particularly to a microcomputer having a built-in direct memory access (DMA) controller.

【0002】[0002]

【従来の技術】高機能化,高速化の要求の伴ない近年の
マイクロコンピュータは割込みコントローラ,タイマ,
カウンタ,シリアルデータ通信装置等の様々な周辺ユニ
ットを内蔵している。このような周辺ユニットとメモリ
との間でデータ転送が必要となるが、かかるデータ転送
を中央処理装置(CPU)によりソフトウェア(プログ
ラム)の介在で実行するとデータ処理効率が低下する。
そこで、周辺ユニットとメモリとの間のデータ転送をC
PUの代わりにDMAコントローラで実行させることが
一般的である。
2. Description of the Related Art In recent years, microcomputers without demands for higher functions and higher speeds include an interrupt controller, a timer,
Various peripheral units such as a counter and a serial data communication device are built in. Data transfer between such a peripheral unit and the memory is required. However, if such data transfer is executed by a central processing unit (CPU) through software (program), data processing efficiency is reduced.
Therefore, the data transfer between the peripheral unit and the memory is
It is common to have it executed by a DMA controller instead of a PU.

【0003】DMAコントローラは、アクセスすべきメ
モリのアドレス情報をストアするアドレスレジスタ、転
送すべきデータ数をストアするターミナルカウンタレジ
スタ、およびデータ転送方向やメモリアドレスの更新方
向等の制御データをストアする制御レジスタを有し、こ
れらレジスタにはCPUにより必要な情報が初期設定さ
れる。周辺ユニットがDMAコントローラに対しデータ
転送を要求すると、DMAコントローラはCPUからバ
スの使用権を得て周辺ユニットとメモリとの間でデータ
転送を実行する。データ転送が終了するとDMAコント
ローラはバス使用権をCPUに渡し次のデータ転送要求
の待ち状態となる。かくして転送されたデータ数がター
ミナルカウンタレジスタに設定されたデータ数に達する
と、DMAコントローラはCPUに対し割込み要求を発
行する。同要求にもとづきCPUは割込み処理ルーチン
を実行し、上記レジスタに対し必要な情報を再設定し、
次のデータ転送を許可状態とする。
A DMA controller has an address register for storing address information of a memory to be accessed, a terminal counter register for storing the number of data to be transferred, and a control for storing control data such as a data transfer direction and a memory address update direction. The CPU has registers, in which necessary information is initialized by the CPU. When the peripheral unit requests data transfer from the DMA controller, the DMA controller obtains the right to use the bus from the CPU and executes data transfer between the peripheral unit and the memory. When the data transfer is completed, the DMA controller passes the right to use the bus to the CPU and waits for the next data transfer request. When the number of transferred data reaches the number of data set in the terminal counter register, the DMA controller issues an interrupt request to the CPU. Based on the request, the CPU executes an interrupt processing routine, resets necessary information to the above registers,
The next data transfer is permitted.

【0004】[0004]

【発明が解決しようとする課題】DMAコントローラ
は、CPUに対して割込み要求を発行した時点から次の
データ転送に必要な情報が再設定される時点までの期間
はデータ転送禁止状態となるが、この禁止期間に周辺ユ
ニットがデータ転送要求を発行する場合がある。かかる
要求は受け付けられず保留される。データ転送禁止期間
の長さはDMAコントローラからの割込み要求の優先順
位や同コントローラがサポートする転送チャンネル数に
依存しているが、データ転送禁止期間が長いとデータ転
送要求が保留されている周辺回路がその保留期間に再度
データ転送要求を発行する状態となり得る。例えばシリ
アルデータ受信装置では、所定ビット数のデータを受信
する毎にデータ転送要求を発行するが、前のデータがメ
モリに転送されないうちに次のデータの受信が完了する
と前のデータは破壊されてしまい受信オーバーランエラ
ーが発生する。他の例としてシリアルデータ受信装置で
は、次に送信すべきデータが転送されずに送信アンダー
ランエラーが発生する。受信オーバーランエラーや送信
アンダーランエラーはシリアル回線が高速になるぼど発
生しやすくなる。受信/送信データバッファの段数を増
加しても、その段数以上にデータ転送が保留されるとや
はりエラーが生じるし、高速なシリアル回線に見合うよ
うに十分にバッファ段数を増加するとハードウェアの増
大をもたらす。
The DMA controller is in a data transfer prohibited state during a period from when an interrupt request is issued to the CPU to when information required for the next data transfer is reset. The peripheral unit may issue a data transfer request during this prohibition period. Such a request will not be accepted and will be suspended. The length of the data transfer prohibition period depends on the priority of an interrupt request from the DMA controller and the number of transfer channels supported by the controller. May issue a data transfer request again during the suspension period. For example, in a serial data receiving device, a data transfer request is issued every time data of a predetermined number of bits is received, but when the reception of the next data is completed before the previous data is transferred to the memory, the previous data is destroyed. As a result, a reception overrun error occurs. As another example, in a serial data receiving apparatus, data to be transmitted next is not transferred and a transmission underrun error occurs. The reception overrun error and the transmission underrun error are more likely to occur when the speed of the serial line is increased. Even if the number of stages of the receive / transmit data buffer is increased, an error still occurs if data transfer is suspended more than the number of stages, and if the number of buffer stages is increased enough to meet a high-speed serial line, the hardware will increase. Bring.

【0005】したがって、本発明の目的は、現在のデー
タ転送実行状態の終了から次のデータ転送実行状態の開
始までの期間を実質的になくしたDMAコントローラを
有するマイクロコンピュータを提供することにある。
Accordingly, it is an object of the present invention to provide a microcomputer having a DMA controller in which the period from the end of the current data transfer execution state to the start of the next data transfer execution state is substantially eliminated.

【0006】本発明の他の目的は、周辺ユニットからの
データ転送要求の保留によるエラーの発生を防止するこ
とができるDMAコントローラを内蔵したマイクロコン
ピュータを提供することにある。
Another object of the present invention is to provide a microcomputer having a built-in DMA controller capable of preventing occurrence of an error due to suspension of a data transfer request from a peripheral unit.

【0007】本発明のさらに他の目的は、高速シリアル
回線のためのシリアルデータ通信装置をサポートできる
DMAコントローラを内蔵したマイクロコンピュータを
提供することにある。
Another object of the present invention is to provide a microcomputer having a built-in DMA controller capable of supporting a serial data communication device for a high-speed serial line.

【0008】[0008]

【課題を解決するための手段】本発明のマイクロコンピ
ュータは、DMA転送要求信号を発行し、かつ処理完了
時にDMA転送終了指示信号を発行し、かつ前記処理完
了時又は状態退避指示信号の検出時に内部状態を退避し
記憶する状態退避記憶手段を含む周辺回路と、少なくと
もDMA転送継続指示情報を含むDMA制御情報記憶部
とDMA転送回数記憶部とを含む第1、第2、第3の3
種のDMA制御記憶手段と、前記DMA転送要求信号を
検知すると前記周辺回路とメモリとの間でDMA転送を
行うとともに前記第2のDMA制御記憶手段内のDMA
転送回数記憶部の値を更新し、前記更新の結果所定の値
になるかまたは前記DMA転送終了指示信号を検知する
かのいずれかが発生しかつ前記第2のDMA制御記憶手
段内のDMA転送継続指示情報が有効であれば前記第2
のDMA制御記憶手段の内容を前記第3のDMA制御記
憶手段内に、続いて前記第1のDMA制御記憶手段の内
容を第2のDMA制御記憶手段に転送するとともに前記
状態退避指示信号を発行する制御手段とを有するDMA
転送手段とを有することを特徴としている。
A microcomputer according to the present invention issues a DMA transfer request signal, issues a DMA transfer end instruction signal when processing is completed, and outputs a DMA transfer end instruction signal when the processing is completed or when a state saving instruction signal is detected. Peripheral circuit including state saving storage means for saving and storing the internal state, and first, second, and third three units including a DMA control information storage unit including at least DMA transfer continuation instruction information and a DMA transfer count storage unit.
DMA control storage means, and when the DMA transfer request signal is detected, DMA transfer is performed between the peripheral circuit and the memory, and DMA in the second DMA control storage means is performed.
The value of the number-of-transfers storage unit is updated, and either the result of the update becomes a predetermined value or the DMA transfer end instruction signal is detected, and the DMA transfer in the second DMA control storage means is performed. If the continuation instruction information is valid, the second
The contents of the DMA control storage means are transferred into the third DMA control storage means, and then the contents of the first DMA control storage means are transferred to the second DMA control storage means, and the state saving instruction signal is issued. Having control means for performing
Transfer means.

【0009】さらに、本発明のマイクロコンピュータ
は、前記中央処理手段がデータ処理を行うための第1の
バスと、前記DMA転送手段がDMA転送を行うための
第2のバスとをさらに有することを特徴としている。
Further, the microcomputer according to the present invention further comprises a first bus for the central processing means to perform data processing, and a second bus for the DMA transfer means to perform DMA transfer. Features.

【0010】[0010]

【0011】[0011]

【実施例】以下、図面を参照しながら本発明の実施例を
詳述する。
Embodiments of the present invention will be described below in detail with reference to the drawings.

【0012】図1は本発明の第1実施例によるマイクロ
コンピュータ100を用いて構成されたマイクロコンピ
ュータシステムを示すブロック図である。本マイクロコ
ンピュータ100はCPU10と周辺ユニットとしての
DMAコントローラ(DMAC)20,割込みコントロ
ーラ(INTC)30,シリアルデータ受信ユニット4
0およびタイマ,カウンタ等の他のユニット50を有す
る。これらは同一の半導体基板上に構成され内部バス6
0で相互接続されている。
FIG. 1 is a block diagram showing a microcomputer system constituted by using a microcomputer 100 according to a first embodiment of the present invention. The microcomputer 100 includes a CPU 10, a DMA controller (DMAC) 20, an interrupt controller (INTC) 30, and a serial data receiving unit 4 as peripheral units.
0 and other units 50 such as a timer and a counter. These are formed on the same semiconductor substrate and have an internal bus 6
0 interconnected.

【0013】CPU10はシステムバス130を介して
接続されたプログラムメモリ110から命令をフェッチ
して実行しオペランドデータに対する処理を行う。シス
テムバス130にはデータメモリ120も接続されてい
る。
The CPU 10 fetches and executes an instruction from a program memory 110 connected via a system bus 130 to perform processing on operand data. The data memory 120 is also connected to the system bus 130.

【0014】INTC30はDMAC20および周辺ユ
ニット50からの割込み要求信号23、51を含む複数
の割込み要求信号を受け、二つ以上の割込み要求が同時
に発生した場合は予じめ定められた優先順位に従ってそ
のうちの一つを選択し、CPU10に対し割込み処理要
求信号31を発生するとともに割込みベクタ番号32を
供給する。かかる割込み処理要求にもとづきCPU10
は実行中のプログラム処理を一時中断し、そのときのプ
ログラムカウンタ,プログラムステータスワード,汎用
レジスタ(すべて図示せず)をセーブして割込み処理ル
ーチンを実行する。
The INTC 30 receives a plurality of interrupt request signals including the interrupt request signals 23 and 51 from the DMAC 20 and the peripheral unit 50, and when two or more interrupt requests occur simultaneously, the interrupt request is performed according to a predetermined priority. And generates an interrupt processing request signal 31 to the CPU 10 and supplies the interrupt vector number 32 to the CPU 10. Based on the interrupt processing request, the CPU 10
Suspends the program processing being executed, saves the program counter, program status word, and general-purpose registers (all not shown) at that time and executes the interrupt processing routine.

【0015】シリアルデータ受信ユニット40は、外部
からシリアル回線150を介して供給されるシリアルデ
ータを受信する。シリアルデータはシフトレジスタ40
5に順に取り込まれる。所定ビット数(例えば、8ビッ
ト)のデータを受信すると、同データはバッファレジス
タ404に転送され、シフトレジスタ405は次のシリ
アルデータの受信に入る。バッファレジスタ404にデ
ータが転送されると、受信制御部401はDMA転送要
求信号42をアクティブにしDMA20にデータ転送を
要求する。バッファレジスタ404に転送されたデータ
が、シリアルデータ転送の1フレームの終了を示すEO
F(End Of Flame)コードのときは、ブロ
ック切換信号41をアクティブにしてDMAC20にブ
ロック切換を要求する。EOFコードを受信したことや
受信データにエラーが発生したことはステータスレジス
タ402に記録される。受信制御部401はDMAC2
0からのデータ出力指示信号25に同期してバッファレ
ジスタ404の内容を内部バス60に出力する。また、
DMAC20からのステータスセーブ指示信号24に応
答してステータスレジスタ402内の内容をステータス
セーブレジスタ403にセーブする。
The serial data receiving unit 40 receives serial data supplied from outside via a serial line 150. Serial data is stored in the shift register 40
5 in turn. When data of a predetermined number of bits (for example, 8 bits) is received, the data is transferred to the buffer register 404, and the shift register 405 starts receiving the next serial data. When the data is transferred to the buffer register 404, the reception control unit 401 activates the DMA transfer request signal 42 and requests the DMA 20 to transfer data. The data transferred to the buffer register 404 is EO indicating the end of one frame of the serial data transfer.
In the case of the F (End Of Frame) code, the block switching signal 41 is activated to request the DMAC 20 to perform block switching. The reception of the EOF code and the occurrence of an error in the received data are recorded in the status register 402. The reception control unit 401 is a DMAC2
The contents of the buffer register 404 are output to the internal bus 60 in synchronization with the data output instruction signal 25 from 0. Also,
The contents in the status register 402 are saved in the status save register 403 in response to the status save instruction signal 24 from the DMAC 20.

【0016】DMAC20は転送制御部201を有し、
同制御部201はカレントレジスタブロック202にス
トアされている制御情報にもとづき、ユニット40とメ
モリ120間のDMAデータ転送を実行する。レジスタ
ブロック202にストアされている制御情報は、データ
の転送回数を示す転送回数情報、メモリ120のアクセ
スアドレスを示すメモリアドレス情報、および制御/状
態情報を有する。制御/状態情報には、DMAデータ転
送の方向(すなわち、メモリから周辺ユニットあるいは
周辺ユニットからメモリ、本実施例ではシリアル受信ユ
ニット40からメモリ120への転送)、メモリアドレ
スの更新方向、DMA転送要求を受け付けてよいかどう
かを示す転送要求受付許可情報を有し、さらに、DMA
転送を次のブロックへ続けて実行してよいかどうかを示
すブロック継続指示情報を含んでいる。DMAC20は
さらに本発明に従って、ネクストレジスタブロック20
3およびセーブレジスタブロック204を有する。ネク
ストレジスタブロック203には現在のDMA転送の終
了後に次に実行すべきDMA転送に必要な情報、すなわ
ち、次のDMA転送の転送回数情報、メモリアドレス情
報および制御/状態情報をストアする。セーブレジスタ
ブロック204はカレントレジスタブロック202の転
送回数情報と制御/状態情報とがセーブされる。転送制
御部201はCPU10に対してホールド要求(HLD
RQ)信号21を出力しCPU10からホールドアクノ
レッジ(HLDACK)信号22を受けてバス60、1
30の使用権を得、シリアル受信ユニット40からメモ
リ120へデータ転送を実行する。データ転送を実行す
る毎にカレントレジスタブロック202の転送回数は1
減算されるとともにメモリアドレス202が更新され
る。転送回数が0となる、すなわち転送したデータ数が
現在のDMA転送により指定されたデータ数に達するか
又はユニット40からFOFコード受信にもとづくブロ
ックの切換要求信号41がアクティブとなると、カレン
トレジスタブロック202の転送回数情報と制御/状態
情報がセーブレジスタブロック204にセーブされる。
そして、セーブした制御/状態情報に含まれるブロック
継続指示情報が「継続」を指示しているときは、ネクス
トレジスタブロック203の内容がカレントレジスタブ
ロック202にコピーされ、割込み要求信号23が発生
される。ブロック継続指示情報が「非継続」を指示して
いるときは、ネクストレジスタブロック203からカレ
ントレジスタブロック232へのコピーが行われること
なく割込み要求信号23が発生される。
The DMAC 20 has a transfer control unit 201,
The control unit 201 executes DMA data transfer between the unit 40 and the memory 120 based on the control information stored in the current register block 202. The control information stored in the register block 202 includes transfer count information indicating a data transfer count, memory address information indicating an access address of the memory 120, and control / status information. The control / status information includes the direction of the DMA data transfer (that is, the transfer from the memory to the peripheral unit or from the peripheral unit to the memory, from the serial receiving unit 40 to the memory 120 in this embodiment), the update direction of the memory address, the DMA transfer request Has transfer request acceptance permission information indicating whether or not to accept DMA.
It includes block continuation instruction information indicating whether transfer can be continued to the next block. DMAC 20 further includes a next register block 20 in accordance with the present invention.
3 and a save register block 204. The next register block 203 stores information necessary for the next DMA transfer to be executed after the end of the current DMA transfer, that is, information on the number of transfers of the next DMA transfer, memory address information, and control / status information. The save register block 204 saves the transfer count information and the control / state information of the current register block 202. The transfer control unit 201 issues a hold request (HLD
RQ) signal 21 and receives a hold acknowledge (HLDACK) signal 22 from the CPU 10 to
Then, the data transfer from the serial receiving unit 40 to the memory 120 is executed. Each time data transfer is performed, the number of transfers of the current register block 202 is 1
At the same time, the memory address 202 is updated. When the number of transfers becomes 0, that is, when the number of transferred data reaches the number of data specified by the current DMA transfer or when the block switching request signal 41 based on the reception of the FOF code from the unit 40 becomes active, the current register block 202 Is saved in the save register block 204.
When the block continuation instruction information included in the saved control / state information indicates “continuation”, the contents of the next register block 203 are copied to the current register block 202, and the interrupt request signal 23 is generated. . When the block continuation instruction information indicates “non-continuation”, the interrupt request signal 23 is generated without copying from the next register block 203 to the current register block 232.

【0017】データメモリ120はCPU10によって
処理されるべきおよび処理されたオペランドデータをス
トアするが、さらに、シリアルデータ受信ユニット40
によって受信されたデータが転送されるべきN個のブロ
ック122,124,…,126を有する。これらブロ
ックの夫々に対応してブロック制御データエリア12
3,125,…,127が設けられている。ブロック制
御データエリアの夫々は、対応するブロックのサイズを
示す転送回数データエリアと、対応するブロックの先頭
アドレスを示すメモリアドレスデータエリアと、対応す
るブロックと受信ユニット40間のDMA転送における
制御/状態データエリアと、受信ユニット40のステー
タスセーブレジスタ403の内容が転送されるべき周辺
状態セーブデータエリア、他のブロックのための制御デ
ータエリアの先頭アドレスをストアするネクストアドレ
スデータエリアとを有する。データメモリ120はさら
に制御データエリアアドレスをストア領域121を有す
る。
The data memory 120 stores operand data to be processed and processed by the CPU 10, and further stores the serial data receiving unit 40.
Has N blocks 122, 124,... The block control data area 12 corresponds to each of these blocks.
, 127 are provided. Each of the block control data areas includes a transfer count data area indicating the size of a corresponding block, a memory address data area indicating a head address of the corresponding block, and control / status in DMA transfer between the corresponding block and the receiving unit 40. It has a data area, a peripheral state save data area to which the contents of the status save register 403 of the receiving unit 40 are to be transferred, and a next address data area for storing a head address of a control data area for another block. The data memory 120 further has a control data area address storage area 121.

【0018】以下、図2および図3に示した動作フロー
も参照して本マイクロコンピュータの具体的動作を詳述
する。
Hereinafter, the specific operation of the microcomputer will be described in detail with reference to the operation flow shown in FIGS.

【0019】CPUはDMAC20を起動する前に初期
設定を行なう。すなわち、第1乃至第Nブロック12
2,124,…,126をデータメモリ120に割り当
●、対応するブロック制御データエリア123,12
5,…127に前述してデータを書込む。なお、第1乃
至第(N−1)ブロック制御データエリアのDMA制御
/状態データにおけるブロック継続指示情報は「継続」
を指示し、第Nブロック制御データエリアのそれは「非
継続」を指示しているとする。また、第1ブロック制御
データエリアのネクストアドレスデータには第2ブロッ
ク制御データエリアの先頭番地が、第2ブロック制御デ
ータエリアのそれには第3ブロック制御データエリアの
先頭番地が、そして第(N−1)ブロック制御データエ
リアのそれには第Nブロック制御データエリアの先頭番
地が設定されるとする。制御データエリアアドレス12
1は第1ブロック制御データエリア123の先頭番地が
設定される。CPU40はまたシリアルデータ受信ユニ
ット40にシリアルデータ受信に必要な情報、例えばシ
リアル回線150のスピードを設定しシリアル受信を許
可する。そして、DMAC20のネクストレジスタブロ
ック203に第2ブロック制御データエリア125の転
送回数データ,メモリアドレスデータ,DMA制御/状
態データを設定し、カレントレジスタブロック202に
第1ブロック制御データエリア123の転送回数デー
タ,メモリアドレスデータ,DMA制御/状態データを
設定してDMAC20を起動する。CPU10はひき続
きプログラムメモリ10から命令をフェッチし実行す
る。
The CPU performs an initial setting before activating the DMAC 20. That is, the first to Nth blocks 12
, 126 are assigned to the data memory 120, and the corresponding block control data areas 123, 12
Data is written in 5,... 127 as described above. The block continuation instruction information in the DMA control / status data of the first to (N-1) th block control data areas is "continue".
And that of the Nth block control data area indicates "non-continuation". Also, the next address data of the first block control data area includes the start address of the second block control data area, the second block control data area includes the start address of the third block control data area, and the (N- 1) It is assumed that the start address of the Nth block control data area is set in the block control data area. Control data area address 12
1 is set to the start address of the first block control data area 123. The CPU 40 also sets information necessary for serial data reception in the serial data receiving unit 40, for example, the speed of the serial line 150, and permits serial reception. Then, the transfer count data of the second block control data area 125, the memory address data, and the DMA control / state data are set in the next register block 203 of the DMAC 20, and the transfer count data of the first block control data area 123 is set in the current register block 202. , Memory address data and DMA control / status data are set and the DMAC 20 is started. CPU 10 subsequently fetches and executes instructions from program memory 10.

【0020】一方、起動されたDMAC20は図2に示
した動作フローに従って動作する。すなわち、シリアル
データ受信ユニット40からのEOFコード受信にとも
なうブロック切換要求信号41がアクティブかどうか調
べ(251)、データ転送要求信号42がアクティブか
どうか調べる(252)。
On the other hand, the activated DMAC 20 operates according to the operation flow shown in FIG. That is, it is checked whether the block switching request signal 41 accompanying the reception of the EOF code from the serial data receiving unit 40 is active (251), and it is checked whether the data transfer request signal 42 is active (252).

【0021】シリアルデータ受信ユニット40も起動さ
れており、シリアル回線150を介して送信されるシリ
アルデータを受信している。所定ビット数のデータを受
信すると、そのデータがEOFコードか通常のデータか
を調べ、信号41か又は42を発生する。
The serial data receiving unit 40 is also activated, and receives serial data transmitted via the serial line 150. When data of a predetermined number of bits is received, it is checked whether the data is an EOF code or normal data, and a signal 41 or 42 is generated.

【0022】シリアルデータ受信ユニット40がデータ
転送要求信号42を発生したとすると、転送制御部20
1はHLDRQ信号21をアクティブにしてバス60、
130の使用権をCPU10に要求する(253)。C
PU10は実行中のプログラム処理を一時中断し内部を
ホールド状態としてHLDACK信号22をDMAC2
0に返す。転送制御部201はアクティブレベルのHL
DACK信号22を検出すると(254)、カレントレ
ジスタブロック202のメモリアドレスをバス60、1
30を介してデータメモリ120に供給するとともにデ
ータ出力指示信号25を発生してシリアルデータ受信ユ
ニット40に受信データをバス60に出力せしめる。か
くして、受信データはメモリ120内の第1ブロック1
22の先頭アドレスに転送される(255)。転送後、
HLDRQ信号21を取下げバス使用権をCPU10に
戻す。転送制御部201はカレントレジスタブロック2
02のメモリアドレスを更新して書き戻し、転送回数デ
ータから1つ減算して書き戻す(257)。所望なら更
新したアドレスを第1ブロック122のアクセスアドレ
スとしてもよい。転送制御部201は減算した転送回数
が零かどうか判定し(258)、零でなければステップ
251に戻る。かかる処理はデータ転送要求信号42が
アクティブになる毎に実行される。
If the serial data receiving unit 40 generates a data transfer request signal 42, the transfer control unit 20
1 activates the HLDRQ signal 21 to activate the bus 60,
The right to use 130 is requested to the CPU 10 (253). C
The PU 10 temporarily suspends the program processing being executed, puts the inside in a hold state, and outputs the HLDACK signal 22 to the DMAC 2
Return to 0. The transfer control unit 201 has an active level HL
When the DACK signal 22 is detected (254), the memory address of the current register block 202 is transferred to the bus 60, 1
The data is supplied to the data memory 120 through the bus 30 and the data output instruction signal 25 is generated to make the serial data receiving unit 40 output the received data to the bus 60. Thus, the received data is stored in the first block 1 in the memory 120.
It is transferred to the head address of No. 22 (255). After the transfer,
The HLDRQ signal 21 is withdrawn and the right to use the bus is returned to the CPU 10. The transfer control unit 201 sets the current register block 2
02 is updated and rewritten, and one is subtracted from the transfer count data and rewritten (257). If desired, the updated address may be used as the access address of the first block 122. The transfer control unit 201 determines whether the subtracted transfer count is zero (258), and if not, returns to step 251. This process is executed every time the data transfer request signal 42 becomes active.

【0023】ブロック切換要求信号41が発生されるか
又は転送回数が零なる、すなわち、第1ブロック122
が受信データで満たされると、ステップ259に処理が
移る。すなわち、カレントレジスタブロック202の転
送回数情報と制御/状態情報とがセーブレジスタブロッ
ク204にセーブされる。転送制御部201はセーブさ
れた制御/状態情報の中のブロック継続指示情報を判定
する(260)。本説明では同情報は「継続」を指示し
ているので、ステップ261に移り、ネクストレジスタ
ブロック203の内容がカレントレジスタブロック20
2にコピーされる。かくして、DMAC20は、CPU
10による再設定を待つことなく、シリアルデータ受信
ユニット40とメモリ120の第2ブロック124との
DMA転送を実行できる状態となる。転送制御部201
はこの後、周辺セーブ信号24と割込み要求信号23を
発生し、ステップ251に移行する。したがって、この
後、シリアルデータ受信ユニット40がデータ転送要求
信号42を発生すると、受信データは第2ブロック12
4に転送されることになる。
The block switching request signal 41 is generated or the number of transfers becomes zero, that is, the first block 122
Is satisfied with the received data, the process proceeds to step 259. That is, the transfer count information and the control / state information of the current register block 202 are saved in the save register block 204. The transfer control unit 201 determines the block continuation instruction information in the saved control / state information (260). In this description, since the information indicates “continuation”, the process proceeds to step 261 and the contents of the next register block 203 are stored in the current register block 20.
2 Thus, the DMAC 20 has a CPU
The DMA transfer between the serial data receiving unit 40 and the second block 124 of the memory 120 can be executed without waiting for resetting by 10. Transfer control unit 201
Generates a peripheral save signal 24 and an interrupt request signal 23, and shifts to step 251. Therefore, when the serial data receiving unit 40 subsequently generates the data transfer request signal 42, the received data is transmitted to the second block 12
4 will be transferred.

【0024】一方、周辺セーブ信号24に応答して受信
制御部401はステータスレジスタ402の内容をステ
ータスセーブレジスタ403にセーブする。
On the other hand, in response to the peripheral save signal 24, the reception control unit 401 saves the contents of the status register 402 in the status save register 403.

【0025】INTC30はDMAC20からの割込み
要求信号23に応答してCPU10に割込み処理要求を
発生する。CPU10は同要求にもとづきプログラム実
行を中断し、中断したプログラム実行の再開に必要な情
報をデータメモリ120のスタック領域(図示せず)に
退避させ、図3の割込み処理ルーチンを実行する。
The INTC 30 issues an interrupt processing request to the CPU 10 in response to the interrupt request signal 23 from the DMAC 20. The CPU 10 suspends the program execution based on the request, saves information necessary for resuming the suspended program execution to a stack area (not shown) of the data memory 120, and executes the interrupt processing routine of FIG.

【0026】この割込み処理ルーチンにおいて、CPU
10はまず受信ユニット40内のステータスセーブレジ
スタ132からセーブされたステータス情報を読込み
(301)、受信データや受信状態にエラーが発生して
いるかどうかをチェックする(302)。エラーが発生
しておれば、エラー処理303として、DMAC20お
よびデータ受信ユニット40の動作を止め、シリアルデ
ータの送信元にデータの再送信を要求するとともにDM
AC20,ユニット40の再設定を行なう。エラー発生
がなければ、ステータスセーブレジスタ403の内容を
第1ブロック制御データエリア123の周辺状態セーブ
データエリアに転送し、DMA20のセーブレジスタブ
ロック204の内容を同エリア123の転送回数データ
エリアおよびDMA制御/状態データエリアに転送する
(304)。この処理のために、制御データエリアアド
レス121としてデータエリア123の先頭アドレスが
ストアされており、同アドレスと各ブロックにおける各
データエリアの予じめ定まったオフセット量とから各デ
ータエリアのアドレスが算出される。勿論、DMAC2
0および受信ユニット40内の各レジスタのアドレスは
予じめ定まっている。そして、第1ブロック制御データ
エリア123のネクストアドレスデータ、すなわち第2
ブロック制御データエリアの先頭アドレスが制御データ
エリアアドレス121として設定される。次に、第1ブ
ロック制御データエリア123にセーブされたDMA制
御/状態データのブロック継続指示情報を判定する(3
05)。本説明では同情報は「継続」を指示しているの
で、新たに設定された制御データエリアアドレス121
と第2ブロック制御データエリア125内のネクストア
ドレスデータとを利用して、第3ブロック制御データエ
リア(図示せず)内の転送回数データ,メモリアドレス
データおよびDMA制御/状態データをDMAC20の
ネクストレジスタブロック203に転送する(30
6)。
In this interrupt processing routine, the CPU
10 first reads the saved status information from the status save register 132 in the receiving unit 40 (301), and checks whether an error has occurred in the received data or the receiving state (302). If an error has occurred, as an error process 303, the operations of the DMAC 20 and the data receiving unit 40 are stopped, a request is made to the source of serial data for retransmission of data, and
The AC 20 and the unit 40 are reset. If no error occurs, the contents of the status save register 403 are transferred to the peripheral state save data area of the first block control data area 123, and the contents of the save register block 204 of the DMA 20 are transferred to the transfer count data area and DMA control of the area 123. / Transfer to the status data area (304). For this processing, the head address of the data area 123 is stored as the control data area address 121, and the address of each data area is calculated from the same address and a predetermined offset amount of each data area in each block. Is done. Of course, DMAC2
The addresses of 0 and each register in the receiving unit 40 are predetermined. Then, the next address data of the first block control data area 123, that is, the second address data,
The head address of the block control data area is set as the control data area address 121. Next, block continuation instruction information of the DMA control / status data saved in the first block control data area 123 is determined (3.
05). In the present description, the information indicates “continuation”, so that the newly set control data area address 121
And the next address data in the second block control data area 125, and transfers the transfer count data, memory address data, and DMA control / status data in the third block control data area (not shown) to the next register of the DMAC 20. Transfer to block 203 (30
6).

【0027】図2に戻って、ステップ260でブロック
継続指示情報が「非継続」を指示しているときは、転送
制御部201はネクストレジスタブロック203の内容
をカレントレジスタ202にコピーすることなく信号2
4と23を発生し、DMAC20はCPU10にはデー
タ再設定の待ち状態となりDMA転送禁止状態となる。
したがって、図3に示したCPUの割込み処理ルーチン
では、ステップ305の次はステップ307に移り、第
2および第3ブロック制御データエリア内の転送回数デ
ータ,メモリアドレスデータおよびDMA制御/状態デ
ータがカレントレジスタブロック202およびネクスト
レジスタブロック203にそれぞれ転送され、DMAC
20が再起動される。
Returning to FIG. 2, when the block continuation instruction information indicates "non-continuation" in step 260, the transfer control unit 201 outputs a signal without copying the contents of the next register block 203 to the current register 202. 2
4 and 23 are generated, and the DMAC 20 waits for the CPU 10 to reset the data and enters the DMA transfer prohibited state.
Accordingly, in the interrupt processing routine of the CPU shown in FIG. 3, the process proceeds from step 305 to step 307, in which the transfer count data, memory address data, and DMA control / status data in the second and third block control data areas are current. Are transferred to the register block 202 and the next register block 203, respectively.
20 is restarted.

【0028】ステップ306又は307の実行後、CP
U10は第1ブロック122に転送されたデータに対す
る処理を実行する(308)。実行後、データメモリ1
20から退避しておいた情報を復帰し、中断されていた
プログラムを再開する。
After execution of step 306 or 307, the CP
U10 performs processing on the data transferred to the first block 122 (308). After execution, data memory 1
The information saved from step 20 is restored, and the suspended program is resumed.

【0029】各ブロック制御データエリアにはセーブレ
ジスタブロック204の転送回数情報も転送されるの
で、上述したブロック切換がFOEコードの受信による
ブロック切換要求信号41により実行された場合でも、
各ブロックにいくつのデータが転送されているのか判定
できる。
Since the transfer count information of the save register block 204 is also transferred to each block control data area, even if the above-described block switching is executed by the block switching request signal 41 due to the reception of the FOE code,
It is possible to determine how many data are transferred to each block.

【0030】このように、ブロック継続指示情報を「継
続」にしておけば、所定数のデータが転送されるか又は
FOEコードが受信されても、DMAC20は次のブロ
ックへのデータ転送許可状態となるので、受信オーバー
ランエラーが発生することを防止できる。
As described above, if the block continuation instruction information is set to “continue”, even if a predetermined number of data is transferred or the FOE code is received, the DMAC 20 sets the data transfer permission state to the next block. Therefore, occurrence of a reception overrun error can be prevented.

【0031】本マイクロコンピュータ100がシリアル
データ送信ユニットも内蔵するときは、同ユニットのた
めのカレントレジスタブロック,ネクストレジスタブロ
ックおよびセーブレジスタブロックをDMAC20内に
さらに用意し、送信ユニットと受信ユニットのためのデ
ータ転送を時分割的に実行することにより受信オーバー
ランエラーおよび送信アンダーランエラーの両方とも防
止できる。
When the microcomputer 100 also incorporates a serial data transmission unit, a current register block, a next register block and a save register block for the same unit are further prepared in the DMAC 20 to provide a transmission unit and a reception unit. Executing the data transfer in a time-division manner can prevent both the reception overrun error and the transmission underrun error.

【0032】図4を参照すると、本発明の第2実施例に
よるマイクロコンピュータ101は、シリアルデータ受
信ユニット40とローカルメモリ400との間のDMA
転送を実行するDMAC20を有する。なお、図1と同
一構成部は同じ番号で示して説明を省略する。DMAC
20,受信ユニット40およびローカルメモリ400は
ローカルバス450で相互接続されている。受信ユニッ
ト40がデータ転送要求を発行すると、転送制御部20
1はHLDRQ信号21およびHLDACK信号22に
より、ローカルバス450を管理するプロセッサ(図示
せず)からローカルバスの使用権を得て、受信ユニット
40からローカルメモリ400へデータを転送する。
Referring to FIG. 4, a microcomputer 101 according to a second embodiment of the present invention includes a DMA between a serial data receiving unit 40 and a local memory 400.
It has a DMAC 20 for executing transfer. Note that the same components as those in FIG. 1 are denoted by the same reference numerals and description thereof is omitted. DMAC
20, the receiving unit 40 and the local memory 400 are interconnected by a local bus 450. When the receiving unit 40 issues a data transfer request, the transfer control unit 20
1 obtains the right to use the local bus from a processor (not shown) that manages the local bus 450 based on the HLDRQ signal 21 and the HLDACK signal 22, and transfers data from the receiving unit 40 to the local memory 400.

【0033】かかる構成では、図3に示したCPU10
の割込み処理ルーチンがDMA転送により一時中断され
ることがないので、CPUの処理効率をさらに高めるこ
とができる。ローカルメモリ400もマイクロコンピュ
ータ101の管理下にあり、ローカルバス450をDM
A転送の専用バスとして用いれば、転送制御部201は
信号21,22を用いることなくDMA転送を実行でき
る。
In such a configuration, the CPU 10 shown in FIG.
This interrupt processing routine is not temporarily interrupted by the DMA transfer, so that the processing efficiency of the CPU can be further improved. The local memory 400 is also under the control of the microcomputer 101, and the local bus 450
When used as a dedicated bus for A transfer, the transfer control unit 201 can execute DMA transfer without using the signals 21 and 22.

【0034】なお、図3の割込み処理ルーチンはプログ
ラムメモリ110にストアされていてユーザーが比較的
自由に変更できる。たとえば、エラーチェック(30
2)およびデータ処理(308)はすべてのブロック1
22,124,…,126へのデータ転送終了後に一括
して実行してもよい。ただし、ステップ304乃至30
6はブロック継続を指示する限り実行した方が好まし
い。
The interrupt processing routine of FIG. 3 is stored in the program memory 110 and can be changed relatively freely by the user. For example, error check (30
2) and data processing (308) for all blocks 1
, 126 may be executed collectively after the data transfer to data transfer to the memory devices 22, 124,... However, steps 304 to 30
6 is preferably executed as long as it instructs block continuation.

【0035】ところで、図3の割込み処理ルーチンの実
行にあたっては、まずCPU10は中断されたプログラ
ム実行のその時点での状態、すなわちプログラムカウン
タ(PC)、プログラムステータスワード(PSW)お
よび汎用レジスタの内容をデータメモリ120にセーブ
し、割込み処理ルーチンの実行後にセーブした内容を復
帰してプログラムを再開させるという所謂オーバーヘッ
ドを伴なう。かかるオーバーヘッドをなくしまたDMA
C20からの割込み要求にもとづく処理のうちの定格的
なものをマイクロコンピュータ自体があたかもハードウ
ェアの一部として実行すれば、処理効率はさらに高まり
またユーザーのプログラム負担を軽減することができ
る。
In executing the interrupt processing routine shown in FIG. 3, the CPU 10 firstly stores the current state of the interrupted program execution, that is, the contents of the program counter (PC), program status word (PSW) and general-purpose registers. There is a so-called overhead of saving the data in the data memory 120 and restoring the saved contents after executing the interrupt processing routine to restart the program. Eliminate such overhead and use DMA
If the microcomputer itself executes the rated processing based on the interrupt request from C20 as if it were a part of the hardware, the processing efficiency can be further increased and the user's program load can be reduced.

【0036】そのための構成を第3実施例として図5に
示す。なお、図5には本実施例では、マイクロコンピュ
ータのCPU15とINTC30のみが示されており、
その他の構成は図1と同一であるので省略している。本
CPU15はマイクロプログラム制御方法を採用してあ
り、プログラムメモリ110にストアされた各命令は対
応する一連のマイクロ命令(すなわち、マイクロプログ
ラム)を実行することによりこの機能が達成される。マ
イクロプログラムはユーザーからは見えないので、ユー
ザーにとっては完全にハードウェアの一部である。
FIG. 5 shows a configuration for this purpose as a third embodiment. FIG. 5 shows only the CPU 15 and the INTC 30 of the microcomputer in this embodiment.
Other configurations are the same as those in FIG. The CPU 15 employs a microprogram control method, and each function stored in the program memory 110 executes a corresponding series of microinstructions (that is, microprograms) to achieve this function. The microprogram is completely invisible to the user because it is invisible to the user.

【0037】すなわち、プログラムカウンタ(PC)1
51の内容はアドレスバスドライバ153を介してバス
60、130に転送され、それによってプログラムメモ
リ110から読み出された命令はデータバッファ154
を介して命令レジスタ(IR)155に一時ストアされ
る。IR155からの命令はデコーダ156で解読され
て実行部158に供給される。実行部はマイクロプログ
ラムメモリ1585を有し、マイクロプログラムポイン
タ1584に解読された命令が有するマイクロアドレス
がセットされることにより、一連のマイクロ命令が読み
出され実行される。実行部158はさらに算術論理演算
ユニット(ALU)1581、その演算状態を一時スト
アするプログラムステータスワード(PSW)158
2、テンポラリレジスタ1583を有し、汎用レジスタ
157とも協働して一連のマイクロ命令が実行されるこ
とにより、IR155にストアされた命令の機能が遂行
される。実行部158から出力される制御信号群159
は命令実行のためのシーケンスコントロール信号であ
る。
That is, the program counter (PC) 1
51 is transferred to the buses 60 and 130 via the address bus driver 153, so that the instruction read from the program memory 110 is transferred to the data buffer 154.
Is temporarily stored in the instruction register (IR) 155 via The instruction from the IR 155 is decoded by the decoder 156 and supplied to the execution unit 158. The execution unit has a microprogram memory 1585, and by setting the microaddress of the decoded instruction to the microprogram pointer 1584, a series of microinstructions is read and executed. The execution unit 158 further includes an arithmetic logic unit (ALU) 1581 and a program status word (PSW) 158 for temporarily storing the operation state.
2. It has a temporary register 1583 and executes a series of micro-instructions in cooperation with the general-purpose register 157, thereby performing the function of the instruction stored in the IR 155. Control signal group 159 output from execution unit 158
Is a sequence control signal for instruction execution.

【0038】マイクロプログラムメモリ1585には本
実施例に従ってマクロサービスマイクロプログラム15
86がストアされている。マクロサービスについては後
で詳述する。このマクロサービスプログラム1586
は、INTC30からの割込み要求がマクロサービス要
求を指定しているときに起動される。
The micro program memory 1585 stores the macro service micro program 15 according to the present embodiment.
86 are stored. The macro service will be described later in detail. This macro service program 1586
Is activated when the interrupt request from the INTC 30 specifies a macro service request.

【0039】すなわち、INTC30は、DMAC20
からの割込み要求をマクロサービスとして処理するか通
常のベクタ割込みとして処理するかを指定するフラグ3
3を有している。フラグ33がセットされたときはマク
ロサービスが指定され、クリアされたときにはベクタ割
込みが指定される。INTC30は、割込み要求を受け
ると、実行部158に割込み処理要求信号31を発生す
るとともに割込みモード情報32−1をIR155にス
トアする。さらにベクタ番号情報32−2を実行部15
8に供給する。割込みモード情報32−1を解読した結
果、ベクタ割込みが指定されておれば、ベクタ番号情報
32−2から割込み処理ルーチンの先頭番地を得、PC
151,PSW1582,汎用レジスタ157の内容を
データメモリ120にセーブして、PCに上記先頭番地
を設定して割込み処理ルーチンを実行する。一方、割込
みモード情報32−1がマクロサービスを指定している
ときは、ベクタ番号32−2からマクロサービスマイク
ロプログラム1582の先頭マイクロアドレスを得、こ
れをポインタ1584に設定してマイクロプログラムを
実行する。このとき、PC151,PSW1582,汎
用レジスタ157の内容はセーブされずにそのままの状
態とされ、かつそれらの内容の更新は禁止される。
That is, the INTC 30 is the DMAC 20
Flag 3 that specifies whether to process an interrupt request from the server as a macro service or as a normal vector interrupt
Three. When the flag 33 is set, the macro service is specified, and when it is cleared, the vector interrupt is specified. When receiving the interrupt request, the INTC 30 generates an interrupt processing request signal 31 in the execution unit 158 and stores the interrupt mode information 32-1 in the IR 155. Further, the execution unit 15 stores the vector number information 32-2.
8 As a result of decoding the interrupt mode information 32-1, if a vector interrupt is designated, the start address of the interrupt processing routine is obtained from the vector number information 32-2, and
151, the contents of the PSW 1582, and the contents of the general-purpose register 157 are saved in the data memory 120, the start address is set in the PC, and the interrupt processing routine is executed. On the other hand, when the interrupt mode information 32-1 specifies the macro service, the head micro address of the macro service micro program 1582 is obtained from the vector number 32-2, and this is set in the pointer 1584 to execute the micro program. . At this time, the contents of the PC 151, the PSW 1582, and the general-purpose register 157 are left unsaved without being saved, and updating of the contents is prohibited.

【0040】次に、動作につき詳述する。CPU15は
図1で述べたようにプログラムメモリ110にストアさ
れたプログラムを実行することによりデータメモリ12
0,シリアルデータ受信ユニット40およびDMAC2
0に初期設定を実行する。ただし、本実施例では、DM
A制御/状態情報としてマクロサービスの後に続けてC
PU15をベクタ割込み処理に移行させるベクタ割込み
要求指定情報も含まれている。本説明では、第1乃至第
(N−1)ブロックではベクタ割込要求は指定されず、
第Nブロックで指定されている。また、第1乃至第(N
−1)ブロックではブロック継続指定情報は「継続」と
なっており、第Nブロックでは「非継続」となってい
る。さらに本実施例では上記初期設定時にINTC30
のフラグ33はセットされる。かかる初期設定後、CP
U15は引き続きプログラムメモリ110から命令フェ
ッチして実行する。
Next, the operation will be described in detail. The CPU 15 executes the program stored in the program memory 110 as described in FIG.
0, serial data receiving unit 40 and DMAC2
Perform initialization to 0. However, in this embodiment, DM
A control / status information followed by macro service followed by C
Vector interrupt request designation information for causing the PU 15 to shift to vector interrupt processing is also included. In the present description, no vector interrupt request is specified in the first to (N-1) th blocks.
It is specified in the Nth block. In addition, the first to (N
-1) In the block, the block continuation designation information is "continuation", and in the Nth block, it is "non-continuation". Further, in the present embodiment, the INTC 30
Is set. After such initial settings, the CP
U15 continues to fetch and execute instructions from the program memory 110.

【0041】一方、DMAC20は図2で示したフロー
に従って動作しており、所定ビット数のデータが受信さ
れる毎に同データは受信ユニット40からデータメモリ
120の第1ブロック122にDMA転送される。そし
て、カレントレジスタブロック202の転送回数データ
が零となるか又はFOFコードが受信されると、本説明
では、カレントレジスタ202の転送回数データおよび
制御/状態データがセーブレジスタブロック204にセ
ーブされ、ネクストレジスタブロック203の内容がカ
レントレジスタブロック202にコピーされる(図の2
59乃至261)、その後、周辺セーブ指示信号24が
発生されるとともに割込み要求信号23が発生される。
On the other hand, the DMAC 20 operates according to the flow shown in FIG. 2, and every time data of a predetermined number of bits is received, the data is DMA-transferred from the receiving unit 40 to the first block 122 of the data memory 120. . When the transfer count data of the current register block 202 becomes zero or the FOF code is received, in this description, the transfer count data and the control / status data of the current register 202 are saved in the save register block 204, and the next The contents of the register block 203 are copied to the current register block 202 (2 in FIG.
59 to 261), then the peripheral save instruction signal 24 is generated and the interrupt request signal 23 is generated.

【0042】フラグ33がセットされているので、IN
TC30は割込み要求信号23に応答してマクロサービ
スモード指定情報32−1をIR155に転送する。か
くして、マクロサービスマイクロプログラムがPC15
1,PSW1582,汎用レジスタ157の内容をセー
ブすることなくそのままにした状態で起動される。この
マクロサービスマイクロプログラムのフローチャートが
図6に示されている。すなわち、データメモリ120の
制御データエリアアドレス121の値を使ってステータ
スセーブレジスタ403の内容とDMAC20のセーブ
レジスタブロック204の内容が第1ブロック制御デー
タエリア123の対応する領域にそれぞれ転送される
(601)。セーブされたDMA制御/状態データのう
ちのブロック継続指示情報がチェックされる(60
2)。本説明では「継続」指示となっているので、第1
ブロック制御データエリア123のネクストアドレスデ
ータがエリアアドレス121として設定され(60
3)、同アドレスと第2ブロック制御データエリア12
5のネクストアドレスデータ2を利用して、第3ブロッ
ク制御データエリアの転送回数データ,メモリアドレス
データおよびDMA制御/状態データがDMAC20の
ネクストレジスタブロック203に転送される(60
4)。この後、第1ブロック制御データエリア123に
転送されたDMA制御/状態データのうちのベクタ割込
み要求指示情報がチェックされる(605)。本説明で
は、ベクタ割込み要求をしないので、マクロサービスを
終了する。
Since the flag 33 is set, IN
The TC 30 transfers the macro service mode designation information 32-1 to the IR 155 in response to the interrupt request signal 23. Thus, the macro service microprogram is
1, the PSW 1582 and the general-purpose register 157 are started without saving. A flowchart of the macro service micro program is shown in FIG. That is, using the value of the control data area address 121 of the data memory 120, the contents of the status save register 403 and the contents of the save register block 204 of the DMAC 20 are transferred to the corresponding areas of the first block control data area 123, respectively (601). ). The block continuation instruction information of the saved DMA control / status data is checked (60).
2). In this description, since the instruction is “continuation”, the first
The next address data of the block control data area 123 is set as the area address 121 (60).
3), the same address and the second block control data area 12
Using the next address data 2 of No. 5, the transfer count data, memory address data and DMA control / status data of the third block control data area are transferred to the next register block 203 of the DMAC 20 (60).
4). Thereafter, the vector interrupt request instruction information of the DMA control / status data transferred to the first block control data area 123 is checked (605). In this description, since no vector interrupt request is made, the macro service ends.

【0043】マクロサービスが終了すると、PC15
1,PSW1582,汎用レジスタ157の更新が許可
され、中断されたプログラムの実行が再開される。プロ
グラムの中断および再開にともなうオーバーベッドが生
じないので、CPUの処理効率はさらに高まる。
When the macro service ends, the PC 15
1, the update of the PSW 1582 and the general-purpose register 157 are permitted, and the execution of the interrupted program is resumed. Since there is no overbed due to the interruption and resumption of the program, the processing efficiency of the CPU is further increased.

【0044】上記ステップ602で「非継続」が指定さ
れておれば、ステップ605に移行する。このステップ
でベクタ割込み要求が指定されておれば、フラグ33が
クリアされ(606)、マクロサービスを終了する。
If "non-continuation" is designated in step 602, the flow shifts to step 605. If a vector interrupt request has been specified in this step, the flag 33 is cleared (606), and the macro service ends.

【0045】フラグ33がクリアされることにより、I
NTC30はベクタ割込みモードコード32−1を再度
IR/55に設定し、この結果、ユーザープログラムに
よる割込みルーチンが起動される。
When the flag 33 is cleared, I
The NTC 30 sets the vector interrupt mode code 32-1 to IR / 55 again, and as a result, an interrupt routine by the user program is started.

【0046】この割込みルーチンによる処理は、各ブロ
ックに対応するブロック継続指示情報および/又はベク
タ割込み要求指示情報に応じて様々な処理が考えられ
る。本説明では、第Nブロック126へのデータ転送後
に、ベクタ割込みが起動されるので、その割込み処理ル
ーチンで、各ブロックでの周辺状態セーブデータにもと
づくエラーチェックおよび各データに対する処理が一括
して実行される。
Various processes can be considered for the processing by the interrupt routine according to the block continuation instruction information and / or the vector interrupt request instruction information corresponding to each block. In this description, since the vector interrupt is activated after the data is transferred to the N-th block 126, the error check based on the peripheral state save data in each block and the processing for each data are collectively executed in the interrupt processing routine. Is done.

【0047】このように、本実施例によれば、DMAC
20とデータメモリ120間の必要なデータ転送がマイ
クロプログラムによるマクロサービスとしてマイクロコ
ンピュータのハードウェアの一部として実行されるの
で、データ処理の実行効率がさらに高まり、かつユーザ
ーに対しプログラム作成の負担を軽減することができ
る。
As described above, according to the present embodiment, the DMAC
Since the necessary data transfer between the memory 20 and the data memory 120 is executed as a part of the hardware of the microcomputer as a macro service by the microprogram, the execution efficiency of the data processing is further improved, and the burden of program creation on the user is reduced. Can be reduced.

【0048】本実施例においても、図4に従ってDMA
C20が受信ユニット40とローカルメモリ400との
間のDMA転送を実行させることができる。
Also in the present embodiment, the DMA
C20 can cause a DMA transfer between the receiving unit 40 and the local memory 400 to be performed.

【0049】[0049]

【発明の効果】以上のとおり、本発明によれば、DMA
転送のブロックの切り替えを数クロックという非常に高
速に実行できて転送禁止期間が極めて短縮化でき、DM
A転送要求の発行期間が短かい場合にも対処することが
できる。
As described above, according to the present invention, the DMA
Switching of transfer blocks can be performed at a very high speed of several clocks, and the transfer prohibition period can be extremely shortened.
It is possible to cope with a case where the issue period of the A transfer request is short.

【0050】本発明は上記実施例に限定されず、適宜変
更できることは明らかである。例えば、ネクストレジス
タブロック203をカレントレジスタブロック202に
コピーする代わりに、転送制御部201が参照すべきレ
ジスタをマルチプレクサでネクストレジスタブロック2
03となるように切替てもよい。このとき、次の情報は
レジスタブロック202にロードされ、これがネクスト
レジスタブロックとなる。
It is clear that the present invention is not limited to the above-described embodiment, but can be modified as appropriate. For example, instead of copying the next register block 203 to the current register block 202, a register to be referred to by the transfer control unit 201 is stored in the next register block 2 by the multiplexer.
03 may be switched. At this time, the next information is loaded into the register block 202, which becomes the next register block.

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

【図1】本発明の第1実施例によるマイクロコンピュー
タを用いたシステムブロック図である。
FIG. 1 is a system block diagram using a microcomputer according to a first embodiment of the present invention.

【図2】図1で示したDMACの動作フローチャートで
ある。
FIG. 2 is an operation flowchart of a DMAC shown in FIG. 1;

【図3】図1で示したマイクロコンピュータの割込み処
理ルーチンの一例を示すフローチャートである。
FIG. 3 is a flowchart illustrating an example of an interrupt processing routine of the microcomputer illustrated in FIG. 1;

【図4】本発明の第2実施例によるシステムブロック図
である。
FIG. 4 is a system block diagram according to a second embodiment of the present invention.

【図5】本発明の第3実施例によるマイクロコンピュー
タのCPUを示すブロック図である。
FIG. 5 is a block diagram showing a CPU of a microcomputer according to a third embodiment of the present invention.

【図6】図5で示したCPUのマクロサービスマイクロ
プログラムのフローチャートである。
FIG. 6 is a flowchart of a macro service microprogram of the CPU shown in FIG. 5;

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 ダイレクトメモリアクセス(以下、DM
Aと記す)転送要求信号を発行し、かつ処理完了時にD
MA転送終了指示信号を発行し、かつ前記処理完了時又
は状態退避指示信号の検出時に内部状態を退避し記憶す
る状態退避記憶手段を含む周辺回路と、少なくともDM
A転送継続指示情報を含むDMA制御情報記憶部とDM
A転送回数記憶部とを含む第1、第2、第3の3種のD
MA制御記憶手段と、前記DMA転送要求信号を検知す
ると前記周辺回路とメモリとの間でDMA転送を行うと
ともに前記第2のDMA制御記憶手段内のDMA転送回
数記憶部の値を更新し、前記更新の結果所定の値になる
かまたは前記DMA転送終了指示信号を検知するかのい
ずれかが発生しかつ前記第2のDMA制御記憶手段内の
DMA転送継続指示情報が有効であれば前記第2のDM
A制御記憶手段の内容を前記第3のDMA制御記憶手段
内に、続いて前記第1のDMA制御記憶手段の内容を第
2のDMA制御記憶手段に転送するとともに前記状態退
避指示信号を発行する制御手段とを有するDMA転送手
段とを有することを特徴とするマイクロコンピュータ。
1. A direct memory access (hereinafter referred to as DM)
A) A transfer request signal is issued, and D is
A peripheral circuit including state saving storage means for issuing an MA transfer end instruction signal and saving and storing the internal state upon completion of the processing or upon detection of the state saving instruction signal;
DMA control information storage unit including A transfer continuation instruction information and DM
A first, second, and third D types including an A transfer number storage unit
MA control storage means, and when the DMA transfer request signal is detected, performs a DMA transfer between the peripheral circuit and the memory, and updates a value of a DMA transfer number storage unit in the second DMA control storage means, If either a predetermined value is obtained as a result of the update or the DMA transfer end instruction signal is detected, and the DMA transfer continuation instruction information in the second DMA control storage means is valid, the second DM
The contents of the A control storage means are transferred into the third DMA control storage means, then the contents of the first DMA control storage means are transferred to the second DMA control storage means, and the state saving instruction signal is issued. And a DMA transfer unit having a control unit.
【請求項2】 前記中央処理手段がデータ処理を行うた
めの第1のバスと、前記DMA転送手段がDMA転送を
行うための第2のバスとをさらに有することを特徴とす
る請求項記載のマイクロコンピュータ。
Wherein the first bus for the central processing unit performs data processing, according to claim 1, wherein the DMA transfer means, characterized by further comprising a second bus for DMA transfers Microcomputer.
JP3152681A 1990-06-25 1991-06-25 Microcomputer Expired - Fee Related JP2871171B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3152681A JP2871171B2 (en) 1990-06-25 1991-06-25 Microcomputer

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP2-165915 1990-06-25
JP16591590 1990-06-25
JP2-237416 1990-09-07
JP23741690 1990-09-07
JP3152681A JP2871171B2 (en) 1990-06-25 1991-06-25 Microcomputer

Publications (2)

Publication Number Publication Date
JPH04260955A JPH04260955A (en) 1992-09-16
JP2871171B2 true JP2871171B2 (en) 1999-03-17

Family

ID=27320324

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3152681A Expired - Fee Related JP2871171B2 (en) 1990-06-25 1991-06-25 Microcomputer

Country Status (1)

Country Link
JP (1) JP2871171B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6329868A (en) * 1986-07-23 1988-02-08 Nec Corp Dma controller
JPS63239549A (en) * 1987-03-27 1988-10-05 Hitachi Ltd Data chaining control system

Also Published As

Publication number Publication date
JPH04260955A (en) 1992-09-16

Similar Documents

Publication Publication Date Title
EP0464615B1 (en) Microcomputer equipped with DMA controller
JP3176093B2 (en) Microprocessor interrupt controller
JPH0430053B2 (en)
JP3055917B2 (en) Data transfer control device
JPH03129448A (en) Data transfer controller
JPH1083305A (en) Data processing system with self-matching stack pointer and its method
EP0290942B1 (en) Guest machine execution control system for virtual machine system
JP2004516547A (en) Suspension control device
JP2871171B2 (en) Microcomputer
JP2594600B2 (en) Single chip microcomputer
JP3105554B2 (en) Interrupt controller
JP3139310B2 (en) Digital signal processor
JPH06131294A (en) Data transfer device
JP2872042B2 (en) Shared memory access method
JPH0764886A (en) Processor provided with serial interface device
JP3127737B2 (en) Digital signal processor
JP2770797B2 (en) Page Descriptor Update Control Method for Multiprocessor System
JPH02284253A (en) Data transfer device
JP2819705B2 (en) Data transfer control device
JP2583169B2 (en) Operation program switching method for communication processing device
JPH0736820A (en) I/o controller
JPS58158746A (en) Information processing device
JPH04172551A (en) Information processor
JPH0378661B2 (en)
JPH0784933A (en) Input/output control board

Legal Events

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