JP2004104163A - Data communication method and system - Google Patents

Data communication method and system Download PDF

Info

Publication number
JP2004104163A
JP2004104163A JP2002259042A JP2002259042A JP2004104163A JP 2004104163 A JP2004104163 A JP 2004104163A JP 2002259042 A JP2002259042 A JP 2002259042A JP 2002259042 A JP2002259042 A JP 2002259042A JP 2004104163 A JP2004104163 A JP 2004104163A
Authority
JP
Japan
Prior art keywords
master
slave
data
data communication
communication
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.)
Granted
Application number
JP2002259042A
Other languages
Japanese (ja)
Other versions
JP4056832B2 (en
Inventor
Riichi Nakahira
中平 利一
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.)
Denso Ten Ltd
Original Assignee
Denso Ten Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Ten Ltd filed Critical Denso Ten Ltd
Priority to JP2002259042A priority Critical patent/JP4056832B2/en
Publication of JP2004104163A publication Critical patent/JP2004104163A/en
Application granted granted Critical
Publication of JP4056832B2 publication Critical patent/JP4056832B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)
  • Small-Scale Networks (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To properly use and perform a plurality of kinds of data communication and their responses in different ways with a simple configuration. <P>SOLUTION: Between a master 11 and a plurality of slaves 12, 13,..., a common data bus 21, a control bus 22 whose control direction is from the master 11 to the slaves 12, 13,..., and a control bus 23 whose control direction is from the slaves 12, 13,..., to the master 11 are provided. Combinations of and changes in signal levels of the control buses 22, 23 permit shifts among various states to thereby perform data communication, a plurality of frame communication, interruption communication between the master and the slaves, and inter-slave communication. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、マスタからスレーブの方向とスレーブからマスタの方向とに分けた制御ラインで、共通のデータラインを介して行うデータ通信を制御するデータ通信方法およびシステムに関する。
【0002】
【従来の技術】
従来から、複数のプロセッサ、ユニット、機器などの通信ノード間で共通のデータバスを介してデータを通信するデータ通信の方式には、大別してマルチマスタ方式とマスタ−スレーブ方式とがある。図9は、(a)でマルチマスタ方式の例を示し、(b)でマスタ−スレーブ方式の例を示す。
【0003】
図9(a)に示すマルチマスタ方式は、複数の通信ノード1A〜1F間が共通のバス2で相互接続され、通信に参加するすべての通信ノード1A〜1Fがマスタとなり、バス2の管理権を得て、他の通信ノードに対するデータの送信を行い得る。ただし、いずれかの通信ノード1A〜1Bがマスタになってしまうと、他の通信ノードはスレーブとなる。つまり、データの送信に関しては早いもの勝ちとなる。よって、どの通信ノード1A〜1F間でも通信が可能であるけれども、全く同時に送信しようとしたときは、何らかの調停が必要である。
【0004】
特開平6−12366号公報には、システムバス割当て回路によってシステムバスの使用権の調停を行い、複数のプロセッサ間相互でデータ転送を行うバス使用権調停制御システムについての先行技術が開示されている。システムバス割当て回路は、どのプロセッサがシステムバスの使用権の要求を行うことが可能であるかを示す情報を任意に設定可能な機能を備えていて、設定されたプロセッサ番号を順次システムバス上に送出し、そのプロセッサ番号に対応するプロセッサがバス使用権獲得要求を行えば、そのプロセッサから他のプロセッサに対するデータ送信が可能になる。
【0005】
図9(b)に示すマスタ−スレーブ方式は、マスタとなる通信ノード1Aが固定で、通信はマスタとスレーブとなる通信ノード1B〜1Fとの間で行う。マスタとなる通信ノード1Aが固定されているので、バスの管理権に関する調停は不要であり、構成は簡単になる。通信の管理は、マスタとなる通信ノード1Aのみが行うので、スレーブとなる通信ノード1B〜1F間の通信を行うことができず、一旦マスタとなる通信ノード1Aとの間で通信を行い、さらにマスタとなる通信ノード1Aが他の通信ノードに対する通信を行うようにする必要がある。
【0006】
特開平6−266658号公報には、マスタとして指定されるプロセッサから他のプロセッサに同期信号とステータス信号を供給して、データ通信を行うプロセッサを指定し、指定されたプロセッサは同期信号にタイミングを合わせてデータを送信するマルチプロセッサ用バスシステムの先行技術が開示されている。
【0007】
図10はマスタ−スレーブ方式でデータ通信を行うための基本的な構成を示し、図11はデータ通信システムの概要を示す。図10に示すように、バス2を介して相互に接続されている2つの通信ノードの一方がマスタ3となり、他方がスレーブ4となる。バス2には、双方向性のデータライン5と制御ライン6とが含まれる。図11(a)はデータの送受にデータライン5を使用するシステムを示し、図11(b)はデータの送受にデータライン5および制御ライン6の両方を使用するシステムを示す。
【0008】
データ通信では、バイト単位のデータをある程度の数まとめて、フレームとして送信する。このとき、受信側では、データを確実に受信することができたか否かを確認するために、受信側は送信側からのデータを正常に受信しているか否かを1バイト単位で確認し、正常に受信していれば応答信号を受信側から返答する。これには、データライン5を使用して予め定められる伝送制御用の肯定応答信号であるACK信号として応答したり、制御ライン5を使用してANS信号として応答することが考えられている。
【0009】
図11(a)に示すシステムでは、エラー検出時にはACKを返さないで、たとえば予め定める伝送制御用の否定応答信号であるNAKを返答する等で、エラー検出を伝えることができる。また、受信処理に時間がかかるようなときは、次のデータ送信を待つポーズの要求を行うこともある。データライン5を利用して返答を行うときは、ACKやNAKとは異なるポーズ要求も、それぞれ特定の応答コードで区別して行うことができる。
【0010】
図11(b)に示すシステムでは、データライン5を介する正常なデータの受信毎に、制御ライン6を介してANSを返し、エラー時にはANSを返さないことで、エラー検出を伝えることができる。また、ポーズの要求も、制御ライン6やクロックラインのレベルを一定に保つことや、次のデータ受信が可能になるまでANSの返答を遅れさせることで可能となる。
【0011】
一方、1バイト毎に応答を返さずに、フレームでまとめてACKを返す方法も考えられる。しかし、この方法では、途中でエラーを検出しても、それをデータライン5上のACK等では伝えることができないので、制御ライン6のレベルを変えて伝えることになるけれども、そうすると、ポーズ要求の信号と重複してしまう。
【0012】
バイト単位のデータを、ある程度の数まとめてフレームとして送信するデータ通信では、データ量が大きい場合には複数のフレームに分けて伝送する必要がある。これを複数フレーム通信と呼ぶ。複数フレーム通信をマスタ−スレーブの通信方式において実現する場合には、スレーブ4からの通信時はバス使用権要求だけでは、そのスレーブ4が単フレーム通信をしようとしているのか、複数フレーム通信しようとしているのか判別ができない。また、図9(b)に示すように複数のスレーブとなる通信ノード1B〜1Fからバス使用権要求が出されると、どのスレーブがバス2を使用して先にデータを送信することができるかは、マスタとなる通信ノード1Aがスレーブとなる各通信ノード1B〜1Fのうちの一つに対してENQ信号で問い合せを行う順序による。
【0013】
すなわち、図12に示すように、スレーブ4はマスタ3に対してデータライン5に所定のタイミングtでバス2の使用権を要求することはできるけれども、マスタ3はどのスレーブ4かやどのような通信形態かは不明なまま、バス2の使用権を認めるか否かの判断を行う必要がある。
【0014】
【特許文献1】
特開平6−12366号公報
【特許文献2】
特開平6−266658号公報
【0015】
【発明が解決しようとする課題】
図11(a)に示すように、データライン5でデータと応答との送受信を行うシステムでは、前述のように、フレーム送信中のエラー検出の通知は制御ライン6を介して行うようにすることができるけれども、制御ライン6を介して送ることができる情報量は少ないので、ポーズの要求を送信することはできない。またマスタ3に対してスレーブ4がバス使用権要求などを行う際にも、マスタ3には充分な情報を得ることができない。
【0016】
本発明の目的は、簡単な構成でデータ通信とその応答を複数種類使い分けて行うことができるデータ通信方法およびシステムを提供することである。
【0017】
【課題を解決するための手段】
本発明は、共通のデータラインを介するデータの転送を制御する制御ラインを、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて設けておき、マスタとスレーブとの間でデータ通信を行うデータ通信方法であって、
スレーブは複数であり、
マスタが複数のスレーブのうちのいずれかのスレーブを選択して、マスタからスレーブの方向への制御ラインの信号レベルを予め定める論理値に対応するように変化させている間、データの通信を行う共通のデータラインと、
選択されたスレーブは、共通のデータラインを使用して、他のスレーブに対するデータ通信が可能であることを特徴とするデータ通信方法である。
【0018】
本発明に従えば、データ通信は、マスタと複数のスレーブとに共通なデータラインを介して行う。データの転送を制御するために、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて制御ラインを設けておく。マスタがスレーブのうちの一つを選択すれば、選択されたスレーブは、他のスレーブとの間でデータ通信が可能になるので、マスタを介さずにスレーブ同士でデータ通信を行うことができる。スレーブの一つがサブマスタとなってスレーブ間通信が可能になるので、マルチマスタ方式のような調停回路が不要で、簡単にスレーブ間通信を実現することができる。
【0019】
また本発明で、前記選択されたスレーブは、前記他のスレーブに対するデータ通信を行った後、前記スレーブからマスタの方向への制御ラインの信号レベルを予め定めるように変化させて、該データ通信の終了を通知することを特徴とする。
【0020】
本発明に従えば、マスタから選択されて他のスレーブに対するデータ通信を行うサブマスタとなったスレーブは、そのデータ通信の終了を制御ラインの信号レベルを予め定めるように変化させて、マスタに通知することができる。通知を受けたマスタは、サブマスタからバスの使用権の引き渡しを受け、マスタ自身のデータ通信や、バスの管理を続けることができる。
【0021】
また本発明で、前記マスタは、前記選択されたスレーブによるデータ通信の開始後、予め定める時間が経過すると、マスタからスレーブの方向への制御ラインに対する前記信号レベルの変化を終了させることを特徴とする。
【0022】
本発明に従えば、マスタは、サブマスタにバスの使用権を引き渡していることを、マスタからスレーブの方向への制御ラインを予め定める信号レベルとすることで表示し、予め定める時間が経過すると、タイムアウトとしてバスの使用権を回復することができる。サブマスタによるデータ通信にトラブルが発生しても、サブマスタからマスタにバスの使用権を確実に引き渡すことができる。
【0023】
さらに本発明は、共通のデータラインを介するデータの転送を制御する制御ラインを、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて設けておき、マスタとスレーブとの間でデータ通信を行うデータ通信方法であって、
マスタまたはスレーブの一方から他方へのデータ送信中に、該他方が該一方の方向への制御ラインの信号レベルを、予め定める時間だけ論理的に反転するように変化させると、該一方からのデータ送信を一時的に停止させるポーズ要求となり、
該他方が該信号レベルを論理的に反転させる時間が該予め定める時間を超えると、該一方からのデータ送信の終了要求となることを特徴とするデータ通信方法である。
【0024】
本発明に従えば、データ通信は、マスタとスレーブとに共通なデータラインを介して行う。データの転送を制御するために、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて制御ラインを設けておく。たとえばマスタからスレーブへのデータ送信中に、スレーブがスレーブからマスタの方向への制御ラインの信号レベルを、予め定める時間だけ論理的に反転するように変化させると、マスタからのデータ送信を一時的に停止させるポーズ要求となり、スレーブが信号レベルを論理的に反転させる時間が予め定める時間を超えると、マスタからのデータ送信の終了要求となるので、1本の制御ラインで、ポーズ要求と通信終了要求を兼用させることができる。マスタがマスタからスレーブの方向への制御ラインを兼用させて、スレーブからマスタへのデータ通信についても同様に制御することができる。
【0025】
さらに本発明は、共通のデータラインを介するデータの転送を制御する制御ラインを、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて設けておき、マスタとスレーブとの間でデータ通信を行うデータ通信方法であって、
マスタまたはスレーブの一方から他方への複数回に分けて行うデータ送信中に、該データ送信間の予め定めるタイミングで、該他方から該一方の方向への制御ラインの信号レベルを論理値に反転するように変化させると、該他方から該一方へのデータ送信を割込ませることが可能であることを特徴とするデータ通信方法である。
【0026】
本発明に従えば、データ通信は、マスタとスレーブとに共通なデータラインを介して行う。データの転送を制御するために、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて制御ラインを設けておく。たとえばマスタからスレーブへの複数回のフレームに分けて行うデータ通信中に、スレーブがスレーブからマスタの方向への制御ラインの信号レベルを、予め定める時間だけ論理的に反転するように変化させると、マスタからのデータ送信を一時的に停止させて、スレーブからマスタへデータ通信を割込んで行わせることができ、一方からの通信のみでデータラインが占有されうことがないようにすることができる。
【0027】
また本発明で、前記複数回のデータ送信は、予め定めるデータ量のフレームを単位として行い、
前記割込ませるデータ送信は、単一のフレームのデータについて行うことを特徴とする。
【0028】
本発明に従えば、一方から複数回のフレームでデータ通信を行う際に、他方から単フレームのデータ通信を割込ませることができる。
【0029】
さらに本発明は、マスタと複数のスレーブとの間で、共通のデータラインを介して行うデータの転送を制御する制御ラインを、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて設けておき、マスタとスレーブとの間でデータ通信を行うデータ通信システムであって、
マスタは、
スレーブ間でデータ通信を行うスレーブの一方をサブマスタとして選択する選択手段と、
選択手段によって選択されるサブマスタがデータ通信を行うことが可能な時間を規制するタイマと、
選択手段によってサブマスタの選択が開始されると、マスタからスレーブの方向への制御ラインの信号レベルを予め定める論理値に対応するように変化させ、スレーブからマスタの方向への制御ラインを介して、予め定める信号レベルの変化で、選択されたスレーブからデータ通信の終了通知を受信するとき、またはタイマによる時間規制が有効になるとき、マスタからスレーブの方向への制御ラインの信号レベルの変化を停止するように制御する制御手段とを含み、
各スレーブは、
マスタの選択手段によって選択されるとき、他のスレーブに対して送信するデータがあれば、スレーブからマスタの方向への制御ラインの信号レベルを予め定められるように変化させる応答手段と、
応答手段による信号レベルの変化の後で、共通のデータラインを使用し、他のスレーブに対するデータを送信する送信手段と、
他のスレーブがサブマスタとして選択された後で、該サブマスタから送信されるデータを受信する受信手段とを含み、
各スレーブの応答手段は、他のスレーブへのデータの送信が終了すると、マスタの制御手段に対して、スレーブからマスタの方向への制御ラインの信号レベルの該予め定めた変化で、データ通信の終了通知を行うことを特徴とするデータ通信システムである。
【0030】
本発明に従えば、マスタと複数のスレーブとの間で、データ通信を共通のデータラインを介して行うデータ通信システムは、データの転送を制御する制御ラインを、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて設けておく。データ通信システムのマスタは、選択手段と、タイマと、制御手段とを含む。各スレーブは、応答手段と送信手段と受信手段とを含む。マスタの選択手段は、スレーブ間でデータ通信を行うスレーブの一方をサブマスタとして選択する。タイマは、サブマスタがデータ通信を行うことが可能な時間を規制する。制御手段は、選択手段によってサブマスタの選択が開始されると、マスタからスレーブの方向への制御ラインの信号レベルを予め定める論理値に対応するように変化させ、スレーブからマスタの方向への制御ラインを介して、予め定める信号レベルの変化で、選択されたスレーブからデータ通信の終了通知を受信するとき、またはタイマによる時間規制が有効になるとき、マスタからスレーブの方向への制御ラインの信号レベルの変化を停止するように制御する。各スレーブの応答手段は、マスタの選択手段によって選択されるとき、他のスレーブに対して送信するデータがあれば、スレーブからマスタの方向への制御ラインの信号レベルを予め定められるように変化させる。送信手段は、応答手段による信号レベルの変化の後で、共通のデータラインを使用し、他のスレーブに対するデータを送信する。受信手段は、他のスレーブがサブマスタとして選択された後で、そのサブマスタから送信されるデータを受信する。各スレーブの応答手段は、他のスレーブへのデータの送信が終了すると、マスタの制御手段に対して、スレーブからマスタの方向への制御ラインの信号レベルの該予め定めた変化で、データ通信の終了通知を行うので、バスの使用権をサブマスタからマスタに引き渡すことができる。
【0031】
【発明の実施の形態】
図1は、本発明の実施の一形態としてのデータ通信システム10の概略的な構成を示す。データ通信システム10は、マスタ11となる通信ノードと、スレーブ12,13,…となる通信ノードとを、共通のバス20で相互に接続して形成される。バス20は、データバス21と、マスタ11からスレーブ12,13,…の方向への制御バス22と、スレーブ12,13,…からマスタ11の方向への制御バス23とを含む。マスタ11は、選択手段31と制御手段32とタイマ33とを含む。マスタ11は、送信手段34および受信手段35も含む。各スレーブ12,13,…は、応答手段41と送信手段42と受信手段43とを含む。
【0032】
マスタ11と複数のスレーブ12,13,…との間で、データ通信を共通のデータラインであるデータバス21を介して行うデータ通信システム10は、データの転送を制御する制御ライン22,23を、マスタ11からスレーブ12,13,…の方向と、スレーブ12,13,…からマスタ11の方向とに分けて設けておく。
【0033】
マスタ11の選択手段31は、スレーブ12,13,…間でデータ通信を行うスレーブ12,13,…の一方をサブマスタとして選択する。タイマ33は、サブマスタがデータ通信を行うことが可能な時間を規制する。制御手段32は、選択手段31によってサブマスタの選択が開始されると、マスタ11からスレーブ12,13,…の方向への制御ラインである制御バス22の信号レベルを予め定める論理値に対応するように変化させ、スレーブ12,13,…からマスタ11の方向への制御ラインである制御バス23を介して、予め定める信号レベルの変化で、選択されたスレーブ12,13,…からデータ通信の終了通知を受信するとき、またはタイマ33による時間規制が有効になるとき、マスタ11からスレーブ12,13,…の方向への制御バス22の信号レベルの変化を停止するように制御する。
【0034】
各スレーブ12,13,…の応答手段41は、マスタ11の選択手段31によって選択されるとき、他のスレーブ12,13,…に対して送信するデータがあれば、スレーブ12,13,…からマスタ11の方向への制御バス23の信号レベルを予め定められるように変化させる。送信手段42は、応答手段41による信号レベルの変化の後で、共通のデータバス21を使用し、他のスレーブ12,13,…に対するデータを送信する。受信手段43は、他のスレーブ12,13,…がサブマスタとして選択された後で、そのサブマスタから送信されるデータを受信する。各スレーブ12,13,…の応答手段41は、他のスレーブ12,13,…へのデータの送信が終了すると、マスタ11の制御手段32に対して、スレーブ12,13,…からマスタ11の方向への制御バス23の信号レベルの予め定めた変化で、データ通信の終了通知を行うので、バス20の使用権をサブマスタからマスタに引き渡すことができる。
【0035】
図2は、図1の制御バス22,23上の信号による状態遷移を示す。以下の説明では、マスタ11からスレーブ12,13,…の方向への制御バス22をMCL(Master Control Line )、スレーブ12,13,…からマスタ11の方向への制御バス23をSCL(Slave Control Line)として示す。各制御バス22,23は、通常5Vや1Vなど、一定の電圧レベルとなるHレベルにプルアップされており、0V付近のLレベルまでプルダウンされるとアクティブになる。なお、本実施形態でのデータ通信では、HレベルやLレベルの区別は便宜的なものであり、HとLとを逆に取扱うようにすることもできる。また、電圧レベルで信号を表すばかりではなく、電流レベルで信号を表すこともできる。
【0036】
一般的な状態遷移として、次の▲1▼〜▲4▼のケースを想定することができる。
▲1▼マスタ→スレーブ通信時に、ポーズ要求が入る場合は、b(全ての通信待ち)→e(通信中)→f(ポーズ中、スレーブ間通信終了)→e(通信中)→a(単フレーム通信待ち)→b(全ての通信待ち)の状態遷移となる。スレーブ12,13,…は、受信中に何らかの理由で送信データを待って欲しい場合に、「f」の状態で、SCLをたとえば2m秒の所定時間以内の範囲でLレベルにすることによって、マスタ11からの送信の一時停止を要求することができる。また、通信断の要求時には、SCLを所定時間以上Lレベルにし、e→f→h→aの経路を通るようにする。所定時間は、タイマ33によって計時する。
【0037】
▲2▼スレーブ→マスタ通信時に、ポーズ要求が入る場合は、b(全ての通信待ち)→c(スレーブ通信要求)→d(相手確認)→e(通信中)→g(ポーズ)→e(通信中)→a(単フレーム通信待ち)→b(全ての通信待ち)の状態遷移となる。マスタ11は、受信中に何らかの理由で送信データを待って欲しい場合は、「g」の状態でMCLを2m秒の所定時間以内の範囲でHレベルにすることによって、スレーブ12,13,…からの送信の一時停止を要求することができる。また、通信断の要求時には、MCLを所定時間以上Hレベルにして、e→g→aの経路を通るようにする。
【0038】
▲3▼マスタ→スレーブの複数フレーム通信中に、スレーブ→マスタの単フレーム通信を割込ませる場合は、単フレームを送信しようとするスレーブ12,13,…は、「a」の状態のときにSCLをLレベルにする。また、複数フレームを送信するスレーブ12,13,…は、2フレーム目以降の送信時には、「a」の状態でSCLをLレベルにしてはならない。
【0039】
▲4▼スレーブ間通信では、「f」の状態で、SCLを所定時間Lレベルとするパルスをポーズ要求信号として使用しない。通信中のSCLのLレベルのパルスは、スレーブ間通信終了パルスとして使用する。
【0040】
図3は、図1のデータ通信システム10でのデータ通信の手順を示す。ステップs0から手順を開始する。このときは、MCL=H、SCL=Hで、図2では「b」の「全ての通信待ち」の状態に相当する。ステップs1では、MCL=Hが2m秒経過するのを待つ。ステップs2では、マスタ11に単フレームの送信データが有るか否かを判断する。単フレーム送信データが有ると判断されるときは、ステップs3で、MCLをLレベルに変化させる。SCLには変化がなく、Hレベルであり、図2の「e」の状態に移行して、データ通信が開始される。ステップs4では、MCL=Lを続け、通信中となる。ステップs5では、通信が終了しているか否かを判断する。終了ではないと判断するときは、ステップs6でSCLがLレベルとなっているか否かを判断する。Lレベルになっていないと判断するときは、ステップs4に戻る。ステップs6でSCLがLレベルになっていると判断するときは、図2の「f」の状態に移行し、ステップs7でSCLのLレベル期間が2m秒の所定時間以上となっているか否かを判断する。所定異時間以内と判断するときは、ステップs4に戻り、図2の「e」状態に戻る。
【0041】
ステップs7でSCLのL期間が2m秒以上と判断するときは、ステップs8でMCLをHレベルに変え、図2の「h」として示す「回復中」の状態へ移行する。MCL=H、SCL=Lからステップs9では、SCLをHレベルに変え、図2の「a」から「b」に移行して、ステップs10でタイムアウトによる通信の異常終了から回復して、次のデータ通信を待つ。ステップs5で通信終了と判断するときは、ステップs11でMCLをHレベルに変化させ、図2のe→a→bの経路を通って、ステップs12で正常終了となり、全ての信号待ちの状態に回復する。
【0042】
ステップs2でマスタ11に単フレームの送信データが有ると判断しないときは、ステップs13でSCL=Lか否かを判断する。SCL=Lではないと判断するときは、ステップs14でMCL=Hが3m秒以上経過するのを待つ。ステップs14でMCL=Hが3m秒経過していないと判断するときは、ステップs2に戻る。ステップs14でMCL=Hが3m秒以上経過していると判断するときは、ステップs15でマスタ11に複数フレーム送信データが有るか否かを判断する。複数フレーム送信データ有りと判断するときは、ステップs3に移行して、通信を開始する。以下、ステップs3からステップs12までの手順で、送信停止要求が可能な状態で、複数フレームのデータ通信が行われる。
【0043】
ステップs15でマスタ11に複数フレームの送信データが無いと判断するときは、ステップs16でSCL=Lであるか否かを判断する。SCL=Lでないときは、ステップs2に戻る。ステップs16でSCL=Lとなるときは、いずれかのスレーブ12,13,…から、図2の「c」で示す「スレーブ通信要求」があると判断される。MCL=Hなので、MCLもLレベルに変え、図2の「d」状態となって、ステップs17で通信を開始する。次にステップs18では、SCLをHレベルに変え、図2の「e」に示す通信中の状態となり、マスタ11はスレーブ12,13,…に対してポーリングでスレーブ間通信の要求があれば受入れ可能となる。ステップs13でSCL=Lと判断するときも、ステップs17以下で通信が開始される。したがって、ステップs2でマスタ11に単フレーム送信有りと判断しなければ、マスタ11も複数フレームの送信データが有っても、スレーブ12,13,…からの単フレーム送信が優先されることになる。ステップs2の判断で、マスタ11による単フレーム送信は、さらに優先されることはもちろんである。
【0044】
ステップs19では、スレーブ間通信の要求が有るか否かを判断する。要求が有れば、ステップs20でタイマ33にタイムアウト時間がセットされ、ステップs21でSCLがHに変えられ、図2の「e」で示す通信中の状態となる。ステップs22では、通信終了を示すSCL=Lとなっているか否かを判断する。SCL=Lでないと判断するときは、ステップs23でタイマ33の計時時間に基づいてタイムアウトか否かを判断する。タイムアウトでないと判断するときは、ステップs22に戻る。ステップs23でタイムアウトと判断するときは、ステップs24でMCLをHレベルに変え、図2のe→g→a→bの経路を通って、ステップs25で異常終了からの回復として、全ての通信待ちの状態となる。
【0045】
ステップs22でSCL=Lと判断するときは、図2の「f」で示すスレーブ間通信終了と解釈され、ステップs26でSCLをHレベルに変えて、ステップs27では図2の「h」で示す回復中の状態に移行する。次に、SCL=Hとして、図2のh→a→bの経路を通り、ステップs28で正常終了からの回復として、全ての通信待ち状態となる。
【0046】
ステップs19でスレーブ間通信が無いと判断するときは、ステップs29でMCL=L、SCL=Hの状態を続け、図2の「e」で示す通信中の状態を続ける。次にステップs30で、通信終了か否かを判断する。通信終了でないと判断するときは、ステップs31でMCL=Hであるか否かを判断する。MCL=Hでは無いと判断するときは、ステップs29に戻る。ステップs31でMCL=Hであると判断するときは、図2の「g」の状態であり、ステップs32で、MCL=Hである期間が2m秒以上となっているか否かを判断する。H期間が2m秒以上でなければ、ステップs29に戻る。ステップs32でH期間が2m秒以上と判断するときは、図2の「a」の状態であり、さらに「b」の状態に移行して、ステップs33で異常終了から回復し、全ての通信待ち状態となる。ステップs30で通信終了と判断するときは、ステップs34でMCLをHレベルに変え、図2のg→a→bの経路を通って、ステップs35で正常終了から回復し、全ての通信待ち状態となる。
【0047】
図4は、前述の▲1▼で示すマスタ→スレーブ通信で、ポーズ要求がある場合を示す。MDT,SDTは、マスタ11およびスレーブ12,13,…からデータバス21にそれぞれ送出するデータを示す。マスタ11は、時刻t10にMCLをHレベルからLレベルに立ち下げてデータ通信を開始する。MDTのヘッダでデータバス21の使用権を要求し、送信先のスレーブ12,13,…の指定も行う。各スレーブ12,13,…は、ヘッダを受信したら、SCL端子をバス使用権要求のために使用することを停止する。また既にSCLをLにしているときには、一旦保留にして、Hレベルに変え、マスタ11の使用権の解除後に、改めてLレベルに戻す。
【0048】
マスタ11は、使用権を獲得すると、次にデータのフレーム数などを含むデータ長のデータ送信を行い、以下順次フレーム単位でのデータ送信を続ける。データの送信途中に、SCLに立ち下がりのレベル変化を検出すると、次のデータは送信せず、タイマ33を起動し、L期間が所定時間以内であれば、ポーズ要求と判断して、引き続きデータ送信を行う。受信側として指定されるスレーブ12,13,…は、マスタ11からのデータを受信し、受信間隔を空けたい場合には、SCLを所定時間内の範囲でLレベルにしてポーズ要求を行う。たとえば時刻t11で所定時間以内の時間t1でSCLをLレベルとすると、図2の「f」状態として、ポーズ要求を行うことができる。また全データ受信後にエラーが無ければ、 時刻t12でSDTとしてACKを送信する。なお、エラー検出時には、SCLを所定時間以上Lレベルにして、通信断の要求を行う。マスタ11は、SDTとしてACKを受信すると、時刻t13でMCLをHレベルに戻し、図2の「b」状態で、全ての通信待ちとなる。
【0049】
図5は、前述の▲2▼で示すスレーブ→マスタ通信で、ポーズ要求がある場合を示す。マスタ11がMCLをHレベルにしている間の時刻t20に、一つのスレーブ13がSCLをHレベルからLレベルに立ち下げると、マスタ11は、時刻t21にMCLをHレベルからLレベルに立ち下げて、時刻t22,t23でスレーブ12,13,…をそれぞれ指定するアドレスで予め定める伝送制御用の問合せ信号であるENQを送信する。マスタ11は、ENQを送信後、指定したスレーブ12,13,…からNAKを受信するか、または所定時間経過しても応答がない場合は、スレーブ12,13,…を指定するアドレスを変更してENQを送信する。時刻t24で、スレーブ13からデータ通信のヘッドが応答として返されれば、受信を続ける。
【0050】
時刻t20でSCLをLに立ち下げたスレーブ13は、自局宛のENQである場合は時刻t24でSCLをHレベルに戻し、データを所定間隔で送信する。データの送信途中に、たとえば時刻t25でMCLに立ち上がりを検出すると、次のデータは送信せず、タイマ33を起動して、H期間が所定時間以内であれば、図2の「g」で示すポーズとして、引き続きデータの送信を行う。すなわち、マスタ11は、スレーブ13からのデータを受信し、受信間隔を空けたい場合には、時刻t25dでMCLを所定時間以内の範囲でLレベルにしてポーズを要求することができる。全データを受信して、エラーが無ければ、時刻t26でACKを送信し、時刻t27でMCLをHレベルに戻す。なお、エラー検出時には、SCLを所定時間以上Lレベルにして、図2の「f」状態で、通信断の要求を行う。
【0051】
図6は、前述の▲3▼で示す複数フレーム通信時の他通信の割込みがある場合を示す。時刻t30で、マスタ11がMCLをHレベルからLレベルに立ち下げて、複数フレーム通信を開始する。マスタ11は、宛先のスレーブ12,13,…を指定して、ENQ以下、No.1のフレームデータを送信し、宛先のスレーブ12,13,…からACKを受信すると、時刻t31でMCLをLレベルからHレベルに立ち上げる。複数フレーム通信時の送信フレーム間隔は、MCLの立ち上げから3m秒以上経過後とする。時刻t31でMCL立ち上げの後、2m秒経過し、その後1m秒経過するまでの時刻t32にいずれかのスレーブ12,13,…がSCLをHレベルからLレベルに立ち下げると、スレーブ→マスタ間で、単フレームの割込み通信の要求が行われる。この単フレーム通信待ちの状態は、図2の「a」に対応する。
【0052】
マスタ11は、ENQを送信し、割込み受付を知らせる。割込みを要求したスレーブ12,13,…は、時刻t33でSCLをLレベルからHレベルに立ち上げ、スレーブ→マスタの通信を行い、エラーがなければACKを返す。通信終了後、マスタ11は、時刻t34でMCLをLレベルからHレベルに立ち上げ、2〜3m秒経過後の時刻t35までに、SCLがHレベルからLレベルに立ち下げられなければ、No.2フレームデータの通信を行う。以下、時刻t36でMCLをLレベルからHレベルに立ち上げた後、フレームデータの送信毎に、単フレームデータの割込み要求をチェックすることを繰返す。したがって、スレーブ12,13,…側が単フレーム通信を割込ませるには、マスタ11によるMCL立ち上げ後、2m秒〜3m秒以内の所定時間である送信フレーム間隔内のチェック時間範囲で、SCLをHレベルからLレベルに立ち下げるようにすればよい。
【0053】
図7は、前述の▲4▼で示すスレーブ→スレーブでのスレーブ間通信が行われる場合を示す。MCLがHレベルのうちに、時刻t40で送信スレーブがSCLをHレベルからLレベルに立ち下げると、図2のb→cの状態遷移でスレーブ通信要求が行われる。マスタ11は、MCLをHレベルからLレベルに立ち下げて、登録済のアドレスでスレーブ12,13,…の1つを宛先としてENQを送信する。マスタ11は、ENQを送信後、NAKを受信、あるいは所定時間経過しても応答がない場合は、登録済の別のアドレスに変更してENQを送信する。宛先のスレーブ12,13,…が時刻t42でSCLをLレベルからHレベルに立ち上げ、ヘッダを応答として返信するのをマスタ11が受信すると、マスタ11は受信を続ける。スレーブ12,13,…から返信されたヘッダがスレーブ間通信の要求であれば、時刻t43以降、マスタ11は通信を放棄する。ただし、マスタ11は、MCLをLレベルのままとし、所定時間を計時するようにタイマ33を起動する。また、マスタ11は、SLCにスレーブ間通信終了を示すLレベルのパルスが発生しないか監視する。
【0054】
スレーブ間通信は、送信スレーブとなるスレーブ12,13,…の1つが、ENQが自局宛で、自局がSCLをLレベルにしている場合に、時刻t42でSCLをLレベルからHレベルに戻し、フレームにまとめたデータを所定時間間隔で送信して開始される。送信スレーブは、ヘッダと、データ長とをそれぞれ示すフレームに続いて、データ長に対応するデータを、データ0から最終までの複数フレームに分割して順次送信する。送信スレーブによって指定される受信スレーブは、送信スレーブからのデータを受信する。受信スレーブは、最終のフレームの受信後、エラーがなく、正常にデータが受信されていることを確認すると、ACKを返答する。
【0055】
送信スレーブは、受信スレーブからのACKを受信すると、時刻t44でSCLにスレーブ間通信終了パルスを送信する。スレーブ間通信終了パルスは、図2の「f」状態で規定される。マスタ11は、MCLがLレベルである間にSCLのスレーブ間通信終了パルスを受信すると、ACKを送信スレーブに送信した後、時刻t45でMCLをLレベルからHレベルに立ち上げ、MCLをHレベルに戻す。万一、スレーブ間通信終了パルスをタイマ33で計時する所定時間内に受信することができない場合、マスタ11は通信にエラーが発生したと判断し、MCLをLレベルからHレベルに立ち上げて、MCLをHレベルに戻す。
【0056】
図8は、本発明の実施の他の形態であるデータ通信システムとしての車載用電子機器50のシステム構成を示す。車載用電子機器50は、乗用車などの自動車の車両に搭載されるナビゲーション装置51、CD(Compact Disk)再生用のCDデッキ52、MD(Mini Disk )再生用のMDデッキ53、カセットテープ再生用のカセットデッキ54、および放送受信用のチューナ55などを含む。これらの車載用電子機器50間でバス60を介して、データ通信を行う際に、ナビゲーション装置50がマスタとなり、他の機器はスレーブとなる。マスタとスレーブとの間には、データバス61が共用され、マスタからスレーブの方向への制御バス62と、スレーブからマスタの方向への制御バス63とが設けられる。各機器は、必ずしも運転席近傍に設置する必要はなく、特に記録媒体を挿入したり排出したりする操作が不要なチューナ55などは、アンテナの近傍などに設置することができる。データ通信自体は、図1の実施形態と同様に行うことができる。
【0057】
車両では、特に運転者が操作可能な範囲で、車載用電子機器50の搭載スペースは限られている。このため、多くの構成機器に対して、それぞれ操作パネルを設けることは困難である。マスタとなるナビゲーション装置51で、他の機器に対する操作入力も受付け、必要に応じてデータ通信を行って、操作対象となる機器に伝達するようにすれば、車内スペースを有効に使用することができる。本実施形態では、スレーブ間通信や割込み通信も可能であるので、マスタがナビゲーション装置51に固定されていても、各機器の相互間でのデータ通信なども簡単に行うことができ、車載用電子機器50全体を一体的に動作させることができる。
【0058】
なお、以上の説明では、単一のマスタと複数のスレーブとでデータ通信システムを構成しているけれども、図10に示すように、単一のスレーブであっても、本発明による▲1▼のマスタ→スレーブ通信と▲2▼のスレーブ→マスタ通信とを行うことは可能である。
【0059】
【発明の効果】
以上のように本発明によれば、データ通信を、マスタと複数のスレーブとに共通なデータラインを介して行い、データの転送の制御は、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて設ける制御ラインを介して行う。マスタがスレーブのうちの一つを選択すれば、選択されたスレーブは、マスタを介さずにスレーブ同士でデータ通信を行うことができ、マルチマスタ方式のような調停回路が不要で、簡単にスレーブ間通信を実現することができる。したがって、簡単な構成でデータ通信とその応答を複数種類使い分けて行うことができる。
【0060】
また本発明によれば、マスタから選択されてサブマスタとなったスレーブは、そのデータ通信の終了を制御ラインの信号レベルを予め定めるように変化させて、マスタに通知し、バスの使用権を引き渡すことができる。
【0061】
また本発明によれば、サブマスタにバスの使用権が引き渡されていることを、マスタからスレーブの方向への制御ラインの信号レベルとすることで表示し、予め定める時間が経過すると、タイムアウトとしてバスの使用権をマスタに回復することができる。サブマスタによるデータ通信にトラブルが発生しても、マスタにバスの使用権を確実に引き渡すことができる。
【0062】
さらに本発明によれば、マスタとスレーブとに共通なデータラインを介して行うデータの転送を制御するために、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて制御ラインを設けておく。データ送信中に、制御ラインの信号レベルを、予め定める時間だけ論理的に反転するように変化させると、データ送信を一時的に停止させるポーズ要求となり、スレーブが信号レベルを論理的に反転させる時間が予め定める時間を超えると、データ送信の終了要求となるので、1本の制御ラインで、ポーズ要求と通信終了要求とを兼用させることができる。
【0063】
さらに本発明によれば、マスタとスレーブとに共通なデータラインを介して行うデータの転送を制御するために、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて制御ラインを設けておく。複数回のフレームに分けて行うデータ通信中に、受信側が制御ラインの信号レベルを、予め定める時間だけ論理的に反転するように変化させると、データ送信を一時的に停止させるので、受信側からのデータ通信を割込んで行わせることができ、一方からの通信のみでデータラインが占有されることがないようにすることができる。
【0064】
また本発明によれば、複数回のフレームでデータ通信を行う際に、受信側からの単フレームのデータ通信を割込ませることができる。
【0065】
さらに本発明によれば、マスタと複数のスレーブとの間で、データ通信を共通のデータラインを介して行うデータ通信システムは、データの転送を制御する制御ラインを、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて設けておく。マスタは、選択手段とタイマと制御手段とを含む。各スレーブは、応答手段と送信手段と受信手段とを含む。マスタの選択手段は、スレーブ間でデータ通信を行うスレーブの一方をサブマスタとして選択する。受信手段は、他のスレーブがサブマスタとして選択された後で、そのサブマスタから送信されるデータを受信する。各スレーブの応答手段は、他のスレーブへのデータの送信が終了すると、マスタの制御手段に対して、スレーブからマスタの方向への制御ラインの信号レベルの該予め定めた変化で、データ通信の終了通知を行うので、バスの使用権をサブマスタかマスタに引き渡すことができる。したがって、簡単な構成でデータ通信とその応答を複数種類使い分けて行うことができる。
【図面の簡単な説明】
【図1】本発明の実施の一形態としてのデータ通信システム10の概略的なシステム構成を示すブロック図である。
【図2】図1の実施形態で、制御バス22,23の信号の組合せに基づく状態遷移図である。
【図3】図1の実施形態で、データ通信を行う手順を示すフローチャートである。
【図4】図1の実施形態で、マスタ→スレーブ通信を行う場合のタイムチャートである。
【図5】図1の実施形態で、スレーブ→マスタ通信を行う場合のタイムチャートである。
【図6】図1の実施形態で、複数フレーム通信中に単フレーム通信を割込ませる場合のタイムチャートである。
【図7】図1の実施形態で、スレーブ間通信を行う場合のタイムチャートである。
【図8】本発明の実施の他の形態であるデータ通信システムとしての車載用電子機器50の概略的なシステム構成を示すブロック図である。
【図9】従来からのマルチマスタ方式およびマスタ−スレーブ方式のデータ通信システムの概略的なシステム構成をそれぞれ示すブロック図である。
【図10】従来からのマスタ−スレーブ方式の基本的なシステム構成を示すブロック図である。
【図11】図10のマスタ−スレーブ方式でデータ通信を行う場合を示すタイムチャートである。
【図12】従来からのマスタ−スレーブ方式で、スレーブ側からのバス使用権要求を示すタイムチャートである。
【符号の説明】
10 データ通信システム
11 マスタ
12,13,… スレーブ
20,60 バス
21,61 データバス
22,23,62,63 制御バス
31 選択手段
32 制御手段
33 タイマ
34,42 送信手段
35,43 受信手段
41 応答手段
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a data communication method and system for controlling data communication performed via a common data line with control lines divided into a master-slave direction and a slave-master direction.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, data communication systems for communicating data via a common data bus between communication nodes such as a plurality of processors, units, and devices are roughly classified into a multi-master system and a master-slave system. 9A shows an example of the multi-master system, and FIG. 9B shows an example of the master-slave system.
[0003]
In the multi-master system shown in FIG. 9A, a plurality of communication nodes 1A to 1F are interconnected by a common bus 2, all communication nodes 1A to 1F participating in communication become masters, and And transmit data to other communication nodes. However, if any one of the communication nodes 1A and 1B becomes a master, the other communication nodes become slaves. In other words, data transmission is quicker. Therefore, although communication can be performed between any of the communication nodes 1A to 1F, some arbitration is required when transmission is attempted at exactly the same time.
[0004]
Japanese Patent Application Laid-Open No. 6-12366 discloses a prior art of a bus use right arbitration control system in which a system bus allocation circuit arbitrates the right to use a system bus and transfers data among a plurality of processors. . The system bus allocation circuit has a function of arbitrarily setting information indicating which processor can request the right to use the system bus, and sequentially sets the set processor numbers on the system bus. If the processor sends the request and the processor corresponding to the processor number issues a bus use right acquisition request, data transmission from that processor to another processor becomes possible.
[0005]
In the master-slave method shown in FIG. 9B, the communication node 1A serving as the master is fixed, and communication is performed between the master and the communication nodes 1B to 1F serving as the slaves. Since the master communication node 1A is fixed, arbitration regarding the bus management right is unnecessary, and the configuration is simplified. Since communication management is performed only by the master communication node 1A, communication between the slave communication nodes 1B to 1F cannot be performed, and communication is once performed with the master communication node 1A. It is necessary that the master communication node 1A performs communication with another communication node.
[0006]
JP-A-6-266658 discloses that a processor designated as a master supplies a synchronization signal and a status signal to another processor to designate a processor for performing data communication. Prior art of a multiprocessor bus system for transmitting data together is disclosed.
[0007]
FIG. 10 shows a basic configuration for performing data communication in a master-slave system, and FIG. 11 shows an outline of a data communication system. As shown in FIG. 10, one of two communication nodes connected to each other via a bus 2 is a master 3 and the other is a slave 4. The bus 2 includes a bidirectional data line 5 and a control line 6. FIG. 11A shows a system using the data line 5 for data transmission / reception, and FIG. 11B shows a system using both the data line 5 and the control line 6 for data transmission / reception.
[0008]
In data communication, a certain number of bytes of data are collected and transmitted as a frame. At this time, on the receiving side, in order to confirm whether or not the data has been successfully received, the receiving side confirms whether or not the data from the transmitting side has been normally received in units of 1 byte. If it has been received normally, a response signal is returned from the receiving side. For this purpose, it is considered that the data line 5 is used to respond as an ACK signal which is a predetermined acknowledgment signal for transmission control, or the control line 5 is used to respond as an ANS signal.
[0009]
In the system shown in FIG. 11A, error detection can be transmitted by not returning ACK at the time of error detection, for example, by returning NAK which is a predetermined negative response signal for transmission control. When the receiving process takes a long time, a request for a pause waiting for the next data transmission may be made. When a reply is made using the data line 5, a pause request different from ACK or NAK can be made with a specific response code.
[0010]
In the system shown in FIG. 11B, every time normal data is received via the data line 5, ANS is returned via the control line 6, and ANS is not returned at the time of error, so that error detection can be transmitted. Also, a pause request can be made by keeping the levels of the control line 6 and the clock line constant, or by delaying the ANS response until the next data can be received.
[0011]
On the other hand, a method of returning an ACK collectively in a frame without returning a response for each byte is also conceivable. However, in this method, even if an error is detected on the way, it cannot be transmitted by ACK or the like on the data line 5, so that the level of the control line 6 is changed and transmitted. It overlaps with the signal.
[0012]
In data communication in which a certain number of bytes of data are collectively transmitted as a frame, when the data amount is large, it is necessary to transmit the data in a plurality of frames. This is called multi-frame communication. When multiple-frame communication is realized in a master-slave communication method, the slave 4 is trying to perform single-frame communication or multiple-frame communication by only requesting the bus use right at the time of communication from the slave 4. Cannot be determined. Also, as shown in FIG. 9B, when a bus use right request is issued from a plurality of communication nodes 1B to 1F serving as slaves, which slave can transmit data earlier using bus 2 Depends on the order in which the master communication node 1A makes an inquiry to one of the slave communication nodes 1B to 1F with the ENQ signal.
[0013]
That is, as shown in FIG. 12, the slave 4 can request the data line 5 for the right to use the bus 2 to the master 3 at a predetermined timing t. It is necessary to determine whether or not to grant the right to use the bus 2 without knowing the communication mode.
[0014]
[Patent Document 1]
JP-A-6-12366
[Patent Document 2]
JP-A-6-266658
[0015]
[Problems to be solved by the invention]
As shown in FIG. 11A, in a system for transmitting and receiving data and a response on the data line 5, as described above, notification of error detection during frame transmission is performed via the control line 6. However, the amount of information that can be sent via the control line 6 is so small that a request for a pause cannot be sent. Also, when the slave 4 issues a bus use right request to the master 3, sufficient information cannot be obtained from the master 3.
[0016]
SUMMARY OF THE INVENTION An object of the present invention is to provide a data communication method and system capable of performing a plurality of types of data communication and its response with a simple configuration.
[0017]
[Means for Solving the Problems]
According to the present invention, a control line for controlling data transfer via a common data line is provided separately in the direction from the master to the slave and in the direction from the slave to the master, and data communication is performed between the master and the slave. The data communication method to be performed,
There are multiple slaves,
Data communication is performed while the master selects any one of the plurality of slaves and changes the signal level of the control line in the direction from the master to the slave so as to correspond to a predetermined logical value. A common data line,
The selected slave is a data communication method in which data communication with another slave is possible using a common data line.
[0018]
According to the present invention, data communication is performed via a data line common to a master and a plurality of slaves. In order to control data transfer, control lines are provided separately for the direction from the master to the slave and the direction from the slave to the master. If the master selects one of the slaves, the selected slave can perform data communication with another slave, so that the slaves can perform data communication with each other without going through the master. Since one of the slaves becomes a submaster and communication between slaves becomes possible, an arbitration circuit such as a multi-master system is not required, and communication between slaves can be easily realized.
[0019]
Further, in the present invention, after the selected slave performs data communication with the other slave, the selected slave changes a signal level of a control line in a direction from the slave to the master in a predetermined manner to perform the data communication. The termination is notified.
[0020]
According to the present invention, a slave that has been selected from the master and has become a submaster that performs data communication with another slave notifies the master of the end of the data communication by changing the signal level of the control line as predetermined. be able to. The master that has received the notification receives the right to use the bus from the submaster, and can continue data communication of the master itself and management of the bus.
[0021]
Further, in the present invention, the master terminates the change of the signal level with respect to the control line in the direction from the master to the slave when a predetermined time has elapsed after the start of data communication by the selected slave. I do.
[0022]
According to the present invention, the master indicates that the right to use the bus has been handed over to the submaster by setting the control line in the direction from the master to the slave to a predetermined signal level, and when a predetermined time elapses, The right to use the bus can be restored as a timeout. Even if a trouble occurs in the data communication by the sub-master, the right to use the bus can be reliably transferred from the sub-master to the master.
[0023]
Further, according to the present invention, a control line for controlling data transfer via a common data line is provided separately in a master-to-slave direction and a slave-to-master direction, and data communication is performed between the master and the slave. A data communication method for performing
During transmission of data from one of the masters or slaves to the other, if the other changes the signal level of the control line in the one direction so as to be logically inverted for a predetermined time, the data from the one is changed. It becomes a pause request to temporarily stop transmission,
The data communication method is characterized in that if the time for the other to logically invert the signal level exceeds the predetermined time, a request for terminating data transmission from the one is made.
[0024]
According to the present invention, data communication is performed via a data line common to the master and the slave. In order to control data transfer, control lines are provided separately for the direction from the master to the slave and the direction from the slave to the master. For example, during the data transmission from the master to the slave, if the slave changes the signal level of the control line in the direction from the slave to the master so that it is logically inverted for a predetermined time, the data transmission from the master is temporarily stopped. If the time required for the slave to logically invert the signal level exceeds a predetermined time, a request for terminating data transmission is issued from the master. Requests can be shared. The master can also use the control line in the direction from the master to the slave, and similarly control data communication from the slave to the master.
[0025]
Further, according to the present invention, a control line for controlling data transfer via a common data line is provided separately in a master-to-slave direction and a slave-to-master direction, and data communication is performed between the master and the slave. A data communication method for performing
During a data transmission performed from one of the master and the slave to the other a plurality of times, at a predetermined timing between the data transmissions, the signal level of the control line in the direction from the other to the one is inverted to a logical value. With such a change, it is possible to interrupt data transmission from the other to the one.
[0026]
According to the present invention, data communication is performed via a data line common to the master and the slave. In order to control data transfer, control lines are provided separately for the direction from the master to the slave and the direction from the slave to the master. For example, during data communication performed in a plurality of frames from the master to the slave, when the slave changes the signal level of the control line in the direction from the slave to the master so as to be logically inverted for a predetermined time, Data transmission from the master can be temporarily stopped, data communication can be interrupted from the slave to the master, and the data line can not be occupied by communication from only one side. .
[0027]
In the present invention, the plurality of times of data transmission is performed in units of frames having a predetermined data amount,
The transmission of the interrupted data is performed for data of a single frame.
[0028]
According to the present invention, when performing data communication in a plurality of frames from one side, it is possible to interrupt single-frame data communication from the other side.
[0029]
Further, according to the present invention, a control line for controlling data transfer between a master and a plurality of slaves via a common data line is provided separately in a master-to-slave direction and a slave-to-master direction. A data communication system for performing data communication between a master and a slave,
The master
Selecting means for selecting one of the slaves performing data communication between the slaves as a submaster,
A timer that regulates the time during which the submaster selected by the selection means can perform data communication;
When the selection of the submaster is started by the selection means, the signal level of the control line in the direction from the master to the slave is changed to correspond to a predetermined logical value, and via the control line in the direction from the slave to the master, Stops the change of the signal level of the control line in the direction from the master to the slave when the notification of the end of data communication is received from the selected slave or the time regulation by the timer becomes valid at the predetermined signal level change. Control means for controlling the
Each slave
When selected by the selection means of the master, if there is data to be transmitted to other slaves, response means for changing the signal level of the control line from the slave to the master in a predetermined manner,
Transmitting means for transmitting data to other slaves using a common data line after the signal level change by the responding means;
Receiving means for receiving data transmitted from the sub-master after another slave is selected as the sub-master,
When the transmission of data to the other slave ends, the response means of each slave instructs the master control means to perform data communication with the predetermined change in the signal level of the control line in the direction from the slave to the master. The data communication system is characterized by performing an end notification.
[0030]
According to the present invention, a data communication system for performing data communication between a master and a plurality of slaves via a common data line includes a control line for controlling data transfer in a master-to-slave direction and a slave direction. From the direction of the master. The master of the data communication system includes a selection unit, a timer, and a control unit. Each slave includes a response unit, a transmission unit, and a reception unit. The master selecting means selects one of the slaves performing data communication between the slaves as a submaster. The timer regulates the time during which the submaster can perform data communication. The control means, when the selection of the submaster is started by the selection means, changes the signal level of the control line in the direction from the master to the slave so as to correspond to a predetermined logical value, and controls the control line in the direction from the slave to the master. Via a predetermined signal level change, when receiving an end notification of data communication from the selected slave, or when the time regulation by the timer becomes effective, the signal level of the control line in the direction from the master to the slave Is controlled to stop the change. The response means of each slave, when selected by the master selection means, changes the signal level of the control line from the slave to the master in a predetermined direction if there is data to be transmitted to another slave. . The transmission means transmits data to other slaves using the common data line after the signal level is changed by the response means. The receiving means receives data transmitted from the submaster after another slave is selected as the submaster. When the transmission of data to the other slave ends, the response means of each slave instructs the master control means to perform data communication with the predetermined change in the signal level of the control line in the direction from the slave to the master. Since the completion notification is performed, the right to use the bus can be transferred from the submaster to the master.
[0031]
BEST MODE FOR CARRYING OUT THE INVENTION
FIG. 1 shows a schematic configuration of a data communication system 10 as one embodiment of the present invention. The data communication system 10 is formed by connecting a communication node serving as a master 11 and communication nodes serving as slaves 12, 13,... The bus 20 includes a data bus 21, a control bus 22 in the direction from the master 11 to the slaves 12, 13,..., And a control bus 23 in the direction from the slaves 12, 13,. The master 11 includes a selection unit 31, a control unit 32, and a timer 33. The master 11 also includes a transmitting unit 34 and a receiving unit 35. Each of the slaves 12, 13,... Includes a response unit 41, a transmission unit 42, and a reception unit 43.
[0032]
The data communication system 10, which performs data communication between the master 11 and the plurality of slaves 12, 13,... Via a data bus 21, which is a common data line, includes control lines 22, 23 for controlling data transfer. , The direction from the master 11 to the slaves 12, 13,... And the direction from the slaves 12, 13,.
[0033]
The selecting means 31 of the master 11 selects one of the slaves 12, 13,... Performing data communication between the slaves 12, 13,. The timer 33 regulates the time during which the submaster can perform data communication. When the selection unit 31 starts the selection of the sub-master, the control unit 32 causes the signal level of the control bus 22 which is a control line from the master 11 to the slaves 12, 13,... To correspond to a predetermined logical value. Through the control bus 23, which is a control line from the slaves 12, 13,... In the direction of the master 11, to end the data communication from the selected slaves 12, 13,. When the notification is received or when the time regulation by the timer 33 becomes valid, the control is performed so that the change in the signal level of the control bus 22 from the master 11 to the slaves 12, 13,.
[0034]
When the selecting means 31 of the master 11 selects the slaves 12, 13,..., If there is data to be transmitted to the other slaves 12, 13,. The signal level of the control bus 23 in the direction of the master 11 is changed as predetermined. The transmission means 42 transmits data to the other slaves 12, 13,... Using the common data bus 21 after the signal level is changed by the response means 41. The receiving unit 43 receives data transmitted from the sub-master after the other slaves 12, 13,... Have been selected as sub-masters. When the data transmission to the other slaves 12, 13,... Is completed, the response means 41 of each of the slaves 12, 13,. Since the end of data communication is notified by a predetermined change in the signal level of the control bus 23 in the direction, the right to use the bus 20 can be transferred from the submaster to the master.
[0035]
FIG. 2 shows a state transition by a signal on the control buses 22 and 23 in FIG. In the following description, the control bus 22 in the direction from the master 11 to the slaves 12, 13,... Is an MCL (Master Control Line), and the control bus 23 in the direction from the slaves 12, 13,. Line). Each of the control buses 22 and 23 is normally pulled up to an H level which is a constant voltage level such as 5V or 1V, and becomes active when pulled down to an L level near 0V. In the data communication according to the present embodiment, the distinction between the H level and the L level is for convenience, and H and L may be handled in reverse. Further, not only a signal can be represented by a voltage level, but also a signal can be represented by a current level.
[0036]
The following cases (1) to (4) can be assumed as general state transitions.
{Circle around (1)} When a pause request is received during master-to-slave communication, b (waiting for all communications) → e (communicating) → f (pausing, communication between slaves ended) → e (communicating) → a (single The state transition is “frame communication waiting” → b (all communication waiting). When the slaves 12, 13,... Want to wait for transmission data for some reason during reception, the slaves 12, 13,... Set the SCL to the L level within a predetermined time of, for example, 2 ms in the state of “f”, thereby 11 can be requested to suspend transmission. Further, when a request for communication disconnection is made, the SCL is set to the L level for a predetermined time or more, and the path is changed from e to f to h to a. The predetermined time is measured by the timer 33.
[0037]
{Circle around (2)} When a pause request is received during slave-to-master communication, b (all communication waiting) → c (slave communication request) → d (confirm partner) → e (during communication) → g (pause) → e ( The state transition is “communicating” → a (waiting for single frame communication) → b (waiting for all communications). If the master 11 wants to wait for transmission data during reception for some reason, the master 11 sets the MCL to the H level within a predetermined time of 2 msec in the state of “g”, thereby allowing the slaves 12, 13,. Can be requested to suspend transmission. Also, when a request for communication disconnection is made, the MCL is set to the H level for a predetermined time or longer so as to pass through the path e → g → a.
[0038]
{Circle around (3)} When the slave-to-master single-frame communication is interrupted during the master-to-slave multiple-frame communication, the slaves 12, 13,... Set SCL to L level. The slaves 12, 13,... That transmit a plurality of frames must not set the SCL to the L level in the state of “a” when transmitting the second and subsequent frames.
[0039]
{Circle around (4)} In the communication between slaves, in the state of “f”, a pulse for setting the SCL to the L level for a predetermined time is not used as a pause request signal. The L level pulse of the SCL during communication is used as a communication end pulse between slaves.
[0040]
FIG. 3 shows a procedure of data communication in the data communication system 10 of FIG. The procedure starts from step s0. At this time, MCL = H and SCL = H, which corresponds to the state of “all communication waiting” of “b” in FIG. In step s1, the control waits until MCL = H elapses 2 ms. In step s2, it is determined whether or not the master 11 has single frame transmission data. If it is determined that there is single frame transmission data, the MCL is changed to L level in step s3. The SCL remains unchanged and is at the H level, and the state shifts to the state of “e” in FIG. 2 to start data communication. At step s4, MCL = L is maintained, and communication is in progress. In step s5, it is determined whether the communication has been completed. If it is determined that the processing is not to be ended, it is determined in step s6 whether or not the SCL is at the L level. If it is determined that the L level has not been reached, the process returns to step s4. When it is determined in step s6 that the SCL is at the L level, the state shifts to the state of "f" in FIG. Judge. If it is determined that it is within the predetermined different time, the process returns to step s4, and returns to the “e” state in FIG.
[0041]
If it is determined in step s7 that the L period of the SCL is 2 ms or more, the MCL is changed to the H level in step s8, and the state shifts to the "recovering" state indicated by "h" in FIG. In step s9 from MCL = H and SCL = L, the SCL is changed to the H level, and the state shifts from “a” to “b” in FIG. 2. Wait for data communication. If it is determined in step s5 that the communication has been completed, the MCL is changed to the H level in step s11, and the communication ends normally in step s12 via the path e → a → b in FIG. Recover.
[0042]
If it is not determined in step s2 that there is single frame transmission data in the master 11, it is determined in step s13 whether SCL = L. If it is determined that SCL is not L, the process waits at step s14 for MCL = H to pass for 3 ms or more. When it is determined in step s14 that MCL = H has not passed 3 ms, the process returns to step s2. If it is determined in step s14 that MCL = H has passed 3 ms or more, it is determined in step s15 whether the master 11 has transmission data for a plurality of frames. If it is determined that there is transmission data for a plurality of frames, the process proceeds to step s3 to start communication. Hereinafter, in a procedure from step s3 to step s12, data communication of a plurality of frames is performed in a state where a transmission stop request can be made.
[0043]
When it is determined in step s15 that there is no transmission data of a plurality of frames in the master 11, it is determined in step s16 whether SCL = L. If SCL is not L, the process returns to step s2. If SCL = L in step s16, it is determined that any of the slaves 12, 13,... Has a “slave communication request” indicated by “c” in FIG. Since MCL = H, the MCL is also changed to the L level, the state becomes “d” in FIG. 2, and communication is started in step s17. Next, in step s18, the SCL is changed to the H level, and the communication state shown in "e" of FIG. 2 is established, and the master 11 accepts a request for inter-slave communication by polling the slaves 12, 13,. It becomes possible. When it is determined in step s13 that SCL = L, the communication is started in step s17 and subsequent steps. Therefore, if it is not determined in step s2 that the master 11 has single frame transmission, the single frame transmission from the slaves 12, 13,. . In the determination of step s2, the single frame transmission by the master 11 is of course given higher priority.
[0044]
In step s19, it is determined whether there is a request for slave communication. If there is a request, a time-out time is set in the timer 33 in step s20, the SCL is changed to H in step s21, and the communication state shown by "e" in FIG. 2 is established. In step s22, it is determined whether or not SCL = L indicating the end of communication. If it is determined that SCL is not L, it is determined in step s23 whether a timeout has occurred based on the time measured by the timer 33. If it is determined that the timeout has not occurred, the process returns to step s22. If it is determined in step s23 that a time-out has occurred, the MCL is changed to the H level in step s24, and all communication waits as a recovery from the abnormal end in step s25 via the path e → g → a → b in FIG. State.
[0045]
When it is determined in step s22 that SCL = L, it is interpreted that the communication between slaves indicated by “f” in FIG. 2 has been completed, and the SCL is changed to the H level in step s26, and in step s27, indicated by “h” in FIG. Move to a recovering state. Next, assuming that SCL = H, the vehicle goes through the path of h → a → b in FIG.
[0046]
When it is determined in step s19 that there is no communication between slaves, the state of MCL = L and SCL = H is continued in step s29, and the state of communication indicated by "e" in FIG. 2 is continued. Next, in step s30, it is determined whether or not the communication has ended. If it is determined that the communication has not ended, it is determined in step s31 whether MCL = H. When it is determined that MCL is not H, the process returns to step s29. When it is determined in step s31 that MCL = H, the state is "g" in FIG. 2. In step s32, it is determined whether the period in which MCL = H is equal to or longer than 2 ms. If the H period is not longer than 2 ms, the process returns to step s29. When it is determined in step s32 that the H period is equal to or longer than 2 ms, the state is “a” in FIG. 2, and the state is further shifted to “b”. State. If it is determined in step s30 that the communication is to be ended, the MCL is changed to the H level in step s34, and the communication is recovered from the normal end in step s35 through the path g → a → b in FIG. Become.
[0047]
FIG. 4 shows a case in which there is a pause request in the master-to-slave communication indicated by (1) above. MDT and SDT indicate data transmitted from the master 11 and the slaves 12, 13,... To the data bus 21, respectively. The master 11 lowers the MCL from the H level to the L level at time t10 and starts data communication. The right to use the data bus 21 is requested by the MDT header, and the destination slaves 12, 13,... Are also specified. When receiving the header, each of the slaves 12, 13,... Stops using the SCL terminal for requesting the right to use the bus. If the SCL has already been set to L, it is temporarily suspended, changed to H level, and returned to the L level again after releasing the right to use the master 11.
[0048]
When the master 11 obtains the right to use, the master 11 next transmits data of a data length including the number of data frames, and continues data transmission sequentially in frame units. If a falling level change is detected in the SCL during data transmission, the next data is not transmitted, the timer 33 is started, and if the L period is within a predetermined time, it is determined that a pause request has been made and the data is continuously transmitted. Send. The slaves 12, 13,... Designated as reception sides receive data from the master 11 and, when it is desired to provide a reception interval, set the SCL to the L level within a predetermined time and make a pause request. For example, when the SCL is set to the L level at a time t1 within a predetermined time at a time t11, a pause request can be made in the “f” state in FIG. If there is no error after receiving all data, ACK is transmitted as SDT at time t12. When an error is detected, the SCL is set to the L level for a predetermined time or longer, and a request for disconnection of communication is made. Upon receiving the ACK as the SDT, the master 11 returns the MCL to the H level at time t13, and waits for all communications in the state “b” in FIG.
[0049]
FIG. 5 shows a case where there is a pause request in the slave-to-master communication indicated by (2) above. At time t20 while the master 11 keeps the MCL at the H level, if one slave 13 lowers the SCL from the H level to the L level, the master 11 lowers the MCL from the H level to the L level at a time t21. Then, at times t22 and t23, an ENQ which is an inquiry signal for transmission control predetermined by an address designating the slaves 12, 13,... Is transmitted. After transmitting the ENQ, the master 11 receives a NAK from the specified slaves 12, 13,..., Or changes the address specifying the slaves 12, 13,. To send ENQ. At time t24, if the data communication head is returned from the slave 13 as a response, the reception is continued.
[0050]
The slave 13 that has lowered the SCL to L at the time t20 returns the SCL to the H level at the time t24 when the ENQ is addressed to the own station, and transmits the data at a predetermined interval. If a rising edge is detected in the MCL at time t25 during the transmission of data, for example, the next data is not transmitted, the timer 33 is started, and if the H period is within a predetermined time, it is indicated by “g” in FIG. As a pause, data transmission is continued. That is, the master 11 receives the data from the slave 13 and can request a pause by setting the MCL to the L level within a predetermined time range at time t25d when it is desired to increase the reception interval. If all data are received and there is no error, ACK is transmitted at time t26, and MCL is returned to the H level at time t27. Note that when an error is detected, the SCL is set to the L level for a predetermined time or longer, and a request for communication disconnection is made in the state “f” in FIG.
[0051]
FIG. 6 shows a case where there is an interruption of another communication at the time of the multiple frame communication indicated by the above (3). At time t30, the master 11 lowers the MCL from the H level to the L level, and starts communication of a plurality of frames. The master 11 specifies destination slaves 12, 13,... When the ACK is received from the destination slaves 12, 13,..., The MCL rises from L level to H level at time t31. The transmission frame interval at the time of multiple frame communication is assumed to be 3 ms or more after the start of the MCL. When one of the slaves 12, 13,... Lowers the SCL from the H level to the L level at time t32 after 2 ms elapses after the rise of the MCL at time t31 and until 1 ms elapses thereafter, the time between the slave and the master changes. Thus, a request for interrupt communication of a single frame is made. This single frame communication waiting state corresponds to “a” in FIG.
[0052]
The master 11 transmits ENQ to notify the reception of the interrupt. , Which have requested an interrupt, raise the SCL from the L level to the H level at time t33, perform communication from the slave to the master, and return ACK if there is no error. After the end of the communication, the master 11 raises the MCL from the L level to the H level at a time t34. If the SCL does not fall from the H level to the L level by a time t35 after a lapse of 2 to 3 ms, the master. Communication of two-frame data is performed. Hereinafter, after the MCL is raised from the L level to the H level at the time t36, the checking of the interrupt request of the single frame data is repeated every time the frame data is transmitted. Therefore, in order for the slaves 12, 13,... To interrupt single-frame communication, the SCL must be set within a check time range within a transmission frame interval that is a predetermined time within 2 ms to 3 ms after the master 11 starts MCL. What is necessary is just to make it fall from H level to L level.
[0053]
FIG. 7 shows a case in which the slave-to-slave communication between the slave and the slave indicated by (4) is performed. When the transmitting slave lowers the SCL from the H level to the L level at time t40 while the MCL is at the H level, a slave communication request is made in the state transition from b to c in FIG. The master 11 lowers the MCL from the H level to the L level and transmits an ENQ to one of the slaves 12, 13,. After transmitting the ENQ, if the master 11 receives the NAK or does not receive a response within a predetermined time, the master 11 changes the registered address to another registered address and transmits the ENQ. When the master 11 receives that the destination slaves 12, 13,... Raise the SCL from the L level to the H level at time t42 and returns the header as a response, the master 11 continues to receive. If the header returned from the slaves 12, 13, ... is a request for communication between slaves, the master 11 abandons the communication after time t43. However, the master 11 keeps the MCL at the L level and activates the timer 33 so as to measure a predetermined time. The master 11 also monitors the SLC for an L-level pulse indicating the end of communication between slaves.
[0054]
In the inter-slave communication, when one of the slaves 12, 13,... Serving as the transmission slave has the ENQ addressed to the own station and the own station sets the SCL to the L level, the SCL is changed from the L level to the H level at time t42. Then, the process is started by transmitting the data summarized in the frame at predetermined time intervals. The transmission slave divides the data corresponding to the data length into a plurality of frames from data 0 to the end, and subsequently transmits the data corresponding to the data length, following the frame indicating the header and the data length. The receiving slave specified by the transmitting slave receives data from the transmitting slave. When the receiving slave confirms that there is no error and data is normally received after receiving the last frame, the receiving slave returns an ACK.
[0055]
Upon receiving the ACK from the receiving slave, the transmitting slave transmits an inter-slave communication end pulse to the SCL at time t44. The inter-slave communication end pulse is defined in the state “f” in FIG. When the master 11 receives the SCL inter-slave communication end pulse while the MCL is at the L level, the master 11 transmits an ACK to the transmission slave, and then raises the MCL from the L level to the H level at time t45, and sets the MCL to the H level. Return to If the slave end communication end pulse cannot be received within the predetermined time period measured by the timer 33, the master 11 determines that an error has occurred in the communication and raises the MCL from the L level to the H level. Return MCL to H level.
[0056]
FIG. 8 shows a system configuration of a vehicle-mounted electronic device 50 as a data communication system according to another embodiment of the present invention. The on-vehicle electronic device 50 includes a navigation device 51 mounted on a vehicle such as a passenger car, a CD deck 52 for CD (Compact Disk) playback, an MD deck 53 for MD (Mini Disk) playback, and a cassette tape playback for cassette tape. It includes a cassette deck 54, a tuner 55 for broadcast reception, and the like. When performing data communication between these in-vehicle electronic devices 50 via the bus 60, the navigation device 50 becomes a master, and the other devices become slaves. A data bus 61 is shared between the master and the slave, and a control bus 62 from the master to the slave and a control bus 63 from the slave to the master are provided. Each device does not necessarily need to be installed in the vicinity of the driver's seat. In particular, the tuner 55 or the like that does not require the operation of inserting and ejecting the recording medium can be installed in the vicinity of the antenna. The data communication itself can be performed similarly to the embodiment of FIG.
[0057]
In a vehicle, the mounting space of the on-vehicle electronic device 50 is limited particularly in a range where the driver can operate. For this reason, it is difficult to provide an operation panel for each of many components. When the navigation device 51 serving as a master also receives an operation input to another device, performs data communication as needed, and transmits the data to the device to be operated, the space in the vehicle can be effectively used. . In the present embodiment, since communication between slaves and interruption communication is also possible, even if the master is fixed to the navigation device 51, data communication between each device can be easily performed, and the in-vehicle electronic device can be used. The entire device 50 can be operated integrally.
[0058]
In the above description, a data communication system is configured by a single master and a plurality of slaves. However, as shown in FIG. It is possible to perform master-to-slave communication and (2) slave-to-master communication.
[0059]
【The invention's effect】
As described above, according to the present invention, data communication is performed via a data line common to a master and a plurality of slaves, and control of data transfer is performed in a master-to-slave direction and a slave-to-master direction. The control is performed via a control line provided separately. If the master selects one of the slaves, the selected slave can perform data communication between the slaves without the intervention of the master. Inter-communication can be realized. Therefore, data communication and its response can be selectively used in plural types with a simple configuration.
[0060]
Further, according to the present invention, the slave selected from the master and becoming a submaster changes the signal level of the control line in advance so as to determine the end of the data communication, notifies the master, and hands over the right to use the bus. be able to.
[0061]
Further, according to the present invention, the fact that the right to use the bus has been transferred to the submaster is indicated by setting the signal level of the control line in the direction from the master to the slave, and when a predetermined time has elapsed, the bus is timed out as a timeout. Can be restored to the master. Even if trouble occurs in data communication by the submaster, the right to use the bus can be reliably transferred to the master.
[0062]
Further, according to the present invention, in order to control data transfer performed through a data line common to the master and the slave, control lines are provided separately in the direction from the master to the slave and in the direction from the slave to the master. deep. If the signal level of the control line is changed so as to be logically inverted for a predetermined time during data transmission, a pause request for temporarily stopping data transmission is generated, and the time required for the slave to logically invert the signal level is obtained. Is longer than a predetermined time, a data transmission end request is issued, so that a single control line can be used for both a pause request and a communication end request.
[0063]
Further, according to the present invention, in order to control data transfer performed through a data line common to the master and the slave, control lines are provided separately in the direction from the master to the slave and in the direction from the slave to the master. deep. If the receiving side changes the signal level of the control line so as to be logically inverted for a predetermined time during data communication performed in a plurality of frames, data transmission is temporarily stopped. Can be performed by interrupting the data communication, and the data line can be prevented from being occupied only by communication from one side.
[0064]
Further, according to the present invention, when performing data communication in a plurality of frames, it is possible to interrupt single-frame data communication from the receiving side.
[0065]
Furthermore, according to the present invention, a data communication system that performs data communication between a master and a plurality of slaves via a common data line includes a control line for controlling data transfer, a direction from the master to the slave, It is provided separately for the direction from the slave to the master. The master includes a selection unit, a timer, and a control unit. Each slave includes a response unit, a transmission unit, and a reception unit. The master selecting means selects one of the slaves performing data communication between the slaves as a submaster. The receiving means receives data transmitted from the submaster after another slave is selected as the submaster. When the transmission of data to the other slave ends, the response means of each slave instructs the master control means to perform data communication with the predetermined change in the signal level of the control line in the direction from the slave to the master. Since the completion notification is performed, the right to use the bus can be transferred to the submaster or the master. Therefore, data communication and its response can be selectively used in plural types with a simple configuration.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a schematic system configuration of a data communication system 10 as one embodiment of the present invention.
FIG. 2 is a state transition diagram based on a combination of signals of control buses 22 and 23 in the embodiment of FIG.
FIG. 3 is a flowchart showing a procedure for performing data communication in the embodiment of FIG. 1;
FIG. 4 is a time chart when performing master-to-slave communication in the embodiment of FIG. 1;
FIG. 5 is a time chart in the case of performing a slave-to-master communication in the embodiment of FIG. 1;
FIG. 6 is a time chart when the single frame communication is interrupted during the multiple frame communication in the embodiment of FIG. 1;
FIG. 7 is a time chart when performing communication between slaves in the embodiment of FIG. 1;
FIG. 8 is a block diagram showing a schematic system configuration of a vehicle-mounted electronic device 50 as a data communication system according to another embodiment of the present invention.
FIG. 9 is a block diagram showing a schematic system configuration of a conventional multi-master system and master-slave system data communication system, respectively.
FIG. 10 is a block diagram showing a basic system configuration of a conventional master-slave system.
FIG. 11 is a time chart showing a case where data communication is performed by the master-slave method of FIG. 10;
FIG. 12 is a time chart showing a bus use request from a slave in a conventional master-slave system.
[Explanation of symbols]
10 Data communication system
11 Master
12, 13, ... slave
20,60 bus
21,61 Data bus
22, 23, 62, 63 control bus
31 Selection means
32 control means
33 timer
34, 42 transmission means
35, 43 receiving means
41 Response means

Claims (7)

共通のデータラインを介するデータの転送を制御する制御ラインを、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて設けておき、マスタとスレーブとの間でデータ通信を行うデータ通信方法であって、
スレーブは複数であり、
マスタが複数のスレーブのうちのいずれかのスレーブを選択して、マスタからスレーブの方向への制御ラインの信号レベルを予め定める論理値に対応するように変化させている間、
選択されたスレーブは、共通のデータラインを使用して、他のスレーブに対するデータ通信が可能であることを特徴とするデータ通信方法。
A data communication method in which control lines for controlling data transfer via a common data line are provided separately in the direction from the master to the slave and in the direction from the slave to the master, and data communication is performed between the master and the slave. And
There are multiple slaves,
While the master selects any one of the plurality of slaves and changes the signal level of the control line in the direction from the master to the slave to correspond to a predetermined logical value,
A data communication method, wherein a selected slave can perform data communication with another slave using a common data line.
前記選択されたスレーブは、前記他のスレーブに対するデータ通信を行った後、前記スレーブからマスタの方向への制御ラインの信号レベルを予め定めるように変化させて、該データ通信の終了を通知することを特徴とする請求項1記載のデータ通信方法。After performing data communication with the other slave, the selected slave changes the signal level of the control line in the direction from the slave to the master as predetermined to notify the end of the data communication. The data communication method according to claim 1, wherein: 前記マスタは、前記選択されたスレーブによるデータ通信の開始後、予め定める時間が経過すると、マスタからスレーブの方向への制御ラインに対する前記信号レベルの変化を終了させることを特徴とする請求項1または2記載のデータ通信方法。2. The method according to claim 1, wherein the master terminates the change of the signal level with respect to the control line in the direction from the master to the slave when a predetermined time elapses after the start of data communication by the selected slave. 2. The data communication method according to 2. 共通のデータラインを介するデータの転送を制御する制御ラインを、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて設けておき、マスタとスレーブとの間でデータ通信を行うデータ通信方法であって、
マスタまたはスレーブの一方から他方へのデータ送信中に、該他方が該一方の方向への制御ラインの信号レベルを、予め定める時間だけ論理的に反転するように変化させると、該一方からのデータ送信を一時的に停止させるポーズ要求となり、
該他方が該信号レベルを論理的に反転させる時間が該予め定める時間を超えると、該一方からのデータ送信の終了要求となることを特徴とするデータ通信方法。
A data communication method in which control lines for controlling data transfer via a common data line are provided separately in the direction from the master to the slave and in the direction from the slave to the master, and data communication is performed between the master and the slave. And
During transmission of data from one of the masters or slaves to the other, if the other changes the signal level of the control line in the one direction so as to be logically inverted for a predetermined time, the data from the one is changed. It becomes a pause request to temporarily stop transmission,
A data communication method, wherein when the time for the other to logically invert the signal level exceeds the predetermined time, a request for terminating data transmission is issued from the one.
共通のデータラインを介するデータの転送を制御する制御ラインを、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて設けておき、マスタとスレーブとの間でデータ通信を行うデータ通信方法であって、
マスタまたはスレーブの一方から他方への複数回に分けて行うデータ送信中に、該データ送信間の予め定めるタイミングで、該他方から該一方の方向への制御ラインの信号レベルを論理値に反転するように変化させると、該他方から該一方へのデータ送信を割込ませることが可能であることを特徴とするデータ通信方法。
A data communication method in which control lines for controlling data transfer via a common data line are provided separately in the direction from the master to the slave and in the direction from the slave to the master, and data communication is performed between the master and the slave. And
During a data transmission performed from one of the master and the slave to the other a plurality of times, at a predetermined timing between the data transmissions, the signal level of the control line in the direction from the other to the one is inverted to a logical value. The data communication method is characterized in that it is possible to interrupt the data transmission from the other to the one by changing as above.
前記複数回のデータ送信は、予め定めるデータ量のフレームを単位として行い、
前記割込ませるデータ送信は、単一のフレームのデータについて行うことを特徴とする請求項5記載のデータ通信方法。
The plurality of times of data transmission is performed in units of frames of a predetermined data amount,
6. The data communication method according to claim 5, wherein the interrupted data transmission is performed on data of a single frame.
マスタと複数のスレーブとの間で、共通のデータラインを介して行うデータの転送を制御する制御ラインを、マスタからスレーブの方向と、スレーブからマスタの方向とに分けて設けておき、マスタとスレーブとの間でデータ通信を行うデータ通信システムであって、
マスタは、
スレーブ間でデータ通信を行うスレーブの一方をサブマスタとして選択する選択手段と、
選択手段によって選択されるサブマスタがデータ通信を行うことが可能な時間を規制するタイマと、
選択手段によってサブマスタの選択が開始されると、マスタからスレーブの方向への制御ラインの信号レベルを予め定める論理値に対応するように変化させ、スレーブからマスタの方向への制御ラインを介して、予め定める信号レベルの変化で、選択されたスレーブからデータ通信の終了通知を受信するとき、またはタイマによる時間規制が有効になるとき、マスタからスレーブの方向への制御ラインの信号レベルの変化を停止するように制御する制御手段とを含み、
各スレーブは、
マスタの選択手段によって選択されるとき、他のスレーブに対して送信するデータがあれば、スレーブからマスタの方向への制御ラインの信号レベルを予め定められるように変化させる応答手段と、
応答手段による信号レベルの変化の後で、共通のデータラインを使用し、他のスレーブに対するデータを送信する送信手段と、
他のスレーブがサブマスタとして選択された後で、該サブマスタから送信されるデータを受信する受信手段とを含み、
各スレーブの応答手段は、他のスレーブへのデータの送信が終了すると、マスタの制御手段に対して、スレーブからマスタの方向への制御ラインの信号レベルの該予め定め変化で、データ通信の終了通知を行うことを特徴とするデータ通信システム。
A control line for controlling data transfer between the master and a plurality of slaves via a common data line is provided separately in the direction from the master to the slave and in the direction from the slave to the master. A data communication system for performing data communication with a slave,
The master
Selecting means for selecting one of the slaves performing data communication between the slaves as a submaster,
A timer that regulates the time during which the submaster selected by the selection means can perform data communication;
When the selection of the submaster is started by the selection means, the signal level of the control line in the direction from the master to the slave is changed to correspond to a predetermined logical value, and via the control line in the direction from the slave to the master, Stops the change of the signal level of the control line in the direction from the master to the slave when the notification of the end of data communication is received from the selected slave or the time regulation by the timer becomes valid at the predetermined signal level change. Control means for controlling the
Each slave
When selected by the selection means of the master, if there is data to be transmitted to other slaves, response means for changing the signal level of the control line from the slave to the master in a predetermined manner,
Transmitting means for transmitting data to other slaves using a common data line after the signal level change by the responding means;
Receiving means for receiving data transmitted from the sub-master after another slave is selected as the sub-master,
When the transmission of data to the other slave ends, the response means of each slave instructs the control means of the master to terminate the data communication with the predetermined change in the signal level of the control line in the direction from the slave to the master. A data communication system for performing notification.
JP2002259042A 2002-09-04 2002-09-04 Data communication method Expired - Fee Related JP4056832B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002259042A JP4056832B2 (en) 2002-09-04 2002-09-04 Data communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002259042A JP4056832B2 (en) 2002-09-04 2002-09-04 Data communication method

Publications (2)

Publication Number Publication Date
JP2004104163A true JP2004104163A (en) 2004-04-02
JP4056832B2 JP4056832B2 (en) 2008-03-05

Family

ID=32260194

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002259042A Expired - Fee Related JP4056832B2 (en) 2002-09-04 2002-09-04 Data communication method

Country Status (1)

Country Link
JP (1) JP4056832B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010141803A (en) * 2008-12-15 2010-06-24 Nippon Telegr & Teleph Corp <Ntt> Data transmission method and system
JP2010219860A (en) * 2009-03-17 2010-09-30 Kenwood Corp Communication system and communication method
JP2016533608A (en) * 2013-10-07 2016-10-27 クアルコム,インコーポレイテッド Communication between slave devices of camera control interface
CN113094321A (en) * 2021-04-30 2021-07-09 中煤科工集团重庆研究院有限公司 RS485 bus communication method based on group call and time slot allocation
CN115085758A (en) * 2022-06-10 2022-09-20 贵州电网有限责任公司 Dual-transceiver multi-mode RS-485 communication host and working method
CN116367354A (en) * 2023-02-16 2023-06-30 北京卫信杰科技发展有限公司 High-precision time system and communication networking system

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010141803A (en) * 2008-12-15 2010-06-24 Nippon Telegr & Teleph Corp <Ntt> Data transmission method and system
JP2010219860A (en) * 2009-03-17 2010-09-30 Kenwood Corp Communication system and communication method
JP2016533608A (en) * 2013-10-07 2016-10-27 クアルコム,インコーポレイテッド Communication between slave devices of camera control interface
CN108763122A (en) * 2013-10-07 2018-11-06 高通股份有限公司 Camera control interface is communicated from equipment to from equipment
CN113094321A (en) * 2021-04-30 2021-07-09 中煤科工集团重庆研究院有限公司 RS485 bus communication method based on group call and time slot allocation
CN113094321B (en) * 2021-04-30 2022-04-26 中煤科工集团重庆研究院有限公司 RS485 bus communication method based on group call and time slot allocation
CN115085758A (en) * 2022-06-10 2022-09-20 贵州电网有限责任公司 Dual-transceiver multi-mode RS-485 communication host and working method
CN116367354A (en) * 2023-02-16 2023-06-30 北京卫信杰科技发展有限公司 High-precision time system and communication networking system
CN116367354B (en) * 2023-02-16 2024-03-26 北京卫信杰科技发展有限公司 High-precision time system and communication networking system

Also Published As

Publication number Publication date
JP4056832B2 (en) 2008-03-05

Similar Documents

Publication Publication Date Title
US11010327B2 (en) I3C point to point
US20050102456A1 (en) Command transmission method and command transmission apparatus in pipeline bus system
US11010328B2 (en) Communication apparatus, communication method, program, and communication system
CN112639753B (en) Aggregated inband interruption
US11144490B2 (en) Optimal I3C in-band interrupt handling through reduced slave arbitration cycles
US10678723B2 (en) Urgent in-band interrupts on an I3C bus
US8521932B2 (en) Arbitrator and arbitrating method applied to system management bus system
US20200201808A1 (en) Time-division multiplexing (tdm) data transfer on serial interfaces
WO2019139684A1 (en) Priority scheme for fast arbitration procedures
JP2004104163A (en) Data communication method and system
US20190171589A1 (en) Clock line driving for single-cycle data over clock signaling and pre-emption request in a multi-drop bus
US20170371830A1 (en) Accelerated i3c master stop
JP2000293485A (en) Communication interface
US11520729B2 (en) I2C bus architecture using shared clock and dedicated data lines
US20190171611A1 (en) Protocol-framed clock line driving for device communication over master-originated clock line
CN112445744B (en) I2C communication
US20210141757A1 (en) Adaptive address arbitration optimization on an i3c bus
CN114655136A (en) Vehicle control system, vehicle control method, control device, and storage medium
US8195846B2 (en) Direct memory access controller for improving data transmission efficiency in MMoIP and method therefor
CN111984576A (en) Data communication system and method
CN115884229B (en) Transmission delay management method, electronic device and storage medium
JP4219784B2 (en) Expansion unit for information processing equipment
JP4087070B2 (en) Broadcast / ACK transmission method
JP2007174118A (en) Communication message conversion device
JP4666369B2 (en) USB device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050902

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070914

A131 Notification of reasons for refusal

Effective date: 20070925

Free format text: JAPANESE INTERMEDIATE CODE: A131

A521 Written amendment

Effective date: 20071126

Free format text: JAPANESE INTERMEDIATE CODE: A523

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: 20071211

A61 First payment of annual fees (during grant procedure)

Effective date: 20071212

Free format text: JAPANESE INTERMEDIATE CODE: A61

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Year of fee payment: 3

Free format text: PAYMENT UNTIL: 20101221

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

Free format text: PAYMENT UNTIL: 20111221

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121221

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees