JP5708273B2 - Communication apparatus, information processing apparatus, and data transmission method - Google Patents

Communication apparatus, information processing apparatus, and data transmission method Download PDF

Info

Publication number
JP5708273B2
JP5708273B2 JP2011126277A JP2011126277A JP5708273B2 JP 5708273 B2 JP5708273 B2 JP 5708273B2 JP 2011126277 A JP2011126277 A JP 2011126277A JP 2011126277 A JP2011126277 A JP 2011126277A JP 5708273 B2 JP5708273 B2 JP 5708273B2
Authority
JP
Japan
Prior art keywords
transmission data
transmission
register
data buffer
buffer
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.)
Active
Application number
JP2011126277A
Other languages
Japanese (ja)
Other versions
JP2012253659A (en
Inventor
幹児 平野
幹児 平野
康司 山内
康司 山内
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toyota Motor Corp
Original Assignee
Toyota Motor 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 Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2011126277A priority Critical patent/JP5708273B2/en
Publication of JP2012253659A publication Critical patent/JP2012253659A/en
Application granted granted Critical
Publication of JP5708273B2 publication Critical patent/JP5708273B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Communication Control (AREA)

Description

本発明は、送信先にデータを送信する通信装置に関し、特に、チップセレクトにより送信先を切り換える通信装置に関する。   The present invention relates to a communication apparatus that transmits data to a transmission destination, and more particularly to a communication apparatus that switches a transmission destination by chip selection.

マイコン内のチップやマイコンと周辺のICがシリアル通信することでデータを送受信することがある。このようなシリアル通信において、送信側と受信側が1対多の関係になると、送信側(以下、単に通信装置という)にはチップセレクト機能が搭載されることが一般的である。また、マイコンでは周辺の各ICへのデータ送信要求が不定期に発生するため、あるICへのデータ送信中に別のICへのデータ送信要求が生じてもよいように、通信装置には送信バッファが設けられる。   Data may be transmitted and received by serial communication between a chip in the microcomputer or a microcomputer and a peripheral IC. In such serial communication, when the transmission side and the reception side have a one-to-many relationship, a chip selection function is generally mounted on the transmission side (hereinafter simply referred to as a communication device). In addition, since a data transmission request to each peripheral IC is irregularly generated in the microcomputer, a data transmission request to another IC may be generated during data transmission to one IC. A buffer is provided.

この送信バッファに複数の送信データが蓄積された場合に、送信制御をどのように行うかについていくつかの手法が知られている。例えば、FIFO(First In First Out)方式により送信データの送信順を管理することができる。しかし、FIFOでは、送信バッファにすでに多くのデータが蓄積されている場合、マイコンが新たに送信要求した送信データが送信されるまでの時間保証が困難になる。   Several methods are known as to how transmission control is performed when a plurality of transmission data is accumulated in the transmission buffer. For example, the transmission order of transmission data can be managed by a FIFO (First In First Out) method. However, in FIFO, when a lot of data is already stored in the transmission buffer, it is difficult to guarantee the time until transmission data newly requested by the microcomputer is transmitted.

また、例えば、通信装置が優先度を管理する手法が知られている。この場合、通信装置は、IC毎に優先度を設定しておいたり、ソフトウェア等により動的に優先度を決定する、などの優先度管理が必要になる。しかし、IC毎に優先度を設定すると、優先度の低いICに送信される送信データの時間保証が困難になる。また、ソフトウェア等により動的に優先度を設定する手法では、処理が複雑になるという問題がある(例えば、特許文献1参照。)。特許文献1には、複数のレジスタにデータを書き込むレジスタ書き込み部において、複数のレジスタへのデータの書き込みタイミングが競合した場合、生成される内部クロック信号に基づいてデータ書き込みの優先順位を決定するレジスタ書き込み部が開示されている。   In addition, for example, a method in which a communication device manages priority is known. In this case, the communication device requires priority management such as setting a priority for each IC or dynamically determining the priority by software or the like. However, if priority is set for each IC, it is difficult to guarantee the time of transmission data transmitted to an IC with a low priority. Further, the method of dynamically setting the priority by software or the like has a problem that the processing becomes complicated (see, for example, Patent Document 1). Japanese Patent Application Laid-Open No. 2004-228688 describes a register writing unit that writes data to a plurality of registers, and determines the priority of data writing based on the generated internal clock signal when the timing of writing data to the plurality of registers competes. A writing unit is disclosed.

特開2007−140215号公報JP 2007-140215 A

しかしながら、特許文献1に記載された技術では、クロック周波数を利用するなどして優先度を決定するので、処理が複雑である点に変わりはない。また、ICの数が多くなった場合に対応しきれないという問題がある。   However, in the technique described in Patent Document 1, since the priority is determined by using the clock frequency or the like, the process is still complicated. In addition, there is a problem that it is not possible to cope with the case where the number of ICs increases.

本発明は、上記課題に鑑み、複雑な優先度制御を行うことなく、複数の周辺回路に送信されるデータの時間保証が可能な通信装置を提供することを目的とする。   In view of the above problems, an object of the present invention is to provide a communication device capable of guaranteeing the time of data transmitted to a plurality of peripheral circuits without performing complicated priority control.

上記課題に鑑み、本発明は、送信データが書き込まれる送信レジスタと、複数の送信先から1つの送信先を指定する送信先指定手段と、送信先に送信データをシリアル送信する送信制御手段と、送信待ちの送信データ及び各送信データに対応付けられた優先度情報を蓄積する送信データバッファと、前記送信レジスタに書き込まれた送信データと前記送信データバッファに蓄積されている送信データの送信先が同じ場合、前記送信データバッファに蓄積されている送信データを前記送信レジスタに書き込まれた送信データで上書きする送信データ制御手段と、を有し、前記送信データ制御手段は、前記送信データバッファに蓄積されている送信データを前記送信レジスタに書き込まれた送信データで上書きする頻度に応じて前記優先度情報を決定して、前記送信データバッファに上書きされた送信データに対応付けて前記送信データバッファに書き込む、ことをする通信装置を提供する。 In view of the above problems, the present invention provides a transmission register to which transmission data is written, a transmission destination designating unit that designates one transmission destination from a plurality of transmission destinations, a transmission control unit that serially transmits transmission data to the transmission destination, A transmission data buffer for storing transmission data awaiting transmission and priority information associated with each transmission data, transmission data written in the transmission register, and a transmission destination of transmission data stored in the transmission data buffer. If the same, the transmission data control means for overwriting the transmission data stored in the transmission data buffer with the transmission data written in the transmission register, the transmission data control means stores in the transmission data buffer The priority information is changed according to the frequency of overwriting the transmitted data with the transmission data written in the transmission register. Constant to, in association with the transmission data is overwritten in the transmission data buffer written in the transmission data buffer, a communications device for the.

複雑な優先度制御を行うことなく、複数の周辺回路に送信されるデータの時間保証が可能な通信装置を提供することができる。   It is possible to provide a communication apparatus capable of guaranteeing the time of data transmitted to a plurality of peripheral circuits without performing complicated priority control.

本実施形態の通信装置がデータを送信する手順を模式的に説明する図の一例である。It is an example of the figure which illustrates typically the procedure in which the communication apparatus of this embodiment transmits data. ECUの概略構成図の一例である。It is an example of the schematic block diagram of ECU. 従来の通信装置の構成図の一例とレジスタフォーマットの一例を示す図である。It is a figure which shows an example of the block diagram of a conventional communication apparatus, and an example of a register format. 本実施形態の通信装置の構成図の一例を示す図である。It is a figure which shows an example of the block diagram of the communication apparatus of this embodiment. 本実施形態のレジスタフォーマットの一例を示す図である。It is a figure which shows an example of the register format of this embodiment. 従来の通信装置のタイミングチャート図の一例である。It is an example of the timing chart figure of the conventional communication apparatus. 従来の通信装置のシーケンス図の一例である。It is an example of the sequence diagram of the conventional communication apparatus. 通信装置のタイミングチャート図の一例である。It is an example of the timing chart figure of a communication apparatus. 通信装置のシーケンス図の一例である。It is an example of the sequence diagram of a communication apparatus. 送信データ制御部の処理手順を示すフローチャート図の一例である。It is an example of the flowchart figure which shows the process sequence of a transmission data control part. 優先度の遷移例を説明する図の一例である。It is an example of the figure explaining the example of a transition of a priority. 優先度の遷移例を説明する図の一例である。It is an example of the figure explaining the example of a transition of a priority.

以下、本発明を実施するための形態について図面を参照しながら説明する。
図1は、本実施形態の通信装置が送信データを送信する手順を模式的に説明する図の一例である。
図1(a)に示すように、送信データバッファには送信データ1〜3が順番に書き込まれる。図では送信デーファバッファの下の送信データほど先に書き込まれたものとする。送信データバッファには優先度の設定が可能になっている。
Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings.
FIG. 1 is an example of a diagram schematically illustrating a procedure in which the communication apparatus according to the present embodiment transmits transmission data.
As shown in FIG. 1A, transmission data 1 to 3 are sequentially written in the transmission data buffer. In the figure, it is assumed that transmission data under the transmission data buffer is written earlier. A priority can be set in the transmission data buffer.

通信装置は、次送信データバッファが空いていれば、次送信データバッファに送信データを書き込む。優先度が同じ場合、書き込む送信データはFIFO(First In First Out)により決定される。このため、次送信データバッファの送信データ1は送信用のレジスタに書き込まれ、送信先に送信される。
図1(b)に示すように、次送信データバッファの送信データ1がなくなると、通信装置は送信データ1の次に古い送信データ2を次送信データバッファに書き込む。ここで、次送信データバッファに送信データ2が存在する状態で、送信レジスタに送信データ3aが書き込まれたとする。送信データ3と送信データ3aは送信先が同じ送信データである。
図1(c)に示すように、通信装置は、送信レジスタの送信データと同じ送信先の送信データが送信データバッファ又は次送信データバッファに存在すると、先に書き込まれた送信データの優先度を読み出し、1つインクリメントして、後から書き込まれた送信データの優先度を置き換える。つまり、送信データ3の優先度が“0”の場合、送信データ3aの優先度が“1”となる。これは、短時間に同じ送信先に送信される送信データは優先度が高いと考えられるためである。
図1(d)に示すように、通信装置は送信データバッファから送信データ3を消去し、送信データ3aを書き込む。これにより、後から送信される送信データを優先して送信することができる。
図1(e)に示すように、通信装置は次送信データバッファの送信データと送信データバッファの送信データの優先度を比較する。すなわち、送信データ2の優先度0と送信データ3aの優先度1を比較する。この場合、優先度の高い方を優先すべきと考えられる。
図1(f)に示すように、送信データバッファの送信データの方が優先度が高い場合、通信装置は次送信データバッファの送信データと送信データバッファの送信データを入れ替える。すなわち、送信データ2と送信データ3aを入れ替える。
If the next transmission data buffer is empty, the communication device writes the transmission data in the next transmission data buffer. When the priorities are the same, the transmission data to be written is determined by FIFO (First In First Out). For this reason, the transmission data 1 of the next transmission data buffer is written in the register for transmission and transmitted to the transmission destination.
As shown in FIG. 1B, when there is no transmission data 1 in the next transmission data buffer, the communication apparatus writes transmission data 2 that is next to transmission data 1 to the next transmission data buffer. Here, it is assumed that the transmission data 3a is written in the transmission register in a state where the transmission data 2 exists in the next transmission data buffer. Transmission data 3 and transmission data 3a are transmission data having the same transmission destination.
As shown in FIG. 1C, the communication device sets the priority of the transmission data written earlier when the transmission data of the same destination as the transmission data of the transmission register exists in the transmission data buffer or the next transmission data buffer. Read is incremented by 1 to replace the priority of transmission data written later. That is, when the priority of the transmission data 3 is “0”, the priority of the transmission data 3a is “1”. This is because transmission data transmitted to the same transmission destination in a short time is considered to have high priority.
As shown in FIG. 1D, the communication apparatus erases the transmission data 3 from the transmission data buffer and writes the transmission data 3a. Thereby, transmission data transmitted later can be preferentially transmitted.
As shown in FIG. 1E, the communication device compares the priority of the transmission data in the next transmission data buffer and the transmission data in the transmission data buffer. That is, the priority 0 of the transmission data 2 is compared with the priority 1 of the transmission data 3a. In this case, the higher priority should be given priority.
As illustrated in FIG. 1F, when the transmission data in the transmission data buffer has a higher priority, the communication apparatus switches the transmission data in the next transmission data buffer and the transmission data in the transmission data buffer. That is, the transmission data 2 and the transmission data 3a are exchanged.

このように、通信装置は、同じ送信先の送信データの送信要求が頻繁に発生すると、該送信データの優先度を高くする。また、送信データバッファ又は次送データバッファに存在する送信先が同じ送信データを、後に書き込まれた送信データで上書きする。この結果、同じ送信先の送信データは1つになるので、時間保証がしやすくなる。   In this way, when a transmission request for transmission data of the same transmission destination frequently occurs, the communication device increases the priority of the transmission data. In addition, transmission data having the same transmission destination existing in the transmission data buffer or the next transmission data buffer is overwritten with transmission data written later. As a result, the transmission data of the same transmission destination becomes one, so that it is easy to guarantee time.

また、送信データバッファの送信データは、送信の頻度に応じて優先度が調整されているので、後から書き込まれた送信データでも、頻繁に書き込まれる送信先の送信データは優先度が高くなり確実に時間保証される。   In addition, since the priority of transmission data in the transmission data buffer is adjusted according to the frequency of transmission, even if the transmission data is written later, the transmission data of the transmission destination that is frequently written has a higher priority and is sure. Guaranteed on time.

また、同じ送信先の送信データは送信データバッファに1つだけになるので、送信データバッファのレジスタ数は送信先の数とすればよい(チップセレクト数)。このため、送信データバッファの容量を低減できる。従来の技術では、最大通信負荷を考慮して送信先毎に2つ以上のレジスタが用意することが一般的なので、本実施形態では、送信データバッファの容量を半分程度かそれ以下にすることができる。   In addition, since there is only one transmission data of the same transmission destination in the transmission data buffer, the number of registers in the transmission data buffer may be the number of transmission destinations (the number of chip select). For this reason, the capacity of the transmission data buffer can be reduced. In the conventional technique, since it is common to prepare two or more registers for each transmission destination in consideration of the maximum communication load, in this embodiment, the capacity of the transmission data buffer can be reduced to about half or less. it can.

また、同じ送信先の送信データは1つしかないので、送信データ間の優先度管理が容易になる。このため、最大通信負荷を考慮した複雑な優先度管理が不要になる。また、1つの送信先に必要なレジスタ数が1つでよいので、送信データバッファを大きく取ることができない場合でも、送信先を増加させることが容易になる。   In addition, since there is only one transmission data of the same transmission destination, priority management between transmission data becomes easy. For this reason, complicated priority management considering the maximum communication load is not required. Further, since only one register is required for one transmission destination, it is easy to increase the transmission destination even when a large transmission data buffer cannot be provided.

〔構成例〕
図2は、ECUの概略構成図の一例を示す。ECU(electronic control unit)300はマイコン200や周辺の回路を有する。周辺の回路は、例えば、IC101(以下、区別する場合IC1〜4という)であり、マイコン200に付加的な機能を提供する。本実施形態の通信装置100はこのIC1〜4と通信する。
[Configuration example]
FIG. 2 shows an example of a schematic configuration diagram of the ECU. The ECU (electronic control unit) 300 includes a microcomputer 200 and peripheral circuits. The peripheral circuit is, for example, an IC 101 (hereinafter referred to as IC 1 to 4 when distinguished), and provides an additional function to the microcomputer 200. The communication device 100 according to the present embodiment communicates with the ICs 1 to 4.

マイコン200は、メインバス19に接続されたCPU11、RAM12、ROM13、INTC14、DMAC15、及び、バスコントローラ16を有する。また、マイコン200は、周辺バス20に接続されたTimer(以下、区別する場合Timer1、Timer0という)17、ADC18、及び、通信装置100を有する。CPU11は、シングルコア又はマルチコアのCPUである。または、ハードウェアマルチスレッド(HMT)型のCPUでもよい。CPU11はRAM12を作業メモリにしてプログラムを実行する。ROM13はフラッシュメモリなどの不揮発メモリであり、CPU11が実行するプログラムや静的なデータを記憶している。プログラムは、デバイスドライバ、OS、マイコン200に特有のアプリ、などである。アプリは1つとは限らず、例えば機能統合されたECU300では制御対象の異なる複数のアプリが記憶されることがある。   The microcomputer 200 includes a CPU 11, a RAM 12, a ROM 13, an INTC 14, a DMAC 15, and a bus controller 16 that are connected to the main bus 19. The microcomputer 200 includes a Timer (hereinafter referred to as Timer 1 and Timer 0 when distinguished) 17, an ADC 18, and a communication device 100 connected to the peripheral bus 20. The CPU 11 is a single core or multi-core CPU. Alternatively, a hardware multi-thread (HMT) type CPU may be used. The CPU 11 executes the program using the RAM 12 as a working memory. The ROM 13 is a non-volatile memory such as a flash memory, and stores programs executed by the CPU 11 and static data. The program is a device driver, an OS, an application unique to the microcomputer 200, and the like. The number of applications is not limited to one. For example, in the ECU 300 with integrated functions, a plurality of applications with different control targets may be stored.

DMAC15は、CPU11からの指示によりRAM12やROM13のデータをTimer17やADC18、通信装置100、又は、不図示のCANコントローラに送信する。また、DMAC15は、これらの回路からINTC14を介して割り込みされたCPU11から指示を受けて、Timer17やADC18、通信装置100からデータを受け取り、RAM12に書き込む。   The DMAC 15 transmits the data in the RAM 12 and the ROM 13 to the Timer 17, the ADC 18, the communication device 100, or a CAN controller (not shown) according to an instruction from the CPU 11. The DMAC 15 receives an instruction from the CPU 11 interrupted via the INTC 14 from these circuits, receives data from the Timer 17, the ADC 18, and the communication device 100, and writes it in the RAM 12.

INTC14はIRQやその他の割り込み端子を介してTimer17、ADC18、又は、通信装置100から入力された割り込み要求を、周辺機器の優先順位に基づき調停してCPU11に通知する。これによりCPU11は割り込みした周辺機器に応じて決まった処理を実行する。   The INTC 14 arbitrates an interrupt request input from the Timer 17, the ADC 18, or the communication device 100 via the IRQ or other interrupt terminal based on the priority order of the peripheral devices and notifies the CPU 11 of the arbitration request. As a result, the CPU 11 executes a process determined according to the interrupted peripheral device.

バスコントローラ16は、メインバス19と周辺バス20との間のバス本数や周波数の違いを吸収して相互にデータを受け渡す。   The bus controller 16 absorbs the difference in the number of buses and the frequency between the main bus 19 and the peripheral bus 20 and transfers data to each other.

周辺バス20には、実行速度の比較的おそい周辺回路が接続されており、Timer17は、例えばCPU11が設定した値をカウントし終わるとINTC14を介してCPU11に割り込みすることでCPU11に通知する。通知によりCPU11は例えば定期的に所定のプログラムを実行することができる。   A peripheral circuit having a relatively slow execution speed is connected to the peripheral bus 20, and the Timer 17 notifies the CPU 11 by interrupting the CPU 11 via the INTC 14 when the value set by the CPU 11 is counted, for example. By the notification, the CPU 11 can execute a predetermined program periodically, for example.

通信装置100は、IC1〜4とそれぞれ接続されている。具体的には、クロック信号線、データ送信線、データ受信線、及び、C/S線によりIC1〜4とそれぞれ接続されている。通信装置100と1つのマルチプレクサを接続し、マルチプレクサからIC1〜4をそれぞれ接続してもよい。   The communication device 100 is connected to each of the ICs 1 to 4. Specifically, they are connected to the ICs 1 to 4 by clock signal lines, data transmission lines, data reception lines, and C / S lines, respectively. The communication apparatus 100 and one multiplexer may be connected, and the ICs 1 to 4 may be connected from the multiplexer.

IC1〜4は、マイコン200が使用するリソースの一つである。これらは、マイコン200内のリソース(ADCやTimer)ではリソースが不十分な場合や、マイコン200が備えていない機能でマイコン200が必要とする機能を提供するために配置される。IC1〜4は、例えば、ADC、DAC、別のマイコン等である。そして、通信装置100は、マイコン200が選択的にIC1〜4と通信することを可能にする。例えば、マイコン200が十分な数のI/Oポートを有していない場合に有効である。IC1がADCであれば、マイコン200はIC1にA/D変換を要求する際に、IC1を送信先に指定して通信装置100に変換対象の送信データを書き込む。また、例えば、IC2が他のマイコンであれば、マイコン200は他のマイコンを送信先に指定して通信装置100に送信対象の送信データを書き込む。   IC1-4 are one of the resources which the microcomputer 200 uses. These are arranged in order to provide functions required by the microcomputer 200 when the resources (ADC and Timer) in the microcomputer 200 are insufficient, or functions that the microcomputer 200 does not have. IC1-4 are ADC, DAC, another microcomputer etc., for example. And the communication apparatus 100 enables the microcomputer 200 to communicate with IC1-4 selectively. For example, this is effective when the microcomputer 200 does not have a sufficient number of I / O ports. If IC1 is an ADC, when requesting A / D conversion from IC1, microcomputer 200 designates IC1 as a transmission destination and writes transmission data to be converted into communication device 100. For example, if the IC 2 is another microcomputer, the microcomputer 200 designates the other microcomputer as a transmission destination and writes transmission data to be transmitted to the communication device 100.

逆に、IC1〜4が通信装置100に送信した送信データは、通信装置100がINTC14を介してCPU11に割り込みすることで、受信したことが通知される。CPU11がDMAC15を制御すると、IC1〜4の送信データがRAM12に書き込まれる。   Conversely, transmission data transmitted from the ICs 1 to 4 to the communication device 100 is notified by the communication device 100 interrupting the CPU 11 via the INTC 14. When the CPU 11 controls the DMAC 15, the transmission data of the ICs 1 to 4 is written into the RAM 12.

〔通信装置の構成例〕
図3は、比較のために従来の通信装置100の構成図の一例(図3(a))とレジスタフォーマット(図3(b))を、図4は本実施形態の通信装置100の構成図の一例を、図5は本実施形態のレジスタフォーマットの一例を、それぞれ示す。
[Configuration example of communication device]
FIG. 3 shows an example of a configuration diagram (FIG. 3A) and a register format (FIG. 3B) of a conventional communication device 100 for comparison, and FIG. 4 shows a configuration diagram of the communication device 100 of this embodiment. FIG. 5 shows an example of the register format of this embodiment.

図3(a)と図4を比較すると、本実施形態の通信装置100は、次送信データバッファ39と送信データ制御部40とを有する点で異なっている。また、送信データバッファ36と送信データ制御部40が接続されることで、時間保障された送信データの送信制御が可能になる。   Comparing FIG. 3A and FIG. 4, the communication apparatus 100 of this embodiment is different in that it includes a next transmission data buffer 39 and a transmission data control unit 40. Further, by connecting the transmission data buffer 36 and the transmission data control unit 40, it is possible to control transmission of transmission data with a guaranteed time.

<レジスタフォーマット>
まず、レジスタフォーマットについて説明する。
・送信レジスタ35のレジスタフォーマットは、送信先チップセレクト指定ビットと送信データを有する。送信レジスタ35のレジスタフォーマットは従来から変更がない。
・受信レジスタ38のレジスタフォーマットは、受信チップセレクト番号ビットと受信データを有する。受信レジスタ38のレジスタフォーマットは従来から変更がない。
・送信データバッファ36のレジスタフォーマットは、プライオリティビット、送信先チップセレクト指定ビット、送信データを有する。本実施形態の送信データバッファ36のレジスタフォーマットにはプライオリティビットが追加されている。
・次送信データバッファ39のレジスタフォーマットは、送信データバッファ36のレジスタフォーマットと同じである。
<Register format>
First, the register format will be described.
The register format of the transmission register 35 includes a transmission destination chip select designation bit and transmission data. The register format of the transmission register 35 has not been changed conventionally.
The register format of the reception register 38 includes a reception chip select number bit and reception data. The register format of the reception register 38 has not been changed conventionally.
The register format of the transmission data buffer 36 includes a priority bit, a transmission destination chip select designation bit, and transmission data. A priority bit is added to the register format of the transmission data buffer 36 of the present embodiment.
The register format of the next transmission data buffer 39 is the same as the register format of the transmission data buffer 36.

また、従来の送信データバッファ36が、送信先が4つしかなくても例えば30段必要であるのに対し、本実施形態の送信データバッファ36は最小では4段あればまかなえる。これは、送信先が同じ送信データにおいては、過去の送信データの優先度が、より新しい送信データに反映され、過去の送信データは上書きされるためである。   Further, for example, the conventional transmission data buffer 36 requires 30 stages even if there are only four transmission destinations, whereas the transmission data buffer 36 of the present embodiment can be provided with a minimum of four stages. This is because in the transmission data having the same transmission destination, the priority of the past transmission data is reflected in the newer transmission data, and the past transmission data is overwritten.

また、各レジスタに設定される情報は以下のとおりである。
・送信先チップセレクト指定ビット:IC1〜4を選択するための情報
・送信データ:IC1〜4に送信されるデータ(データにはコマンドも含まれる)
・プライオリティビット:送信データの優先度情報(値が大きいほど優先度が高いとする)
・受信チップセレクト番号ビット:IC1〜4のうち送信データを受信レジスタ38に書き込んだICの識別情報
・受信データ:IC1〜4から受信されたデータ
また、各レジスタに送信データ等を設定する回路は以下のようになる。
・送信レジスタ:CPU11
・受信レジスタ:IC1〜IC4(シリアル通信制御部)
・送信データバッファ:送信データ制御部40
・次送信データバッファ:送信データ制御部40
・送受信制御レジスタ:CPU11
<通信装置の各ブロック>
クロック制御レジスタ31には、クロック周波数を制御するためのクロック制御情報(例えば分周比)が設定される。マイコン200は例えば電源オンの直後の初期設定などでクロック制御情報をクロック制御レジスタ31に設定する。シリアルクロック制御部32は、クロック制御情報に基づき例えばPLLと分周器を用いてクロック周波数を生成する。なお、このクロック周波数は、IC1〜4と同期を取るための信号であり、クロック信号線41を介してIC1〜4に供給される。シリアルクロック制御部32は、シリアル通信制御部33やマイコン200内の周辺機器にクロック周波数を供給する。
Information set in each register is as follows.
-Destination chip select designation bit: Information for selecting IC1-4-Transmission data: Data transmitted to IC1-4 (data includes command)
Priority bit: Priority information of transmission data (assuming that the higher the value, the higher the priority)
・ Receiving chip select number bit: Identification information of the IC in which transmission data is written to the reception register 38 among the ICs 1 to 4. ・ Reception data: data received from the ICs 1 to 4. Further, a circuit for setting transmission data or the like in each register is as follows. It becomes as follows.
-Transmission register: CPU11
Receive registers: IC1 to IC4 (serial communication control unit)
Transmission data buffer: transmission data control unit 40
Next transmission data buffer: transmission data control unit 40
-Transmission / reception control register: CPU11
<Each block of communication device>
In the clock control register 31, clock control information (for example, a frequency division ratio) for controlling the clock frequency is set. For example, the microcomputer 200 sets the clock control information in the clock control register 31 by initial setting immediately after the power is turned on. The serial clock control unit 32 generates a clock frequency using, for example, a PLL and a frequency divider based on the clock control information. The clock frequency is a signal for synchronizing with the ICs 1 to 4 and is supplied to the ICs 1 to 4 via the clock signal line 41. The serial clock control unit 32 supplies a clock frequency to the serial communication control unit 33 and peripheral devices in the microcomputer 200.

シリアル通信制御部33は、シリアル出力信号線42とシリアル入力信号線43を有する。シリアル出力信号線42、シリアル入力信号線43はいずれもIC1〜4と接続されている。シリアル出力信号線42は、通信装置100からIC1〜4のいずれかに送信データを送信するための信号線であり、シリアル入力信号線43は、IC1〜4のいずれかから通信装置100が送信データを受信するための信号線である。なお、シリアル通信制御部33は、次送信データバッファ39、送受信制御レジスタ37、及び、受信レジスタ38と接続されている。   The serial communication control unit 33 includes a serial output signal line 42 and a serial input signal line 43. The serial output signal line 42 and the serial input signal line 43 are both connected to the ICs 1 to 4. The serial output signal line 42 is a signal line for transmitting transmission data from the communication device 100 to any one of the ICs 1 to 4, and the serial input signal line 43 is transmitted from any one of the ICs 1 to 4 by the communication device 100. Is a signal line for receiving the signal. The serial communication control unit 33 is connected to the next transmission data buffer 39, the transmission / reception control register 37, and the reception register 38.

シリアル通信制御部33は、不図示のデータバッファ(送信用、受信用)を有し、次送信データバッファ39の送信データをデータバッファに移動してから送信する。また、シリアル通信制御部33はIC1〜4から受信した送信データをデータバッファに蓄積し、1つの送信データを受信し終わると受信レジスタ38に移動する。なお、シリアル通信制御部33は、送信データの送信時、送信先のIC1〜4から受信データを受信する。受信された受信データは送信データのエコーや、受信状態を通知するためのデータである。   The serial communication control unit 33 has a data buffer (not shown) (for transmission and reception), and transmits the transmission data of the next transmission data buffer 39 after moving to the data buffer. The serial communication control unit 33 accumulates the transmission data received from the ICs 1 to 4 in the data buffer, and moves to the reception register 38 when one transmission data is received. The serial communication control unit 33 receives the reception data from the transmission destination ICs 1 to 4 when transmitting the transmission data. The received data is data for echoing transmission data and notifying the reception state.

チップセレクト制御部34は、チェネル数分のチップセレクト信号線を有する。すなわち、各チップセレクト信号線44がIC1〜4のいずれかと接続されている。チップセレクト制御部34は、次送信データバッファ39の送信先チップセレクト指定ビットを読み出し、この送信先チップセレクト指定ビットに基づきIC1〜4のいずれかと接続されたチップセレクト信号線44をアサートする(負論理正論理のいずれでもよい)。   The chip select control unit 34 has as many chip select signal lines as the number of channels. That is, each chip select signal line 44 is connected to one of the ICs 1 to 4. The chip select control unit 34 reads the transmission destination chip select designation bit of the next transmission data buffer 39, and asserts the chip selection signal line 44 connected to any one of the ICs 1 to 4 based on the transmission destination chip select designation bit (negative). Any of logical positive logic).

送信レジスタ35には、送信対象の送信データが書き込まれる。マイコン200のCPU11は、プログラムを実行することでIC1〜4のいずれかに送信データを送信する命令を実行すると、送信レジスタ35に送信データを書き込む。プログラムにとって、送信先チップセレクト指定ビットと送信データは引数などにより指定されている。   In the transmission register 35, transmission data to be transmitted is written. When the CPU 11 of the microcomputer 200 executes a command to transmit transmission data to any one of the ICs 1 to 4 by executing a program, the transmission data is written in the transmission register 35. For the program, the destination chip select designation bit and the transmission data are designated by an argument or the like.

送信データ制御部40は、送信レジスタ35、送信データバッファ36、及び、次送信データバッファ39と接続されている。送信データ制御部40は、送信データバッファ36においてプライオリティビットが付与されてない送信用のデータにプライオリティビットを付与する。プライオリティビットの初期値はゼロとする。また、送信データ制御部40は、送信データバッファ36において送信先が同じ送信データの検出、プライオリティビットの書き換え、送信先が同じ送信データのうち古い送信データの消去、次送信データバッファ39と送信データバッファ36のプライオリティビットの比較、比較結果に基づく送信データの入れ換え等を行う。詳しい制御は後述する。   The transmission data control unit 40 is connected to the transmission register 35, the transmission data buffer 36, and the next transmission data buffer 39. The transmission data control unit 40 assigns a priority bit to data for transmission to which no priority bit is assigned in the transmission data buffer 36. The initial value of the priority bit is zero. Further, the transmission data control unit 40 detects transmission data having the same transmission destination in the transmission data buffer 36, rewrites the priority bit, erases old transmission data among transmission data having the same transmission destination, and transmits the next transmission data buffer 39 and the transmission data. The priority bits of the buffer 36 are compared, transmission data is exchanged based on the comparison result, and the like. Detailed control will be described later.

