JP2018101448A - Semiconductor device - Google Patents

Semiconductor device Download PDF

Info

Publication number
JP2018101448A
JP2018101448A JP2018062537A JP2018062537A JP2018101448A JP 2018101448 A JP2018101448 A JP 2018101448A JP 2018062537 A JP2018062537 A JP 2018062537A JP 2018062537 A JP2018062537 A JP 2018062537A JP 2018101448 A JP2018101448 A JP 2018101448A
Authority
JP
Japan
Prior art keywords
data
data transfer
transfer
mode
bit
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.)
Pending
Application number
JP2018062537A
Other languages
Japanese (ja)
Inventor
三ッ石 直幹
Naomiki Mitsuishi
直幹 三ッ石
誠司 猪狩
Seiji Inokari
誠司 猪狩
勝正 内山
Katsumasa Uchiyama
勝正 内山
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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2018062537A priority Critical patent/JP2018101448A/en
Publication of JP2018101448A publication Critical patent/JP2018101448A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a semiconductor device capable of obtaining output data corresponding to input data by referencing table data with a simple configuration.SOLUTION: A DTC 3 comprises a first transfer source address register, a second transfer source address register, a transfer destination address register, and a transfer count register. The DTC reads first data from the transfer source address SAR1 specified in the first transfer source address register, operates the first data to generate second data, and transfers data to the transfer destination address DAR specified in the transfer destination address register with the transfer source address SAR2 indicated in the second transfer source address register as the transfer source address. The DTC then generates a new transfer source address SAR2 or a new transfer destination address DAR by adding the second data to or deleting it from the transfer source address SAR2 or the transfer destination address DAR. The DTC repeats the data transfer only the number of times CR specified in the transfer count register.SELECTED DRAWING: Figure 17

Description

本発明は半導体装置に関し、例えばマイクロコンピュータに関する。   The present invention relates to a semiconductor device, for example, a microcomputer.

一般に、シングルチップマイクロコンピュータは、中央処理装置(CPU:Central Processing Unit)を中心にして、プログラム保持用のROM(Read Only Memory:リードオンリメモリ)、データ保持用のRAM(Random Access Memory:ランダムアクセスメモリ)、及びデータ又は信号の入出力を行うための入出力回路などの機能ブロックが、一つの半導体基板上に形成されている。このようなシングルチップマイクロコンピュータは、様々な機器制御に用いられる。  In general, a single chip microcomputer is mainly composed of a central processing unit (CPU), a ROM (Read Only Memory) for holding a program, and a RAM (Random Access Memory) for holding a data. Memory and a functional block such as an input / output circuit for inputting / outputting data or signals are formed on one semiconductor substrate. Such a single chip microcomputer is used for various device control.

シングルチップマイクロコンピュータの機器制御において、割り込みなどのイベントに呼応して、データ転送を行う要求がある。CPUは命令の組み合わせによって任意の処理を実現できるものの、割り込み処理を行う場合には、処理の流れを切り替えるために例外処理、スタックの退避・復帰処理、復帰命令の実行が必要になる。この場合、データ転送行う際の命令リードなどのCPUの動作時間が大きくなりがちである。   In device control of a single chip microcomputer, there is a request for data transfer in response to an event such as an interrupt. Although the CPU can realize arbitrary processing by a combination of instructions, when interrupt processing is performed, exception processing, stack save / return processing, and execution of a return instruction are required to switch the processing flow. In this case, the operation time of the CPU such as instruction read when performing data transfer tends to be long.

上記のデータ転送の問題点を解消するため、シングルチップマイクロコンピュータにデータ転送装置を設け、少ないハードウェアで多数の周辺処理装置(入出力回路)からの要求に応じたデータ転送を行う技術が提案されている(特許文献1)。この技術では、転送すべきデータが格納されているメモリの位置を示す転送元アドレスなどのデータ転送情報が、記憶装置(RAM)に格納される。また、データ転送に必要なすべての情報が記憶装置(RAM)のどこに格納してあるかを示すアドレスを格納するベクタテーブルが設けられる。そして、データ転送の起動要求があった場合に、起動要求に対応してベクタテーブルの内容を参照する手段と、ベクタテーブルの内容からデータ転送に必要なすべての情報を得る手段が設けられる。この技術では、少ないハードウェアでデータ転送を実現することができるが、データ転送の内容については考慮されていない。   In order to solve the above-mentioned problems of data transfer, a technology has been proposed in which a data transfer device is provided in a single-chip microcomputer and data is transferred in response to requests from a large number of peripheral processing devices (input / output circuits) with a small amount of hardware (Patent Document 1). In this technique, data transfer information such as a transfer source address indicating the position of a memory in which data to be transferred is stored is stored in a storage device (RAM). In addition, a vector table is provided for storing addresses indicating where in the storage device (RAM) all information necessary for data transfer is stored. A means for referring to the contents of the vector table in response to the activation request and a means for obtaining all information necessary for the data transfer from the contents of the vector table are provided. With this technology, data transfer can be realized with a small amount of hardware, but the contents of the data transfer are not considered.

これに対し、データ転送装置でのデータ転送の応用範囲を広げるため、データ転送のモードによって異なるデータ転送を行う技術も提案されている(特許文献2)。この技術では、データ転送のモードとして、リピート転送モード、ブロック転送モードが提案されている。これにより、転送先や転送元のアドレスの制御や、転送回数の選択などを行うことが可能である。例えば、本技術をプリンタなどのシステムに適用すれば、ステッピングモータの制御、プリンタの印字データ制御が可能である。また、受信データのメモリへの蓄積に好適である。また、この技術では、データ転送情報を、データ転送装置内部に専用のハードウェアとして保有し、このハードウェアを有効に利用するため、ショートアドレスモード/フルアドレスモードの転送情報の構成を選択可能にすることも示されている。本例では、ステッピングモータは回転角と移動量が対応しており、フィードバックが不要であり、所定の数のデータを、所定の順番で転送することができればよい。本技術では、転送元アドレス及び転送先アドレスの一方はRAMなどとなるが、RAMの記憶内容を更新しながら使用することは考えられていない。   On the other hand, in order to expand the application range of data transfer in the data transfer device, a technique for performing different data transfer depending on the data transfer mode has been proposed (Patent Document 2). In this technique, a repeat transfer mode and a block transfer mode have been proposed as data transfer modes. This makes it possible to control the transfer destination and transfer source addresses, select the number of transfers, and the like. For example, if the present technology is applied to a system such as a printer, it is possible to control a stepping motor and print data of the printer. It is also suitable for storing received data in a memory. Also, with this technology, data transfer information is stored as dedicated hardware inside the data transfer device, and the configuration of transfer information in the short address mode / full address mode can be selected in order to effectively use this hardware. It has also been shown to do. In this example, the stepping motor corresponds to the rotation angle and the movement amount, does not require feedback, and only needs to be able to transfer a predetermined number of data in a predetermined order. In this technique, one of the transfer source address and the transfer destination address is a RAM or the like, but it is not considered to use the RAM while updating the stored contents of the RAM.

データ転送に必要な情報を記憶装置に格納して、データ転送装置の1回の動作で、少なくとも1つ以上の情報によるデータ転送が指定可能(チェイン転送ないしチェイン動作)な技術も提案されている(特許文献3)。本技術によれば、任意の起動要因で、任意の数の転送を可能としたことにより、様々な用途に適用可能となる。その結果、システム構成上の自由度を向上し、使い勝手を向上させることができる。   A technique has also been proposed in which information necessary for data transfer is stored in a storage device, and data transfer based on at least one piece of information can be specified (chain transfer or chain operation) by one operation of the data transfer device. (Patent Document 3). According to the present technology, an arbitrary number of transfers can be performed by an arbitrary activation factor, so that the present technology can be applied to various applications. As a result, the degree of freedom in system configuration can be improved and usability can be improved.

データ転送装置内にあらかじめ設定したデータと転送するデータとの間で比較や簡単な演算が行える演算器を内蔵した技術も提案されている(特許文献4)。この技術では、データ転送を、専用のハードウェアであるデータ転送装置で実行するので、CPUより高速なデータ転送を実現できる。その結果、CPUの割り込み処理の頻度を低減できるので、効率的な処理を行うことができる。   There has also been proposed a technique in which an arithmetic unit capable of performing comparison and simple calculation between data set in advance in the data transfer device and data to be transferred has been proposed (Patent Document 4). In this technique, data transfer is executed by a data transfer device that is dedicated hardware, so that data transfer at a speed higher than that of the CPU can be realized. As a result, since the frequency of CPU interrupt processing can be reduced, efficient processing can be performed.

特開平1−125644号公報Japanese Patent Laid-Open No. 1-125644 特開平5−307516号公報JP-A-5-307516 特開平7−129537号公報JP-A-7-129537 特開2000−194647号公報JP 2000-194647 A

ところが、発明者らは、上述の技術には、以下に示す問題点が有ることを見出した。近年、マイクロコンピュータが内蔵する機能及び制御対象は増加しており、マイクロコンピュータの制御もより高い精度が求められるようになっている。例えば、入力データに対応したデータ出力を行うことが求められるが、入力データの種類ごとに専用のハードウェアを設けると、マイクロコンピュータの物理的規模が増大してしまう。また、マイクロコンピュータの構造が複雑化し、出力データを得るための処理時間も長くなってしまう。   However, the inventors have found that the above-described technique has the following problems. In recent years, functions and controlled objects built in microcomputers are increasing, and higher accuracy is required for microcomputer control. For example, it is required to output data corresponding to input data. However, if dedicated hardware is provided for each type of input data, the physical scale of the microcomputer increases. Further, the structure of the microcomputer becomes complicated, and the processing time for obtaining output data also becomes long.

その他の課題と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。   Other problems and novel features will become apparent from the description of the specification and the accompanying drawings.

一実施の形態によれば、半導体装置は、データ転送情報に基づいて転送元アドレス領域から転送先アドレス領域へデータを転送するデータ転送装置を備え、前記データ転送装置は、第1の転送元アドレス情報からリードしたデータに基づいて、第2の転送元アドレス情報に演算を行い、演算結果に基づいてリードを行い、リードしたデータを転送先アドレス情報に基づいてライトする。   According to one embodiment, a semiconductor device includes a data transfer device that transfers data from a transfer source address region to a transfer destination address region based on data transfer information, and the data transfer device includes a first transfer source address. The second transfer source address information is calculated based on the data read from the information, the read is performed based on the calculation result, and the read data is written based on the transfer destination address information.

一実施の形態によれば、半導体装置において、簡易な構成にて、テーブルデータを参照することで、入力データに対応する出力データを得ることができる。   According to an embodiment, output data corresponding to input data can be obtained by referring to table data with a simple configuration in a semiconductor device.

実施の形態1にかかるマイクロコンピュータの構成を模式的に表したブロック図である。1 is a block diagram schematically illustrating a configuration of a microcomputer according to a first embodiment. データ転送装置(DTC)の基本的なデータの流れを示す図である。It is a figure which shows the basic data flow of a data transfer apparatus (DTC). データ転送情報の構成を示す図である。It is a figure which shows the structure of data transfer information. データ転送装置(DTC)の構成を模式的に表したブロック図である。It is a block diagram showing typically the composition of a data transfer device (DTC). データ転送装置(DTC)の状態遷移を示す図である。It is a figure which shows the state transition of a data transfer apparatus (DTC). 分岐モードでのデータ転送を示す図である。It is a figure which shows the data transfer in a branch mode. 分岐モードでのデータ転送情報の指定の一例を示す図である。It is a figure which shows an example of designation | designated of the data transfer information in branch mode. シフトモードでのデータ転送を示す図である。It is a figure which shows the data transfer in shift mode. シフトモードで使用するテーブルの指定方法の一例を示す図である。It is a figure which shows an example of the designation | designated method of the table used by shift mode. オフセットモードでのデータ転送を示す図である。It is a figure which shows the data transfer in offset mode. オフセットモードで使用するテーブルの指定方法の一例を示す図である。It is a figure which shows an example of the designation | designated method of the table used by offset mode. 比例モードでのデータ転送を示す図である。It is a figure which shows the data transfer in a proportional mode. 微分モードでのデータ転送を示す図である。It is a figure which shows the data transfer in differential mode. 積分モードでのデータ転送を示す図である。It is a figure which shows the data transfer in integral mode. 転送モードがブロック加算モードである場合のデータ転送を示す図である。It is a figure which shows data transfer in case transfer mode is block addition mode. 分岐モードの変形例でのデータ転送を示す図である。It is a figure which shows the data transfer in the modification of branch mode. 分岐モードの変形例でのDTCの状態遷移図である。It is a state transition diagram of DTC in the modification of a branch mode. アドレス演算モードでのデータ転送を示す図である。It is a figure which shows the data transfer in an address calculation mode. アドレス演算モードで使用するテーブルの指定方法の一例を示す図である。It is a figure which shows an example of the designation | designated method of the table used in address calculation mode. 割り込みコントローラ(INT)のブロック図である。It is a block diagram of an interrupt controller (INT). マイクロコンピュータ(MCU)を含むカメラシステムのブロック図である。1 is a block diagram of a camera system including a microcomputer (MCU).

以下、図面を参照して本発明の実施の形態について説明する。各図面においては、同一要素には同一の符号が付されており、必要に応じて重複説明は省略される。   Embodiments of the present invention will be described below with reference to the drawings. In the drawings, the same elements are denoted by the same reference numerals, and redundant description is omitted as necessary.

実施の形態1
実施の形態1にかかる半導体装置であるマイクロコンピュータ100について説明する。図1Aに、実施の形態1にかかるマイクロコンピュータ100の構成を模式的に表したブロック図を示す。図1Bに、マイクロコンピュータ100に含まれるデータ転送装置(DTC)の基本的なデータの流れを示す。以下、図1Aを参照して、マイクロコンピュータ100の構成を説明する。なお、マイクロコンピュータは、以下ではMCU(Micro Controller Unit)と略記する。
Embodiment 1
A microcomputer 100 that is a semiconductor device according to the first embodiment will be described. FIG. 1A is a block diagram schematically showing the configuration of the microcomputer 100 according to the first embodiment. FIG. 1B shows a basic data flow of a data transfer device (DTC) included in the microcomputer 100. Hereinafter, the configuration of the microcomputer 100 will be described with reference to FIG. 1A. Hereinafter, the microcomputer is abbreviated as MCU (Micro Controller Unit).

MCU100は、中央処理装置(CPU)1、割り込みコントローラ(Interrupt Controller:以下、INTと称する)2、データ転送装置(データトランスファコントローラ(Data Transfer Controller:以下、DTCと称する))3、リードオンリメモリ(ROM)4、ランダムアクセスメモリ(RAM)5、バスコントローラ(Bus Controller:以下、BSCと称する)6、タイマ7、通信モジュール8、アナログモジュール9、入出力ポート(I/O)10及び内部バス11などを有する。通信モジュール8として、例えばシリアルコミュニケーションインタフェースなどが設けられる。アナログモジュール9として、例えばアナログ/デジタル(A/D)変換器およびデジタル/アナログ(D/A)変換器などが設けられる。   The MCU 100 includes a central processing unit (CPU) 1, an interrupt controller (hereinafter referred to as INT) 2, a data transfer device (data transfer controller (hereinafter referred to as DTC)) 3, a read-only memory ( ROM) 4, random access memory (RAM) 5, bus controller (hereinafter referred to as BSC) 6, timer 7, communication module 8, analog module 9, input / output port (I / O) 10 and internal bus 11 Etc. As the communication module 8, for example, a serial communication interface or the like is provided. For example, an analog / digital (A / D) converter and a digital / analog (D / A) converter are provided as the analog module 9.

MCU100では、動作の主体となるのはCPU1である。CPU1は、主にROM4から命令を読込んで動作する。DTC3は、CPU1の設定に基づき、CPU1に代ってデータ転送を行う。   In the MCU 100, the CPU 1 is the main operation. The CPU 1 mainly operates by reading instructions from the ROM 4. The DTC 3 performs data transfer on behalf of the CPU 1 based on the setting of the CPU 1.

INT2は、タイマ7、通信モジュール8及びアナログモジュール9などからの割み込み要求や、MCU1の外部からの複数の外部割り込み要求信号に基づくI/O10からの割り込み要求を受けて、CPU1又はDTC3に割り込み要求又はデータ転送要求を出力する。また、INT2は、割り込み要求信号による処理を開始又は終了したときに、割り込みをクリアする信号である割込みクリア信号を、タイマ7、通信モジュール8、アナログモジュール9及びI/O10のそれぞれの割込み信号又は割り込み要因フラグに対応して出力する。   The INT 2 receives an interrupt request from the timer 7, the communication module 8, the analog module 9, etc., or an interrupt request from the I / O 10 based on a plurality of external interrupt request signals from outside the MCU 1, and sends it to the CPU 1 or DTC 3. An interrupt request or a data transfer request is output. In addition, the INT 2 sends an interrupt clear signal, which is a signal for clearing the interrupt when processing by the interrupt request signal is started or ended, to the interrupt signal of each of the timer 7, the communication module 8, the analog module 9, and the I / O 10. Output in response to the interrupt factor flag.

BSC6は、CPU1及びDTC3からのバスリクエスト信号を受けて、内部バス11の占有に対する調停をして、バス使用許可信号を出力する。BSC6は、CPU1及びDTC3と、バスリクエスト、バスアクノレジ、バスコマンド、ウェイト、アドレス及びデータなどのインタフェースを行い、内部バス11に接続されたRAMやその他の機能ブロック及びモジュールに対するリード/ライトを実現する。   The BSC 6 receives the bus request signals from the CPU 1 and the DTC 3, arbitrates the occupation of the internal bus 11, and outputs a bus use permission signal. The BSC 6 interfaces with the CPU 1 and the DTC 3 such as a bus request, a bus acknowledge, a bus command, a wait, an address, and data, and implements read / write to the RAM and other functional blocks and modules connected to the internal bus 11.

上述の通り、DTC3は、データ転送情報に基づいて、データ転送を行う。図2に、データ転送情報の構成を示す。データ転送情報は、モードレジスタ(MRとも称する)、第1ソースアドレスレジスタ(SAR1とも称する)、第2ソースアドレスレジスタ(SAR2とも称する)、デスティネーションアドレスレジスタ(DARとも称する)、データレジスタ(DRとも称する)及び転送カウントレジスタ(CRとも称する)からなる。   As described above, the DTC 3 performs data transfer based on the data transfer information. FIG. 2 shows the configuration of the data transfer information. The data transfer information includes a mode register (also referred to as MR), a first source address register (also referred to as SAR1), a second source address register (also referred to as SAR2), a destination address register (also referred to as DAR), and a data register (also referred to as DR). And a transfer count register (also referred to as CR).

MRは、DTC3が行うデータ転送のモードを指定する。DTC3は、MRが指定するデータ転送のモードによって、DR、SAR1、SAR2、DAR及びCRのうちから必要なデータを利用する。   MR designates the mode of data transfer performed by DTC3. The DTC 3 uses necessary data from DR, SAR1, SAR2, DAR, and CR depending on the data transfer mode specified by the MR.

CRは、ブロック転送カウントレジスタ(BTCRとも称する)と転送カウントレジスタ(TCRとも称する)とに分割される。TCRは、8ビットのTCRHと8ビットのTCRLと に分割される。   The CR is divided into a block transfer count register (also referred to as BTCR) and a transfer count register (also referred to as TCR). The TCR is divided into 8-bit TCRH and 8-bit TCRL.

これらのレジスタは、1組分の回路がDTC3の内部に存在し、特に制限はされないものの、CPU1のアドレス空間上には存在しない。これらのレジスタに格納されるべきデータ転送情報は、必要組数がCPU1のアドレス空間上の、RAM5などの所定のデータ転送情報配置領域に配置される。   These registers have one set of circuits in the DTC 3 and are not particularly limited, but do not exist in the address space of the CPU 1. The data transfer information to be stored in these registers is arranged in a predetermined data transfer information arrangement area such as the RAM 5 in the required number of sets in the address space of the CPU 1.

次いで、MRのビット構成について説明する。MRのビット31〜16は、データ転送モードの設定と、テーブル参照用のデータ転送機能の入力データと指定と、を行う。MRのビット15〜0は、テーブル参照用のデータ転送機能のテーブル参照の指定と、通常データ転送機能のデータ転送の指定と、を行う。このとき、テーブルは、複数のデータないしパラメータを、アドレス空間上に所定の順序で予め配置したものである。   Next, the MR bit configuration will be described. The MR bits 31 to 16 are used to set the data transfer mode and to specify and input data for the table transfer data transfer function. Bits 15 to 0 of MR perform designation of table reference of the data transfer function for table reference and designation of data transfer of the normal data transfer function. At this time, the table is obtained by arranging a plurality of data or parameters in advance in a predetermined order on the address space.

MRのビット31はTLUビットであり、データ転送において、テーブル参照を実行するか否かを選択する。TLUビットが「0」にクリアされている場合は、テーブル参照を実行しない。このときのデータ転送情報は、後述するDREビットの値により変化する。TLUビットが「1」で、DREビットが「0」にクリアされている場合、データ転送情報はMR、SAR2、DAR及びCRの132ビット(32ビット×4本)となる。TLUビットが「1」で、DREビットが「1」にセットされている場合、データ転送情報はMR、DR、SAR2、DAR及びCRの160ビット(32ビット×5本)となる。   Bit 31 of MR is a TLU bit and selects whether or not to perform table reference in data transfer. When the TLU bit is cleared to “0”, the table reference is not executed. The data transfer information at this time varies depending on the value of the DRE bit described later. When the TLU bit is “1” and the DRE bit is cleared to “0”, the data transfer information is 132 bits (32 bits × 4) of MR, SAR2, DAR, and CR. When the TLU bit is “1” and the DRE bit is set to “1”, the data transfer information is 160 bits (32 bits × 5) of MR, DR, SAR2, DAR, and CR.

TLUビットが「1」にされている場合、テーブル参照が実行される。このとき、後述するSFMビット、OFMビット、PRMビット、DRMビット、INMビット、BRMビット、AEMビット及びNOPビットに基づいて、テーブル参照モードが指定される。テーブル参照モードについては、後述する。   When the TLU bit is set to “1”, a table reference is executed. At this time, the table reference mode is designated based on the SFM bit, OFM bit, PRM bit, DRM bit, INM bit, BRM bit, AEM bit, and NOP bit, which will be described later. The table reference mode will be described later.

MRのビット30〜23は、それぞれSFMビット、OFMビット、PRMビット、DRMビット、INMビット、BRMビット、AEMビット及びNOPビットである。これらのビットは、テーブル参照を実行する場合のテーブル参照モードを指定する情報である。   The MR bits 30 to 23 are the SFM bit, OFM bit, PRM bit, DRM bit, INM bit, BRM bit, AEM bit and NOP bit, respectively. These bits are information for designating a table reference mode when executing table reference.

SFMビットが「1」の場合、テーブル参照モードはシフトモードとなる。OFMビットが「1」の場合、テーブル参照モードはオフセットモードとなる。PRMビットが「1」の場合、テーブル参照モードは比例モードとなる。DRMビットが「1」の場合、テーブル参照モードは微分モードとなる。INMビットが「1」の場合、テーブル参照モードは積分モードとなる。BRMビットが「1」の場合、テーブル参照モードは分岐モードとなる。AEMビットが「1」の場合、テーブル参照モードはアドレス演算モードとなる。NOPビットが「1」の場合、テーブル参照モードはノーオペレーションモードとなる。   When the SFM bit is “1”, the table reference mode is the shift mode. When the OFM bit is “1”, the table reference mode is the offset mode. When the PRM bit is “1”, the table reference mode is the proportional mode. When the DRM bit is “1”, the table reference mode is the differential mode. When the INM bit is “1”, the table reference mode is the integration mode. When the BRM bit is “1”, the table reference mode is a branch mode. When the AEM bit is “1”, the table reference mode is the address calculation mode. When the NOP bit is “1”, the table reference mode is the no operation mode.

シフトモードでは、データ転送情報は、後述するCREビットの値により変化する。CREビットが「1」にセットされている場合、データ転送情報は、MR、SAR1、SAR2、DAR及びCRの160ビット(32ビット×5本)となる。CREビットが「0」にクリアされている場合、データ転送情報は、MR、SAR1、SAR2及びDARの132ビット(32ビット×4本)となる。   In the shift mode, the data transfer information changes depending on the value of the CRE bit described later. When the CRE bit is set to “1”, the data transfer information is 160 bits (32 bits × 5) of MR, SAR1, SAR2, DAR, and CR. When the CRE bit is cleared to “0”, the data transfer information is 132 bits (32 bits × 4) of MR, SAR1, SAR2, and DAR.

オフセットモード、比例モード及び微分モードでは、データ転送情報は、後述するCREビットの値により変化する。CREビットが「1」にセットされている場合、データ転送情報は、MR、DR、DAR1、SAR2、DAR及びCRの182ビット(32ビット×6本)となる。CREビットが「0」にクリアされている場合、データ転送情報は、MR、DR、SAR1、SAR2及びDARの160ビット(32ビット×5本)となる。   In the offset mode, the proportional mode, and the differential mode, the data transfer information changes depending on the value of the CRE bit described later. When the CRE bit is set to “1”, the data transfer information is 182 bits (32 bits × 6) of MR, DR, DAR1, SAR2, DAR, and CR. When the CRE bit is cleared to “0”, the data transfer information is 160 bits (32 bits × 5) of MR, DR, SAR1, SAR2, and DAR.

積分モード及びアドレス演算モードでは、データ転送情報は、MR、SAR1、SAR2、DAR及びCRの160ビット(32ビット×5本)となる。   In the integration mode and the address calculation mode, the data transfer information is 160 bits (32 bits × 5) of MR, SAR1, SAR2, DAR, and CR.

分岐モードでは、データ転送情報は、MR、SAR1及びSAR2の96ビット(32ビット×3本)となる。   In the branch mode, the data transfer information is 96 bits (32 bits × 3) of MR, SAR1, and SAR2.

ノーオペレーションモードでは、データ転送情報は、MRのみの32ビット(32ビット×1本)となる。   In the no operation mode, the data transfer information is 32 bits (32 bits × 1) of MR only.

なお、各テーブル参照モードでのデータ転送の詳細については、後述する。   Details of the data transfer in each table reference mode will be described later.

ビット22〜20は、SF[2:0]ビットであり、入力データのシフトを+3〜−3ビットで指定する。+のときは左算術シフト、−のときは右算術シフトを行う。   Bits 22 to 20 are SF [2: 0] bits and specify shift of input data by +3 to -3 bits. When +, perform left arithmetic shift, and when-, perform right arithmetic shift.

ビット19及びビット18は、それぞれS1M[1:0]ビットであり、データ転送後にSAR1をインクリメントするか、デクリメントするか、又は固定にするかを指定する。   Bit 19 and bit 18 are S1M [1: 0] bits, respectively, which specify whether SAR1 is incremented, decremented, or fixed after data transfer.

ビット17、16はISz[1:0]ビットであり、入力データのリードをバイトサイズ、ワードサイズ、又はロングワードサイズのいずれで行うかを選択する。   Bits 17 and 16 are ISz [1: 0] bits, and select whether to read input data in byte size, word size, or long word size.

MRのビット15及びビット14は、SM[1:0]ビットであり、データ転送後にSAR2をインクリメントするか、デクリメントするか、又は固定にするかを指定する。   Bits 15 and 14 of MR are SM [1: 0] bits, and specify whether SAR2 is incremented, decremented, or fixed after data transfer.

MRのビット13及びビット12は、DM[1:0]ビットであり、データ転送後にDARをインクリメントするか、デクリメントするか、又は固定にするかを指定する。   Bits 13 and 12 of MR are DM [1: 0] bits, and designate whether DAR is incremented, decremented, or fixed after data transfer.

MRのビット11及び10は、TMD[1:0]ビットであり、データの転送モードを指定する。TMD[1:0]ビットが「00」のとき、転送モードはノーマルモードとなる。TMD[1:0]ビットが「01」のとき、転送モードはリピートモードとなる。TMD[1:0]ビットが「10」とき、転送モードはブロック転送モードとなる。TMD[1:0]ビットが「11」とき、転送モードはブロック加算モードとなる。各転送モードの詳細については、後述する。   MR bits 11 and 10 are TMD [1: 0] bits and designate a data transfer mode. When the TMD [1: 0] bits are “00”, the transfer mode is the normal mode. When the TMD [1: 0] bits are “01”, the transfer mode is a repeat mode. When the TMD [1: 0] bits are “10”, the transfer mode is the block transfer mode. When the TMD [1: 0] bits are “11”, the transfer mode is the block addition mode. Details of each transfer mode will be described later.

MRのビット9はDIRビットであり、転送元及び転送先のいずれをリピート領域とし、いずれをブロック領域とするかを指定する。   Bit 9 of MR is a DIR bit, and designates which of the transfer source and transfer destination is a repeat area and which is a block area.

MRのビット7及び6は、それぞれSz[1:0]ビットであり、1回のデータ転送をバイトサイズ、ワードサイズ及びロングワードサイズのいずれで行うかを指定する。   Bits 7 and 6 of MR are Sz [1: 0] bits, respectively, and specify whether one data transfer is performed in byte size, word size, or long word size.

ビット3はDREビットである。DREビットが「0」にクリアされている場合は、DRを使用せず、リードしたデータをライトする。DREビットが「1」にセットされている場合は、DRを使用し、リードしたデータからDRの内容を減算したものをライトする。   Bit 3 is the DRE bit. When the DRE bit is cleared to “0”, the read data is written without using DR. When the DRE bit is set to “1”, DR is used, and data obtained by subtracting the contents of DR from the read data is written.

ビット2はCREビットである。CREビットが「0」にクリアされている場合は、起動要求信号に応じて、無制限にDTCの動作を行う。このとき、転送モードが通常モードの場合、CRを使用しない。CREビットが「1」にセットされている場合は、CRに初期設定した値に応じて、DTC3が動作する。   Bit 2 is the CRE bit. When the CRE bit is cleared to “0”, the DTC operation is performed without limitation in accordance with the activation request signal. At this time, if the transfer mode is the normal mode, the CR is not used. When the CRE bit is set to “1”, the DTC 3 operates according to the value initially set in the CR.

MRのビット1はNXTE1ビットであり、1つの起動要因に対してデータ転送を終了するか、次のデータ転送を行うかを指定する。NXTE1ビットを「0」にクリアした場合、データ転送情報リード及びデータ転送後、データ転送情報をライトしてDTC3の動作を終了する。NXTE1ビットを「1」にセットした場合、データ転送情報リード及びデータ転送後、データ転送情報をライトする。更に、連続したアドレスからデータ転送情報をリードする。そして、このデータ転送情報で指定されるデータ転送を行った後、データ転送情報をライトする。このように、データ転送情報のライト、データ転送及びデータ転送情報のライトの一連の処理を複数回連続して行う動作を、チェイン動作と称する。MRのビット0はNXTE0ビットであり、CRが「0」になったときに、チェイン動作を行うかを指定する。   Bit 1 of MR is the NXTE1 bit, and designates whether to end data transfer or perform the next data transfer for one activation factor. When the NXTE1 bit is cleared to “0”, after the data transfer information is read and transferred, the data transfer information is written and the operation of the DTC 3 is terminated. When the NXTE1 bit is set to “1”, the data transfer information is written after the data transfer information read and data transfer. Further, data transfer information is read from successive addresses. Then, after performing the data transfer specified by the data transfer information, the data transfer information is written. An operation in which a series of processes of data transfer information write, data transfer, and data transfer information write is continuously performed a plurality of times is referred to as a chain operation. Bit 0 of MR is the NXTE0 bit, and specifies whether to perform a chain operation when CR becomes “0”.

DTC3の構成について説明する。図3に、DTC3の構成を模式的に表したブロック図を示す。DTC3は、データ転送制御ブロック(DTCCNTとも称する)31、バスインタフェース(BIFとも称する)32、ベクタ生成ブロック(VGとも称する)33、ベクタアドレスレジスタ(VARとも称する)34、MR、SAR1、SAR2、DAR、CR、DR、演算器(ALUとも称する)35及び内部バス36を有する。   A configuration of the DTC 3 will be described. FIG. 3 is a block diagram schematically showing the configuration of DTC3. The DTC 3 includes a data transfer control block (also referred to as DTCCNT) 31, a bus interface (also referred to as BIF) 32, a vector generation block (also referred to as VG) 33, a vector address register (also referred to as VAR) 34, MR, SAR1, SAR2, and DAR. , CR, DR, an arithmetic unit (also referred to as ALU) 35 and an internal bus 36.