本実施形態の送信データバッファ36は、少なくとも送信先数と同じ数のレジスタを有する。送信先数よりも多い数のレジスタを有していてもよい。送信先数より多いレジスタを搭載することで、CPU11が短時間に同じ送信先の送信データを送信レジスタ35に書き込んだ場合に複数の送信データを送信データバッファ36に記憶できるので、マイコン200の待機状態を減らすことができる。   The transmission data buffer 36 of this embodiment has at least as many registers as the number of transmission destinations. There may be more registers than the number of destinations. By mounting more registers than the number of transmission destinations, when the CPU 11 writes transmission data of the same transmission destination to the transmission register 35 in a short time, a plurality of transmission data can be stored in the transmission data buffer 36. The state can be reduced.

送信データ制御部40は、プライオリティビットの高い送信データから優先して送信データバッファ36から読み出すが、プライオリティビットが同じなら古い送信データから読み出す。この意味で、送信データバッファ36はFIFO型の性質を有する。   The transmission data control unit 40 reads from the transmission data buffer 36 preferentially from transmission data having a high priority bit, but reads from old transmission data if the priority bits are the same. In this sense, the transmission data buffer 36 has a FIFO type property.

なお、従来の送信データバッファ36は、書き込み開始アドレスを示すライトポインタと、読み出し開始アドレスを示すリードポインタを有する。ライトポインタは送信データバッファ36に最後に送信データが書き込まれたレジスタの次のレジスタのアドレスを示し、リードポインタはシリアル通信制御部33に読み取られた送信データが記憶されていたレジスタの次のレジスタのアドレスを示す。送信データバッファ36の送信データがシリアル通信制御部33により送信されると、ライトポインタとリードポインタは同じレジスタのアドレスを示す。したがって、リードポインタの方がライトポインタよりも小さいアドレスを示す場合、シリアル通信制御部33が送信すべき送信データが送信データバッファ36に記憶されていることになる。   Note that the conventional transmission data buffer 36 has a write pointer indicating a write start address and a read pointer indicating a read start address. The write pointer indicates the address of the register next to the register in which the transmission data was last written in the transmission data buffer 36, and the read pointer is the register next to the register in which the transmission data read by the serial communication control unit 33 is stored. Indicates the address. When the transmission data of the transmission data buffer 36 is transmitted by the serial communication control unit 33, the write pointer and the read pointer indicate the same register address. Therefore, when the read pointer indicates an address smaller than the write pointer, the transmission data to be transmitted by the serial communication control unit 33 is stored in the transmission data buffer 36.

次送信データバッファ39は、原則的に、次に、シリアル通信制御部33が送信する送信データが記憶されるバッファである。原則的にと書いたのは、シリアル通信制御部33に取り込まれる前であれば、優先度によって次送信データバッファ39から送信データバッファ36に移動する場合があるためである。いったん、シリアル通信制御部33に送信された送信データが次送信データバッファ39に戻ることはない。   In principle, the next transmission data buffer 39 is a buffer in which transmission data to be transmitted next by the serial communication control unit 33 is stored. The reason for writing in principle is that the data may be moved from the next transmission data buffer 39 to the transmission data buffer 36 depending on the priority before being taken into the serial communication control unit 33. The transmission data once transmitted to the serial communication control unit 33 never returns to the next transmission data buffer 39.

送受信制御レジスタ37は、マイコン200のCPU11が送信許可又は受信許可を設定するためのレジスタである。CPU11は、例えば、送信レジスタ35に送信データを書き込み終わると送信許可を送受信制御レジスタ37に設定し、送受信完了割り込みを受け取ると受信許可を送受信制御レジスタ37に設定する。   The transmission / reception control register 37 is a register for the CPU 11 of the microcomputer 200 to set transmission permission or reception permission. For example, the CPU 11 sets transmission permission in the transmission / reception control register 37 when transmission data is completely written in the transmission register 35, and sets reception permission in the transmission / reception control register 37 when a transmission / reception completion interrupt is received.

受信レジスタ38はシリアル通信制御部33とチップセレクト制御部34と接続されている。受信レジスタ38には、チップセレクト制御部34がアサートしているチャネル情報により受信チップセレクト番号、及び、シリアル通信制御部33が受信した受信データが書き込まれる。シリアル通信制御部33がCPU11に送受信完了割り込みすると、CPU11は受信レジスタ38から受信データを読み出す。   The reception register 38 is connected to the serial communication control unit 33 and the chip select control unit 34. In the reception register 38, the reception chip select number and the reception data received by the serial communication control unit 33 are written according to the channel information asserted by the chip select control unit 34. When the serial communication control unit 33 interrupts transmission / reception completion to the CPU 11, the CPU 11 reads received data from the reception register 38.

〔送信データについて〕
図1にて説明したように、本実施形態の通信装置100は送信先が同じ送信データのうち後の送信データのみを送信することになる。このため、送信データは相対値ではなく絶対値に制限される。例えば、状態そのものではなく状態の反転を要求する送信データ(例えば、“1”を送る度に開閉を判定する送信データ)は相対値が送信されるため、同じ送信先の送信データのうち奇数個が欠けると制御と状態が逆になってしまう。
[About transmission data]
As described with reference to FIG. 1, the communication apparatus 100 according to the present embodiment transmits only subsequent transmission data among transmission data having the same transmission destination. For this reason, transmission data is limited to an absolute value, not a relative value. For example, since the relative value is transmitted for the transmission data requesting the inversion of the state, not the state itself (for example, transmission data for determining opening / closing every time “1” is transmitted), an odd number of transmission data of the same transmission destination If it is missing, the control and state will be reversed.

これに対し、High又はLow、オン又はオフ、開又は閉などのように、数値そのものが含まれる送信データは絶対値が送信されるため、同じ送信先の送信データのうち1つ以上が欠けても、最後の絶対値が有効なのでCPU11が指示したとおりの制御や状態が得られる。したがって、本実施形態のCPU11はこのような絶対値の送信データを送信するように設計されている。   On the other hand, since transmission data including the numerical value itself such as High or Low, on or off, open or closed is transmitted as an absolute value, one or more of the transmission data of the same transmission destination is missing. However, since the last absolute value is valid, the control and state as instructed by the CPU 11 can be obtained. Therefore, the CPU 11 of this embodiment is designed to transmit such absolute value transmission data.

〔従来の送信例〕
図6は、比較のために説明する従来の通信装置100のタイミングチャート図の一例を、図7はシーケンス図の一例をそれぞれ示す。
s1:CPU11は、送信データ1を送信レジスタ35に書き込む。
s2:送信データバッファ36は送信レジスタ35への書き込みをフラグなどで検出して、送信データ1をレジスタに記憶する。なお、送信データバッファ36は、新たに記憶したレジスタの次のレジスタを示すようにライトポインタを更新する。この結果、ライトポインタとリードポインタが不一致となる。
s3:CPU11は送信データ1を送信レジスタ35に書き込むと、送受信制御レジスタ37に送信許可を設定する。
s4:シリアル通信制御部33は、ライトポインタとリードポインタの不一致を検出して、送信データバッファ36のリードポインタが示すレジスタから送信データ1を読み出す。
s5:シリアル通信制御部33は、送受信制御レジスタ37に送信許可が設定されているので、送信データ1の送信を開始する。なお、シリアル通信制御部33は、読み出したレジスタの次のレジスタを示すようにリードポインタを更新する。この結果、ライトポインタとリードポインタは一致する。
s6:シリアル通信制御部33が送信データ1を送信している間に、CPU11が送信データ2を送信レジスタ35に書き込む。
s7:送信データバッファ36は送信レジスタ35への書き込みをフラグなどで検出して、レジスタに記憶する。
s8:シリアル通信制御部33が送信データ1を送信している間に、CPU11が送信データ3を送信レジスタ35に書き込む。
s9:送信データバッファ36は送信レジスタ35への書き込みをフラグなどで検出して、レジスタに記憶する。s6〜s7においてもライトポインタが更新される。
s10:シリアル通信制御部33は送信データ1の送信が完了すると受信レジスタ38に受信データを書き込む。
s11:また、シリアル通信制御部33は送信データ1の送信が完了すると、CPU11に送受信完了割り込みを行う。
s12:シリアル通信制御部33は、ライトポインタとリードポインタの不一致を検出して、送信データバッファ36のリードポインタが示すレジスタから送信データ2を読み出す。
s13:シリアル通信制御部33は、送受信制御レジスタ37に送信許可が設定されているので、送信データ2の送信を開始する。なお、シリアル通信制御部33は、読み出したレジスタの次のレジスタを示すようにリードポインタを更新する。この次点では、ライトポインタとリードポインタは不一致のままである。
s14:シリアル通信制御部33は送信データ2の送信が完了すると受信レジスタ38に受信データを書き込む。
s15:また、シリアル通信制御部33は送信データ2の送信が完了すると、CPU11に送受信完了割り込みを行う。
s16:シリアル通信制御部33は、ライトポインタとリードポインタの不一致を検出して、送信データバッファ36のリードポインタが示すレジスタから送信データ3を読み出す。
s17:シリアル通信制御部33は、送受信制御レジスタ37に送信許可が設定されているので、送信データ3の送信を開始する。なお、シリアル通信制御部33は、読み出したレジスタの次のレジスタを示すようにリードポインタを更新する。これにより、ライトポインタとリードポインタが一致する。
s18:シリアル通信制御部33は送信データ3の送信が完了すると受信レジスタ38に受信データを書き込む。
s19:また、シリアル通信制御部33は送信データ3の送信が完了すると、CPU11に送受信完了割り込みを行う。
[Conventional transmission example]
FIG. 6 shows an example of a timing chart of a conventional communication apparatus 100 described for comparison, and FIG. 7 shows an example of a sequence diagram.
s1: The CPU 11 writes the transmission data 1 to the transmission register 35.
s2: The transmission data buffer 36 detects writing to the transmission register 35 with a flag or the like, and stores the transmission data 1 in the register. The transmission data buffer 36 updates the write pointer to indicate the register next to the newly stored register. As a result, the write pointer and the read pointer do not match.
s3: When the transmission data 1 is written in the transmission register 35, the CPU 11 sets transmission permission in the transmission / reception control register 37.
s4: The serial communication control unit 33 detects a mismatch between the write pointer and the read pointer, and reads the transmission data 1 from the register indicated by the read pointer of the transmission data buffer 36.
s5: Since the transmission permission is set in the transmission / reception control register 37, the serial communication control unit 33 starts transmission of the transmission data 1. The serial communication control unit 33 updates the read pointer to indicate the register next to the read register. As a result, the write pointer matches the read pointer.
s6: While the serial communication control unit 33 is transmitting the transmission data 1, the CPU 11 writes the transmission data 2 in the transmission register 35.
s7: The transmission data buffer 36 detects writing to the transmission register 35 with a flag or the like and stores it in the register.
s8: While the serial communication control unit 33 is transmitting the transmission data 1, the CPU 11 writes the transmission data 3 in the transmission register 35.
s9: The transmission data buffer 36 detects writing to the transmission register 35 with a flag or the like and stores it in the register. The write pointer is also updated in s6 to s7.
s10: When the transmission of the transmission data 1 is completed, the serial communication control unit 33 writes the reception data in the reception register 38.
s11: When the transmission of the transmission data 1 is completed, the serial communication control unit 33 issues a transmission / reception completion interrupt to the CPU 11.
s12: The serial communication control unit 33 detects a mismatch between the write pointer and the read pointer, and reads the transmission data 2 from the register indicated by the read pointer of the transmission data buffer 36.
s13: Since the transmission permission is set in the transmission / reception control register 37, the serial communication control unit 33 starts transmission of the transmission data 2. The serial communication control unit 33 updates the read pointer to indicate the register next to the read register. At this next point, the write pointer and the read pointer remain inconsistent.
s14: When the transmission of the transmission data 2 is completed, the serial communication control unit 33 writes the reception data in the reception register 38.
s15: When the transmission of the transmission data 2 is completed, the serial communication control unit 33 issues a transmission / reception completion interrupt to the CPU 11.
s16: The serial communication control unit 33 detects a mismatch between the write pointer and the read pointer, and reads the transmission data 3 from the register indicated by the read pointer of the transmission data buffer 36.
s17: Since the transmission permission is set in the transmission / reception control register 37, the serial communication control unit 33 starts transmission of the transmission data 3. The serial communication control unit 33 updates the read pointer to indicate the register next to the read register. As a result, the write pointer matches the read pointer.
s18: When the transmission of the transmission data 3 is completed, the serial communication control unit 33 writes the reception data in the reception register 38.
s19: When the transmission of the transmission data 3 is completed, the serial communication control unit 33 issues a transmission / reception completion interrupt to the CPU 11.