DTCCNT31は、INT2からの起動要求信号DCTREQ及びMRの内容に基づき、DTC3の制御を行う。   The DTCCNT 31 controls the DTC 3 based on the contents of the activation request signal DCTREQ from the INT 2 and the MR.

BIF32は、DTC3の内部バス36とMCU1の内部バス11とのインタフェースを行う。このインタフェースには、バスリクエスト、バスアクノレジ、バスコマンド、ウェイト、アドレス、データなどが含まれる。   The BIF 32 provides an interface between the internal bus 36 of the DTC 3 and the internal bus 11 of the MCU 1. This interface includes a bus request, a bus acknowledge, a bus command, a wait, an address, data, and the like.

VG33は、INT2から与えられるベクタ番号DTCVECに従って、ベクタアドレスを生成する。例えば、ベクタ番号DTCVECを4倍などとし、所定のオフセットを加算する。   The VG 33 generates a vector address according to the vector number DTCVEC given from the INT2. For example, the vector number DTCVEC is quadrupled and a predetermined offset is added.

VAR34は、ベクタアドレスからリードしたデータ転送情報の先頭アドレスを格納する。   The VAR 34 stores the start address of the data transfer information read from the vector address.

MR、SAR1、SAR2、DAR及びCRは、データ転送情報の先頭アドレスから順次リードしたデータ転送情報を格納する。   MR, SAR1, SAR2, DAR, and CR store data transfer information sequentially read from the head address of the data transfer information.

ALU35は、論理演算、シフト及び算術演算などの機能を持ち、所定の順序でこれらの演算を実行する。図示しないが、内部バス36は複数のバスを有し、複数のバスを介して、SAR1、SAR2、DAR、CR及びDRの内容をALU35に与えることができる。ALU35は、SAR1、SAR2、DAR、CR及びDRを用いた演算を行うことができる。   The ALU 35 has functions such as logical operation, shift, and arithmetic operation, and executes these operations in a predetermined order. Although not shown, the internal bus 36 has a plurality of buses, and the contents of SAR1, SAR2, DAR, CR, and DR can be given to the ALU 35 through the plurality of buses. The ALU 35 can perform calculations using SAR1, SAR2, DAR, CR, and DR.

ノーマルモード
TMD[1:0]ビットが「00」の場合、転送モードはノーマルモードとなる。ノーマルモードでは、1回の起動で、SARで示される転送元アドレスからDARで示される転送先アドレスへ、1回のデータ転送を行う。データ転送の終了後、SARは、SM[1:0]ビットに応じて、インクリメント、デクリメント又は固定される。DARは、DM[1:0]ビットに応じて、インクリメント、デクリメント又は固定される。その後、TCRがデクリメントされる。
Normal mode When the TMD [1: 0] bits are “00”, the transfer mode is the normal mode. In the normal mode, one data transfer is performed from the transfer source address indicated by SAR to the transfer destination address indicated by DAR by one activation. After the data transfer is finished, the SAR is incremented, decremented or fixed according to the SM [1: 0] bits. The DAR is incremented, decremented or fixed according to the DM [1: 0] bits. Thereafter, the TCR is decremented.

ノーマルモードでは、以上で説明したデータ転送とレジスタ操作を、起動要因が発生するごとに、TCRで指定された回数だけ繰り返す。   In the normal mode, the data transfer and register operation described above are repeated as many times as specified by the TCR each time an activation factor occurs.

CRで指定された回数だけ繰り返し動作を行った後、起動要因となった割り込みがCPUに要求される。   After repeating the operation as many times as specified by CR, the CPU is requested to generate an interrupt that has caused the activation.

リピートモード
TMD[1:0]ビットが「01」の場合、転送モードはリピートモードとなる。DIRビットが「0」にクリアされている場合、転送元アドレスをリピート領域として設定する。DIRビットが「1」にセットされている場合、転送先アドレスをリピート領域として設定する。リピートモードでは、TCRHを転送カウントレジスタ、TCRLを転送回数保持レジスタとして使用する。リピート領域の大きさは、TCRHで指定される。データ転送の開始前には、TCRHとTCRLとには、同じ値が初期値として設定される。
Repeat mode When the TMD [1: 0] bits are “01”, the transfer mode is the repeat mode. When the DIR bit is cleared to “0”, the transfer source address is set as a repeat area. When the DIR bit is set to “1”, the transfer destination address is set as a repeat area. In the repeat mode, TCRH is used as a transfer count register and TCRL is used as a transfer count holding register. The size of the repeat area is specified by TCRH. Before the start of data transfer, the same value is set as the initial value for TCRH and TCRL.

リピートモードでは、1回の起動で、SARで示される転送元アドレスからDARで示される転送先アドレスへ、1回のデータ転送を行う。データ転送の終了後、SARは、SM[1:0]ビットに応じて、インクリメント、デクリメント又は固定される。DARは、DM[1:0]ビットに応じて、インクリメント、デクリメント又は固定される。その後、TCR(TCRH)がデクリメントされる。リピートモードでは、以上で説明したデータ転送とレジスタ操作を、起動要因が発生するごとに、TCR(TCRH及びTCRL)で指定された回数だけ繰り返す。   In the repeat mode, data is transferred once from the transfer source address indicated by SAR to the transfer destination address indicated by DAR by one activation. After the data transfer is finished, the SAR is incremented, decremented or fixed according to the SM [1: 0] bits. The DAR is incremented, decremented or fixed according to the DM [1: 0] bits. Thereafter, TCR (TCRH) is decremented. In the repeat mode, the data transfer and the register operation described above are repeated as many times as specified by the TCR (TCRH and TCRL) each time an activation factor is generated.

指定された回数のデータ転送が終了すると、TCRHは「0」となる。その後、TCRLに保持した内容に基づいて、SAR、DAR及びTCRHの一部又は全部の初期設定値が回復される。   When the designated number of times of data transfer is completed, TCRH becomes “0”. After that, based on the contents held in the TCRL, some or all of the initial setting values of the SAR, DAR, and TCRH are recovered.

TCRHが「0」になった場合、TCRLの内容が転送カウンタレジスタのTCRHに転送される。これにより、TCRHは初期値に回復される。また、SAR又はDARは、以下の演算により、初期設定値に回復される。   When TCRH becomes “0”, the contents of TCRL are transferred to TCRH of the transfer counter register. Thereby, TCRH is restored to the initial value. In addition, SAR or DAR is restored to the initial setting value by the following calculation.

DIRビットが「1」にセットされているとき、式(1)に示す演算OP1が行われ、SARは初期設定値に回復される。

Figure 2018101448
When the DIR bit is set to “1”, the operation OP1 shown in Expression (1) is performed, and the SAR is restored to the initial setting value.
Figure 2018101448

DIRビットが「0」にクリアされているとき、式(2)に示す演算OP2が行われ、DARは初期設定値に回復される。

Figure 2018101448
When the DIR bit is cleared to “0”, the operation OP2 shown in Expression (2) is performed, and the DAR is restored to the initial setting value.
Figure 2018101448

上記の演算を行うには、リピート領域に指定したSAR又はDARに対して、TCRLの内容を、内部バス36を介してALU35に入力する。ALU35は、式(1)又は式(2)に示す演算を行うことで、SAR又はDARが初期化される。   In order to perform the above calculation, the contents of the TCRL are input to the ALU 35 via the internal bus 36 for the SAR or DAR specified as the repeat area. The ALU 35 initializes the SAR or DAR by performing the calculation shown in the formula (1) or the formula (2).

ブロック転送モード
TMD[1:0]ビットが「10」の場合、転送モードはブロック転送モードとなる。DIRビットが「0」にクリアされている場合、転送元アドレスをブロック領域として設定する。DIRビットが「1」にセットされている場合、転送先アドレスをブロック領域として設定する。ブロック転送モードでは、SARを転送元アドレス指定レジスタ、DARを転送先アドレス指定レジスタ、TCRHをブロックサイズカウントレジスタ、TCRLをブロックサイズ保持レジスタ、BTCRをブロック転送カウントレジスタとして使用する。
Block Transfer Mode When the TMD [1: 0] bits are “10”, the transfer mode is the block transfer mode. When the DIR bit is cleared to “0”, the transfer source address is set as a block area. When the DIR bit is set to “1”, the transfer destination address is set as a block area. In the block transfer mode, SAR is used as a transfer source address specification register, DAR as a transfer destination address specification register, TCRH as a block size count register, TCRL as a block size holding register, and BTCR as a block transfer count register.

ブロック転送モードでは、1回の起動で、SARで示される転送元アドレスからDARで示される転送先アドレスへ、ブロックサイズ分のデータ転送を行う。データ転送ごとに、SARは、SM[1:0]ビットに応じて、インクリメント、デクリメント又は固定される。DARは、DM[1:0]ビットに応じて、インクリメント、デクリメント又は固定される。その後、TCR(TCRH)がデクリメントされる。   In the block transfer mode, data corresponding to the block size is transferred from the transfer source address indicated by SAR to the transfer destination address indicated by DAR by one activation. For each data transfer, the SAR is incremented, decremented or fixed depending on the SM [1: 0] bits. The DAR is incremented, decremented or fixed according to the DM [1: 0] bits. Thereafter, TCR (TCRH) is decremented.

指定された回数のデータ転送が終了すると、TCRHが「0」となる。この場合、リピートモードと同様に、TCRLに保持した内容に基づいて、SAR、DAR及びTCRHの一部又は全部の初期設定値が回復される。   When the designated number of times of data transfer is completed, TCRH becomes “0”. In this case, as in the repeat mode, some or all of the initial setting values of SAR, DAR, and TCRH are recovered based on the contents held in the TCRL.

また、ブロック領域のデータ転送が終了すると、BTCRをデクリメントする。ブロック転送モードでは、以上で説明したブロック領域のデータ転送を、起動要因が発生するごとに、BTCRで指定された回数だけ(BTCRが「0」になるまで)繰り返す。   When the data transfer in the block area is completed, the BTCR is decremented. In the block transfer mode, the data transfer in the block area described above is repeated the number of times designated by the BTCR (until BTCR becomes “0”) every time an activation factor occurs.

図4に、DTC3の状態遷移図を示す。図4に示す状態遷移は、主として、DTC3のデータ転送制御ブロック(DTCCNT)31に実装される。   FIG. 4 shows a state transition diagram of DTC3. The state transition shown in FIG. 4 is mainly implemented in the data transfer control block (DTCCNT) 31 of DTC3.

DTC3は、INT2から起動要求信号DTCREQが与えられると、VRステートに遷移する。VRステートに遷移後、DTC3は、ベクタ番号DTCVECに従って、VG33で生成したベクタアドレスに基づき、ベクタ領域(データ転送情報先頭アドレス配置領域)に格納されたデータ転送情報の先頭アドレスをリードする。DTC3は、リードした内容を、VAR34に格納する。   When the activation request signal DTCREQ is given from the INT2, the DTC3 transits to the VR state. After the transition to the VR state, the DTC 3 reads the start address of the data transfer information stored in the vector area (data transfer information start address arrangement area) based on the vector address generated by the VG 33 according to the vector number DTCVEC. The DTC 3 stores the read contents in the VAR 34.

次に、DTC3は、IRステートに遷移する。IRステートに遷移後、DTC3は、VRステートにてリードした先頭アドレスに従って、データ転送情報配置領域に格納されたデータ転送情報をリードする。この際、DTC3は、MR、DR、SAR1、SAR2、DAR及びCRをリードする。   Next, DTC 3 transitions to the IR state. After the transition to the IR state, the DTC 3 reads the data transfer information stored in the data transfer information arrangement area according to the head address read in the VR state. At this time, the DTC 3 reads MR, DR, SAR1, SAR2, DAR, and CR.

DTC3は、TLUビットが「0」にクリアされている状態で、ノーマルモードのデータ転送を行う場合は、SRステート、DWステート、IWステートと遷移する。   In the state where the TLU bit is cleared to “0” and the normal mode data transfer is performed, the DTC 3 transits to the SR state, the DW state, and the IW state.

SRステートでは、DTC3は、SAR2の内容に従い、転送元アドレスの内容をリードする。また、DTC3は、MRの内容に従い、SAR2のインクリメントなどを行う。   In the SR state, the DTC 3 reads the content of the transfer source address according to the content of the SAR2. The DTC 3 increments the SAR 2 according to the contents of the MR.

DWステートでは、DTC3は、リードした内容を、DARの内容に従い、転送先アドレスへライトする。また、DTC3は、MRの内容に従い、DARのインクリメントやCRのデクリメントなどを行う。   In the DW state, the DTC 3 writes the read contents to the transfer destination address according to the contents of the DAR. The DTC 3 increments the DAR, decrements the CR, and the like according to the contents of the MR.

IWステートでは、DTC3は、VAR34の内容に従って、MR、SAR1、SAR2、DAR及びCRをデータ転送情報配置領域に書き戻す。但し、IWステートでは、MR、DR、SAR、DAR及びCRの内で更新されなかったもののライトを行わないようにすることができる。例えば、DARが固定の場合、DARのライトは行わない。   In the IW state, DTC 3 writes MR, SAR1, SAR2, DAR, and CR back to the data transfer information allocation area according to the contents of VAR34. However, in the IW state, it is possible to prevent writing of data that has not been updated among MR, DR, SAR, DAR, and CR. For example, when the DAR is fixed, the DAR is not written.

なお、DTC3は、MRの内容に従い、ブロック転送モードのデータ転送を行う場合は、上述のSRステート、DWステートの動作を、TCRで指定された回数だけ繰り返す。   The DTC 3 repeats the above-described SR state and DW state operations as many times as specified by the TCR when performing data transfer in the block transfer mode in accordance with the contents of the MR.

その後、チェイン動作を行わない場合、DTC3は、CRの内容に従って、起動要因となった割り込み要因フラグ又はDTEビットをクリアし、動作を終了して、停止状態に戻る。   After that, when the chain operation is not performed, the DTC 3 clears the interrupt factor flag or the DTE bit that becomes the activation factor according to the contents of CR, ends the operation, and returns to the stopped state.

チェイン動作を行う場合、DTC3は、IWステートからIRステートへと戻り、別のデータ転送を行うことができる。   When performing a chain operation, the DTC 3 returns from the IW state to the IR state and can perform another data transfer.

一方、DTC3は、TLUビットが「1」にクリアされている状態(テーブル参照を行う場合)で、ノーマルモードのデータ転送を行う場合は、IRステートからDRステートに遷移する。   On the other hand, the DTC 3 transitions from the IR state to the DR state when performing data transfer in the normal mode when the TLU bit is cleared to “1” (when referring to the table).

DRステートでは、DTC3は、テーブルを参照するための入力データをリードする。その後は、上述の通り、SRステート、DWステート、IWステートと遷移する。SRステートでは、入力データとSAR2の内容に基づき、所要のテーブルを参照(リード)する。その後は、通常データ転送モードと同様である。   In the DR state, the DTC 3 reads input data for referring to the table. After that, as described above, the state transits to the SR state, the DW state, and the IW state. In the SR state, a required table is referenced (read) based on the input data and the contents of SAR2. After that, it is the same as the normal data transfer mode.

本実施の形態では、テーブル参照モードのうち、分岐モードを選択して動作を行う。 分岐モードでは、TLUビットが「1」、かつ、BRMビットが「1」の場合、テーブル参照モードは分岐モードとなる。図5に、分岐モードでのデータ転送を示す。   In the present embodiment, the operation is performed by selecting a branch mode among the table reference modes. In the branch mode, when the TLU bit is “1” and the BRM bit is “1”, the table reference mode is the branch mode. FIG. 5 shows data transfer in the branch mode.

CPU1は、所要のデータ転送情報を、所定の転送情報アドレス領域にライトしておく。テーブルデータとして、当該データ転送情報による動作に引き続いて実行するデータ転送情報の先頭アドレスのオフセットを用意しておく。この状態で、割り込み要因が発生してDTC3が起動されると、対応するベクタ領域からデータ転送情報先頭アドレスをリードする(VRステート)。   The CPU 1 writes required data transfer information in a predetermined transfer information address area. As table data, an offset of the head address of data transfer information to be executed following the operation according to the data transfer information is prepared. In this state, when an interrupt factor occurs and DTC 3 is activated, the data transfer information head address is read from the corresponding vector area (VR state).