〔本実施形態の送信例〕
図8は、本実施形態の通信装置100のタイミングチャート図の一例を、図9はシーケンス図の一例をそれぞれ示す。
s21:CPU11は、送信データ1を送信レジスタ35に書き込む。
s22:送信データ制御部40は、送信レジスタ35への書き込みをフラグなどで検出して、送信レジスタ35から送信データ1を読み出す。
s23:送信データ制御部40は、送信データバッファ36から各送信データの送信先チップセレクト指定ビットを読み出す。この時はまだ送信データバッファ36に送信データはない。
s24:送信データ制御部40は、次送信データバッファ39に記憶されている送信データの送信先チップセレクト指定ビットを読み出す。この時はまだ次送信データバッファ39に送信データはない。
s25:送信データ制御部40は、送信レジスタ35から読み出した送信データ1と、送信先チップセレクト指定ビットが同じ送信データが送信データバッファ36又は次送信データバッファ39にあるか否かを判定する。
s26:ここでは、送信データバッファ36と次送信データバッファ39に送信データが記憶されていないので、送信データ制御部40は送信データ1を次送信データバッファ39に書き込む。
s27:CPU11が送信データ2を送信レジスタ35に書き込む。
s28:CPU11が送信データ3を送信レジスタ35に書き込む。
s29:送信データ制御部40は、送信レジスタ35への書き込みをフラグなどで検出して、送信レジスタ35から送信データ2を読み出す。
s30:送信データ制御部40は、送信データバッファ36から各送信データの送信先チップセレクト指定ビットを読み出す。送信データバッファ36にはまだ送信データがない。
s31:送信データ制御部40は、次送信データバッファ39に記憶されている送信データの送信先チップセレクト指定ビットを読み出す。次送信データバッファ39には送信データ1が記憶されているので、送信データ1の送信先チップセレクト指定ビットを読み出す。
s32:送信データ制御部40は、送信レジスタ35から読み出した送信データ2と、送信先チップセレクト指定ビットが同じ送信データが送信データバッファ36又は次送信データバッファ39にあるか否かを判定する。
s33:送信データ1と送信データ2は、送信先チップセレクト指定ビットが一致しないので、送信データ制御部40は送信データ2を送信データバッファ36に書き込む。
s34:送信データ制御部40は、送信レジスタ35への書き込みをフラグなどで検出して、送信レジスタ35から送信データ3を読み出す。
s35:送信データ制御部40は、送信データバッファ36から各送信データの送信先チップセレクト指定ビットを読み出す。送信データバッファ36から送信データ2の送信先チップセレクト指定ビットが読み出される。
s36:送信データ制御部40は、次送信データバッファ39に記憶されている送信データの送信先チップセレクト指定ビットを読み出す。次送信データバッファ39には送信データ1が記憶されているので、送信データ1の送信先チップセレクト指定ビットを読み出す。
s37:送信データ制御部40は、送信レジスタ35から読み出した送信データ3と、送信先チップセレクト指定ビットが同じ送信データが送信データバッファ36又は次送信データバッファ39にあるか否かを判定する。
s38:送信データ3と、送信データ1又は送信データ2は、送信先チップセレクト指定ビットが一致しないので、送信データ制御部40は送信データ3を送信データバッファ36に書き込む。
s39:CPU11は送受信制御レジスタ37に送信許可を設定する。
s40:シリアル通信制御部33は、次送信データバッファ39の送信データがあることをフラグなどで検知し、送信データ1を次送信データバッファ36から読み出す。次送信データバッファ39の送信データの下位の16ビットはシリアル通信制御部33に移動する。また、次送信データバッファ39の送信データの上位の4ビットはチップセレクト制御部34に移動する。
s41:シリアル通信制御部33は、送受信制御レジスタ37に送信許可が設定されているので、送信データ1の送信を開始する。
s42:送信データ制御部40は、次送信データバッファ39の送信データがシリアル通信制御部33に移動したことを検知して、送信データバッファ36から送信データ2を読み出し、次送信データバッファ39に書き込む。なお、送信データ2は送信データバッファ36から消去される。
s43:そして、シリアル通信制御部33が送信データ1を送信している間に、CPU11が送信データ3aを送信レジスタ35に書き込む。送信データ3aと送信データ3は送信先が同じである。
s44:送信データ制御部40は、送信レジスタ35への書き込みをフラグなどで検出して、送信レジスタ35から送信データ3aを読み出す。
s45:送信データ制御部40は、送信データバッファ36から各送信データの送信先チップセレクト指定ビットを読み出す。ここでは送信データ3の送信先チップセレクト指定ビットが読み出される。
s46:送信データ制御部40は、次送信データバッファ39に記憶されている送信データ2の送信先チップセレクト指定ビットを読み出す。ここでは、送信データ2の送信先チップセレクト指定ビットを読み出す。
s47:送信データ制御部40は、送信レジスタ35から読み出した送信データ3aと、送信先チップセレクト指定ビットが同じ送信データが送信データバッファ36又は次送信データバッファ39にあるか否かを判定する。
s48:送信データ3aと送信データ3は、送信先チップセレクト指定ビットが一致するので、送信データ制御部40は、送信データバッファ36の送信データ3のプライオリティビットを読み出す。
s49:送信データ制御部40は、読み出したプライオリティビットを1インクリメントする。
s50:送信データ制御部40は、1インクリメントしたプライオリティビットを、送信データ3aのプライオリティビットに設定する。
s51:送信データ制御部40は、送信データバッファ36の送信データ3を、送信データ3aにより置き換える。
s52:送信データ制御部40は、次送信データバッファ39から送信データ2のプライオリティビットを読み出す。
s53:送信データ制御部40は、送信データバッファ36から送信データ3aのプライオリティビットを読み出す。
s54:送信データ制御部40は、送信データ3aと送信データ2のプライオリティビットを比較する。
s55:送信データ3aの方がプライオリティビットが大きいので、送信データ制御部40は次送信データバッファ39の送信データ2を送信データバッファ36に退避する。
s56:送信データバッファ36の送信データ3aを次送信データバッファ39に書き込む(送信データ2と送信データ3aを入れ替える)。
s57:シリアル通信制御部33は送信データ1の送信が完了すると受信レジスタ38に受信データを書き込む。
s58:また、シリアル通信制御部33は送信データ1の送信が完了すると、CPU11に送受信完了割り込みを行う。
s59:シリアル通信制御部33は、次送信データバッファ39に送信データがあることをフラグなどで検知し、また、送受信制御レジスタ37に送信許可が設定されているので、送信データ3aを読み出す。
s60:シリアル通信制御部33は送信データ3aの送信を開始する。これにより、次送信データバッファ39の送信データ3aの下位16ビットはシリアル通信制御部33に移動する。また、次送信データバッファ39の送信データ3aの上位の4ビットはチップセレクト制御部34に移動する。
[Transmission example of this embodiment]
FIG. 8 shows an example of a timing chart of the communication apparatus 100 of the present embodiment, and FIG. 9 shows an example of a sequence diagram.
s21: The CPU 11 writes the transmission data 1 in the transmission register 35.
s22: The transmission data control unit 40 detects writing to the transmission register 35 with a flag or the like, and reads the transmission data 1 from the transmission register 35.
s23: The transmission data control unit 40 reads the transmission destination chip select designation bit of each transmission data from the transmission data buffer 36. At this time, there is no transmission data in the transmission data buffer 36 yet.
s24: The transmission data control unit 40 reads the transmission destination chip select designation bit of the transmission data stored in the next transmission data buffer 39. At this time, there is no transmission data in the next transmission data buffer 39 yet.
s25: The transmission data control unit 40 determines whether the transmission data 1 read from the transmission register 35 and the transmission data having the same transmission destination chip select designation bit exist in the transmission data buffer 36 or the next transmission data buffer 39.
s26: Here, since transmission data is not stored in the transmission data buffer 36 and the next transmission data buffer 39, the transmission data control unit 40 writes the transmission data 1 in the next transmission data buffer 39.
s27: The CPU 11 writes the transmission data 2 to the transmission register 35.
s28: The CPU 11 writes the transmission data 3 to the transmission register 35.
s29: The transmission data control unit 40 detects writing to the transmission register 35 with a flag or the like, and reads the transmission data 2 from the transmission register 35.
s30: The transmission data control unit 40 reads the transmission destination chip select designation bit of each transmission data from the transmission data buffer 36. There is no transmission data in the transmission data buffer 36 yet.
s31: The transmission data control unit 40 reads the transmission destination chip select designation bit of the transmission data stored in the next transmission data buffer 39. Since the transmission data 1 is stored in the next transmission data buffer 39, the transmission destination chip select designation bit of the transmission data 1 is read.
s32: The transmission data control unit 40 determines whether or not transmission data 2 having the same transmission destination chip select designation bit as the transmission data 2 read from the transmission register 35 exists in the transmission data buffer 36 or the next transmission data buffer 39.
s33: Since transmission data 1 and transmission data 2 do not match the transmission destination chip select designation bit, the transmission data control unit 40 writes transmission data 2 in the transmission data buffer 36.
s34: The transmission data control unit 40 detects writing to the transmission register 35 with a flag or the like, and reads the transmission data 3 from the transmission register 35.
s35: The transmission data control unit 40 reads the transmission destination chip select designation bit of each transmission data from the transmission data buffer 36. The transmission destination chip select designation bit of the transmission data 2 is read from the transmission data buffer 36.
s36: The transmission data control unit 40 reads the transmission destination chip select designation bit of the transmission data stored in the next transmission data buffer 39. Since the transmission data 1 is stored in the next transmission data buffer 39, the transmission destination chip select designation bit of the transmission data 1 is read.
s37: The transmission data control unit 40 determines whether or not transmission data 3 having the same transmission destination chip select designation bit as the transmission data 3 read from the transmission register 35 exists in the transmission data buffer 36 or the next transmission data buffer 39.
s38: Since transmission data 3 and transmission data 1 or transmission data 2 do not match the destination chip select designation bit, transmission data control unit 40 writes transmission data 3 in transmission data buffer 36.
s39: The CPU 11 sets transmission permission in the transmission / reception control register 37.
s40: The serial communication control unit 33 detects that there is transmission data in the next transmission data buffer 39 using a flag or the like, and reads the transmission data 1 from the next transmission data buffer 36. The lower 16 bits of the transmission data in the next transmission data buffer 39 move to the serial communication control unit 33. Further, the upper 4 bits of the transmission data in the next transmission data buffer 39 move to the chip select control unit 34.
s41: Since transmission permission is set in the transmission / reception control register 37, the serial communication control unit 33 starts transmission of the transmission data 1.
s42: The transmission data control unit 40 detects that the transmission data in the next transmission data buffer 39 has moved to the serial communication control unit 33, reads the transmission data 2 from the transmission data buffer 36, and writes it in the next transmission data buffer 39. . The transmission data 2 is erased from the transmission data buffer 36.
s43: While the serial communication control unit 33 is transmitting the transmission data 1, the CPU 11 writes the transmission data 3a in the transmission register 35. Transmission data 3a and transmission data 3 have the same transmission destination.
s44: The transmission data control unit 40 detects writing to the transmission register 35 with a flag or the like, and reads the transmission data 3a from the transmission register 35.
s45: The transmission data control unit 40 reads the transmission destination chip select designation bit of each transmission data from the transmission data buffer 36. Here, the destination chip select designation bit of the transmission data 3 is read.
s46: The transmission data control unit 40 reads the transmission destination chip select designation bit of the transmission data 2 stored in the next transmission data buffer 39. Here, the transmission destination chip select designation bit of transmission data 2 is read.
s47: The transmission data control unit 40 determines whether or not the transmission data 3a read from the transmission register 35 and transmission data having the same transmission destination chip select designation bit exist in the transmission data buffer 36 or the next transmission data buffer 39.
s48: Since the transmission data 3a and the transmission data 3 have the same destination chip select designation bit, the transmission data control unit 40 reads the priority bit of the transmission data 3 in the transmission data buffer 36.
s49: The transmission data control unit 40 increments the read priority bit by 1.
s50: The transmission data control unit 40 sets the priority bit incremented by 1 as the priority bit of the transmission data 3a.
s51: The transmission data control unit 40 replaces the transmission data 3 in the transmission data buffer 36 with the transmission data 3a.
s52: The transmission data control unit 40 reads the priority bit of the transmission data 2 from the next transmission data buffer 39.
s53: The transmission data control unit 40 reads the priority bit of the transmission data 3a from the transmission data buffer 36.
s54: The transmission data control unit 40 compares the priority bits of the transmission data 3a and the transmission data 2.
s55: Since the transmission data 3a has a larger priority bit, the transmission data control unit 40 saves the transmission data 2 of the next transmission data buffer 39 in the transmission data buffer 36.
s56: The transmission data 3a of the transmission data buffer 36 is written into the next transmission data buffer 39 (transmission data 2 and transmission data 3a are interchanged).
s57: When the transmission of the transmission data 1 is completed, the serial communication control unit 33 writes the reception data in the reception register 38.
s58: When the transmission of the transmission data 1 is completed, the serial communication control unit 33 issues a transmission / reception completion interrupt to the CPU 11.
s59: The serial communication control unit 33 detects that there is transmission data in the next transmission data buffer 39 by a flag or the like, and reads transmission data 3a because transmission permission is set in the transmission / reception control register 37.
s60: The serial communication control unit 33 starts transmission of the transmission data 3a. As a result, the lower 16 bits of the transmission data 3 a of the next transmission data buffer 39 are moved to the serial communication control unit 33. Further, the upper 4 bits of the transmission data 3 a in the next transmission data buffer 39 are moved to the chip select control unit 34.