リードしたアドレスに基づいて、データ転送情報配置領域からデータ転送情報INF11をリードする(IRステート)。このときのデータ転送情報INF11は、MR、SAR1及びSAR2となる。   Based on the read address, the data transfer information INF11 is read from the data transfer information arrangement area (IR state). The data transfer information INF11 at this time is MR, SAR1, and SAR2.

SAR1で指定したアドレスから、ISz[1:0]ビットで指定したデータサイズのデータをリードする(DRステート)。ここでリードしたデータを判定データと称する。判定データは、前記の、引き続いてチェイン動作として実行するデータ転送情報の先頭アドレスのオフセットである。   Data having a data size designated by ISz [1: 0] bits is read from the address designated by SAR1 (DR state). The data read here is referred to as determination data. The determination data is an offset of the start address of the data transfer information that is subsequently executed as a chain operation.

ALU35は、リードした判定データを、Sz[1:0]ビットで指定した転送データサイズ(テーブルのデータサイズ)に応じて、1、2、4倍し、又は、0、1、2ビットだけシフトして、テーブルのオフセット値を生成する。シフト量は、必要に応じてSF[2:0]ビットで指定することができる。そして、テーブルのオフセット値をSAR2に加算して転送元アドレスとして使用する。   The ALU 35 multiplies the read determination data by 1, 2, or 4 according to the transfer data size (table data size) specified by the Sz [1: 0] bit, or shifts it by 0, 1, or 2 bits. Then, an offset value of the table is generated. The shift amount can be specified by SF [2: 0] bits as necessary. Then, the offset value of the table is added to SAR2 and used as the transfer source address.

前記の転送元アドレスから転送データをリードする(SRステート)。なお、リードした転送データのライトは行わない(DWステート)。   Read transfer data from the transfer source address (SR state). Note that the read transfer data is not written (DW state).

その後、SAR2の更新、及び元のデータ転送情報INF11のアドレスにライトすることなく、IRステートでリードしたMR、SAR1及びSAR2に相当する、VARのインクリメントを行い、データ転送情報INF11による処理を終了する(IWステート)。   Thereafter, without updating the SAR2 and writing to the address of the original data transfer information INF11, the VAR corresponding to MR, SAR1, and SAR2 read in the IR state is incremented, and the processing by the data transfer information INF11 is completed. (IW state).

次いで、テーブルからリードした内容に16を乗算し、又は、4ビットシフトした結果を、データ転送情報INF11の次のアドレスに相当するVARに加算する。これにより、チェイン動作として起動するデータ転送情報の先頭アドレスが生成される。なお、テーブルに16を乗算するのは、データ転送情報が4ロングワード(すなわち16バイト)であることに対応したものである。   Next, the content read from the table is multiplied by 16, or the result of 4-bit shift is added to VAR corresponding to the next address of the data transfer information INF11. Thereby, the head address of the data transfer information that is activated as a chain operation is generated. Note that multiplying the table by 16 corresponds to the fact that the data transfer information is 4 long words (ie, 16 bytes).

次いで、生成されたチェイン動作で起動するデータ転送情報の先頭アドレスに基づいて、データ転送情報INF22をリードし、データ転送を行う。   Next, the data transfer information INF22 is read based on the top address of the data transfer information activated by the generated chain operation, and data transfer is performed.

分岐モードでは、例えば、シリアルコミュニケーションインタフェース(SCI)などの通信手段を介してコマンドを入力し、受信完了割り込みでDTC3を起動する。このコマンドを判定データとしてテーブル参照を行い、テーブル参照結果に対応したデータ転送情報を得ることができる。そして、引き続き、生成したデータ転送情報に基づき、データ転送(チェイン動作)を行う。これによれば、コマンドに対応したパラメータ(テーブルに格納されているオフセット)でデータ転送情報を指定することができる。その結果、パラメータに対応して、柔軟に転送元アドレス及び転送先アドレスを選択することができる。   In the branch mode, for example, a command is input via a communication means such as a serial communication interface (SCI), and the DTC 3 is activated by a reception completion interrupt. By referring to the table using this command as determination data, data transfer information corresponding to the table reference result can be obtained. Subsequently, data transfer (chain operation) is performed based on the generated data transfer information. According to this, the data transfer information can be designated by the parameter (offset stored in the table) corresponding to the command. As a result, the transfer source address and the transfer destination address can be flexibly selected in accordance with the parameters.

図6に、分岐モードでのデータ転送情報の指定の一例を示す。分岐モードでは、判定データに従ってチェイン動作でのデータ転送に用いるデータ転送情報を切り替えるために、必要な組数のデータ転送情報が予め用意される。   FIG. 6 shows an example of designation of data transfer information in the branch mode. In the branch mode, a necessary number of sets of data transfer information are prepared in advance in order to switch data transfer information used for data transfer in the chain operation according to the determination data.

データ転送情報INF11は、ベクタで指定される。データ転送情報INF11による1つめのデータ転送の終了後、VARに格納したアドレスにデータ転送情報INF11をライトするとともに、アドレスのインクリメントを行い、データ転送情報INF11を格納した次のアドレスをVARに保持する。   The data transfer information INF11 is specified by a vector. After completion of the first data transfer by the data transfer information INF11, the data transfer information INF11 is written to the address stored in the VAR, the address is incremented, and the next address storing the data transfer information INF11 is held in the VAR. .

分岐モードでは、データ転送情報INF11が更新されないので、実際のライトは行わず、DTC3内部でアドレス(VAR)のインクリメントのみを行うようにする。   In the branch mode, since the data transfer information INF11 is not updated, the actual write is not performed, and only the address (VAR) is incremented within the DTC 3.

VARと判定データに16を乗算したものとをALU35で加算して、データ転送情報INF22の先頭アドレスを得る。   The ALU 35 adds the VAR and the determination data multiplied by 16 to obtain the head address of the data transfer information INF22.

なお、判定データに16を乗算せずに、判定データにVARを加算してもよい。これによれば、データ転送情報が可変長である場合でも判定データの設定によって対応できる。   Note that VAR may be added to the determination data without multiplying the determination data by 16. According to this, even when the data transfer information has a variable length, it can be handled by setting the determination data.

複数のコマンドないしパラメータに対し、同一のデータないしデータ転送情報INF12を使用することもできる。例えば、CPUに委ねるべき複数のコマンドに対しては、データ転送情報INF12においてノーオペレーションモードを指定し、DTEビットを「0」にクリアして、CPUに割り込みを要求するようにする。   The same data or data transfer information INF12 can be used for a plurality of commands or parameters. For example, for a plurality of commands to be entrusted to the CPU, the no operation mode is designated in the data transfer information INF12, the DTE bit is cleared to “0”, and an interrupt is requested to the CPU.

また、例えば、ステータス要求コマンドに対応したパラメータに「0」を設定した場合、データ転送情報INF11に連続する領域のデータ転送情報INF12に、所定のステータスレジスタの所定の送信データレジスタへのデータ転送などを設定するようにする。CPUの処理を必要とせず、コマンドに対する応答をDTCのみで実現できる。   For example, when “0” is set in the parameter corresponding to the status request command, the data transfer information INF12 in the area continuous to the data transfer information INF11 is transferred to the predetermined transmission data register of the predetermined status register. To set. A response to the command can be realized only by the DTC without requiring any CPU processing.

以上、本構成によれば、入力データに対応した出力データを、テーブルを参照して得ることによって、制御に対応した制御を実現できる。また、テーブルを利用することで、制御に対応した制御を行うために要する専用のハードウェアを最小限にすることができる。また、入力データの有効なビットを指定する(DRとの論理積、およびシフト)ことで、テーブルの情報量を小さくすることができる。   As described above, according to this configuration, the control corresponding to the control can be realized by obtaining the output data corresponding to the input data with reference to the table. Further, by using the table, it is possible to minimize the dedicated hardware required for performing control corresponding to the control. In addition, by specifying valid bits of input data (logical product with DR and shift), the amount of information in the table can be reduced.

また、本構成によれば、イベントに呼応した通常のデータ転送(通常データ転送)機能と、テーブル参照を行うデータ転送(テーブル参照)機能を、1つのハードウェアで実現できる。これらの機能は、データ転送情報で切り替えることができる。つまり、1回のデータ転送に必要な分だけ専用のハードウェアを設ければ足りる。よって、機能の追加により、使用するデータ転送情報の量が増え、その結果ハードウェア規模が増えても、半導体装置(マイクロコンピュータ)全体の物理的な規模の増加を抑制することができる。換言すれば、通常のデータ転送機能と、テーブル参照を行うデータ転送機能とを、1つのハードウェアで実現できるので、半導体装置(マイクロコンピュータ)の物理的な規模の増加を抑制することができる。また、割込みコントローラやDTCベクタなどを共通化して、ハードウェア構成を簡略化することができる。   Also, according to this configuration, a normal data transfer function (normal data transfer) function corresponding to an event and a data transfer function (table reference) function for referring to a table can be realized by a single piece of hardware. These functions can be switched by data transfer information. That is, it is sufficient to provide dedicated hardware as much as necessary for one data transfer. Therefore, by adding functions, the amount of data transfer information to be used increases, and as a result, even if the hardware scale increases, an increase in the physical scale of the entire semiconductor device (microcomputer) can be suppressed. In other words, the normal data transfer function and the data transfer function for referring to the table can be realized by a single piece of hardware, so that an increase in the physical scale of the semiconductor device (microcomputer) can be suppressed. Also, the hardware configuration can be simplified by sharing the interrupt controller, DTC vector, and the like.

本構成では、CRを無効とする指定を行うことができる。これにより、所定回数のデータ転送を行うこととは別に、半導体装置(マイクロコンピュータ)の状態に応じた制御を任意の回数実行することができる。その結果、データ転送情報を短縮して、DTC動作の高速化と、メモリの利用効率の向上と、を実現できる。また、CRを無効とすることで、データ転送情報の更新を行わない、すなわち、データ転送情報の書き戻しを不要とすることができる。   In this configuration, it is possible to specify that the CR is invalid. As a result, apart from performing a predetermined number of data transfers, control according to the state of the semiconductor device (microcomputer) can be executed any number of times. As a result, the data transfer information can be shortened, and the DTC operation can be speeded up and the memory utilization efficiency can be improved. Also, by disabling CR, the data transfer information is not updated, that is, it is not necessary to write back the data transfer information.

本構成によれば、DTCがCPUに代わって、データ転送やテーブル参照を実行可能である。これにより、CPUに割り込みを要求する頻度を低減し、CPUを低消費電力状態とする期間を長くすることができる。また、CPUが割り込み処理にあたって実行すべき例外処理、スタックの退避・復帰操作、及び、復帰命令の実行を不要とすることができ、プログラムの簡略化やシステムの効率化に寄与することができる。また、イベントの発生から所要の動作の実行までの時間を短縮し、いわゆる応答性を向上することができる。更に、DTCは、CPUより論理規模が小さく、かつ高速に処理を行うことができる。これにより、DTC動作中にCPUを低消費電力状態とすることで、半導体装置(マイクロコンピュータ)の低消費電力化を実現することができる。   According to this configuration, the DTC can execute data transfer and table reference instead of the CPU. As a result, the frequency of requesting an interrupt to the CPU can be reduced, and the period during which the CPU is in a low power consumption state can be extended. Further, it is possible to eliminate the exception processing, stack save / restore operation, and execution of the return instruction to be executed by the CPU in interrupt processing, which can contribute to the simplification of the program and the efficiency of the system. In addition, the time from the occurrence of an event to the execution of a required operation can be shortened, and so-called responsiveness can be improved. Furthermore, the DTC has a smaller logical scale than the CPU and can perform processing at high speed. Thereby, the power consumption of the semiconductor device (microcomputer) can be reduced by setting the CPU in the low power consumption state during the DTC operation.

また、本実施の形態で説明したデータ転送装置は、特に使用用途は限定されず、RAMなどの汎用的な記憶装置にデータ転送情報を格納できるものである。このようなデータ転送装置には、以下の利点がある。
(1)データ転送の数を増やすことができる。いわゆるDMA(Direct Memory Access)コントローラのように、データ転送情報をデータ転送装置自身の専用のハードウェアとして持つ方式では、実装されたハードウェアによってデータ転送の数が制限される。これに対し、データ転送装置は、データ転送情報を使用用途の限定されないRAMに格納するので、データ転送の数を増やすことが容易であり、利用者の種々の使用方法に対応することができる。
(2)いわゆるDMAコントローラのように、起動要因の選択をデータ転送装置自身の制御レジスタによる指定およびマイクロコンピュータのインタフェースとして実装する方式では、多くの割り込みないしイベントに対応するのが困難である。これに対し、データ転送装置は、割り込み要因を利用して、CPUに割り込みを要求するか、DTCにデータ転送を要求するかを選択することができる。これにより、多くの割り込みないしイベント発生に対して、データ転送を行うことができる。
(3)チェイン動作など1回の起動時に実行するデータ転送の数を増やすことができ、異なるデータ転送を組み合わせて機能を実現できる。
(4)データ転送情報の構成を変更できる。また、データ転送情報を構成するデータの増減ができる。
(5)専用のハードウェアは、最低限(1回)のデータ転送に必要な分をもうければよい。そのため、MCUの機能を追加して、ハードウェア規模が増えても、MCU全体の物理的な規模の増加を抑制することができる。
(6)データ転送装置自身の専用のハードウェアとして、制御レジスタなどを持たないため、CPUからのライトとの競合など、複雑な動作条件を考慮する必要がない。よって、MCUの物理的な規模の増加を抑止することに寄与できる。
Further, the data transfer device described in this embodiment is not particularly limited in usage, and can store data transfer information in a general-purpose storage device such as a RAM. Such a data transfer device has the following advantages.
(1) The number of data transfers can be increased. In a system having data transfer information as dedicated hardware of the data transfer apparatus itself, such as a so-called DMA (Direct Memory Access) controller, the number of data transfers is limited by the installed hardware. On the other hand, since the data transfer device stores the data transfer information in a RAM that is not limited to the intended use, it is easy to increase the number of data transfers, and it is possible to cope with various usage methods of the user.
(2) As in the so-called DMA controller, it is difficult to deal with many interrupts or events in a method in which the selection of the activation factor is specified by the control register of the data transfer device itself and the microcomputer interface. On the other hand, the data transfer device can select whether to request an interrupt from the CPU or to request a data transfer from the DTC using an interrupt factor. Thus, data transfer can be performed for many interrupts or event occurrences.
(3) It is possible to increase the number of data transfers to be executed at one activation such as a chain operation, and to realize a function by combining different data transfers.
(4) The configuration of the data transfer information can be changed. In addition, the data constituting the data transfer information can be increased or decreased.
(5) The dedicated hardware only needs to have the minimum necessary (one time) data transfer. Therefore, even if the function of the MCU is added and the hardware scale increases, an increase in the physical scale of the entire MCU can be suppressed.
(6) Since there is no control register or the like as dedicated hardware of the data transfer apparatus itself, it is not necessary to consider complicated operating conditions such as competition with writing from the CPU. Therefore, it can contribute to suppressing an increase in the physical scale of the MCU.

実施の形態2
実施の形態2にかかるマイクロコンピュータについて説明する。本実施の形態では、テーブル参照モードがシフトモードである場合のMCU100の動作について説明する。図7に、シフトモードでのデータ転送を示す。TLUビットが「1」かつSFTビットが「1」の場合、テーブル参照モードはシフトモードとなる。
Embodiment 2
A microcomputer according to the second embodiment will be described. In the present embodiment, the operation of the MCU 100 when the table reference mode is the shift mode will be described. FIG. 7 shows data transfer in the shift mode. When the TLU bit is “1” and the SFT bit is “1”, the table reference mode is the shift mode.

CPU1は、所要のデータ転送情報を、所定の転送情報アドレス領域にライトしておく。テーブルデータとして、当該データ転送情報でライトするデータ(出力データとも称する)、例えば、速度パラメータを用意しておく。この状態で、割り込み要因が発生し、DTC3が起動されると、対応するベクタ領域から、データ転送情報先頭アドレスをリードする(VRステート)。   The CPU 1 writes required data transfer information in a predetermined transfer information address area. As table data, data to be written with the data transfer information (also referred to as output data), for example, a speed parameter is prepared. In this state, when an interrupt factor is generated and DTC 3 is activated, the data transfer information head address is read from the corresponding vector area (VR state).

リードしたアドレスに基づいて、データ転送情報配置領域からデータ転送情報INF21をリードする(IRステート)。シフトモードでは、データ転送情報INF21は、MR、SAR1、SAR2及びDARである。   Based on the read address, the data transfer information INF21 is read from the data transfer information arrangement area (IR state). In the shift mode, the data transfer information INF21 is MR, SAR1, SAR2, and DAR.

SAR1で指定したアドレスから、ISz[1:0]ビットで指定したデータサイズのデータをリードする(DRステート)。ここでは、リードしたデータをシフトデータと称する。   Data having a data size designated by ISz [1: 0] bits is read from the address designated by SAR1 (DR state). Here, the read data is referred to as shift data.

ALU35は、リードしたシフトデータを、Szビット[1:0]で指定した転送データサイズ(テーブルのデータサイズ)に応じて、1、2、4倍し、又は、0、1、2ビットだけシフトする演算を行う。シフト量は、必要に応じて、SF[2:0]ビットで指定することができる。そして、演算結果をSAR2に加算して転送元アドレスとして使用する。DTC3は、SAR2の内容として、加算結果をセットする。   The ALU 35 doubles the read shift data according to the transfer data size (table data size) specified by the Sz bits [1: 0], or shifts it by 0, 1, 2 bits. Perform the operation. The shift amount can be specified by SF [2: 0] bits as necessary. Then, the operation result is added to SAR2 and used as a transfer source address. DTC3 sets the addition result as the contents of SAR2.

SAR2で指定した転送元アドレスから転送データをリードし(SRステート)、DARで指定した転送先アドレスにライトする(DWステート)。転送先アドレスは、例えばタイマなどとされる。   Transfer data is read from the transfer source address specified by SAR2 (SR state), and written to the transfer destination address specified by DAR (DW state). The transfer destination address is, for example, a timer.

その後、データ転送情報の内で更新が行われたもの、具体的には、SAR2を元のアドレスにライトする(IWステート)。   Thereafter, the data transfer information that has been updated, specifically, SAR2 is written to the original address (IW state).

図8に、シフトモードで使用するテーブルの指定方法の一例を示す。例えば、モータの速度を指定するデータの制御において、モータを駆動するタイマに速度データを与える場合を想定する。この速度パラメータは、予め計算しておき、テーブルとしてROMに格納しておく。そのアドレスはSAR2で指定するものとする。この速度パラメータは、例えば16ビットであり、昇順に速度が大きくなるようにする。   FIG. 8 shows an example of a method for specifying a table used in the shift mode. For example, assume that speed data is given to a timer that drives a motor in control of data that specifies the speed of the motor. The speed parameter is calculated in advance and stored in the ROM as a table. The address is designated by SAR2. This speed parameter is, for example, 16 bits, and the speed increases in ascending order.

Sz[1:0]ビットでワードサイズを指定し、入力データ(シフトデータ)を2倍してSAR2に加算する。初期設定の段階では、SAR2はパラメータ0を指定するようにする。   The word size is designated by Sz [1: 0] bits, the input data (shift data) is doubled and added to SAR2. In the initial setting stage, SAR2 designates parameter 0.

モータを駆動する必要が生じた場合は、シフトデータに基づき、所定の速度パラメータ、例えばパラメータmをタイマに転送する。別のタイマやアナログ入力でモータの状態を監視し、加速が十分と判断したならば、負方向のシフトデータ、すなわち、より速度の遅い速度パラメータ(パラメータn)を得て、これをタイマに転送する。   When it becomes necessary to drive the motor, a predetermined speed parameter, for example, parameter m is transferred to the timer based on the shift data. If the motor status is monitored by another timer or analog input and it is judged that acceleration is sufficient, negative shift data, that is, a slower speed parameter (parameter n) is obtained and transferred to the timer. To do.

この例では、例えばマイクロコンピュータの制御するモータの状態をA/D変換器(アナログモジュール9に相当)で入力する。この入力を変換完了割り込みとして、DTC3を起動できる。そして、A/D変換器での変換結果をシフトデータとして使用し、モータを駆動するタイマに速度データ(出力データ)を与えることができる。モータの状態に対応した速度データは、予め計算してテーブルとしてROMに格納しておくので、実動作状態においては演算を行う必要はなく、テーブルを参照すればよい。   In this example, for example, the state of the motor controlled by the microcomputer is input by an A / D converter (corresponding to the analog module 9). The DTC 3 can be activated using this input as a conversion completion interrupt. Then, the conversion result of the A / D converter can be used as shift data, and speed data (output data) can be given to a timer that drives the motor. Since the speed data corresponding to the motor state is calculated in advance and stored in the ROM as a table, it is not necessary to perform calculation in the actual operation state, and the table may be referred to.

上記説明した様に、シフトモードを用いることで、マイクロコンピュータの制御対象の状態をフィードバックしたデータ転送を行うことができる。   As described above, by using the shift mode, data transfer can be performed by feeding back the state of the microcomputer to be controlled.

実施の形態3
実施の形態3にかかるマイクロコンピュータについて説明する。本実施の形態では、テーブル参照モードがオフセットモードである場合のMCU100の動作について説明する。図9に、オフセットモードでのデータ転送を示す。TLUビットが「1」、かつ、OFMビットが「1」の場合、テーブル参照モードはオフセットモードとなる。
Embodiment 3
A microcomputer according to the third embodiment will be described. In the present embodiment, the operation of the MCU 100 when the table reference mode is the offset mode will be described. FIG. 9 shows data transfer in the offset mode. When the TLU bit is “1” and the OFM bit is “1”, the table reference mode is the offset mode.

まず、シフトモードの場合と同様に、VRステート、IRステートと遷移する。オフセットモードでのデータ転送情報INF31は、MR、DR、SAR1、SAR2及びDARである。   First, as in the shift mode, the state transits to the VR state and the IR state. The data transfer information INF31 in the offset mode is MR, DR, SAR1, SAR2, and DAR.

SAR1で指定したアドレスから、データをリードする(DRステート)。ここでは、リードしたデータをオフセットデータと称する。   Data is read from the address designated by SAR1 (DR state). Here, the read data is referred to as offset data.

DRには、リードしたオフセットデータの有効なビットを指定するマスクデータを保持しておく。例えば、オフセットデータが32ビットで、上位8ビットと下位4ビットを無視する場合は、マスクデータとして「00FFFFF0」をセットする。なお、上位8ビットを無視したので、符号拡張を行うようにするとよい。また、下位4ビットを無視したので、一旦4ビット右シフトを行う。そして、Sz[1:0]ビットで指定したサイズに応じて、0、1、2ビットだけ左シフトを行う。左シフト終了後の結果を、SAR2に加算して、加算結果を転送元アドレスとして使用する。DTC3は、SAR2の内容として、加算結果をセットする。   In DR, mask data designating valid bits of the read offset data is held. For example, when the offset data is 32 bits and the upper 8 bits and the lower 4 bits are ignored, “00FFFFF0” is set as the mask data. Since the upper 8 bits are ignored, sign extension should be performed. Since the lower 4 bits are ignored, 4-bit right shift is performed once. Then, the left shift is performed by 0, 1, 2 bits according to the size specified by the Sz [1: 0] bits. The result after the end of the left shift is added to SAR2, and the addition result is used as the transfer source address. DTC3 sets the addition result as the contents of SAR2.

SAR2で指定した転送元アドレスから転送データをリードし(SRステート)、DARで指定した転送先アドレスにライトする(DWステート)。   Transfer data is read from the transfer source address specified by SAR2 (SR state), and written to the transfer destination address specified by DAR (DW state).

その後、SAR2の更新、すなわち、データ転送情報の内で更新が行われたSAR2を元のアドレスにライトすることなく、処理を終了する(IWステート)。   Thereafter, the process is terminated (IW state) without updating the SAR2, that is, without writing the updated SAR2 in the data transfer information to the original address.

図10に、オフセットモードで使用するテーブルの指定方法の一例を示す。テーブルの構造は、シフトモードの場合と同様とすることができる。   FIG. 10 shows an example of a method for specifying a table used in the offset mode. The structure of the table can be the same as in the shift mode.

SAR2は、テーブルの基準アドレスを保持する。図10では、アドレス領域の中央を基準アドレス(パラメータm)としているが、先頭アドレスなどの他のアドレスを基準アドレスとしてもよい。入力データ(オフセットデータ)に基づくオフセットを基準アドレスに加算して、出力データ(パラメータn)が得られる。   SAR2 holds the reference address of the table. In FIG. 10, the center of the address area is the reference address (parameter m), but another address such as the head address may be used as the reference address. Output data (parameter n) is obtained by adding an offset based on the input data (offset data) to the reference address.

そして、入力データの有効なビットを指定する(DRとの論理積)ことで、必要なテーブルを小さくすることができる。   By specifying valid bits of input data (logical product with DR), a necessary table can be reduced.

実施の形態4
実施の形態4にかかるマイクロコンピュータについて説明する。本実施の形態では、テーブル参照モードを応用したPID制御を行う場合のMCU100の動作について説明する。本実施の形態では、テーブル参照モードとして、比例モード(P)、積分モード(I)及び微分モード(D)を用いる。そして、比例モード、積分モード及び微分モードでのデータ転送結果を転送モードの1つであるブロック加算モードでのデータ転送で加算することで、PID制御を実現する。以下、各テーブル参照モードとブロック加算モードでのデータ転送について説明する。
Embodiment 4
A microcomputer according to the fourth embodiment will be described. In the present embodiment, the operation of the MCU 100 when performing PID control using the table reference mode will be described. In the present embodiment, proportional mode (P), integral mode (I), and differential mode (D) are used as the table reference mode. Then, PID control is realized by adding the data transfer results in the proportional mode, the integral mode and the differential mode in the data transfer in the block addition mode which is one of the transfer modes. Hereinafter, data transfer in each table reference mode and block addition mode will be described.

比例モード
比例モードについて説明する。図11に、比例モードでのデータ転送を示す。TLUビットが「1」、かつ、PRMビットが「1」の場合、テーブル参照モードは比例モードとなる。
Proportional mode The proportional mode is explained. FIG. 11 shows data transfer in the proportional mode. When the TLU bit is “1” and the PRM bit is “1”, the table reference mode is the proportional mode.

まず、シフトモードの場合と同様に、VRステート、IRステートと遷移する。比例モードのデータ転送情報INF41は、MR、DR、SAR1、SAR2及びDARである。   First, as in the shift mode, the state transits to the VR state and the IR state. The data transfer information INF41 in the proportional mode is MR, DR, SAR1, SAR2, and DAR.

SAR1で指定したアドレスから、データをリードする(DRステート)。ここでは、リードデータを現在値データと称する。   Data is read from the address designated by SAR1 (DR state). Here, the read data is referred to as current value data.

DRには、目標値データを保持しておく。そして、現在値データと目標値データとの偏差を求める。そして、Sz[1:0]ビットで指定したサイズに応じて、0、1、2ビットだけ左シフトを行う。左シフト終了後の結果をSAR2に加算して、加算結果を転送元アドレスとして使用する。DTC3は、SAR2の内容として、加算結果をセットする。   Target value data is held in DR. Then, a deviation between the current value data and the target value data is obtained. Then, the left shift is performed by 0, 1, 2 bits according to the size specified by the Sz [1: 0] bits. The result after the end of the left shift is added to SAR2, and the addition result is used as the transfer source address. DTC3 sets the addition result as the contents of SAR2.

その後、オフセットモードと同様に、SRステート、DWステートと遷移する。   Thereafter, as in the offset mode, the state transits to the SR state and the DW state.

その後、SAR2の更新、すなわち、データ転送情報の内で更新が行われたSAR2を元のアドレスにライトすることなく、処理を終了する(IWステート)。   Thereafter, the process is terminated (IW state) without updating the SAR2, that is, without writing the updated SAR2 in the data transfer information to the original address.

現在値データは、A/D変換器(アナログモジュール9に相当)の変換結果ないしタイマの位相計数などによって得ることができる。DTC3は、A/D変換器の変換終了割り込みやインターバルタイマ(タイマ7に相当)割り込みなどによって起動することができる。   The current value data can be obtained by the conversion result of the A / D converter (corresponding to the analog module 9) or the phase count of the timer. The DTC 3 can be started by a conversion end interrupt of the A / D converter, an interval timer (corresponding to the timer 7) interrupt, or the like.

比例モードでは、入力データである制御対象の現在値と目標値との偏差に応じた出力データを、テーブルを参照して得ることができる。例えば、偏差が大きければ出力データを大きく、偏差が小さければ出力データを小さくするといった比例制御を実現することができる。   In the proportional mode, output data corresponding to the deviation between the current value of the controlled object that is input data and the target value can be obtained by referring to the table. For example, proportional control can be realized in which the output data is increased if the deviation is large and the output data is decreased if the deviation is small.

微分モード
次いで、微分モードについて説明する。図12に、微分モードでのデータ転送を示す。TLUビットが「1」かつDRMビットが「1」の場合、テーブル参照モードは微分モードとなる。
Differential Mode Next, the differential mode will be described. FIG. 12 shows data transfer in the differential mode. When the TLU bit is “1” and the DRM bit is “1”, the table reference mode is the differential mode.

まず、シフトモードの場合と同様に、VRステート、IRステートと遷移する。微分モードのデータ転送情報INF51は、MR、DR、SAR1、SAR2及びDARである。   First, as in the shift mode, the state transits to the VR state and the IR state. The differential mode data transfer information INF51 is MR, DR, SAR1, SAR2, and DAR.

SAR1で指定したアドレスから、現在値データをリードする(DRステート)。   Current value data is read from the address designated by SAR1 (DR state).

DRには前回の(古い)現在値データを保持しておき、リードした新しい現在値データと前回の現在値データとの比較を行う。この減算結果は微分値(速度)に相当する。そして、Sz[1:0]ビットで指定したサイズに応じて、0、1、2ビットだけ左シフトを行う。左シフト終了後の結果をSAR2に加算して、加算結果を転送元アドレスとして使用する。DTC3は、SAR2の内容として、加算結果をセットする。DRの内容を、リードした新しい現在値データに置き換える。   The previous (old) current value data is held in the DR, and the new current value data read is compared with the previous current value data. This subtraction result corresponds to a differential value (speed). Then, the left shift is performed by 0, 1, 2 bits according to the size specified by the Sz [1: 0] bits. The result after the end of the left shift is added to SAR2, and the addition result is used as the transfer source address. DTC3 sets the addition result as the contents of SAR2. The contents of DR are replaced with the read new current value data.

その後、オフセットモードと同様に、SRステート、DWステートと遷移する。   Thereafter, as in the offset mode, the state transits to the SR state and the DW state.

その後、データ転送情報の内で更新が行われたもの、具体的には、DR(リードした新しい現在値データ)を元のアドレスにライトする(IWステート)。   After that, the updated data transfer information, specifically, the DR (the new current value data read) is written to the original address (IW state).

微分モードによれば、入力データである制御対象の現在値の2回の変化(微分値)に応じた出力データを、テーブルを参照して得ることができる。例えば、変化が大きければ出力データを小さく、変化が小さければ出力データを大きく、といった微分制御が実現できる。   According to the differential mode, output data corresponding to two changes (differential values) of the current value of the controlled object that is input data can be obtained by referring to the table. For example, differential control can be realized such that the output data is small if the change is large, and the output data is large if the change is small.

積分モード
次いで、積分モードについて説明する。図13に、積分モードでのデータ転送を示す。TLUビットは「1」にセットされる。積分モードでは、チェイン動作により結合された2つのデータ転送を行う。TMD[1:0]ビットは「01」(リピートモード)にセットされ、NXTE1ビットは「1」にセット(チェイン動作)される。
Integration Mode Next, the integration mode will be described. FIG. 13 shows data transfer in the integration mode. The TLU bit is set to “1”. In the integration mode, two data transfers combined by a chain operation are performed. The TMD [1: 0] bit is set to “01” (repeat mode), and the NXTE1 bit is set to “1” (chain operation).

まず、1つめのデータ転送を行う。このときのデータ転送情報INF61は、MR、DR、SAR1、DAR及びCRである。このとき、DREビットは「1」にセットされる。   First, the first data transfer is performed. The data transfer information INF61 at this time is MR, DR, SAR1, DAR, and CR. At this time, the DRE bit is set to “1”.