この後、送信データ制御部40は、次送信データバッファ39の送信データ3aがシリアル通信制御部33に移動したことを検知して、送信データバッファ36から送信データ2を読み出し、次送信データバッファ39に書き込む。送信データ2は、シリアル通信制御部33が送信データ3aを送信したら、シリアル通信制御部33により送信される。   Thereafter, the transmission data control unit 40 detects that the transmission data 3 a of the next transmission data buffer 39 has moved to the serial communication control unit 33, reads the transmission data 2 from the transmission data buffer 36, and receives the next transmission data buffer 39. Write to. The transmission data 2 is transmitted by the serial communication control unit 33 when the serial communication control unit 33 transmits the transmission data 3a.

このように本実施形態の通信装置100は、送信データの優先度に応じて、送信順をソートして優先度の高い順に送信することができる。また、頻繁に送信されるデータほど優先度を高くすることができる。   As described above, the communication apparatus 100 according to the present embodiment can sort the transmission order according to the priority of the transmission data and transmit the data in the order of high priority. Moreover, the priority can be made higher as data is transmitted more frequently.

<送信データ制御部の処理手順>
図10は、送信データ制御部40の処理手順を示すフローチャート図の一例である。処理手順の一部がシーケンス図の説明と重複する。
<Processing procedure of transmission data control unit>
FIG. 10 is an example of a flowchart illustrating a processing procedure of the transmission data control unit 40. A part of the processing procedure overlaps with the description of the sequence diagram.

送信データ制御部40は送信レジスタ35を監視し、送信レジスタ35に書き込みがあるか否かを判定している(S110)。   The transmission data control unit 40 monitors the transmission register 35 and determines whether or not there is a write in the transmission register 35 (S110).

送信レジスタ35に書き込みがあった場合(S110のYes)、送信データ制御部40は送信レジスタ35から送信データを読み出す(S120)。   When there is a write in the transmission register 35 (Yes in S110), the transmission data control unit 40 reads transmission data from the transmission register 35 (S120).

送信データ制御部40は、次送信データバッファ39に同じ送信先の送信データがあるか否かを判定する(S130)。次送信データバッファ39にそもそも送信データがない場合、又は、次送信データバッファ39に送信データがあっても送信先チップセレクト指定ビットが一致しない場合、S130の判定はNoになる。   The transmission data control unit 40 determines whether there is transmission data of the same transmission destination in the next transmission data buffer 39 (S130). If there is no transmission data in the next transmission data buffer 39 in the first place, or if there is transmission data in the next transmission data buffer 39 and the transmission destination chip select designation bits do not match, the determination in S130 is No.

次送信データバッファ39に同じ送信先の送信データがある場合(S130のYes)、送信データ制御部40は、次送信データバッファ39のデータ部分(下位16ビット)を、送信レジスタ35から読み出した送信データのデータ部分で置き換える(S140)。これにより、後から同じ送信先に送信されるデータのみを送信でき、時間保証が容易になる。   When there is transmission data of the same transmission destination in the next transmission data buffer 39 (Yes in S130), the transmission data control unit 40 transmits the data portion (lower 16 bits) of the next transmission data buffer 39 read from the transmission register 35. Replace with the data portion of the data (S140). As a result, only data to be transmitted later to the same destination can be transmitted, and time guarantee is facilitated.

次に、送信データ制御部40は、次送信データバッファ39のプライオリティビットを1インクリメントする(S150)。これにより、頻繁に送信される送信データの優先度を大きくすることができる。   Next, the transmission data control unit 40 increments the priority bit of the next transmission data buffer 39 by 1 (S150). Thereby, the priority of the transmission data transmitted frequently can be enlarged.

次送信データバッファ39に同じ送信先の送信データがない場合(S130のNo)、送信データ制御部40は、送信データバッファ36に同じ送信先の送信データがあるか否かを判定する(S160)。なお、次送信データバッファ39と送信データバッファ36に同じ送信先の送信データが記憶されることはない。また、次送信データバッファ39に送信データが書き込まれていないのに、送信データバッファ36に送信データが書き込まれている状況は生じない。   When there is no transmission data of the same transmission destination in the next transmission data buffer 39 (No in S130), the transmission data control unit 40 determines whether there is transmission data of the same transmission destination in the transmission data buffer 36 (S160). . Note that transmission data of the same transmission destination is not stored in the next transmission data buffer 39 and the transmission data buffer 36. In addition, there is no situation where transmission data is written in the transmission data buffer 36 even though transmission data is not written in the next transmission data buffer 39.

送信データバッファ36に同じ送信先の送信データがある場合(S160のYes)、送信データ制御部40は、送信データバッファ36の送信先が同じ送信データからプライオリティビットを取得する(S170)。   When there is transmission data with the same transmission destination in the transmission data buffer 36 (Yes in S160), the transmission data control unit 40 acquires priority bits from transmission data with the same transmission destination in the transmission data buffer 36 (S170).

送信データ制御部40は、取得したプライオリティビットを1インクリメントする(S180)。これにより、頻繁に送信される送信データの優先度を大きくすることができる。   The transmission data control unit 40 increments the acquired priority bit by 1 (S180). Thereby, the priority of the transmission data transmitted frequently can be enlarged.

送信データ制御部40は、1インクリメントしたプライオリティビットを、送信先レジスタから読み出した送信データのプライオリティビットに設定する(S190)。   The transmission data control unit 40 sets the priority bit incremented by 1 to the priority bit of the transmission data read from the transmission destination register (S190).

そして、プライオリティビットが新たに設定された送信データを、送信データ制御部40は送信データバッファ36の送信先が同じ送信データに上書きする(S200)。これにより、後から同じ送信先に送信されるデータのみを送信できる。   Then, the transmission data control unit 40 overwrites the transmission data having the same transmission destination in the transmission data buffer 36 with the transmission data in which the priority bit is newly set (S200). As a result, only data to be transmitted to the same destination later can be transmitted.