シフトモードの場合と同様に、VRステート、IRステートと遷移する。   As in the shift mode, the state transits to the VR state and the IR state.

SAR1で指定したアドレスから、現在値データをリードする(SRステート)。   Current value data is read from the address designated by SAR1 (SR state).

DRには目標値データを保持しておき、リードした現在値データとの減算を行う。そして減算結果をDARが指定するアドレスにライトする(DWステート)。このライトは、リピートモードと同様の動作にて行う。これにより、CRのTCRHで指定した数だけ(図13では4個)、現在値と目標値との偏差データ(偏差n〜偏差(n+3))を蓄積する。   Target value data is held in DR, and subtraction from the read current value data is performed. Then, the subtraction result is written to an address designated by the DAR (DW state). This writing is performed by the same operation as in the repeat mode. As a result, deviation data (deviation n to deviation (n + 3)) between the current value and the target value is accumulated for the number specified by the TCRH of CR (four in FIG. 13).

その後、データ転送情報の内で更新が行われたもの、具体的には、DAR及びCRを元のアドレスにライトする(IWステート)。   Thereafter, the updated data transfer information, specifically, the DAR and CR are written to the original address (IW state).

次いで、2つめのデータ転送を行う。このときのデータ転送情報INF62は、MR、SAR1、SAR2、DAR及びCRである。このとき、INMビットが「1」にセットされる。   Next, the second data transfer is performed. The data transfer information INF62 at this time is MR, SAR1, SAR2, DAR, and CR. At this time, the INM bit is set to “1”.

データ転送情報配置領域からデータ転送情報INF62をリードする(IRステート)。データ転送情報INF62は、データ転送情報INF61に連続したアドレスからリードされる。   Data transfer information INF62 is read from the data transfer information arrangement area (IR state). The data transfer information INF62 is read from an address continuous to the data transfer information INF61.

SAR1で指定したアドレスから、現在値と目標値との偏差データを、ブロック転送モードと同様に、SAR1をインクリメント又はデクリメントし、TCRHをデクリメントしながら、TCRLで指定した回数分リードする(DRステート)。そして、TCRHが「0」になると、SAR1及びTCRHの内容を、所期設定値に戻す。このとき、データサイズはISz[1:0]ビットで指定される。   As in the block transfer mode, the deviation data between the current value and the target value is read from the address specified by SAR1 by the number of times specified by TCRL while incrementing or decrementing SAR1 and decrementing TCRH (DR state). . When TCRH becomes “0”, the contents of SAR1 and TCRH are returned to the initial set values. At this time, the data size is specified by ISz [1: 0] bits.

リードした偏差データをDTC3内部で加算し、加算した数に応じて除算又は右シフトを行う。除算又は右シフトは、加算したデータ数(TCRLの内容)などに応じて自動的に行うように構成してもよいし、SF[2:0]ビットで指定するようにしてもよい。除算又は右シフトした結果を、Sz[1:0]ビットで指定したサイズに応じて、0、1、2ビットだけ左シフトする。左シフトした結果を、SAR2に加算して、転送元アドレスとして使用する。   The read deviation data is added inside the DTC 3, and division or right shift is performed according to the added number. The division or the right shift may be automatically performed according to the number of added data (contents of TCRL), or may be designated by SF [2: 0] bits. The result of division or right shifting is shifted left by 0, 1, 2 bits according to the size specified by Sz [1: 0] bits. The result of the left shift is added to SAR2 and used as the transfer source address.

SAR2で指定した転送元アドレスから転送データをリードする(SRステート)。そして、リードしたデータをDARで指定した転送先アドレスにライトする(DWステート)。   Transfer data is read from the transfer source address designated by SAR2 (SR state). Then, the read data is written to the transfer destination address designated by DAR (DW state).

その後、SAR2の更新、すなわち、データ転送情報の内で更新が行われたSAR2を元のアドレスにライトすることなく、処理を終了する(IWステート)。   Thereafter, the process is terminated (IW state) without updating the SAR2, that is, without writing the updated SAR2 in the data transfer information to the original address.

なお、データ転送情報INF61による1つめのデータ転送でライトし、データ転送情報INF62による2つめのデータ転送でリードする領域は、動作開始前に初期化を行っておくようにする。   Note that the area that is written by the first data transfer by the data transfer information INF61 and is read by the second data transfer by the data transfer information INF62 is initialized before the operation is started.

積分モードによれば、入力データである制御対象の現在値と目標値との偏差の一定時間の累積に応じた出力データを、テーブルを参照して得ることができる。例えば、累積値が大きければ出力データを大きく、累積値が小さければ出力データを小さく、といった積分制御を行うことができる。   According to the integration mode, output data corresponding to the accumulation of a certain time of deviation between the current value of the controlled object and the target value as input data can be obtained by referring to the table. For example, it is possible to perform integration control such that the output data is increased if the accumulated value is large, and the output data is decreased if the accumulated value is small.

また、DRに設定した目標値データとの減算は、データ転送情報INF61による1つめのデータ転送では行わず(DRE=0)、データ転送情報INF62による2つめのデータ転送にて行う(DRE=1)ようにしてもよい。   Further, the subtraction with the target value data set in DR is not performed in the first data transfer by the data transfer information INF61 (DRE = 0), but is performed in the second data transfer by the data transfer information INF62 (DRE = 1). You may do it.

ブロック加算モード
続いて、データの転送モードの1つであるブロック加算モードについて説明する。図14に、転送モードがブロック加算モードである場合のデータ転送を示す。ブロック加算モードでは、TLUビットが「0」にクリア(通常データ転送機能)され、TMD1及びTMD0ビットが「11」(ブロック加算モード)にセットされる。
Block Addition Mode Next, the block addition mode, which is one of the data transfer modes, will be described. FIG. 14 shows data transfer when the transfer mode is the block addition mode. In the block addition mode, the TLU bit is cleared to “0” (normal data transfer function), and the TMD1 and TMD0 bits are set to “11” (block addition mode).

DTC3が起動されると、データ転送情報先頭アドレスをリード(VRステート)し、データ転送情報配置領域からデータ転送情報をリードする(IRステート)。ブロック加算モードでのデータ転送情報は、MR、SAR2、DAR及びCRである。   When the DTC 3 is activated, the data transfer information head address is read (VR state), and the data transfer information is read from the data transfer information arrangement area (IR state). Data transfer information in the block addition mode is MR, SAR2, DAR, and CR.

SAR2で指定したアドレスから、ブロック転送モードと同様に、SAR2をインクリメント又はデクリメントし、TCRHをデクリメントしながら、TCRLで指定した回数(図14では3回)分リードする(SRステート)。TCRHが0になると、SAR2及びTCRHの内容を所期設定値に戻す。このときデータサイズはSz[1:0]ビットで指定される。   Similarly to the block transfer mode, SAR2 is incremented or decremented from the address designated by SAR2, and TCRH is decremented, and the number of times designated by TCRL (three times in FIG. 14) is read (SR state). When TCRH becomes 0, the contents of SAR2 and TCRH are returned to the initial set values. At this time, the data size is specified by Sz [1: 0] bits.

リードしたデータは、DTC3内部で加算し、DARで指定した転送先アドレスにライトする(DWステート)。   The read data is added inside the DTC 3 and written to the transfer destination address designated by the DAR (DW state).

その後、SAR2の更新、すなわち、データ転送情報の内で更新が行われたSAR2を元のアドレスにライトすることなく、処理を終了する(IWステート)。   Thereafter, the process is terminated (IW state) without updating the SAR2, that is, without writing the updated SAR2 in the data transfer information to the original address.

比例モード、積分モード、微分モードの転送先アドレスを、RAM上の連続したアドレスにし、これをブロック加算モードで重畳し、モータ制御などを行う、所要のタイマにライトするようにできる。例えば、インターバルタイマでDTCを起動し、比例モード、積分モード、微分モード、ブロック加算モードを、チェイン動作(最後のブロック加算モード以外のNXTE1ビットを1にセット)で連続して実行するようにすることができる。入力データに対応した、PID制御を実現することができる。   The transfer destination addresses in the proportional mode, integral mode, and differential mode can be made continuous addresses in the RAM, which are superimposed in the block addition mode, and written to a required timer that performs motor control and the like. For example, the DTC is started by the interval timer, and the proportional mode, the integration mode, the differentiation mode, and the block addition mode are continuously executed in a chain operation (the NXTE1 bit other than the last block addition mode is set to 1). be able to. PID control corresponding to input data can be realized.

実施の形態5
実施の形態5にかかるマイクロコンピュータについて説明する。本実施の形態では、実施の形態1にかかる分岐モードの変形例について説明する。図15に、分岐モードの変形例でのデータ転送を示す。この変形例では、テーブルに用意したデータの最上位ビット(MSB)によって、チェイン動作の有無を選択する。
Embodiment 5
A microcomputer according to the fifth embodiment will be described. In the present embodiment, a modification of the branch mode according to the first embodiment will be described. FIG. 15 shows data transfer in a modification example of the branch mode. In this modification, the presence / absence of a chain operation is selected by the most significant bit (MSB) of the data prepared in the table.

データ転送情報INF71は、MR、DR、SAR1及びSAR2とする。初期設定において、又は、CRが「0」であるといった、一連の処理が終了した後の再設定の処理において、DRを「00000000」としておく。   The data transfer information INF71 is MR, DR, SAR1, and SAR2. The DR is set to “00000000” in the initial setting or in the resetting process after the series of processes such as CR is “0”.

SAR1で指定したアドレスから、ISz[1:0]ビットで指定したデータサイズのシフトデータをリードする(DRステート)。リードしたシフトデータとSAR2とに基づいて、転送元アドレスを生成する。   Read shift data of the data size specified by the ISz [1: 0] bit from the address specified by SAR1 (DR state). A transfer source address is generated based on the read shift data and SAR2.

SAR2で指定した転送元アドレスから転送データをリードし、リードデータはDRに格納するとともに、テーブルをリードしたことを示すステータスとしてDRのビット31を「1」にセットする(SRステート)。なお、転送データのライトは行わない(DWステート)。   Transfer data is read from the transfer source address designated by SAR2, the read data is stored in DR, and DR bit 31 is set to "1" as a status indicating that the table has been read (SR state). Note that transfer data is not written (DW state).

データ転送情報の内で更新が行われたもの、具体的には、DRを元のアドレスにライトする(IWステート)。   The updated data transfer information, specifically, the DR is written to the original address (IW state).

リードしたテーブルデータのMSBが「1」にセットされている場合について説明する。リードしたテーブルデータであるDRに格納したデータ(ビット31は無視する)と、VARとから、実施の形態1と同様に、チェイン動作で起動するデータ転送情報の先頭アドレスを生成する。生成した先頭アドレスに対応するデータ転送情報INF72をリードし、これに基づきデータ転送を行う。   A case where the MSB of the read table data is set to “1” will be described. From the data stored in the DR, which is the read table data (ignoring bit 31), and the VAR, the head address of the data transfer information activated by the chain operation is generated as in the first embodiment. Data transfer information INF72 corresponding to the generated head address is read, and data transfer is performed based on this.

次いで、リードしたテーブルデータのMSBが「0」にクリアされている場合について説明する。この場合、チェイン動作を行わずに処理を終了する。   Next, a case where the MSB of the read table data is cleared to “0” will be described. In this case, the process is terminated without performing the chain operation.

次に、同一の起動要因でDTC3が起動され、データ転送情報INF71をリードしたとき、TLUビット及びSFMビットがそれぞれ「1」にセットされ、かつ、DRのビット31が「1」にセットされている場合、データ転送を行わず、前記同様に、DRに格納したデータとVARとに基づいて、チェイン動作を開始する。前記同様に、データ転送情報INF72をリードし、これに基づき、データ転送を行う。   Next, when DTC3 is activated by the same activation factor and data transfer information INF71 is read, the TLU bit and the SFM bit are set to “1”, and the DR bit 31 is set to “1”. If not, the data transfer is not performed, and the chain operation is started based on the data stored in the DR and the VAR as described above. Similarly to the above, the data transfer information INF72 is read, and based on this, data transfer is performed.

例えば、シリアルコミュニケーションインタフェース(SCI)などの通信手段を介して、コマンドを入力し、受信完了割り込みでDTCを起動し、これを判定データとしてテーブル参照を行う場合、直ちにコマンドに対応したデータ転送を実行可能な場合と、次の受信完了割り込みを待たなければならない場合がある。   For example, when a command is input via a communication means such as a serial communication interface (SCI), a DTC is activated by a reception completion interrupt, and when this is referred to as a determination data, a data transfer corresponding to the command is immediately executed. In some cases, it may be necessary to wait for the next reception completion interrupt.

直ちにコマンドに対応したデータ転送を実行可能な場合は、テーブルデータのMSBを「1」にセットしておき、チェイン動作で、コマンドに対応したデータ転送を実行することができる。   If the data transfer corresponding to the command can be executed immediately, the MSB of the table data can be set to “1” and the data transfer corresponding to the command can be executed by the chain operation.

次の受信完了割り込みを待たなければならない場合は、テーブルデータのMSBを「0」にクリアしておき、1回目のDTC起動時には、テーブルデータをDRに格納し、チェイン動作すなわちデータ転送を行わずに一旦終了する。2回目のDTC3起動時には、データ転送情報INF31をリードして、TLUビット、SFMビット及びDRのビット31がいずれも「1」にセットされているので、テーブル参照を行わず、コマンドに対応した、次のデータ転送情報INF32をリードし、これに基づき、データ転送を行う。   When it is necessary to wait for the next reception completion interrupt, the MSB of the table data is cleared to “0”, and the table data is stored in the DR at the first DTC activation, and the chain operation, that is, the data transfer is not performed. Exit once. When the DTC 3 is activated for the second time, the data transfer information INF31 is read, and the TLU bit, SFM bit, and DR bit 31 are all set to “1”. Next data transfer information INF32 is read, and based on this, data transfer is performed.

2回目のDTC起動時には、テーブルデータのMSBによらず、同一の動作にできる。   When the DTC is activated for the second time, the same operation can be performed regardless of the MSB of the table data.

DRに、リードしたテーブルデータを格納するほか、チェイン動作の次のデータ転送情報先頭アドレスを格納するようにしてもよい。テーブルをリードしたことを示すステータスは、DRを使用するほか、MRの適切なビットを使用してもよい。   In addition to storing the read table data, the next data transfer information start address of the chain operation may be stored in the DR. The status indicating that the table has been read may use DR as well as an appropriate bit of MR.

図16に、分岐モードの変形例でのDTCの状態遷移図を示す。
IRステートにおいて、TLUビット、SFMビット、DRのビット31がいずれも「1」にセットされていれば、再度IRステートに遷移し、次のデータ転送情報のリードを行う。
FIG. 16 shows a state transition diagram of DTC in a modification of the branch mode.
If the TLU bit, the SFM bit, and the DR bit 31 are all set to “1” in the IR state, the state transits to the IR state again, and the next data transfer information is read.

以上、本構成によれば、テーブル参照モードが分岐モードである場合に、リードしたデータに含まれる情報に基づいて、チェイン動作の実行の是非を判断することが可能となる。   As described above, according to this configuration, when the table reference mode is the branch mode, it is possible to determine whether or not to execute the chain operation based on the information included in the read data.

実施の形態6
実施の形態6にかかるマイクロコンピュータについて説明する。本実施の形態では、テーブル参照モードがアドレス演算モードである場合のMCU100の動作について説明する。図17に、アドレス演算モードでのデータ転送を示す。TLUビットが「1」かつAEMビットが「1」の場合、テーブル参照モードはアドレス演算モードとなる。
Embodiment 6
A microcomputer according to the sixth embodiment will be described. In the present embodiment, the operation of the MCU 100 when the table reference mode is the address calculation mode will be described. FIG. 17 shows data transfer in the address calculation mode. When the TLU bit is “1” and the AEM bit is “1”, the table reference mode is the address calculation mode.

DTC3が起動されると、対応するベクタ領域から、データ転送情報先頭アドレスをリードする(VRステート)。   When the DTC 3 is activated, the data transfer information head address is read from the corresponding vector area (VR state).

リードしたアドレスに基づいて、データ転送情報配置領域からデータ転送情報INF81をリードする(IRステート)。このときのデータ転送情報INF81は、MR、SAR1、SAR2、DAR及びCRである。   Based on the read address, the data transfer information INF81 is read from the data transfer information arrangement area (IR state). The data transfer information INF81 at this time is MR, SAR1, SAR2, DAR, and CR.

SAR1で指定したアドレスから、ISz[1:0]ビットで指定したデータサイズのデータをリードする(DRステート)。ここでは、リードしたデータをアドレス演算データと称する。   Data having a data size designated by ISz [1: 0] bits is read from the address designated by SAR1 (DR state). Here, the read data is referred to as address calculation data.

リードしたアドレス演算データは、ALU35で、Sz[1:0]ビットで指定した転送データサイズに応じて1、2、4倍し、又は0、1、2ビットだけシフトする演算を行う。演算結果を、一旦、DTC3内部(例えばDR)に保持する。   The read address calculation data is calculated by the ALU 35 by 1, 2, 4 times or shifting by 0, 1, 2 bits according to the transfer data size specified by the Sz [1: 0] bit. The calculation result is temporarily held inside the DTC 3 (for example, DR).

SAR2で指定した転送元アドレスから転送データをリードし(SRステート)、DARで指定した転送先アドレスにライトする(DWステート)。そして、CRのデクリメントを行う。   Transfer data is read from the transfer source address specified by SAR2 (SR state), and written to the transfer destination address specified by DAR (DW state). Then, the CR is decremented.

DIRビットが「0」のときは、SM[1:0]ビットで指定されたインクリメント又はデクリメントに代わり、シフトしたアドレス演算データをSAR2に加算又は減算し、結果をSAR2に格納する。   When the DIR bit is “0”, the shifted address operation data is added to or subtracted from SAR2 instead of the increment or decrement specified by the SM [1: 0] bit, and the result is stored in SAR2.

DIRビットが「1」のときは、DM[1:0]ビットで指定されたインクリメント又はデクリメントに代わり、シフトしたアドレス演算データをDARに加算又は減算し、結果をDARに格納する。   When the DIR bit is “1”, the shifted address operation data is added to or subtracted from the DAR instead of the increment or decrement specified by the DM [1: 0] bit, and the result is stored in the DAR.

その後、データ転送情報INF81の内で更新が行われたもの、具体的には、SAR2又はDARとCRとを、元のアドレスにライトする(IWステート)。   After that, the updated data transfer information INF81, specifically, SAR2 or DAR and CR is written to the original address (IW state).

上記のデータ転送を、CR(TCRH)で指定した回数だけ繰り返す。   The above data transfer is repeated as many times as specified by CR (TCRH).

図18に、アドレス演算モードで使用するテーブルの指定方法の一例を示す。i番目のデータ転送にてデータDiのデータ転送を行う場合、アドレス演算データ(テーブル)からパラメータPiをリードする。パラメータPiに基づき、データDiのデータ転送後に、転送元アドレス(SAR2)または転送先アドレス(DAR)に対して演算を行う。   FIG. 18 shows an example of how to specify a table used in the address calculation mode. When data Di is transferred in the i-th data transfer, the parameter Pi is read from the address calculation data (table). Based on the parameter Pi, an operation is performed on the transfer source address (SAR2) or the transfer destination address (DAR) after the data Di is transferred.

次のi+1番目のデータ転送で、データDi+1のデータ転送を行うとき、データDiとデータDi+1のアドレスは連続ではなく、パラメータPiに基づいて、間隔が挿入される。   When the data transfer of the data Di + 1 is performed in the next i + 1-th data transfer, the addresses of the data Di and the data Di + 1 are not continuous, and an interval is inserted based on the parameter Pi.

この間隔は、各データ転送に対して、アドレス演算データ(テーブル)に含まれるパラメータで指定することができる。このため、DTC3は、テーブルを参照することで、不規則な間隔で配置されたデータを連続してデータ転送することができる。   This interval can be specified by a parameter included in the address calculation data (table) for each data transfer. Therefore, the DTC 3 can continuously transfer data arranged at irregular intervals by referring to the table.

実施の形態7
実施の形態7にかかるマイクロコンピュータについて説明する。本実施の形態では、MCU100のINT2の具体例について説明する。図19に、割り込みコントローラ(INT)2のブロック図を示す。
Embodiment 7
A microcomputer according to the seventh embodiment will be described. In the present embodiment, a specific example of INT2 of MCU 100 will be described. FIG. 19 shows a block diagram of the interrupt controller (INT) 2.

INT2は、割り込み/DTC判定回路51、DTC許可レジスタ(DTERとも称する)52、優先順位判定回路53、ラッチ回路54及びデコーダ回路55を有する。   The INT 2 includes an interrupt / DTC determination circuit 51, a DTC permission register (also referred to as DTER) 52, a priority determination circuit 53, a latch circuit 54, and a decoder circuit 55.

MCU100の割り込み要因には、内部割り込み及び外部割り込みの2種類があり、それぞれ割り込み要因フラグを有する。割り込みの要因フラグは、タイマ、通信、アナログの機能ブロックが所定の状態になったときに、「1」にセットされる。例えば、外部割り込み要因フラグは、外部割り込み入力端子が所定のレベルになったとき、又は、所定の信号変化が発生したときに「1」にセットされる。割り込み要因フラグは、CPU1のライト動作によって「0」にクリアされるほか、DTC3によるデータ転送が終了したときに「0」にクリアされる。   There are two types of interrupt factors of the MCU 100, an internal interrupt and an external interrupt, each having an interrupt factor flag. The interrupt factor flag is set to “1” when the timer, communication, and analog function blocks enter a predetermined state. For example, the external interrupt factor flag is set to “1” when the external interrupt input terminal becomes a predetermined level or when a predetermined signal change occurs. The interrupt factor flag is cleared to “0” by the write operation of the CPU 1 and is also cleared to “0” when the data transfer by the DTC 3 is completed.

割り込み要因フラグの各ビットの出力は、割り込み許可回路に入力される。この割り込み許可回路には、さらに割り込み許可レジスタの内容、すなわち割り込み許可ビットが入力される。割り込み許可レジスタは、CPU1からリード/ライト可能なレジスタで、対応する割り込みを許可するか、禁止するか、を選択する。   The output of each bit of the interrupt factor flag is input to the interrupt permission circuit. The interrupt permission circuit further receives the contents of the interrupt permission register, that is, the interrupt permission bit. The interrupt permission register is a register readable / writable by the CPU 1 and selects whether to permit or prohibit the corresponding interrupt.

割り込み要因フラグが「1」にセットされ、割り込み許可ビットが「1」にセットされていると割り込みが要求される。割り込みを要求である割り込み許可回路の出力は、割り込み/DTC判定回路51に入力される。   If the interrupt factor flag is set to “1” and the interrupt permission bit is set to “1”, an interrupt is requested. The output of the interrupt permission circuit, which is an interrupt request, is input to the interrupt / DTC determination circuit 51.

また、割り込み/DTC判定回路51には、DTC許可レジスタ(DTERとも称する)52の内容が入力される。割り込み/DTC判定回路51は、割り込みが要求されたとき、DTC3を起動するか、CPU1に割り込みを許可するかを選択する。   Further, the contents of the DTC permission register (also referred to as DTER) 52 are input to the interrupt / DTC determination circuit 51. The interrupt / DTC determination circuit 51 selects whether to activate the DTC 3 or to allow the CPU 1 to interrupt when an interrupt is requested.

DTC許可レジスタ52の割り込み要因に対応したビットが「1」にセットされていると、割り込み/DTC判定回路51は、DTC3の起動を要求し、CPU1の割り込みを要求しない。DTC許可レジスタ52の割り込み要因に対応したビットが「0」にクリアされていると、割り込み/DTC判定回路51は、CPU1の割り込みを要求し、DTC3の起動を要求しない。割り込み/DTC判定回路51は、起動要求を優先順位判定回路53に出力する。   When the bit corresponding to the interrupt factor of the DTC permission register 52 is set to “1”, the interrupt / DTC determination circuit 51 requests activation of the DTC 3 and does not request an interrupt from the CPU 1. If the bit corresponding to the interrupt factor in the DTC permission register 52 is cleared to “0”, the interrupt / DTC determination circuit 51 requests an interrupt from the CPU 1 and does not request activation of the DTC 3. The interrupt / DTC determination circuit 51 outputs an activation request to the priority order determination circuit 53.

優先順位判定回路53は、CPU1の割り込み要求、DTC3の起動要求のそれぞれについて、複数の割り込み要求が発生している場合に優先順位を判定する。CPU1の起動要求の優先順位判定を行う際には、マスクレベルの判定を併せて行うことができる。CPU1の起動要求の優先順位の判定は、プライオリティレジスタや割り込みマスクレベルなどに従って制御される。   The priority determination circuit 53 determines the priority for each of the interrupt request from the CPU 1 and the activation request from the DTC 3 when a plurality of interrupt requests are generated. When determining the priority order of the activation request of the CPU 1, the mask level can be determined together. The determination of the priority of the activation request of the CPU 1 is controlled according to the priority register, the interrupt mask level, and the like.

優先順位判定回路53は、最高の優先順位を有する起動要求を選択し、ベクタ番号を生成する。CPU1の起動要求を選択した場合、優先順位判定回路53は、CPU1の割り込み要求CPUINTとベクタ番号CPUVECとを生成する。DTC3の起動要求を選択した場合、DTC3の起動要求信号DTCREQとベクタ番号DTCVECとを生成する。起動要求信号DTCREQは、DTC3に入力される。ベクタ番号DTCVECはラッチ回路54に入力される。   The priority determination circuit 53 selects the activation request having the highest priority and generates a vector number. When the activation request for the CPU 1 is selected, the priority determination circuit 53 generates an interrupt request CPUINT and a vector number CPUVEC for the CPU 1. When the activation request for DTC3 is selected, the activation request signal DTCREQ for DTC3 and the vector number DTCVEC are generated. The activation request signal DTCREQ is input to DTC3. The vector number DTCVEC is input to the latch circuit 54.

また、ラッチ回路54には、DTC動作開始信号及びDTC動作終了信号がDTC3から入力される。すなわち、DTC3が動作を開始するとDTC動作信号が活性状態になり、ラッチ回路54はベクタ番号DTCVECのラッチないし保持する。DTC3のデータ転送が終了してDTC動作終了信号が活性状態になると、ラッチ回路54によるラッチは解除される。   The latch circuit 54 receives a DTC operation start signal and a DTC operation end signal from the DTC 3. That is, when the DTC 3 starts operation, the DTC operation signal becomes active, and the latch circuit 54 latches or holds the vector number DTCVEC. When the data transfer of DTC3 is completed and the DTC operation end signal is activated, the latch by the latch circuit 54 is released.

ベクタ番号DTCVECとDTC動作終了信号とは、デコーダ回路55に入力される。これにより、対応する割り込み要因フラグに対する要因クリア信号が活性状態になって、対応する割り込み要因フラグ又はDTEビットがクリアされる。   The vector number DTCVEC and the DTC operation end signal are input to the decoder circuit 55. As a result, the factor clear signal for the corresponding interrupt factor flag is activated, and the corresponding interrupt factor flag or DTE bit is cleared.

所要の割り込み要因でDTC3を起動する場合、CPU1は予めデータ転送情報などを所要のアドレスにライトするとともに、当該割り込み要因に対応する割り込み許可ビットと、DTC許可レジスタ52の当該割り込み要因に対応するDTEビットを「1」にセットしておく。   When the DTC 3 is activated by a required interrupt factor, the CPU 1 writes data transfer information and the like in advance to a required address, and also sets an interrupt permission bit corresponding to the interrupt factor and a DTE corresponding to the interrupt factor of the DTC permission register 52. The bit is set to “1”.

当該割り込み要因フラグが「1」にセットされると、DTC3が起動される。DTC3が所定のデータ転送を実行している状態では、DTC3はデータ転送毎に当該割り込み要因フラグを「0」にクリアする。このとき、CPU1に割り込みは要求されない。   When the interrupt factor flag is set to “1”, the DTC 3 is activated. In a state where the DTC 3 is executing a predetermined data transfer, the DTC 3 clears the interrupt factor flag to “0” for each data transfer. At this time, no interruption is requested to the CPU 1.

所定のデータ転送を終了すると、DTC3はデータ転送後にDTEビットを「0」にクリアする。このとき、当該割り込み要因フラグは「1」に保持され、DTEビットが「0」にクリアされているので、CPU1に割り込みが要求される。CPU1は、所定のデータ転送の終了に対応した処理を実行するとともに、データ転送情報やDTEビットの再設定を行う。   When the predetermined data transfer is completed, the DTC 3 clears the DTE bit to “0” after the data transfer. At this time, since the interrupt factor flag is held at “1” and the DTE bit is cleared to “0”, the CPU 1 is requested to interrupt. The CPU 1 executes processing corresponding to the end of predetermined data transfer, and resets the data transfer information and the DTE bit.

実施の形態8
実施の形態8にかかるマイクロコンピュータについて説明する。本実施の形態では、カメラを制御するカメラシステムに上述のMCUを適用した例について説明する。図20に、MCUを含むカメラシステム1000のブロック図を示す。
Embodiment 8
A microcomputer according to the eighth embodiment will be described. In this embodiment, an example in which the above-described MCU is applied to a camera system that controls a camera will be described. FIG. 20 shows a block diagram of a camera system 1000 including an MCU.

カメラシステム1000は、カメラボディMCU1001、カメラレンズMCU1002、焦点モータ1003、焦点モータの位置を検出するエンコーダ1004を含む。このうち、カメラレンズMCU1002には、実施の形態1〜7で説明したMCUのいずれかが用いられる。   The camera system 1000 includes a camera body MCU1001, a camera lens MCU1002, a focus motor 1003, and an encoder 1004 that detects the position of the focus motor. Among these, for the camera lens MCU 1002, any of the MCUs described in the first to seventh embodiments is used.

カメラレンズMCU1002は、焦点モータ駆動用のタイマF(TFとも称する)、エンコーダ入力用のタイマD(TDとも称する)、インターバルタイマ機能を持つタイマI(TIとも称する)を含む。これらのタイマF、タイマD及びタイマIは、それぞれ、タイマ7に相当する。カメラレンズMCU1002には、焦点モータ用のテーブルが格納されたROM4が含まれる(不図示)。また、オートフォーカスの許可や防振の許可などのスイッチを、入出力ポート(I/O)10で入力する。   The camera lens MCU 1002 includes a focus motor driving timer F (also referred to as TF), an encoder input timer D (also referred to as TD), and a timer I having an interval timer function (also referred to as TI). These timer F, timer D, and timer I correspond to the timer 7, respectively. The camera lens MCU 1002 includes a ROM 4 (not shown) that stores a table for the focus motor. Also, switches such as auto-focus permission and anti-shake permission are input via the input / output port (I / O) 10.

カメラレンズMCU1002は、カメラボディMCU1001から、シリアルコミュニケーションインタフェース(SCI、通信モジュール8に相当)などの1回線の通信手段を介して、コマンドとそれに伴うデータを受信する。この受信完了割り込みにより、DTC3が起動する。   The camera lens MCU 1002 receives commands and associated data from the camera body MCU 1001 via one line communication means such as a serial communication interface (SCI, corresponding to the communication module 8). The DTC 3 is activated by this reception completion interrupt.

DTC3のテーブル参照モードを分岐モードとすることで、通信手段から入力したコマンドを解析し、コマンドに基づき所要のデータ転送を行う。   By setting the DTC3 table reference mode to the branch mode, the command input from the communication means is analyzed, and the required data transfer is performed based on the command.

入力したコマンド(例えばステータス要求コマンド)が、レンズの所定の状態(例えば、手振れ補正の許可スイッチの状態)の返信を求めている場合について説明する。この場合、分岐モードに対応するデータ転送情報によりカメラレンズMCU1001の所定の機能ブロック(例えば、入出力ポート(I/O)の内容)を、SCIの送信データレジスタに転送することで、データの送信を行うことができる。そして、コマンドに対してチェイン動作を行うことで、CPUの処理を不要とし、かつ即座に所要の動作を完了できる。   A case where an input command (for example, a status request command) requests a return of a predetermined state of the lens (for example, the state of a camera shake correction permission switch) will be described. In this case, data transmission is performed by transferring a predetermined functional block (for example, the contents of the input / output port (I / O)) of the camera lens MCU 1001 to the SCI transmission data register by the data transfer information corresponding to the branch mode. It can be performed. Then, by performing a chain operation on the command, the CPU processing is unnecessary and the required operation can be completed immediately.