送信データ制御部40は、次送信データバッファ39のプライオリティビットが、上書きした送信データバッファ36の送信データのプライオリティビット以上か否かを判定する(S210)。プライオリティビットが等しい場合は、先に次送信データバッファ39に書き込まれている送信データが優先される。このため、次送信データバッファ39のプライオリティビットが、上書きした送信データバッファ36の送信データのプライオリティビット以上の場合(S210のYes)、処理は終了する。   The transmission data control unit 40 determines whether or not the priority bit of the next transmission data buffer 39 is equal to or higher than the priority bit of the transmission data of the overwritten transmission data buffer 36 (S210). If the priority bits are equal, the transmission data previously written in the next transmission data buffer 39 is given priority. For this reason, when the priority bit of the next transmission data buffer 39 is equal to or higher than the priority bit of the transmission data of the overwritten transmission data buffer 36 (Yes in S210), the process ends.

次送信データバッファ39のプライオリティビットが、上書きした送信データバッファ36の送信データのプライオリティビット以上でない場合(S210のNo)、上書きした送信データバッファ36の送信データのプライオリティビットが最も大きいことになる。このため、送信データ制御部40は、送信データバッファ36の上書きされた送信データと、次送信データバッファ39の送信データを入れ替える(S220)。これにより、頻繁に送信される送信データを優先的に送信することができる。   When the priority bit of the next transmission data buffer 39 is not equal to or higher than the priority bit of the transmission data of the overwritten transmission data buffer 36 (No in S210), the priority bit of the transmission data of the overwritten transmission data buffer 36 is the largest. Therefore, the transmission data control unit 40 replaces the overwritten transmission data in the transmission data buffer 36 with the transmission data in the next transmission data buffer 39 (S220). Thereby, transmission data that is frequently transmitted can be transmitted with priority.

一方、ステップS160において、送信データバッファ36に同じ送信先の送信データがない場合(S160のNo)、送信データ制御部40は、次送信データバッファ39に送信データが書き込まれているか否かを判定する(S230)。なお、この判定はS130で判定しておくこともできる。   On the other hand, in step S160, when there is no transmission data of the same transmission destination in the transmission data buffer 36 (No in S160), the transmission data control unit 40 determines whether or not transmission data is written in the next transmission data buffer 39. (S230). This determination can also be determined in S130.

次送信データバッファ39に送信データが書き込まれている場合(S230のYes)、次送信データバッファ39に送信データを書き込めないので、送信データ制御部40は、送信レジスタ35から読み出した送信データを送信データバッファ36に書き込む(S240)。   When transmission data is written in the next transmission data buffer 39 (Yes in S230), the transmission data cannot be written in the next transmission data buffer 39, so the transmission data control unit 40 transmits the transmission data read from the transmission register 35. Write to the data buffer 36 (S240).

次送信データバッファ39に送信データが書き込まれていない場合(S230のNo)、次送信データバッファ39に送信データを書き込めるので、送信データ制御部40は、送信レジスタ35から読み出した送信データを次送信データバッファ39に書き込む(S250)。   When the transmission data is not written in the next transmission data buffer 39 (No in S230), the transmission data can be written in the next transmission data buffer 39. Therefore, the transmission data control unit 40 transmits the transmission data read from the transmission register 35 to the next transmission. Write to the data buffer 39 (S250).

〔優先度の遷移について〕
図11は、優先度の遷移例を説明する図の一例である。図11(a)に示すように、次送信データバッファ39に送信データ3が書き込まれた状態で、送信レジスタ35にデータ3aが書き込まれると、図11(b)に示すように、優先度が1つ大きくなった送信データ3aが次送信データバッファ39に書き込まれる(S140,S150の処理)。
[About transition of priority]
FIG. 11 is an example of a diagram illustrating an example of priority transition. As shown in FIG. 11A, when the data 3a is written in the transmission register 35 in a state where the transmission data 3 is written in the next transmission data buffer 39, the priority is set as shown in FIG. The increased transmission data 3a is written into the next transmission data buffer 39 (processing of S140 and S150).

CPU11が次々と同じ送信先に送信データ3bを送信する状況が生じた場合を想定すると、まず、図11(c)(d)に示すように、送信データ3bの優先度が送信データ3aに対し1つ大きくなり、次送信データバッファ39に送信データ3bが書き込まれる。   Assuming a situation where the CPU 11 transmits the transmission data 3b to the same destination one after another, first, as shown in FIGS. 11C and 11D, the priority of the transmission data 3b is higher than the transmission data 3a. The transmission data 3b is written in the next transmission data buffer 39 by one.

次に、送信レジスタ35に送信データ3cが書き込まれた場合も、同様に、図11(e)(f)に示すように、送信データ3cの優先度が送信データ3bに対し1つ大きくなり、次送信データバッファ39に送信データ3cが書き込まれる。   Next, when the transmission data 3c is written in the transmission register 35, similarly, as shown in FIGS. 11E and 11F, the priority of the transmission data 3c is increased by one with respect to the transmission data 3b. Transmission data 3 c is written in the next transmission data buffer 39.

図12は、優先度の遷移例を説明する図の別の一例である。送信データバッファ36の送信データ2と同じ送信先に、CPU11が次々と送信データを送信する状況が生じたとする。この場合、次送信データバッファ39の送信データと送信データバッファ36の送信データのプライオリティビットが逆転した時に、次送信データバッファ39の送信データと送信データバッファ36の送信データが入れ替わる。   FIG. 12 is another example of a diagram illustrating an example of priority transition. Assume that a situation occurs in which the CPU 11 sequentially transmits transmission data to the same transmission destination as the transmission data 2 in the transmission data buffer 36. In this case, when the priority bits of the transmission data in the next transmission data buffer 39 and the transmission data in the transmission data buffer 36 are reversed, the transmission data in the next transmission data buffer 39 and the transmission data in the transmission data buffer 36 are switched.

図12(a)(b)は図11(a)(b)と同じ状態である。そして、例えば図12(c)において、送信レジスタ35に送信データ2aが書き込まれた場合、送信データ2aの優先度が送信データ2に対し1つ大きくなり、図12(d)に示すように、送信データバッファ36に送信データ2aが書き込まれる(S170〜S200の処理)。この次点では、次送信データバッファ39の送信データ3aと送信データバッファ36の送信データ2aのプライオリティビットが等しい。   FIGS. 12A and 12B are in the same state as FIGS. 11A and 11B. For example, in FIG. 12C, when the transmission data 2a is written in the transmission register 35, the priority of the transmission data 2a is increased by one with respect to the transmission data 2, and as shown in FIG. The transmission data 2a is written into the transmission data buffer 36 (processing of S170 to S200). At this next point, the priority bits of the transmission data 3a in the next transmission data buffer 39 and the transmission data 2a in the transmission data buffer 36 are equal.

次に、図12(e)において、送信レジスタ35に送信データ2bが書き込まれた場合、送信データ2bの優先度が送信データ2aに対し1つ大きくなり、図12(f)に示すように、送信データバッファ36に送信データ2bが書き込まれる。   Next, in FIG. 12E, when the transmission data 2b is written in the transmission register 35, the priority of the transmission data 2b is increased by one with respect to the transmission data 2a, and as shown in FIG. The transmission data 2b is written in the transmission data buffer 36.

この次点で、次送信データバッファ39の送信データ3aと送信データバッファ36の送信データ2bのプライオリティビットが逆転するので、次送信データバッファ39の送信データ3bと送信データバッファ36の送信データ2bの入れ替えが発生する。   At this next point, since the priority bits of the transmission data 3a in the next transmission data buffer 39 and the transmission data 2b in the transmission data buffer 36 are reversed, the transmission data 3b in the next transmission data buffer 39 and the transmission data 2b in the transmission data buffer 36 are reversed. Replacement occurs.

〔その他〕
上記の実施形態では、プライオリティビットの初期値をゼロとしたが、送信データ制御部40はゼロ以外のプライオリティビットを設定することもできる。例えば、送信データ制御部40は、過去の所定時間(例えば、数秒)の送信先毎の送信頻度を監視し、送信頻度の小さい送信データのプライオリティビットを大きくして、初期値として送信データバッファ36に設定する。たまにしか送信されない送信先の送信データのプライオリティビットの初期値が大きくなるので、高頻度に送信されるためプライオリティビットが大きくなった送信データに対し、たまにしか送信されない送信先データに対しても時間保証しやすくなる。
[Others]
In the above embodiment, the initial value of the priority bit is set to zero. However, the transmission data control unit 40 may set a priority bit other than zero. For example, the transmission data control unit 40 monitors the transmission frequency for each transmission destination in the past predetermined time (for example, several seconds), increases the priority bit of transmission data with a low transmission frequency, and sets the transmission data buffer 36 as an initial value. Set to. Because the initial value of the priority bit of the transmission data of the transmission destination that is transmitted only occasionally becomes large, the transmission data with high priority bit because of the high-frequency transmission is also time for the transmission destination data that is transmitted only occasionally. It will be easier to guarantee.

また、プライオリティビットは送信データ制御部40が設定するとしたが、CPU11が設定可能としてもよい。この場合、CPU11が実行するソフトウェアは、送信先毎に、又は、同じ送信先でもイベントの種類によってプライオリティビットを増減する。したがって、他の送信データが高頻度で送信されているため優先度が高くなっても、CPU11が早く送信したい送信データを優先的に送信することができる。   The priority bit is set by the transmission data control unit 40, but the CPU 11 may be settable. In this case, the software executed by the CPU 11 increases or decreases the priority bits for each transmission destination or even for the same transmission destination depending on the type of event. Therefore, since other transmission data is frequently transmitted, even if the priority is high, the CPU 11 can preferentially transmit the transmission data that the CPU 11 desires to transmit.

11 CPU
31 クロック制御レジスタ
32 シリアルクロック制御部
33 シリアル通信制御部
34 チップセレクト制御部
35 送信レジスタ
36 送信データバッファ
37 送受信制御レジスタ
38 受信レジスタ
39 次送信データバッファ
40 送信データ制御部
100 通信装置
101 IC
200 マイコン
300 ECU
11 CPU
31 clock control register 32 serial clock control unit 33 serial communication control unit 34 chip select control unit 35 transmission register 36 transmission data buffer 37 transmission / reception control register 38 reception register 39 next transmission data buffer 40 transmission data control unit 100 communication device 101 IC
200 Microcomputer 300 ECU

Claims (8)