入力したコマンドが焦点合わせコマンドの場合、引き続き、目標位置を受信する。次の受信完了割り込み発生時に、目標位置を比例モードのDRに設定し、タイマIによって、DTCを起動させる。そして、テーブルを参照して、所要の焦点モータ駆動を行うことができる。   If the input command is a focusing command, the target position is continuously received. When the next reception completion interrupt occurs, the target position is set to the proportional mode DR and the timer I starts the DTC. Then, the required focus motor drive can be performed with reference to the table.

上記動作を行うにあたり、CPU1はスリープないしスタンバイモードなどの低消費電力状態とすることができる。これにより、システムの低消費電力化に寄与できる。DTC3はCPUより論理規模が小さく、かつ高速に処理を行うことができるので、低消費電力化の効果を高めることができる。バッテリで駆動されるカメラシステムなどにおいては、低消費電力化が特に重要である。   In performing the above operation, the CPU 1 can be in a low power consumption state such as a sleep or standby mode. This can contribute to lower power consumption of the system. Since the DTC 3 has a smaller logical scale than the CPU and can perform processing at high speed, the effect of reducing power consumption can be enhanced. In a camera system driven by a battery, low power consumption is particularly important.

ズームレンズの場合、ズーム位置によって、焦点モータ駆動制御を変える必要も考えられる。この場合、テーブルを複数用意し、カメラボディMCU1001から焦点合わせの指示と目標位置と使用するテーブルを受信する。そして、使用するテーブルに対応したアドレスにSAR2を設定することができる。   In the case of a zoom lens, it may be necessary to change the focus motor drive control depending on the zoom position. In this case, a plurality of tables are prepared, and a table to be used is received from the camera body MCU 1001 as a focusing instruction, a target position, and the like. Then, SAR2 can be set to an address corresponding to the table to be used.

なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。例えば、データ転送情報は32ビット単位としたが、データ転送情報は任意のビット単位とすることができる。データ転送情報の配置も任意に変更することができる。具体的には、アドレスレジスタのビット数は32ビットに限定されるものではなく、CPUまたはマイクロコンピュータのアドレス空間に応じて変更でき、例えば16Mバイトのアドレス空間であれば24ビットとすればよい。MRのビット配置を分割して、24ビットのSAR及びDARと組み合わせてもよい。MRのビット配置は任意でよく、SFMビット、OFMビット、PRMビット、DRMビット、INMビット、BRMビット、NOPビットなどはエンコードするようにしてもよい。   Note that the present invention is not limited to the above-described embodiment, and can be changed as appropriate without departing from the spirit of the present invention. For example, although the data transfer information is in 32-bit units, the data transfer information can be in arbitrary bit units. The arrangement of the data transfer information can be arbitrarily changed. Specifically, the number of bits of the address register is not limited to 32 bits, and can be changed according to the address space of the CPU or microcomputer. For example, in the case of a 16 Mbyte address space, it may be 24 bits. The bit arrangement of MR may be divided and combined with 24-bit SAR and DAR. The MR bit arrangement may be arbitrary, and the SFM bit, OFM bit, PRM bit, DRM bit, INM bit, BRM bit, NOP bit, etc. may be encoded.

上述の実施の形態では、通常データ転送のときは、データ転送情報における転送元アドレスレジスタとして、ハードウェアとしてのSAR2を使用するものとしたが、これはSAR1であってもよい。また、データ転送情報に含まれる転送モード情報以外の配置は、任意に変更することができる。転送元アドレス情報は、転送先アドレス情報より前にリード可能に配置することが望ましい。   In the above-described embodiment, SAR2 as hardware is used as the transfer source address register in the data transfer information during normal data transfer. However, this may be SAR1. The arrangement other than the transfer mode information included in the data transfer information can be arbitrarily changed. The transfer source address information is desirably arranged to be readable before the transfer destination address information.

CPUで動作するプログラムは、ROMに配置するほか、外部メモリに配置してもよい。同様に、CPUの作業領域であるメモリはRAMに限らず、外部メモリとしてもよい。また、マイクロコンピュータは、ROM及びRAMの一方又は両方を内蔵しなくてもよい。   The program that operates on the CPU may be arranged in the external memory in addition to the ROM. Similarly, the memory that is the work area of the CPU is not limited to the RAM, and may be an external memory. Further, the microcomputer may not include one or both of the ROM and the RAM.

DTCのデータ転送情報、入力データブロック、係数データブロックについては、処理速度や消費電力などの点で、マイクロコンピュータ内蔵のRAMに格納するのが有利であるものの、外部メモリに格納してもよい。   DTC data transfer information, input data blocks, and coefficient data blocks may be stored in an external memory, although they are advantageously stored in a RAM built in the microcomputer in terms of processing speed and power consumption.

上述の実施の形態では、データ転送情報をRAMなどのメモリに配置するものとして説明した。しかし、いわゆるDMAコントローラなどのように、データ転送情報を内部I/Oレジスタとして機能ブロック内に持つようにし、アドレス空間上に配置する構成とすることも可能である。   In the above-described embodiment, the data transfer information is described as being arranged in a memory such as a RAM. However, as in a so-called DMA controller, the data transfer information may be held in the functional block as an internal I / O register and arranged in the address space.

上述の実施の形態では、データ転送情報をRAMなどの記憶装置に格納する方式に基づき、説明を行った。しかし、使用できるデータ転送情報が実装されたハードウェアによって制限されるものの、いわゆるDMAコントローラに対しても上述の実施の形態で説明したデータ転送を適用可能である。   In the above-described embodiment, the description has been given based on a method of storing data transfer information in a storage device such as a RAM. However, although the data transfer information that can be used is limited by the installed hardware, the data transfer described in the above embodiment can be applied to a so-called DMA controller.

また、DTCのほかに、DMAコントローラなどの他のデータ転送装置を設けることもできる。DTCとDMAコントローラの機能を1つの機能モジュールとすることもできる。   In addition to the DTC, another data transfer device such as a DMA controller may be provided. The functions of the DTC and DMA controller can be combined into one function module.

DTC、割り込みコントローラの具体的な回路構成については、上述の実施の形態で説明した機能と同等の機能を有する種々の回路構成に変更可能である。BSCや、バスやウェイトなどのバス動作の詳細については省略したが、これらは適宜実装可能である。マイクロコンピュータの構成についても、例示に過ぎず、適宜変更可能である。   Specific circuit configurations of the DTC and the interrupt controller can be changed to various circuit configurations having functions equivalent to the functions described in the above embodiments. Details of bus operations such as BSC and buses and waits have been omitted, but these can be implemented as appropriate. The configuration of the microcomputer is also merely an example and can be changed as appropriate.

上述の実施の形態では、マイクロコンピュータついて説明したが、これは例示に過ぎない。上述の実施の形態で説明したDTCは、データ処理装置、データ処理装置と独立した演算器を内蔵した半導体集積回路などの各種の装置に適用することができる。例えば、デジタルシグナルプロセッサ(DSP)を中心にした半導体集積回路装置にも適用可能である。本発明は少なくとも、データ処理装置およびデータ転送装置を内蔵した半導体集積回路装置に適用することができる。   Although the microcomputer has been described in the above embodiment, this is merely an example. The DTC described in the above-described embodiment can be applied to various devices such as a data processing device and a semiconductor integrated circuit incorporating an arithmetic unit independent of the data processing device. For example, the present invention can be applied to a semiconductor integrated circuit device centering on a digital signal processor (DSP). The present invention can be applied to at least a semiconductor integrated circuit device including a data processing device and a data transfer device.

以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は既に述べた実施の形態に限定されるものではなく、その要旨を逸脱しない範囲において種々の変更が可能であることはいうまでもない。   As mentioned above, the invention made by the present inventor has been specifically described based on the embodiments. However, the present invention is not limited to the embodiments already described, and various modifications can be made without departing from the scope of the invention. It goes without saying that it is possible.

1 中央処理装置(CPU)
2 割り込みコントローラ(INT)
3 データ転送装置(DTC)
4 ROM
5 RAM
6 バスコントローラ(BSC)
7 タイマ
8 通信モジュール
9 アナログモジュール
10 入出力ポート(I/O)
11 内部バス
31 DTCCNT
32 BIF
33 VG
34 VAR
35 ALU
36 内部バス
51 割り込み/DTC判定回路
52 割り込み許可レジスタ
53 優先順位判定回路
54 ラッチ回路
55 デコーダ回路
100 マイクロコンピュータ(MCU)
1000 カメラシステム
1001 カメラボディMCU
1002 カメラレンズMCU
1003 防振モータ
1004 センサ
ADC A/D変換器
CPUVEC ベクタ番号
DTCREQ 起動要求信号
DTCVEC ベクタ番号
INF11、INF12、INF21、INF31、INF41、INF51、INF61、INF62、INF71、INF81、INF82、INF91 データ転送情報
CR 転送カウントレジスタ
DAR デスティネーションレジスタ
DR データレジスタ
MR モードレジスタ
SAR1、SAR2 ソースアドレスレジスタ
DTCREQ データ転送要求信号
DTCVEC ベクタ番号
1 Central processing unit (CPU)
2 Interrupt controller (INT)
3 Data transfer device (DTC)
4 ROM
5 RAM
6 Bus controller (BSC)
7 Timer 8 Communication module 9 Analog module 10 Input / output port (I / O)
11 Internal bus 31 DTCCNT
32 BIF
33 VG
34 VAR
35 ALU
36 Internal bus 51 Interrupt / DTC determination circuit 52 Interrupt enable register 53 Priority determination circuit 54 Latch circuit 55 Decoder circuit 100 Microcomputer (MCU)
1000 Camera system 1001 Camera body MCU
1002 Camera lens MCU
1003 Vibration isolation motor 1004 Sensor ADC A / D converter CPUVEC Vector number DTCREQ Activation request signal DTCVEC Vector number INF11, INF12, INF21, INF31, INF41, INF51, INF61, INF62, INF71, INF81, INF82, INF91 Data transfer Count register DAR Destination register DR Data register MR Mode register SAR1, SAR2 Source address register DTCREQ Data transfer request signal DTCVEC Vector number

Claims (5)

データコントローラーを有する半導体装置であって、
前記データコントローラーは、第1の転送元アドレスレジスタ、第2の転送元アドレスレジスタ、転送先アドレスレジスタ及び転送回数レジスタを備え、
前記第1の転送元アドレスレジスタで指定された第1の転送元アドレスから第1のデータを読み出し、
前記第1のデータを演算することにより第2のデータを生成し、
前記第2の転送元アドレスレジスタで示される第2の転送元アドレスを転送元アドレスとして、前記転送先アドレスレジスタで指定される転送先アドレスへデータ転送を行い、
前記第2の転送元アドレス及び前記転送先アドレスのいずれか一方に前記第2のデータを加算又は減算することによって、新たな第2の転送元アドレス又は新たな転送先アドレスを生成し、
前記転送回数レジスタで指定された値の回数だけ当該データ転送を繰り返す、
半導体装置。
A semiconductor device having a data controller,
The data controller includes a first transfer source address register, a second transfer source address register, a transfer destination address register, and a transfer number register.
Reading first data from a first transfer source address designated by the first transfer source address register;
Generating second data by computing the first data;
Using the second transfer source address indicated by the second transfer source address register as a transfer source address, data is transferred to the transfer destination address specified by the transfer destination address register,
A new second transfer source address or a new transfer destination address is generated by adding or subtracting the second data to one of the second transfer source address and the transfer destination address,
The data transfer is repeated as many times as the value specified in the transfer count register.
Semiconductor device.
前記第1のデータに対するデータサイズに応じて論理演算及びシフト演算のいずれか一方又は両方を行った結果を、前記第2のデータとする、
請求項1に記載の半導体装置。
The result of performing either one or both of a logical operation and a shift operation according to the data size for the first data is the second data.
The semiconductor device according to claim 1.
前記データコントローラーは、
起動要求に応じて指定されたデータ転送情報アドレスに基づいて、データ転送情報配置領域よりデータ転送情報を読み出し、前記データ転送情報に含まれる前記第1の転送元アドレス、前記第2の転送元アドレス及び前記転送先アドレスを、前記第1の転送元アドレスレジスタ、前記第2の転送元アドレスレジスタ及び転送先アドレスレジスタにそれぞれ格納する、
請求項1に記載の半導体装置。
The data controller is
Based on the data transfer information address specified in response to the activation request, data transfer information is read from the data transfer information arrangement area, and the first transfer source address and the second transfer source address included in the data transfer information And the transfer destination address are stored in the first transfer source address register, the second transfer source address register, and the transfer destination address register, respectively.
The semiconductor device according to claim 1.
前記データ転送情報は、モード情報をさらに有し、
前記データコントローラーは前記モード情報を格納するモードレジスタをさらに有し、
前記モードレジスタの情報に基づき、前記第2のデータを前記第2の転送元アドレス及び前記転送先アドレスのいずれか一方に加算または減算する、
請求項3に記載の半導体装置。
The data transfer information further includes mode information;
The data controller further includes a mode register for storing the mode information,
Based on the information in the mode register, the second data is added to or subtracted from either the second transfer source address or the transfer destination address.
The semiconductor device according to claim 3.
前記データ転送情報は、前記新たな第2の転送元アドレス又は前記新たな転送先アドレスによって更新される、
請求項4に記載の半導体装置。
The data transfer information is updated by the new second transfer source address or the new transfer destination address.
The semiconductor device according to claim 4.
JP2018062537A 2018-03-28 2018-03-28 Semiconductor device Pending JP2018101448A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018062537A JP2018101448A (en) 2018-03-28 2018-03-28 Semiconductor device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018062537A JP2018101448A (en) 2018-03-28 2018-03-28 Semiconductor device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2014001105A Division JP6316593B2 (en) 2014-01-07 2014-01-07 Semiconductor device

Publications (1)

Publication Number Publication Date
JP2018101448A true JP2018101448A (en) 2018-06-28

Family

ID=62715463

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018062537A Pending JP2018101448A (en) 2018-03-28 2018-03-28 Semiconductor device

Country Status (1)

Country Link
JP (1) JP2018101448A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004038231A (en) * 2002-06-28 2004-02-05 Renesas Technology Corp Semiconductor integrated circuit
JP2006251916A (en) * 2005-03-08 2006-09-21 Fujitsu Ltd Dma transfer system and dma transfer method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004038231A (en) * 2002-06-28 2004-02-05 Renesas Technology Corp Semiconductor integrated circuit
JP2006251916A (en) * 2005-03-08 2006-09-21 Fujitsu Ltd Dma transfer system and dma transfer method

Similar Documents

Publication Publication Date Title
US7500028B2 (en) DMA controller providing for ring buffer and rectangular block transfers
JP3759647B2 (en) Apparatus and method for performing both 24-bit and 16-bit arithmetic operations
KR100681199B1 (en) Method and apparatus for interrupt handling in coarse grained array
JPH07168753A (en) Modulo addition circuit and its operation method
JP3619532B2 (en) Semiconductor integrated circuit device
US20180322079A1 (en) Semiconductor apparatus
JP2001216194A (en) Arithmetic processor
US6728797B2 (en) DMA controller
JP6266308B2 (en) Semiconductor device
JP3605978B2 (en) Microcomputer
US10102161B2 (en) Microcomputer
JP2005057374A (en) Analog/digital converter and micro controller
JP2518293B2 (en) Data Flow Processor
JP2018101448A (en) Semiconductor device
JPH03204718A (en) Information processor
JP6275474B2 (en) Semiconductor device and data transfer device
US20040093439A1 (en) Data processing control apparatus and DMA controller
JP2018085130A (en) Data transfer apparatus and semiconductor apparatus
US20030177291A1 (en) Direct access controller
US20230409323A1 (en) Signal processing apparatus and non-transitory computer-readable storage medium
JP2001216136A (en) Addition circuit and processor
JP2688245B2 (en) DMA controller
JPH044630B2 (en)
JP2918570B2 (en) Central processing unit
JP3936694B2 (en) Semiconductor integrated circuit device and data transfer method for semiconductor integrated circuit device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180328

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20181219

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190129

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20190723