送信データが書き込まれる送信レジスタと、
複数の送信先から1つの送信先を指定する送信先指定手段と、
送信先に送信データをシリアル送信する送信制御手段と、
送信待ちの送信データ及び各送信データに対応付けられた優先度情報を蓄積する送信データバッファと、
前記送信レジスタに書き込まれた送信データと前記送信データバッファに蓄積されている送信データの送信先が同じ場合、前記送信データバッファに蓄積されている送信データを前記送信レジスタに書き込まれた送信データで上書きする送信データ制御手段と、を有し、
前記送信データ制御手段は、前記送信データバッファに蓄積されている送信データを前記送信レジスタに書き込まれた送信データで上書きする頻度に応じて前記優先度情報を決定して、前記送信データバッファに上書きされた送信データに対応付けて前記送信データバッファに書き込む、通信装置。
A transmission register to which transmission data is written; and
A destination designation means for designating one destination from a plurality of destinations;
A transmission control means for serially transmitting transmission data to a transmission destination;
A transmission data buffer for storing transmission data awaiting transmission and priority information associated with each transmission data ;
When the transmission data written in the transmission register and the transmission destination of the transmission data stored in the transmission data buffer are the same, the transmission data stored in the transmission data buffer is the transmission data written in the transmission register. A transmission data control means for overwriting ,
The transmission data control means determines the priority information according to the frequency of overwriting the transmission data stored in the transmission data buffer with the transmission data written in the transmission register, and overwrites the transmission data buffer. A communication device that writes to the transmission data buffer in association with the transmitted data .
前記優先度情報が大きいほど優先度が高い場合、
前記送信データ制御手段は、前記送信データバッファに蓄積されている送信データを前記送信レジスタに書き込まれた送信データで上書きする際、
前記送信データバッファに蓄積されている送信データの前記優先度情報よりも大きい前記優先度情報を、前記送信レジスタに書き込まれた送信データの前記優先度情報に設定して上書きする、ことを特徴とする請求項1に記載の通信装置。
If the higher priority is larger the priority information,
When the transmission data control means overwrites the transmission data stored in the transmission data buffer with the transmission data written in the transmission register,
Said priority information is greater than the priority information of the transmission data stored in the transmission data buffer, overwriting is set to the priority information of the transmission data written in the transmission register, and wherein the The communication device according to claim 1 .
前記送信データ制御手段は、前記送信データバッファに蓄積されている送信データを前記送信レジスタに書き込まれた送信データで上書きする際、
上書きする回数が多くなるほど、大きい前記優先度情報を前記送信レジスタに書き込まれた送信データの前記優先度情報に設定して上書きする、ことを特徴とする請求項2に記載の通信装置。
When the transmission data control means overwrites the transmission data stored in the transmission data buffer with the transmission data written in the transmission register,
As the number of times of overwriting is increased, greater the overwrite priority information set to the priority information of the transmission data written in the transmission register, the communication apparatus according to claim 2, characterized in that.
前記送信データバッファは、前記送信制御手段が送信対象とする送信データが記憶される次送信データバッファと、次送信データバッファに書き込まれるまで1つ以上の送信データが蓄積される送信待ち送信データバッファとを有し、
前記送信レジスタに書き込まれた送信データと前記次送信データバッファに蓄積されている送信データの送信先が同じ場合、
前記送信データ制御手段は、前記次送信データバッファに蓄積されている送信データを前記送信レジスタに書き込まれた送信データで上書きする、
ことを特徴とする請求項1〜3いずれか1項に記載の通信装置。
The transmission data buffer includes a next transmission data buffer in which transmission data to be transmitted by the transmission control unit is stored, and a transmission waiting transmission data buffer in which one or more transmission data are accumulated until the transmission data is written in the next transmission data buffer And
When the transmission data written to the transmission register and the transmission destination of the transmission data stored in the next transmission data buffer are the same,
The transmission data control means overwrites the transmission data stored in the next transmission data buffer with the transmission data written in the transmission register;
The communication apparatus according to any one of claims 1 to 3, characterized in that.
前記送信データバッファは、前記送信制御手段が送信対象とする送信データが記憶される次送信データバッファと、次送信データバッファに書き込まれるまで1つ以上の送信データが蓄積される送信待ち送信データバッファとを有し、
前記送信待ち送信データバッファに蓄積されている送信データを、決定された前記優先度情報とともに前記送信レジスタに書き込まれた送信データで上書きしたことで、
前記送信待ち送信データバッファの送信データの前記優先度情報の方が、前記次送信データバッファの送信データの前記優先度情報よりも高くなった場合、
前記送信データ制御手段は、前記送信待ち送信データバッファの最も前記優先度情報が高い送信データと、前記次送信データバッファの送信データを入れ替える、
ことを特徴とする請求項1〜3いずれか1項記載の通信装置。
The transmission data buffer includes a next transmission data buffer in which transmission data to be transmitted by the transmission control unit is stored, and a transmission waiting transmission data buffer in which one or more transmission data are accumulated until the transmission data is written in the next transmission data buffer And
By overwriting the transmission data stored in the transmission data buffer waiting for transmission with the transmission data written in the transmission register together with the determined priority information,
When the priority information of the transmission data of the transmission waiting transmission data buffer is higher than the priority information of the transmission data of the next transmission data buffer,
The transmission data control unit, and most said priority information is high transmission data of the transmission waiting transmission data buffer, replacing the transmission data of the next transmission data buffer,
The communication apparatus according to any one of claims 1 to 3, wherein
前記優先度情報の初期値はゼロ又は前記送信レジスタに送信データが書き込まれる際に任意に設定される、ことを特徴とする請求項1〜5いずれか1項記載の通信装置。 The priority initial value of the information is arbitrarily set when transmitting data to zero or the transmission register is written, that the communication device of claims 1 to 5 or 1, wherein said. 請求項1〜6いずれか1項記載の通信装置と、
CPUと、
前記CPUが実行するためのプログラムであって、前記プログラムを実行した前記CPUが前記送信レジスタに送信先と送信データを書き込むプログラムを記憶するプログラム記憶手段と、を有し、
前記CPUは前記送信レジスタに送信先と送信データを書き込む、情報処理装置。
The communication device according to any one of claims 1 to 6 ,
CPU,
A program storage means for storing a program to be executed by the CPU, the CPU executing the program storing a transmission destination and transmission data in the transmission register ;
Wherein the CPU writes the transmission data and the transmission destination to the transmission register, the information processing apparatus.
送信データが書き込まれる送信レジスタと、
複数の送信先から1つの送信先を指定する送信先指定手段と、
送信先に送信データをシリアル送信する送信制御手段と、
送信待ちの送信データ及び各送信データに対応付けられた優先度情報を蓄積する送信データバッファと、を有する通信装置のデータ送信方法であって、
前記送信レジスタに書き込まれた送信データと前記送信データバッファに蓄積されている送信データの送信先が同じ場合、送信データ制御手段が、前記送信データバッファに蓄積されている送信データを前記送信レジスタに書き込まれた送信データで上書きするステップと
前記送信データ制御手段が、前記送信データバッファに蓄積されている送信データを前記送信レジスタに書き込まれた送信データで上書きする頻度に応じて前記優先度情報を決定して、前記送信データバッファに上書きされた送信データに対応付けて前記送信データバッファに書き込むステップと、を有することを特徴とするデータ送信方法。
A transmission register to which transmission data is written; and
A destination designation means for designating one destination from a plurality of destinations;
A transmission control means for serially transmitting transmission data to a transmission destination;
A data transmission method for a communication apparatus, comprising: transmission data awaiting transmission; and a transmission data buffer for storing priority information associated with each transmission data ,
When the transmission data written in the transmission register and the transmission destination of the transmission data stored in the transmission data buffer are the same, the transmission data control means sends the transmission data stored in the transmission data buffer to the transmission register. a step of overwriting by the transmission data written,
The transmission data control means determines the priority information according to the frequency of overwriting the transmission data stored in the transmission data buffer with the transmission data written in the transmission register, and overwrites the transmission data buffer. And writing to the transmission data buffer in association with the transmitted data .
JP2011126277A 2011-06-06 2011-06-06 Communication apparatus, information processing apparatus, and data transmission method Active JP5708273B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011126277A JP5708273B2 (en) 2011-06-06 2011-06-06 Communication apparatus, information processing apparatus, and data transmission method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011126277A JP5708273B2 (en) 2011-06-06 2011-06-06 Communication apparatus, information processing apparatus, and data transmission method

Publications (2)

Publication Number Publication Date
JP2012253659A JP2012253659A (en) 2012-12-20
JP5708273B2 true JP5708273B2 (en) 2015-04-30

Family

ID=47526031

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011126277A Active JP5708273B2 (en) 2011-06-06 2011-06-06 Communication apparatus, information processing apparatus, and data transmission method

Country Status (1)

Country Link
JP (1) JP5708273B2 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008172353A (en) * 2007-01-09 2008-07-24 Auto Network Gijutsu Kenkyusho:Kk In-vehicle relay device, in-vehicle communication system, and in-vehicle communication method
JP2009194719A (en) * 2008-02-15 2009-08-27 Nec Electronics Corp Data communication device and method for determining transmission candidate message
JP4478731B2 (en) * 2008-02-20 2010-06-09 富士通テン株式会社 Communication device and gateway device
JP5075868B2 (en) * 2009-04-03 2012-11-21 本田技研工業株式会社 In-vehicle gateway device

Also Published As

Publication number Publication date
JP2012253659A (en) 2012-12-20

Similar Documents

Publication Publication Date Title
US7213084B2 (en) System and method for allocating memory allocation bandwidth by assigning fixed priority of access to DMA machines and programmable priority to processing unit
JPH05250305A (en) Data transfer control system
JP5040050B2 (en) Multi-channel DMA controller and processor system
EP0355462B1 (en) Dedicated service processor with inter-channel communication features
US5974479A (en) System for executing, canceling, or suspending a DMA transfer based upon internal priority comparison between a DMA transfer and an interrupt request
JP4817834B2 (en) Interrupt control device and interrupt control method
US20080276073A1 (en) Apparatus for and method of distributing instructions
US20090320034A1 (en) Data processing apparatus
JP5708273B2 (en) Communication apparatus, information processing apparatus, and data transmission method
JP2004516547A (en) Suspension control device
JP4056768B2 (en) Microcomputer, cache memory control method, and clock control method
US7266630B2 (en) CPU contained LSI
JP7468112B2 (en) INTERFACE CIRCUIT AND METHOD FOR CONTROLLING INTERFACE CIRCUIT - Patent application
US8239652B2 (en) Data processing system
JPH06131294A (en) Data transfer device
WO2024070015A1 (en) Electronic control device, vehicle control system, and task control method
JP2001056793A (en) Information processor
US20170131755A1 (en) SYSTEM-ON-CHIP (SoC) AND METHOD FOR DYNAMICALLY OPTIMIZING POWER CONSUMPTION IN THE SoC
US20230418472A1 (en) Methods and apparatus to schedule memory operations
JP3557507B2 (en) Bus arbitration circuit
JPH0512173A (en) Information processor
JP2006024134A (en) Dma transfer device and dma transfer method
JP2003323335A (en) Memory device and its control method
KR19990003117A (en) SCHEDULING DEVICE OF CDMA Mobile Communication Switch
US20160124776A1 (en) Process for controlling a processing unit improving the management of the tasks to be executed, and corresponding processing unit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140114

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20141119

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141209

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150115

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20150203

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150216

R151 Written notification of patent or utility model registration

Ref document number: 5708273

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151