JP3567925B2 - Serial port sharing system, data output method, and data input method - Google Patents

Serial port sharing system, data output method, and data input method Download PDF

Info

Publication number
JP3567925B2
JP3567925B2 JP2001390987A JP2001390987A JP3567925B2 JP 3567925 B2 JP3567925 B2 JP 3567925B2 JP 2001390987 A JP2001390987 A JP 2001390987A JP 2001390987 A JP2001390987 A JP 2001390987A JP 3567925 B2 JP3567925 B2 JP 3567925B2
Authority
JP
Japan
Prior art keywords
data
output
input
output unit
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.)
Expired - Fee Related
Application number
JP2001390987A
Other languages
Japanese (ja)
Other versions
JP2003198657A (en
Inventor
俊一 北村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP2001390987A priority Critical patent/JP3567925B2/en
Publication of JP2003198657A publication Critical patent/JP2003198657A/en
Application granted granted Critical
Publication of JP3567925B2 publication Critical patent/JP3567925B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、複数のデータ入出力部が共通のシリアルポートを用いてデータの入出力を行うシリアルポート共有システム、データ出力方法、およびデータ入力方法に関する。
【0002】
【従来の技術】
モデムとの間のデータ入出力を、シリアルポートを介して行う情報処理装置がある。図4は、モデムを用いて通信を行う従来の情報処理装置の例を示す説明図である。情報処理装置101,111は、例えば、パーソナルコンピュータ等である。情報処理装置101,111は、モデム102,112を用いて、公衆回線120を介して通信を行う。ここでは、情報処理装置111が、情報処理装置101の異常等を監視する場合を例に説明する。
【0003】
情報処理装置101は、UART(Universal Asynchronous Receiver and Transmitter :汎用非同期送受信装置)103と、サービスプロセッサ104と、シリアルポート105とを備える。情報処理装置111も、情報処理装置101と同様にUARTと、サービスプロセッサと、シリアルポートとを備えるが、図示を省略した。
【0004】
UART103は、情報処理装置111のUARTとデータを授受する。また、UART103は、情報処理装置101における情報処理を実行するCPU106とバス接続されている。そして、CPU106は、通信プログラムに従って、UART103およびモデム102を介して、他の情報処理装置111等と通信を行う。CPU106は、パラレルデータを入出力する。UART103は、CPU106が出力したパラレルデータをシリアルデータに変換し、このシリアルデータをシリアルポート105に出力する。また、UART103は、シリアルポート105から入力されるシリアルデータをパラレルデータに変換してCPU106に出力する。
【0005】
サービスプロセッサ104は、情報処理装置101の状態監視等を行う。例えば、情報処理装置101に異常(温度異常等)が発生したときに、情報処理装置111に異常を通知する。サービスプロセッサ104は、シリアルデータを入出力する。
【0006】
UART103およびサービスプロセッサ104は、いずれも共通のシリアルポート105を介してモデム102にデータを出力する。シリアルポート105は、このデータのビット列をシリアルにモデム102に転送する。モデム102は、このデータを情報処理装置111に伝える。シリアルポート105がUART103とサービスプロセッサ104のどちらのデータをモデム102に出力するのかは、論理スイッチによって切り替える。
【0007】
また、モデム102は、情報処理装置111から受信したデータを、情報処理装置101に入力する。情報処理装置111から受信したデータには、UART103に入力すべきデータと、サービスプロセッサ104に入力すべきデータとがある。モデム102は、共通のシリアルポート105を介して、UART103またはサービスプロセッサ104にデータを入力する。シリアルポート105は、モデム102から送られたデータのビット列をシリアルにUART103やサービスプロセッサ104に伝える。モデム102からシリアルポート105に送られたデータをUART103とサービスプロセッサ104のどちらに入力するのかは、論理スイッチによって切り替える。
【0008】
【発明が解決しようとする課題】
しかし、UART103とサービスプロセッサ104との切り替えに論理スイッチを用いると、データのビット列の途中(例えば1バイトのデータの途中)で切り替えが実行されてしまう可能性がある。そして、1バイトのビット列の途中で切り替えが行われると、データが破壊されてしまう。例えば、UART103が、シリアルポート105を介してモデム102にデータを出力しているとする。このとき、モデム102へのデータ出力が完了しないうちに、サービスプロセッサ104がシリアルポート105を介してモデム102にデータを出力するように切り替えると、UART103の出力データのビット列が途切れ、データが破壊されてしまう場合がある。
【0009】
このような問題は、シリアルポート105を介してUART103やサービスプロセッサ104にデータを入力する場合にも生じる。以下、データを入力する場合の例について説明する。CPU106は、UART103に”A0h”というデータが入力されると特定の動作をし、サービスプロセッサ104は、”A0h,B0h”という連続するデータが入力されると別の動作をするものとする。この”h”は、16進数表示であることを示す符号である。UART103に入力するデータに続いて、サービスプロセッサ104に入力すべき”A0h,B0h”が伝送された場合、この”A0h”がUART103に入力されると、CPU106が所望の動作とは異なる動作を行ってしまう。そのため、この”A0h”がUART103に入力される前に、入力先をサービスプロセッサ104に切り替えなければならない。しかし、論理スイッチによって切り替えを行うと、UART103に入力するビット列の途中(例えば1バイトのデータの途中)で切り替えられ、データが破壊される可能性がある。
【0010】
本発明は、シリアルポートを介してデータを出力する出力元や、シリアルポートを介してデータを入力するときの入力先を、データを破壊させずに切り替えることができるシリアルポート共有システム、データ出力方法、およびデータ入力方法を提供することを目的とする。
【0011】
【課題を解決するための手段】
本発明によるシリアルポート共有システムは、シリアルデータを入出力する第一のデータ入出力部と第二のデータ入出力部とが、一つのシリアルポートを介してデータを入出力するシリアルポート共有システムであって、第一のデータ入出力部および第二のデータ入出力部が出力したデータを格納し、格納したデータをシリアルポートに出力する出力バッファを備え、第一のデータ入出力部は、データを出力バッファに出力する場合に、第二のデータ入出力部にデータ出力を停止させ、出力バッファが第二のデータ入出力部が出力した全てのデータをシリアルポートに出力したときに、データを出力バッファに出力し、出力バッファが第一のデータ入出力部が出力した全てのデータをシリアルポートに出力したときに、第二のデータ入出力部にデータ出力の再開を許可することを特徴とする。
【0012】
また、本発明によるシリアルポート共有システムは、シリアルデータを入出力する第一のデータ入出力部と第二のデータ入出力部とが、一つのシリアルポートを介してデータを入出力するシリアルポート共有システムであって、シリアルポートから入力したデータを格納し、格納したデータを出力する入力バッファと、入力バッファが出力したデータを第一のデータ入出力部または第二のデータ入出力部に出力する切替部とを備え、切替部は、入力バッファが第一のデータ入出力部に入力すべきデータが続くことを示す第一の所定のデータを格納した場合に、第一の所定のデータに続くデータを第一のデータ入出力部に出力し、入力バッファが第一のデータ入出力部に入力すべきデータの終了を示す第二の所定のデータを格納した場合に、第二の所定のデータに続くデータを第二のデータ入出力部に出力することを特徴とする。
【0013】
また、本発明によるシリアルポート共有システムは、シリアルデータを入出力する第一のデータ入出力部と第二のデータ入出力部とが、一つのシリアルポートを介してデータを入出力するシリアルポート共有システムであって、第一のデータ入出力部および第二のデータ入出力部が出力したデータを格納し、格納したデータをシリアルポートに出力する出力バッファと、シリアルポートから入力したデータを格納し、格納したデータを出力する入力バッファと、入力バッファが出力したデータを第一のデータ入出力部または第二のデータ入出力部に出力する切替部とを備え、第一のデータ入出力部は、データを出力バッファに出力する場合に、第二のデータ入出力部にデータ出力を停止させ、出力バッファが第二のデータ入出力部が出力した全てのデータをシリアルポートに出力したときに、データを出力バッファに出力し、出力バッファが第一のデータ入出力部が出力した全てのデータをシリアルポートに出力したときに、第二のデータ入出力部にデータ出力の再開を許可し、切替部は、入力バッファが第一のデータ入出力部に入力すべきデータが続くことを示す第一の所定のデータを格納した場合に、第一の所定のデータに続くデータを第一のデータ入出力部に出力し、入力バッファが第一のデータ入出力部に入力すべきデータの終了を示す第二の所定のデータを格納した場合に、第二の所定のデータに続くデータを第二のデータ入出力部に出力することを特徴とする。
【0014】
例えば、出力バッファが格納するデータが存在しなくなったことを第一のデータ入出力部に通知する出力バッファ情報通知手段を備え、第一のデータ入出力部は、出力バッファ情報通知手段からの通知により、出力バッファが第二のデータ入出力部が出力した全てのデータをシリアルポートに出力したこと、および出力バッファが第一のデータ入出力部が出力した全てのデータをシリアルポートに出力したことを判断する。
【0015】
また、例えば、入力バッファが第一の所定のデータを格納したことと、入力バッファが第二の所定のデータを格納したこととを第一のデータ入出力部に通知する入力バッファ情報通知手段を備え、第一のデータ入出力部は、入力バッファが第一の所定のデータを格納したときに、切替部に第一の所定のデータに続くデータを第一のデータ入出力部に出力させ、入力バッファが第二の所定のデータを格納したときに、切替部に第二の所定のデータに続くデータを第二のデータ入出力部に出力させ、切替部は、第一のデータ入出力部からの要求に応じて、第一の所定のデータに続くデータを第一のデータ入出力部に出力し、第二の所定のデータに続くデータを第二のデータ入出力部に出力する。
【0016】
また、本発明によるデータ出力方法は、シリアルデータを入出力する第一のデータ入出力部と第二のデータ入出力部とが、一つのシリアルポートを用いてデータを出力するデータ出力方法であって、格納したデータを先入れ先出し順に出力する出力バッファに第二のデータ入出力部がデータを出力するステップと、第二のデータ入出力部にデータ出力を停止させるステップと、出力バッファが、第二のデータ入出力部が出力した全てのデータをシリアルポートに出力するステップと、第一のデータ入出力部が、出力バッファにデータを出力するステップと、出力バッファが、第一のデータ入出力部が出力した全てのデータをシリアルポートに出力するステップと、第二のデータ入出力部にデータ出力の再開を許可するステップとを含むことを特徴とする。
【0017】
また、本発明によるデータ入力方法は、シリアルデータを入出力する第一のデータ入出力部と第二のデータ入出力部とが、一つのシリアルポートを用いてデータを入力するデータ入力方法であって、格納したデータを先入れ先出し順に出力する入力バッファが、シリアルポートからのデータを格納し、入力バッファが第一のデータ入出力部に入力すべきデータが続くことを示す第一の所定のデータを格納した場合に、第一の所定のデータに続くデータを第一のデータ入出力部に出力し、入力バッファが第一のデータ入出力部に入力すべきデータの終了を示す第二の所定のデータを格納した場合に、第二の所定のデータに続くデータを第二のデータ入出力部に出力することを特徴とする。
【0018】
【発明の実施の形態】
以下、本発明の実施の形態を図面を参照して説明する。
図1は、本発明によるシリアルポート共有システムの実施の一形態を示す説明図である。図1に示すシリアルポート共有システム1は、モデム31を介してデータを送受信するパーソナルコンピュータ等の情報処理装置30に適用される。情報処理装置30,40は、それぞれモデム31,41を用いて、公衆回線50を介して通信を行う。ここでは、情報処理装置40が、情報処理装置30の異常等を監視する場合を例に説明する。
【0019】
図1では、他の情報処理装置40に送信するデータの伝送経路と、他の情報処理装置40から受信したデータの伝送経路を破線で示す。
【0020】
本例のシリアルポート共有システム1は、サービスプロセッサ2と、UART3と、シリアルポート4と、シリアルデータ−パラレルデータ変換部6,8と、パラレルデータ−シリアルデータ変換部7と、出力バッファ部10と、入力バッファ部20とを備える。
【0021】
シリアルデータ−パラレルデータ変換部6,8は、入力されるシリアルデータをパラレルデータに変換して出力する。シリアルデータ−パラレルデータ変換部6は、UART3およびサービスプロセッサ2からシリアルデータを入力され、そのデータをパラレルデータに変換して出力バッファ部10に出力する。シリアルデータ−パラレルデータ変換部8は、シリアルポート4からシリアルデータを入力され、そのデータをパラレルデータに変換して入力バッファ部10に出力する。
【0022】
パラレルデータ−シリアルデータ変換部7は、出力バッファ10からパラレルデータを入力され、そのデータをシリアルデータに変換してシリアルポート4に出力する。
【0023】
UART3は、他の情報処理装置40のUARTとデータを授受する。UART3は、情報処理装置30における情報処理を実行するCPU5とバス接続されている。そして、CPU5は、通信プログラムに従って、UART3やモデム31等を介して、他の情報処理装置40等と通信を行う。CPU5は、情報処理装置40と送受信するデータとして、パラレルデータを入出力する。UART3は、入力バッファ部20が出力したシリアルデータをパラレルデータに変換してCPU5に出力する。また、UART3は、CPU5が出力したパラレルデータをシリアルデータに変換する。そして、このシリアルデータを、シリアルデータ−パラレルデータ変換部6を介して出力バッファ部10に出力する。シリアルデータ−パラレルデータ変換部6は、UART3の出力データをパラレルデータに変換して出力バッファ10に出力する。
【0024】
サービスプロセッサ2は、情報処理装置30の状態監視等を行う。例えば、情報処理装置30に温度異常等の異常が生じたときに、情報処理装置40に異常を通知する。サービスプロセッサ2は、情報処理装置40と送受信するデータとして、シリアルデータを入出力する。サービスプロセッサ2は、後述する切替部24からシリアルデータを入力される。また、シリアルデータ−パラレルデータ変換部6を介して出力バッファ部10にデータを出力する。シリアルデータ−パラレルデータ変換部6は、サービスプロセッサ2の出力データをパラレルデータに変換して出力バッファ10に出力する。
【0025】
シリアルポート4は、サービスプロセッサ2およびUART3の出力データをパラレルデータ−シリアルデータ変換部7から取得し、モデム31に転送する。また、情報処理装置40が情報処理装置30に向けて送信したデータをモデム31から取得し、このデータのビット列を、シリアルデータ−パラレルデータ変換部8に転送する。
【0026】
出力バッファ部10は、出力バッファ11と、出力バッファ情報通知部12とを備える。出力バッファ11は、シリアルデータ−パラレルデータ変換部6がパラレルデータに変換したUART3の出力データやサービスプロセッサ2の出力データを一時的に格納する。そして、先に格納したデータから先に出力するFIFO(First−in First−out:先入れ先出し)順でデータをシリアルポート4に出力する。このとき、出力バッファ11は、パラレルデータ−シリアルデータ変換部7を介して、データをシリアルポート4に出力する。パラレルデータ−シリアルデータ変換部7は、出力バッファ11から取得したデータをシリアルデータに変換してシリアルポート4に出力する。シリアルポート4は、パラレルデータ−シリアルデータ変換部7が出力したデータのビット列をシリアルにモデム31に転送する。
【0027】
出力バッファ情報通知部12は、出力バッファ11にデータが格納されているか否かを監視し、格納されていたデータが全てパラレルデータ−シリアルデータ7に出力されたときに、出力バッファ11内のデータがなくなったことをサービスプロセッサ2に通知する。サービスプロセッサ2は、この通知に応じて、UART3からのデータ出力を制御する。
【0028】
入力バッファ部20は、入力バッファ21と、入力バッファ情報通知部22と、切替制御部23と、切替部24とを備える。入力バッファ21は、シリアルデータ−パラレルデータ変換部8が出力するパラレルデータを一時的に格納し、格納したデータをFIFO順で切替部24に出力する。切替部24は、入力バッファ21が出力するパラレルデータをシリアルデータに変換し、UART3またはサービスプロセッサ2に出力する。
【0029】
他の情報処理装置40は、情報処理装置30のサービスプロセッサ2に入力すべきデータの前に所定のデータを付加する。この所定のデータは、サービスプロセッサ2に入力すべきデータが次に続くことを意味するデータである。以下、このデータをスタートコードと記す。また、他の情報処理装置40は、サービスプロセッサ2に入力すべきデータの後にも所定のデータを付加する。この所定のデータは、サービスプロセッサ2に入力すべきデータの終了を意味するデータである。以下、このデータをエンドコードと記す。例えば、スタートコードおよびエンドコードがともに”FFh”であり、サービスプロセッサ2に入力すべきデータが”10h,20h”であるとする。この場合、他の情報処理装置40は、情報処理装置30に”FFh,10h,20h,FFh”というデータを送信する。シリアルポート4は、このデータのビット列を、モデム31からシリアルデータ−パラレルデータ変換部8にシリアルに転送する。また、情報処理装置40は、UART3に入力すべきデータには、スタートコードおよびエンドコードを付加せずに送信する。
【0030】
入力バッファ情報通知部3は、スタートコード(第一の所定のデータ)やエンドコード(第二の所定のデータ)がシリアルデータ−パラレルデータ変換部8から入力バッファ21に入力されたときに、その旨の情報をサービスプロセッサ2に通知する。切替制御部23は、サービスプロセッサ2の制御に従って、切替部24からUART3へのデータ出力を停止させたり再開させたりする。
【0031】
本例において、シリアルデータを入出力する第一のデータ入出力部はサービスプロセッサ2であり、シリアルデータを入出力する第二のデータ入出力部はCPU5とバス接続されているUART3である。また、出力バッファ情報通知手段は、出力バッファ情報通知部12であり、入力バッファ情報通知手段は、入力バッファ情報通知部22である。
【0032】
次に、UART3とサービスプロセッサ2とが、シリアルポート4を介してデータを出力するときの動作について説明する。図2は、UART3とサービスプロセッサ2がデータを出力するときの動作の例を示す流れ図である。UART3は、他の情報処理装置40に送信すべきデータを、シリアルデータ−パラレルデータ変換部6を介して出力バッファ11に出力する(ステップS71)。シリアルデータ−パラレルデータ変換部6は、UART3の出力データをパラレルデータに変換し、出力バッファ11は、UART3の出力データをパラレルデータとして格納する。出力バッファ11は、このデータを、パラレルデータ−シリアルデータ変換部7を介してシリアルポート4に出力する。パラレルデータ−シリアルデータ変換部7は、このデータをシリアルデータに変換してシリアルポート4に出力する。シリアルポート4に出力されたデータは、モデム31を介して他の情報処理装置40に送信される。
【0033】
サービスプロセッサ2は、他の情報処理装置40にデータを送信する場合、UART3にデータ出力の停止を指示する(ステップS72)。UART3は、指示があったときに出力していたデータの出力が完了した後は、データ出力を停止する。UART3の出力データは、出力バッファ11に格納されるが、順次パラレルデータ−シリアルデータ変換部7を介してシリアルポート4に出力される。出力バッファ11内のデータがなくなったならば、出力バッファ情報通知部12が、その旨をサービスプロセッサ2に通知する(ステップS73)。
【0034】
サービスプロセッサ2は、この通知を受けると、他の情報処理装置40に送信すべきデータを、シリアルデータ−パラレルデータ変換部6を介して出力バッファ11に出力する(ステップS74)。シリアルデータ−パラレルデータ変換部6は、サービスプロセッサ2の出力データをパラレルデータに変換して出力バッファ11に出力する。出力バッファ11は、このデータを順次シリアルポート4に向けて出力する。パラレルデータ−シリアルデータ変換部7は、出力バッファ11が出力したデータをシリアルデータに変換してシリアルポート4に出力する。サービスプロセッサ2が出力した全てのデータが出力バッファ11からパラレルデータ−シリアルデータ変換部7を介してシリアルポート4に出力されると、出力バッファ情報通知部12は、出力バッファ11内にデータがなくなったことをサービスプロセッサ2に通知する(ステップS75)。
【0035】
サービスプロセッサ2は、ステップS75の通知を受けると、UART3にデータ出力の再開を許可する(ステップS76)。この後、UART3は、再びシリアルデータ−パラレルデータ変換部6を介して出力バッファ11にデータを出力する(ステップS77)。
【0036】
次に、UART3とサービスプロセッサ2とが、シリアルポート4を介してデータを取得するときの動作について説明する。図3は、UART3とサービスプロセッサ2がデータを取得するときの動作の例を示す流れ図である。モデム31が他の情報処理装置40から受信したデータは、シリアルポート4によってシリアルデータ−パラレルデータ変換部8に転送される。シリアルデータ−パラレルデータ変換部8は、このデータをパラレルデータに変換して入力バッファ21に出力する。入力バッファ21は、シリアルデータ−パラレルデータ変換部8から取得したデータを格納し、FIFO順に切替部24に出力する。切替部24は、このデータをシリアルデータに変換して、UART3に出力する(ステップS81)。
【0037】
入力バッファ情報通知部22は、入力バッファ21に格納されるデータを監視し、入力バッファ21にスタートコードが入力されたか否かを判断する(ステップS82)。入力バッファ情報通知部22は、スタートコードが入力バッファ21に格納されたならば、スタートコードが入力された旨をサービスプロセッサ2に通知する(ステップS83)。スタートコードが入力されるまでは、ステップS81の動作を継続する。
【0038】
ステップS83の通知を受けたサービスプロセッサ2は、切替制御部23に、スタートコードより後のデータをUART3に出力させずに、サービスプロセッサ2に出力させるように要求する(ステップS84)。切替制御部23は、切替部24がスタートコードをUART3に出力した後、切替部24にUART3へのデータ出力を停止させ、サービスプロセッサ2へのデータ出力を開始させる。切替部24は、切替制御部23に従い、スタートコードをUART3に出力した後、UART3へのデータ出力を停止する(ステップS85)。スタートコードは、サービスプロセッサ2に入力すべきデータが次に続くことを意味するデータであるが、スタートコードそのものはUART3に入力される。切替部24は、スタートコードに続くデータをFIFO順にサービスプロセッサ2に出力する(ステップS86)。
【0039】
入力バッファ情報通知部22は、入力バッファ21に格納されるデータを監視し、入力バッファ21にエンドコードが入力されたか否かを判断する(ステップS87)。入力バッファ情報通知部22は、エンドコードが入力バッファ21に格納されたならば、エンドコードが入力された旨をサービスプロセッサ2に通知する(ステップS88)。エンドコードが入力されるまでは、ステップS86の動作を継続する。
【0040】
ステップS88の通知を受けたサービスプロセッサ2は、切替制御部23に、UART3へのデータ出力を再開し、エンドコードより後のデータをUART3に出力させるように要求する(ステップS89)。切替制御部23は、切替部24がエンドコードを出力した後、切替部24にUART3へのデータ出力を再開させる。
【0041】
切替部24は、切替制御部23に従い、エンドコードをサービスプロセッサ2に出力した後、サービスプロセッサ2へのデータ出力を停止し、エンドコードに続くデータをUART3に出力する(ステップS90)。
【0042】
なお、スタートコードとエンドコードは、同一のデータ(例えば、”FFh”とする。)であってもよい。この場合、入力バッファ情報通知部22は、”FFh”が入力バッファ21に入力された回数をカウントし、1回目の入力時にはスタートコードが入力され、2回目の入力時にはエンドコードが入力されたと判断すればよい。ただし、入力バッファ情報通知部22は、2回目の入力時にエンドコートが入力されたと判断してステップS88の動作を行ったならば、カウントしている回数を0回に初期化する。
【0043】
本発明によれば、サービスプロセッサ2がデータを出力するときには、UART3にデータ出力の停止を指示する。UART3は、指示があったときに出力していたデータの出力が完了した後は、データ出力を停止する。そして、出力バッファ11内のデータがなくなってからサービスプロセッサ2がデータを出力する。従って、UART3が出力したデータのビット列を途中で途切れさせずに、データの出力元をUART3からサービスプロセッサ2に切り替えることができる。
【0044】
そして、サービスプロセッサ2が出力したデータが、全て出力バッファ11からシリアルポート4に送られたならば、サービスプロセッサ2は、UART3にデータ出力の再開を指示する。従って、UART3は、データ出力を再開することができる。また、サービスプロセッサ3が出力したデータのビット列を途中で途切れさせずに、データの出力元をサービスプロセッサ2からUART3に切り替えることができる。
【0045】
また、本発明によれば、サービスプロセッサ2に入力すべきデータが入力バッファ21に格納された場合、切替部24はそのデータに付加されているスタートコードをUART3に出力した後は、UART3へのデータ出力を停止する。そして、スタートコードに続くデータをサービスプロセッサ2に出力する。切替部24は、エンドコードを出力した後、UART3へのデータ出力を再開する。従って、サービスプロセッサ2に入力すべきデータがUART3に入力されてしまうことがない。例えば、CPU5は、UART103に”A0h”というデータが入力されると特定の動作をし、サービスプロセッサ2は、”A0h,B0h”という連続するデータが入力されると別の動作をするものとする。このとき、サービスプロセッサ2に入力されるべき”A0h,B0h”は、UART3に入力されない。この結果、”A0h”がUART3に入力されてしまい、所望の動作とは異なる動作が行われることを防止できる。
【0046】
また、データのビット列を途切れさせずに、データの入力先をUART3からサービスプロセッサ2に切り替えたり、サービスプロセッサ2からUART3に切り替えることができる。
【0047】
次に、他の情報処理装置40がサービスプロセッサ2に特定の動作を命令するデータを送信し、サービスプロセッサ2が肯定応答(ACK)を返す場合を例にして本発明の動作を説明する。サービスプロセッサ2に特定の動作を命令するデータを”01h”、スタートコードおよびエンドコードを”FFh”とする。
【0048】
他の情報処理装置40は、UART3に入力すべきデータの中に”01h”を挿入する場合、”01h”の前にスタートコードを付加し、後にエンドコードを付加して”FFh,01h,FFh”というデータを挿入する。他の情報処理装置40が送信したデータは、シリアルポート4およびシリアルデータ−パラレルデータ変換部8を介して入力バッファ21に入力される。入力バッファ21は、入力されたデータを格納し、FIFO順に切替部24に出力する。切替部24は、入力されたデータをUART3に出力する(ステップS81)。入力バッファ21に最初の”FFh”が格納されると、入力バッファ情報通知部22は、スタートコードが入力バッファ21に入力された旨をサービスプロセッサ2に通知する(ステップS82,S83)。
【0049】
この通知を受けたサービスプロセッサ2は、切替制御部23に、最初の”FFh”より後のデータをUART3に出力させずに、サービスプロセッサ2に出力させるように要求する(ステップS84)。切替部24は、切替制御部23に従い、最初の”FFh”をUART3に出力した後、UART3へのデータ出力を停止する(ステップS85)。そして、”01h”以降のデータをサービスプロセッサ2に出力する(ステップS86)。入力バッファ21に二番目の”FFh”が格納されると、入力バッファ情報通知部22は、エンドコードが入力バッファ21に入力された旨をサービスプロセッサ2に通知する(ステップS87,S88)。
【0050】
この通知を受けたサービスプロセッサ2は、切替制御部23に、二番目の”FFh”より後のデータをサービスプロセッサ2に出力させずに、UART3に出力させるように要求する(ステップS89)。切替部24は、切替制御部23に従い、二番目の”FFh”をサービスプロセッサ2に出力した後、サービスプロセッサ2へのデータ出力を停止する。そして、二番目の”FFh”より後のデータをUART3に出力する(ステップS90)。
【0051】
また、サービスプロセッサ2は、”01h”が入力されると特定の動作を行い、他の情報処理装置40にACKを返す。このとき、サービスプロセッサ2は、UART3にデータ出力を停止させる(ステップS72)。UART3が既に出力したデータが出力バッファ21からパラレルデータ−シリアルデータ変換部7に出力され、データがなくなったならば、出力バッファ情報通知部22がその旨をサービスプロセッサ2に通知する(ステップS73)。
【0052】
サービスプロセッサ2は、この通知を受けると、ACKを出力バッファ11に出力する(ステップS74)。ACKが出力バッファ11からパラレルデータ−シリアルデータ変換部7に出力され、出力バッファ11内のデータがなくなったならば、出力バッファ情報通知部22がその旨をサービスプロセッサ2に通知する(ステップS75)。この通知を受けたサービスプロセッサ2は、UART3にデータ出力の再開を許可し(ステップS76)、UART3は出力バッファ11にデータを出力する(ステップS77)。
【0053】
上記の例では、サービスプロセッサ2が、入力バッファ情報通知部22からの通知に応じて切替制御部23に指示を出す場合を説明した。UART3が、入力バッファ情報通知部22から通知を受けて、切替制御部23に指示を出してもよい。この場合、入力バッファ情報通知部は、入力バッファがスタートデータを格納したことと、エンドコードを格納したこととをUART3に通知する。UART3は、入力バッファがスタートコードを格納したときに、切替制御部23に、スタートコードに続くデータをサービスプロセッサ2に出力させるように要求する。また、入力バッファがエンドコードを格納したときに、切替制御部23に、エンドコードに続くデータをUART3に出力させるように要求する。切替部24は、切替制御部23に従い、スタートコードに続くデータをサービスプロセッサ2に出力し、エンドコードに続くデータをUART3に出力する。
【0054】
すなわち、本発明は、入力バッファが第一の所定のデータを格納したことと、入力バッファが第二の所定のデータを格納したこととを第二のデータ入出力部に通知する入力バッファ情報通知手段を備え、第二のデータ入出力部は、入力バッファが第一の所定のデータを格納したときに、切替部に第一の所定のデータに続くデータを第一のデータ入出力部に出力させ、入力バッファが第二の所定のデータを格納したときに、切替部に第二の所定のデータに続くデータを第二のデータ入出力部に出力させ、切替部は、第二のデータ入出力部からの要求に応じて、第一の所定のデータに続くデータを第一のデータ入出力部に出力し、第二の所定のデータに続くデータを第二のデータ入出力部に出力する構成であってもよい。
【0055】
また、サービスプロセッサ2が、出力バッファ情報通知部12からの通知に応じてUART3に指示を出すのではなく、UART3が、出力バッファ情報通知部12からの通知に応じてサービスプロセッサ2に指示を出してもよい。この場合、UART3は、データを出力バッファ11に出力する場合に、サービスプロセッサ2にデータ出力を停止させる。そして、UART3は、出力バッファ11がサービスプロセッサ2が出力した全てのデータをシリアルポートに出力したときに、データを出力バッファに出力する。出力バッファ11がUART3が出力した全てのデータをシリアルポートに出力したときに、UART3は、サービスプロセッサ2にデータ出力の再開を許可する。また、出力バッファ情報通知部12は、出力バッファ11内にデータがなくなったことをUART3に通知する。
【0056】
【発明の効果】
本発明によれば、第一のデータ入出力部は、データを出力バッファに出力する場合に、第二のデータ入出力部にデータ出力を停止させ、出力バッファが第二のデータ入出力部が出力した全てのデータをシリアルポートに出力したときに、データを出力バッファに出力し、出力バッファが第一のデータ入出力部が出力した全てのデータをシリアルポートに出力したときに、第二のデータ入出力部にデータ出力の再開を許可する。従って、シリアルポートを介してデータを出力する出力元を、データを破壊させずに切り替えることができる。
【0057】
また、本発明によれば、切替部は、入力バッファが第一のデータ入出力部に入力すべきデータが続くことを示す第一の所定のデータを格納した場合に、第一の所定のデータに続くデータを第一のデータ入出力部に出力し、入力バッファが第一のデータ入出力部に入力すべきデータの終了を示す第二の所定のデータを格納した場合に、第二の所定のデータに続くデータを第二のデータ入出力部に出力する。従って、シリアルポートを介してデータを入力するときの入力先を、データを破壊させずに切り替えることができる。
【図面の簡単な説明】
【図1】本発明によるシリアルポート共有システムの実施の一形態を示す説明図である。
【図2】UARTとサービスプロセッサがデータを出力するときの動作の例を示す流れ図である。
【図3】UARTとサービスプロセッサがデータを取得するときの動作の例を示す流れ図である。
【図4】モデムを用いて通信を行う従来の情報処理装置の例を示す説明図である。
【符号の説明】
1 シリアルポート共有システム
2 サービスプロセッサ
3 UART(汎用非同期送受信装置)
4 シリアルポート
5 CPU
6,8 シリアルデータ−パラレルデータ変換部
7 パラレルデータ−シリアルデータ変換部
10 出力バッファ部
11 出力バッファ
12 出力バッファ情報通知部
20 入力バッファ部
21 入力バッファ
22 入力バッファ情報通知部
23 切替制御部
24 切替部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a serial port sharing system in which a plurality of data input / output units input / output data using a common serial port, a data output method, and a data input method.
[0002]
[Prior art]
2. Description of the Related Art There is an information processing apparatus that performs data input / output with a modem via a serial port. FIG. 4 is an explanatory diagram illustrating an example of a conventional information processing device that performs communication using a modem. The information processing apparatuses 101 and 111 are, for example, personal computers or the like. The information processing apparatuses 101 and 111 perform communication via the public line 120 using the modems 102 and 112. Here, a case where the information processing apparatus 111 monitors an abnormality or the like of the information processing apparatus 101 will be described as an example.
[0003]
The information processing apparatus 101 includes a UART (Universal Asynchronous Receiver and Transmitter) 103, a service processor 104, and a serial port 105. The information processing apparatus 111 also includes a UART, a service processor, and a serial port as in the information processing apparatus 101, but is not illustrated.
[0004]
The UART 103 exchanges data with the UART of the information processing device 111. The UART 103 is connected to the CPU 106 that executes information processing in the information processing apparatus 101 via a bus. Then, the CPU 106 communicates with another information processing device 111 and the like via the UART 103 and the modem 102 according to the communication program. The CPU 106 inputs and outputs parallel data. The UART 103 converts the parallel data output by the CPU 106 into serial data, and outputs the serial data to the serial port 105. The UART 103 converts serial data input from the serial port 105 into parallel data and outputs the parallel data to the CPU 106.
[0005]
The service processor 104 monitors the status of the information processing apparatus 101 and the like. For example, when an abnormality (temperature abnormality or the like) occurs in the information processing apparatus 101, the information processing apparatus 111 is notified of the abnormality. The service processor 104 inputs and outputs serial data.
[0006]
Both the UART 103 and the service processor 104 output data to the modem 102 via the common serial port 105. The serial port 105 serially transfers the bit string of the data to the modem 102. The modem 102 transmits this data to the information processing device 111. Which data of the UART 103 or the service processor 104 the serial port 105 outputs to the modem 102 is switched by a logical switch.
[0007]
The modem 102 inputs the data received from the information processing device 111 to the information processing device 101. The data received from the information processing device 111 includes data to be input to the UART 103 and data to be input to the service processor 104. The modem 102 inputs data to the UART 103 or the service processor 104 via the common serial port 105. The serial port 105 serially transmits a bit string of data transmitted from the modem 102 to the UART 103 and the service processor 104. Which of the data sent from the modem 102 to the serial port 105 is input to the UART 103 or the service processor 104 is switched by a logical switch.
[0008]
[Problems to be solved by the invention]
However, if a logical switch is used for switching between the UART 103 and the service processor 104, the switching may be performed in the middle of a data bit string (for example, in the middle of 1-byte data). If switching is performed in the middle of a 1-byte bit string, data will be destroyed. For example, it is assumed that the UART 103 is outputting data to the modem 102 via the serial port 105. At this time, if the service processor 104 switches to output the data to the modem 102 via the serial port 105 before the data output to the modem 102 is completed, the bit string of the output data of the UART 103 is interrupted and the data is destroyed. In some cases.
[0009]
Such a problem also occurs when data is input to the UART 103 or the service processor 104 via the serial port 105. Hereinafter, an example in which data is input will be described. The CPU 106 performs a specific operation when data “A0h” is input to the UART 103, and the service processor 104 performs another operation when continuous data “A0h, B0h” is input. This "h" is a code indicating that the display is in hexadecimal. When “A0h, B0h” to be input to the service processor 104 is transmitted following the data input to the UART 103, when the “A0h” is input to the UART 103, the CPU 106 performs an operation different from a desired operation. Would. Therefore, before this “A0h” is input to the UART 103, the input destination must be switched to the service processor 104. However, when switching is performed by a logical switch, the switching is performed in the middle of a bit string input to the UART 103 (for example, in the middle of 1-byte data), and data may be destroyed.
[0010]
The present invention relates to a serial port sharing system and a data output method that can switch an output source that outputs data through a serial port and an input destination when inputting data through the serial port without destroying the data. , And a data entry method.
[0011]
[Means for Solving the Problems]
A serial port sharing system according to the present invention is a serial port sharing system in which a first data input / output unit for inputting / outputting serial data and a second data input / output unit input / output data via one serial port. An output buffer for storing data output by the first data input / output unit and the second data input / output unit and outputting the stored data to a serial port; When outputting to the output buffer, the data output to the second data input / output unit is stopped, and when the output buffer outputs all the data output by the second data input / output unit to the serial port, the data is output. Output to the output buffer, and when the output buffer outputs all data output by the first data input / output unit to the serial port, the second data input / output unit And permits the resumption of the data output.
[0012]
Further, in the serial port sharing system according to the present invention, the first data input / output unit for inputting / outputting serial data and the second data input / output unit are configured to share the serial port for inputting / outputting data via one serial port. An input buffer for storing data input from a serial port and outputting the stored data, and outputting data output from the input buffer to a first data input / output unit or a second data input / output unit A switching unit, wherein the switching unit follows the first predetermined data when the input buffer stores first predetermined data indicating that data to be input to the first data input / output unit continues. When the data is output to the first data input / output unit and the input buffer stores the second predetermined data indicating the end of the data to be input to the first data input / output unit, And outputs the data following the predetermined data to the second data input-output unit.
[0013]
Further, in the serial port sharing system according to the present invention, the first data input / output unit for inputting / outputting serial data and the second data input / output unit are configured to share the serial port for inputting / outputting data via one serial port. A system for storing data output by a first data input / output unit and a second data input / output unit, storing an output buffer for outputting the stored data to a serial port, and storing data input from the serial port. An input buffer that outputs the stored data, and a switching unit that outputs the data output by the input buffer to the first data input / output unit or the second data input / output unit. When outputting data to the output buffer, the data output to the second data input / output unit is stopped, and the output buffer is output by the second data input / output unit. When all data has been output to the serial port, the data is output to the output buffer.When the output buffer has output all data output by the first data input / output unit to the serial port, the second data input is performed. The output unit allows the output unit to resume the data output, and the switching unit stores the first predetermined data indicating that the data to be input to the first data input / output unit continues, when the input buffer stores the first predetermined data. When the data following the predetermined data is output to the first data input / output unit and the input buffer stores the second predetermined data indicating the end of the data to be input to the first data input / output unit, Data subsequent to the second predetermined data is output to the second data input / output unit.
[0014]
For example, an output buffer information notifying unit for notifying the first data input / output unit that the data stored in the output buffer is no longer present is provided, and the first data input / output unit receives a notification from the output buffer information notifying unit. That the output buffer has output all the data output by the second data input / output unit to the serial port, and that the output buffer has output all the data output by the first data input / output unit to the serial port Judge.
[0015]
Also, for example, an input buffer information notifying unit that notifies the first data input / output unit that the input buffer has stored the first predetermined data and that the input buffer has stored the second predetermined data. The first data input / output unit, when the input buffer stores the first predetermined data, causes the switching unit to output data following the first predetermined data to the first data input / output unit, When the input buffer stores the second predetermined data, the control unit causes the switching unit to output data subsequent to the second predetermined data to the second data input / output unit. In response to the request from the first data, data following the first predetermined data is output to the first data input / output unit, and data following the second predetermined data is output to the second data input / output unit.
[0016]
The data output method according to the present invention is a data output method in which a first data input / output unit and a second data input / output unit for inputting / outputting serial data output data using one serial port. A step in which the second data input / output unit outputs data to an output buffer that outputs stored data in a first-in first-out order; a step in which the second data input / output unit stops outputting data; and Outputting all data output by the data input / output unit to the serial port, outputting the data to an output buffer by the first data input / output unit, and outputting the data to the first data input / output unit by the first data input / output unit. Outputting to the serial port all of the data output by the device, and allowing the second data input / output unit to resume data output. And butterflies.
[0017]
Further, the data input method according to the present invention is a data input method in which the first data input / output unit for inputting / outputting serial data and the second data input / output unit input data using one serial port. An input buffer that outputs stored data in a first-in first-out order stores data from a serial port, and the input buffer outputs first predetermined data indicating that data to be input to a first data input / output unit continues. When the data is stored, the data following the first predetermined data is output to the first data input / output unit, and the input buffer outputs the second predetermined data indicating the end of the data to be input to the first data input / output unit. When data is stored, data following the second predetermined data is output to the second data input / output unit.
[0018]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is an explanatory diagram showing one embodiment of a serial port sharing system according to the present invention. The serial port sharing system 1 shown in FIG. 1 is applied to an information processing device 30 such as a personal computer that transmits and receives data via a modem 31. The information processing apparatuses 30 and 40 communicate with each other via the public line 50 using the modems 31 and 41, respectively. Here, a case where the information processing apparatus 40 monitors an abnormality or the like of the information processing apparatus 30 will be described as an example.
[0019]
In FIG. 1, a transmission path of data transmitted to another information processing apparatus 40 and a transmission path of data received from another information processing apparatus 40 are indicated by broken lines.
[0020]
The serial port sharing system 1 of this example includes a service processor 2, a UART 3, a serial port 4, serial data-parallel data converters 6, 8, a parallel data-serial data converter 7, an output buffer unit 10, , An input buffer unit 20.
[0021]
The serial data-parallel data converters 6 and 8 convert the input serial data into parallel data and output it. The serial data-parallel data converter 6 receives serial data from the UART 3 and the service processor 2, converts the data into parallel data, and outputs the parallel data to the output buffer 10. The serial data-parallel data converter 8 receives serial data from the serial port 4, converts the data into parallel data, and outputs the parallel data to the input buffer 10.
[0022]
The parallel data-serial data converter 7 receives parallel data from the output buffer 10, converts the data into serial data, and outputs the serial data to the serial port 4.
[0023]
The UART 3 exchanges data with a UART of another information processing device 40. The UART 3 is connected to the CPU 5 that executes information processing in the information processing device 30 via a bus. The CPU 5 communicates with another information processing device 40 and the like via the UART 3 and the modem 31 according to the communication program. The CPU 5 inputs and outputs parallel data as data to be transmitted to and received from the information processing device 40. The UART 3 converts serial data output from the input buffer unit 20 into parallel data and outputs the parallel data to the CPU 5. The UART 3 converts the parallel data output from the CPU 5 into serial data. Then, the serial data is output to the output buffer unit 10 via the serial data-parallel data conversion unit 6. The serial data-parallel data converter 6 converts the output data of the UART 3 into parallel data and outputs the parallel data to the output buffer 10.
[0024]
The service processor 2 monitors the status of the information processing device 30 and the like. For example, when an abnormality such as a temperature abnormality occurs in the information processing device 30, the abnormality is notified to the information processing device 40. The service processor 2 inputs and outputs serial data as data to be transmitted to and received from the information processing device 40. The service processor 2 receives serial data from a switching unit 24 described later. Further, it outputs data to the output buffer unit 10 via the serial data-parallel data conversion unit 6. The serial data-parallel data converter 6 converts the output data of the service processor 2 into parallel data and outputs the parallel data to the output buffer 10.
[0025]
The serial port 4 acquires output data of the service processor 2 and the UART 3 from the parallel data-serial data converter 7 and transfers the data to the modem 31. Further, the data transmitted from the information processing device 40 to the information processing device 30 is acquired from the modem 31, and a bit string of the data is transferred to the serial data-parallel data conversion unit 8.
[0026]
The output buffer unit 10 includes an output buffer 11 and an output buffer information notification unit 12. The output buffer 11 temporarily stores output data of the UART 3 and output data of the service processor 2 converted into parallel data by the serial data / parallel data conversion unit 6. Then, data is output to the serial port 4 in the order of FIFO (First-in First-out) to output first from the data stored first. At this time, the output buffer 11 outputs data to the serial port 4 via the parallel data-serial data converter 7. The parallel data-serial data converter 7 converts data obtained from the output buffer 11 into serial data and outputs the serial data to the serial port 4. The serial port 4 serially transfers the bit string of the data output from the parallel data-serial data converter 7 to the modem 31.
[0027]
The output buffer information notifying unit 12 monitors whether data is stored in the output buffer 11 and when all the stored data is output to the parallel data-serial data 7, the data in the output buffer 11 is output. Is notified to the service processor 2. The service processor 2 controls the data output from the UART 3 according to the notification.
[0028]
The input buffer unit 20 includes an input buffer 21, an input buffer information notification unit 22, a switching control unit 23, and a switching unit 24. The input buffer 21 temporarily stores the parallel data output from the serial data-parallel data conversion unit 8, and outputs the stored data to the switching unit 24 in FIFO order. The switching unit 24 converts the parallel data output from the input buffer 21 into serial data, and outputs the serial data to the UART 3 or the service processor 2.
[0029]
The other information processing device 40 adds predetermined data before data to be input to the service processor 2 of the information processing device 30. The predetermined data is data indicating that the data to be input to the service processor 2 continues next. Hereinafter, this data is referred to as a start code. The other information processing device 40 also adds predetermined data after the data to be input to the service processor 2. The predetermined data is data indicating the end of data to be input to the service processor 2. Hereinafter, this data is referred to as an end code. For example, it is assumed that the start code and the end code are both “FFh” and the data to be input to the service processor 2 are “10h, 20h”. In this case, the other information processing device 40 transmits data “FFh, 10h, 20h, FFh” to the information processing device 30. The serial port 4 serially transfers the bit sequence of the data from the modem 31 to the serial data-parallel data converter 8. Further, the information processing device 40 transmits the data to be input to the UART 3 without adding a start code and an end code.
[0030]
When a start code (first predetermined data) or an end code (second predetermined data) is input from the serial data-parallel data conversion unit 8 to the input buffer 21, the input buffer information notification unit 3 To the service processor 2. The switching control unit 23 stops or restarts data output from the switching unit 24 to the UART 3 according to the control of the service processor 2.
[0031]
In this example, the first data input / output unit for inputting / outputting serial data is the service processor 2, and the second data input / output unit for inputting / outputting serial data is the UART 3 connected to the CPU 5 via a bus. The output buffer information notifying unit is the output buffer information notifying unit 12, and the input buffer information notifying unit is the input buffer information notifying unit 22.
[0032]
Next, an operation when the UART 3 and the service processor 2 output data via the serial port 4 will be described. FIG. 2 is a flowchart showing an example of the operation when the UART 3 and the service processor 2 output data. The UART 3 outputs data to be transmitted to another information processing device 40 to the output buffer 11 via the serial data / parallel data converter 6 (step S71). The serial data-parallel data converter 6 converts the output data of the UART 3 into parallel data, and the output buffer 11 stores the output data of the UART 3 as parallel data. The output buffer 11 outputs this data to the serial port 4 via the parallel data-serial data converter 7. The parallel data-serial data converter 7 converts this data into serial data and outputs it to the serial port 4. The data output to the serial port 4 is transmitted to another information processing device 40 via the modem 31.
[0033]
When transmitting data to another information processing apparatus 40, the service processor 2 instructs the UART 3 to stop outputting data (step S72). The UART 3 stops outputting data after the output of the data being output at the time of the instruction is completed. The output data of the UART 3 is stored in the output buffer 11, but is sequentially output to the serial port 4 via the parallel data-serial data converter 7. If there is no more data in the output buffer 11, the output buffer information notifying unit 12 notifies the service processor 2 of that (step S73).
[0034]
Upon receiving this notification, the service processor 2 outputs data to be transmitted to another information processing device 40 to the output buffer 11 via the serial data-parallel data conversion unit 6 (step S74). The serial data-parallel data converter 6 converts the output data of the service processor 2 into parallel data and outputs the parallel data to the output buffer 11. The output buffer 11 sequentially outputs the data to the serial port 4. The parallel data-serial data converter 7 converts the data output from the output buffer 11 into serial data and outputs the serial data to the serial port 4. When all the data output by the service processor 2 is output from the output buffer 11 to the serial port 4 via the parallel data-serial data conversion unit 7, the output buffer information notifying unit 12 outputs no data in the output buffer 11. Is notified to the service processor 2 (step S75).
[0035]
Upon receiving the notification of step S75, the service processor 2 permits the UART 3 to restart the data output (step S76). Thereafter, the UART 3 outputs the data to the output buffer 11 again via the serial data-parallel data converter 6 (step S77).
[0036]
Next, an operation when the UART 3 and the service processor 2 acquire data via the serial port 4 will be described. FIG. 3 is a flowchart showing an example of an operation when the UART 3 and the service processor 2 acquire data. Data received by the modem 31 from another information processing device 40 is transferred to the serial data-parallel data conversion unit 8 by the serial port 4. The serial data-parallel data conversion unit 8 converts this data into parallel data and outputs it to the input buffer 21. The input buffer 21 stores the data acquired from the serial data-parallel data conversion unit 8 and outputs the data to the switching unit 24 in FIFO order. The switching unit 24 converts this data into serial data and outputs it to the UART 3 (Step S81).
[0037]
The input buffer information notification unit 22 monitors data stored in the input buffer 21 and determines whether a start code has been input to the input buffer 21 (step S82). When the start code is stored in the input buffer 21, the input buffer information notifying unit 22 notifies the service processor 2 that the start code has been input (Step S83). Until the start code is input, the operation of step S81 is continued.
[0038]
The service processor 2 having received the notification in step S83 requests the switching control unit 23 to output the data after the start code to the service processor 2 without outputting the data to the UART 3 (step S84). After the switching unit 24 outputs the start code to the UART 3, the switching control unit 23 causes the switching unit 24 to stop outputting data to the UART 3 and start outputting data to the service processor 2. The switching unit 24 outputs a start code to the UART 3 according to the switching control unit 23, and then stops outputting data to the UART 3 (step S85). The start code is data indicating that data to be input to the service processor 2 follows, and the start code itself is input to the UART 3. The switching unit 24 outputs the data following the start code to the service processor 2 in FIFO order (Step S86).
[0039]
The input buffer information notification unit 22 monitors data stored in the input buffer 21 and determines whether an end code has been input to the input buffer 21 (Step S87). When the end code is stored in the input buffer 21, the input buffer information notification unit 22 notifies the service processor 2 that the end code has been input (step S88). Until the end code is input, the operation of step S86 is continued.
[0040]
The service processor 2 having received the notification of step S88 requests the switching control unit 23 to restart the data output to the UART3 and output the data after the end code to the UART3 (step S89). After the switching unit 24 outputs the end code, the switching control unit 23 causes the switching unit 24 to restart data output to the UART 3.
[0041]
The switching unit 24 outputs the end code to the service processor 2 according to the switching control unit 23, stops outputting data to the service processor 2, and outputs the data following the end code to the UART 3 (step S90).
[0042]
Note that the start code and the end code may be the same data (for example, “FFh”). In this case, the input buffer information notifying unit 22 counts the number of times “FFh” is input to the input buffer 21 and determines that the start code is input at the first input and the end code is input at the second input. do it. However, if the input buffer information notification unit 22 determines that the end coat has been input at the time of the second input and performs the operation of step S88, the input buffer information notifying unit 22 initializes the number of times of counting to zero.
[0043]
According to the present invention, when the service processor 2 outputs data, it instructs the UART 3 to stop outputting data. The UART 3 stops outputting data after the output of the data being output at the time of the instruction is completed. Then, the service processor 2 outputs the data after the data in the output buffer 11 runs out. Therefore, the data output source can be switched from the UART 3 to the service processor 2 without interrupting the bit string of the data output by the UART 3.
[0044]
Then, when all the data output by the service processor 2 is sent from the output buffer 11 to the serial port 4, the service processor 2 instructs the UART 3 to restart the data output. Therefore, the UART 3 can restart data output. Further, the data output source can be switched from the service processor 2 to the UART 3 without interrupting the bit string of the data output by the service processor 3 on the way.
[0045]
Further, according to the present invention, when data to be input to the service processor 2 is stored in the input buffer 21, the switching unit 24 outputs the start code added to the data to the UART 3, and then outputs the start code to the UART 3. Stop data output. Then, data following the start code is output to the service processor 2. After outputting the end code, the switching unit 24 restarts the data output to the UART3. Therefore, data to be input to the service processor 2 is not input to the UART 3. For example, the CPU 5 performs a specific operation when data “A0h” is input to the UART 103, and the service processor 2 performs another operation when continuous data “A0h, B0h” is input. . At this time, “A0h, B0h” to be input to the service processor 2 is not input to the UART3. As a result, it is possible to prevent "A0h" from being input to the UART3 and performing an operation different from a desired operation.
[0046]
Further, the data input destination can be switched from the UART 3 to the service processor 2 or from the service processor 2 to the UART 3 without interrupting the data bit string.
[0047]
Next, the operation of the present invention will be described by taking as an example a case where another information processing device 40 transmits data instructing a specific operation to the service processor 2 and the service processor 2 returns an acknowledgment (ACK). Data for instructing the service processor 2 to perform a specific operation is “01h”, and the start code and the end code are “FFh”.
[0048]
When inserting “01h” into the data to be input to the UART3, the other information processing devices 40 add a start code before “01h”, add an end code after “01h”, and add “FFh, 01h, FFh”. Is inserted. Data transmitted by another information processing device 40 is input to the input buffer 21 via the serial port 4 and the serial data-parallel data conversion unit 8. The input buffer 21 stores the input data and outputs the data to the switching unit 24 in FIFO order. The switching unit 24 outputs the input data to the UART 3 (Step S81). When the first "FFh" is stored in the input buffer 21, the input buffer information notifying unit 22 notifies the service processor 2 that the start code has been input to the input buffer 21 (Steps S82 and S83).
[0049]
The service processor 2 having received the notification requests the switching control unit 23 to output the data after the first “FFh” to the service processor 2 without outputting the data to the UART 3 (step S84). The switching unit 24 outputs the first “FFh” to the UART 3 according to the switching control unit 23, and then stops outputting data to the UART 3 (step S85). Then, data after "01h" is output to the service processor 2 (step S86). When the second "FFh" is stored in the input buffer 21, the input buffer information notifying unit 22 notifies the service processor 2 that the end code has been input to the input buffer 21 (Steps S87 and S88).
[0050]
The service processor 2 having received the notification requests the switching control unit 23 to output the data after the second “FFh” to the UART 3 without outputting the data to the service processor 2 (step S89). The switching unit 24 outputs the second “FFh” to the service processor 2 according to the switching control unit 23, and then stops outputting data to the service processor 2. Then, the data after the second “FFh” is output to UART3 (step S90).
[0051]
When “01h” is input, the service processor 2 performs a specific operation and returns an ACK to another information processing device 40. At this time, the service processor 2 causes the UART 3 to stop outputting data (step S72). The data already output by the UART 3 is output from the output buffer 21 to the parallel data / serial data conversion unit 7, and when there is no more data, the output buffer information notifying unit 22 notifies the service processor 2 of that (step S73). .
[0052]
Upon receiving this notification, the service processor 2 outputs ACK to the output buffer 11 (Step S74). When the ACK is output from the output buffer 11 to the parallel data-serial data conversion unit 7 and the data in the output buffer 11 runs out, the output buffer information notification unit 22 notifies the service processor 2 of the fact (step S75). . Upon receiving this notification, the service processor 2 permits the UART 3 to resume data output (step S76), and the UART 3 outputs data to the output buffer 11 (step S77).
[0053]
In the above example, the case where the service processor 2 issues an instruction to the switching control unit 23 in response to the notification from the input buffer information notification unit 22 has been described. The UART 3 may receive a notification from the input buffer information notification unit 22 and issue an instruction to the switching control unit 23. In this case, the input buffer information notification unit notifies the UART 3 that the input buffer has stored the start data and that the input buffer has stored the end code. The UART 3 requests the switching control unit 23 to output the data following the start code to the service processor 2 when the input buffer stores the start code. Further, when the input buffer stores the end code, it requests the switching control unit 23 to output the data following the end code to the UART 3. The switching unit 24 outputs data following the start code to the service processor 2 and outputs data following the end code to the UART 3 according to the switching control unit 23.
[0054]
That is, the present invention provides an input buffer information notification that notifies the second data input / output unit that the input buffer has stored the first predetermined data and that the input buffer has stored the second predetermined data. Means for outputting data following the first predetermined data to the switching unit to the first data input / output unit when the input buffer stores the first predetermined data. And when the input buffer stores the second predetermined data, the switching unit outputs the data following the second predetermined data to the second data input / output unit, and the switching unit inputs the second data. In response to a request from the output unit, data following the first predetermined data is output to the first data input / output unit, and data following the second predetermined data is output to the second data input / output unit. It may be a configuration.
[0055]
Further, instead of the service processor 2 issuing an instruction to the UART 3 in response to the notification from the output buffer information notifying unit 12, the UART 3 issues an instruction to the service processor 2 in response to the notification from the output buffer information notifying unit 12. You may. In this case, when outputting data to the output buffer 11, the UART 3 causes the service processor 2 to stop outputting data. Then, the UART 3 outputs the data to the output buffer when the output buffer 11 outputs all the data output by the service processor 2 to the serial port. When the output buffer 11 outputs all the data output by the UART 3 to the serial port, the UART 3 permits the service processor 2 to restart the data output. Further, the output buffer information notifying unit 12 notifies the UART 3 that there is no more data in the output buffer 11.
[0056]
【The invention's effect】
According to the present invention, when the first data input / output unit outputs data to the output buffer, the first data input / output unit stops the data output to the second data input / output unit. When all the output data is output to the serial port, the data is output to the output buffer, and when the output buffer outputs all the data output by the first data input / output unit to the serial port, the second Permits the data input / output unit to resume data output. Therefore, the output source that outputs data via the serial port can be switched without destroying the data.
[0057]
Further, according to the present invention, when the input buffer stores the first predetermined data indicating that the data to be input to the first data input / output unit continues, the first predetermined data Is output to the first data input / output unit, and when the input buffer stores the second predetermined data indicating the end of the data to be input to the first data input / output unit, the second predetermined Is output to the second data input / output unit. Therefore, the input destination when data is input via the serial port can be switched without destroying the data.
[Brief description of the drawings]
FIG. 1 is an explanatory diagram showing an embodiment of a serial port sharing system according to the present invention.
FIG. 2 is a flowchart showing an example of an operation when a UART and a service processor output data.
FIG. 3 is a flowchart showing an example of an operation when a UART and a service processor acquire data.
FIG. 4 is an explanatory diagram illustrating an example of a conventional information processing apparatus that performs communication using a modem.
[Explanation of symbols]
1 Serial port sharing system
2 Service processor
3 UART (general-purpose asynchronous transmission / reception device)
4 Serial port
5 CPU
6,8 Serial data-parallel data converter
7 Parallel data-serial data converter
10 Output buffer section
11 Output buffer
12 Output buffer information notification unit
20 Input buffer section
21 Input buffer
22 Input buffer information notification unit
23 Switching control unit
24 Switching unit

Claims (7)

シリアルデータを入出力する第一のデータ入出力部と第二のデータ入出力部とが、一つのシリアルポートを介してデータを入出力するシリアルポート共有システムにおいて、
第一のデータ入出力部および第二のデータ入出力部が出力したデータを格納し、格納したデータをシリアルポートに出力する出力バッファを備え、
第一のデータ入出力部は、データを出力バッファに出力する場合に、第二のデータ入出力部にデータ出力を停止させ、出力バッファが第二のデータ入出力部が出力した全てのデータをシリアルポートに出力したときに、データを出力バッファに出力し、出力バッファが第一のデータ入出力部が出力した全てのデータをシリアルポートに出力したときに、第二のデータ入出力部にデータ出力の再開を許可する
ことを特徴とするシリアルポート共有システム。
A first data input / output unit for inputting / outputting serial data and a second data input / output unit, in a serial port sharing system for inputting / outputting data via one serial port,
An output buffer that stores data output by the first data input / output unit and the second data input / output unit and outputs the stored data to a serial port,
The first data input / output unit, when outputting data to the output buffer, stops the data output to the second data input / output unit, and the output buffer outputs all data output by the second data input / output unit. Outputs data to the output buffer when output to the serial port, and outputs data to the second data input / output unit when the output buffer outputs all data output by the first data input / output unit to the serial port. A serial port sharing system wherein output restart is permitted.
シリアルデータを入出力する第一のデータ入出力部と第二のデータ入出力部とが、一つのシリアルポートを介してデータを入出力するシリアルポート共有システムにおいて、
シリアルポートから入力したデータを格納し、格納したデータを出力する入力バッファと、
入力バッファが出力したデータを第一のデータ入出力部または第二のデータ入出力部に出力する切替部とを備え、
切替部は、入力バッファが第一のデータ入出力部に入力すべきデータが続くことを示す第一の所定のデータを格納した場合に、第一の所定のデータに続くデータを第一のデータ入出力部に出力し、入力バッファが第一のデータ入出力部に入力すべきデータの終了を示す第二の所定のデータを格納した場合に、第二の所定のデータに続くデータを第二のデータ入出力部に出力する
ことを特徴とするシリアルポート共有システム。
A first data input / output unit for inputting / outputting serial data and a second data input / output unit, in a serial port sharing system for inputting / outputting data via one serial port,
An input buffer for storing data input from the serial port and outputting the stored data;
A switching unit that outputs the data output by the input buffer to the first data input / output unit or the second data input / output unit,
When the input buffer stores first predetermined data indicating that data to be input to the first data input / output unit continues, the switching unit converts the data following the first predetermined data into the first data. Output to the input / output unit, and when the input buffer stores the second predetermined data indicating the end of the data to be input to the first data input / output unit, the data following the second predetermined data is stored in the second data. A serial port sharing system for outputting to a data input / output unit.
シリアルデータを入出力する第一のデータ入出力部と第二のデータ入出力部とが、一つのシリアルポートを介してデータを入出力するシリアルポート共有システムにおいて、
第一のデータ入出力部および第二のデータ入出力部が出力したデータを格納し、格納したデータをシリアルポートに出力する出力バッファと、
シリアルポートから入力したデータを格納し、格納したデータを出力する入力バッファと、
入力バッファが出力したデータを第一のデータ入出力部または第二のデータ入出力部に出力する切替部とを備え、
第一のデータ入出力部は、データを出力バッファに出力する場合に、第二のデータ入出力部にデータ出力を停止させ、出力バッファが第二のデータ入出力部が出力した全てのデータをシリアルポートに出力したときに、データを出力バッファに出力し、出力バッファが第一のデータ入出力部が出力した全てのデータをシリアルポートに出力したときに、第二のデータ入出力部にデータ出力の再開を許可し、
切替部は、入力バッファが第一のデータ入出力部に入力すべきデータが続くことを示す第一の所定のデータを格納した場合に、第一の所定のデータに続くデータを第一のデータ入出力部に出力し、入力バッファが第一のデータ入出力部に入力すべきデータの終了を示す第二の所定のデータを格納した場合に、第二の所定のデータに続くデータを第二のデータ入出力部に出力する
ことを特徴とするシリアルポート共有システム。
A first data input / output unit for inputting / outputting serial data and a second data input / output unit, in a serial port sharing system for inputting / outputting data via one serial port,
An output buffer that stores data output by the first data input / output unit and the second data input / output unit and outputs the stored data to a serial port.
An input buffer for storing data input from the serial port and outputting the stored data;
A switching unit that outputs the data output by the input buffer to the first data input / output unit or the second data input / output unit,
The first data input / output unit, when outputting data to the output buffer, stops the data output to the second data input / output unit, and the output buffer outputs all data output by the second data input / output unit. Outputs data to the output buffer when output to the serial port, and outputs data to the second data input / output unit when the output buffer outputs all data output by the first data input / output unit to the serial port. Allow output restart,
When the input buffer stores first predetermined data indicating that data to be input to the first data input / output unit continues, the switching unit converts the data following the first predetermined data into the first data. Output to the input / output unit, and when the input buffer stores the second predetermined data indicating the end of the data to be input to the first data input / output unit, the data following the second predetermined data is stored in the second data. A serial port sharing system for outputting to a data input / output unit.
出力バッファが格納するデータが存在しなくなったことを第一のデータ入出力部に通知する出力バッファ情報通知手段を備え、
第一のデータ入出力部は、出力バッファ情報通知手段からの通知により、出力バッファが第二のデータ入出力部が出力した全てのデータをシリアルポートに出力したこと、および出力バッファが第一のデータ入出力部が出力した全てのデータをシリアルポートに出力したことを判断する
請求項1または請求項3に記載のシリアルポート共有システム。
An output buffer information notifying unit that notifies the first data input / output unit that the data stored in the output buffer no longer exists,
The first data input / output unit outputs that all data output by the second data input / output unit has been output to the serial port by the notification from the output buffer information notification unit, and that the output buffer has the first 4. The serial port sharing system according to claim 1, wherein it is determined that all data output by the data input / output unit has been output to the serial port.
入力バッファが第一の所定のデータを格納したことと、入力バッファが第二の所定のデータを格納したこととを第一のデータ入出力部に通知する入力バッファ情報通知手段を備え、
第一のデータ入出力部は、入力バッファが第一の所定のデータを格納したときに、切替部に第一の所定のデータに続くデータを第一のデータ入出力部に出力させ、入力バッファが第二の所定のデータを格納したときに、切替部に第二の所定のデータに続くデータを第二のデータ入出力部に出力させ、
切替部は、第一のデータ入出力部からの要求に応じて、第一の所定のデータに続くデータを第一のデータ入出力部に出力し、第二の所定のデータに続くデータを第二のデータ入出力部に出力する
請求項2または請求項3に記載のシリアルポート共有システム。
The input buffer has stored the first predetermined data, the input buffer has stored the second predetermined data, and comprises an input buffer information notifying unit that notifies the first data input and output unit,
A first data input / output unit that, when the input buffer stores the first predetermined data, causes the switching unit to output data subsequent to the first predetermined data to the first data input / output unit; When the second predetermined data is stored, the switching unit outputs data subsequent to the second predetermined data to the second data input / output unit,
The switching unit outputs data following the first predetermined data to the first data input / output unit in response to a request from the first data input / output unit, and outputs data following the second predetermined data to the first data input / output unit. 4. The serial port sharing system according to claim 2, wherein the serial port is output to a second data input / output unit.
シリアルデータを入出力する第一のデータ入出力部と第二のデータ入出力部とが、一つのシリアルポートを用いてデータを出力するデータ出力方法であって、
格納したデータを先入れ先出し順に出力する出力バッファに第二のデータ入出力部がデータを出力するステップと、
第二のデータ入出力部にデータ出力を停止させるステップと、
出力バッファが、第二のデータ入出力部が出力した全てのデータをシリアルポートに出力するステップと、
第一のデータ入出力部が、出力バッファにデータを出力するステップと、
出力バッファが、第一のデータ入出力部が出力した全てのデータをシリアルポートに出力するステップと、
第二のデータ入出力部にデータ出力の再開を許可するステップとを含む
ことを特徴とするデータ出力方法。
A first data input / output unit for inputting / outputting serial data and a second data input / output unit are data output methods for outputting data using one serial port,
A step in which the second data input / output unit outputs the data to an output buffer that outputs the stored data in a first-in first-out order;
Stopping the data output to the second data input / output unit;
An output buffer that outputs all data output by the second data input / output unit to a serial port;
A first data input / output unit for outputting data to an output buffer;
An output buffer for outputting all data output by the first data input / output unit to a serial port;
Allowing the second data input / output unit to resume data output.
シリアルデータを入出力する第一のデータ入出力部と第二のデータ入出力部とが、一つのシリアルポートを用いてデータを入力するデータ入力方法であって、
格納したデータを先入れ先出し順に出力する入力バッファが、シリアルポートからのデータを格納し、
入力バッファが第一のデータ入出力部に入力すべきデータが続くことを示す第一の所定のデータを格納した場合に、第一の所定のデータに続くデータを第一のデータ入出力部に出力し、入力バッファが第一のデータ入出力部に入力すべきデータの終了を示す第二の所定のデータを格納した場合に、第二の所定のデータに続くデータを第二のデータ入出力部に出力する
ことを特徴とするデータ入力方法。
A first data input / output unit for inputting / outputting serial data and a second data input / output unit are data input methods for inputting data using one serial port,
An input buffer that outputs the stored data in a first-in first-out order stores data from the serial port,
When the input buffer stores first predetermined data indicating that data to be input continues to the first data input / output unit, data following the first predetermined data is stored in the first data input / output unit. Output, and when the input buffer stores second predetermined data indicating the end of data to be input to the first data input / output unit, data following the second predetermined data is input to the second data input / output unit. A data input method for outputting the data to a unit.
JP2001390987A 2001-12-25 2001-12-25 Serial port sharing system, data output method, and data input method Expired - Fee Related JP3567925B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001390987A JP3567925B2 (en) 2001-12-25 2001-12-25 Serial port sharing system, data output method, and data input method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001390987A JP3567925B2 (en) 2001-12-25 2001-12-25 Serial port sharing system, data output method, and data input method

Publications (2)

Publication Number Publication Date
JP2003198657A JP2003198657A (en) 2003-07-11
JP3567925B2 true JP3567925B2 (en) 2004-09-22

Family

ID=27598708

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001390987A Expired - Fee Related JP3567925B2 (en) 2001-12-25 2001-12-25 Serial port sharing system, data output method, and data input method

Country Status (1)

Country Link
JP (1) JP3567925B2 (en)

Also Published As

Publication number Publication date
JP2003198657A (en) 2003-07-11

Similar Documents

Publication Publication Date Title
JP4564665B2 (en) Method and apparatus for extending the range of general serial bus protocols
US5961626A (en) Method and processing interface for transferring data between host systems and a packetized processing system
US5958024A (en) System having a receive data register for storing at least nine data bits of frame and status bits indicating the status of asynchronous serial receiver
KR100865192B1 (en) System and method of message-based power management
JP3860215B2 (en) Half-duplex UART control for single-channel bidirectional wireless communication
KR970066908A (en) Peripheral interface with delayed flow control of run-length encoded data transmission
CN104461978B (en) Method and device for unidirectional data transmission
JP3567925B2 (en) Serial port sharing system, data output method, and data input method
JP3569149B2 (en) Communication control device
EP1476986B1 (en) Information communication controller interface apparatus and method
US8270611B2 (en) System and method for communicating with a key variable loader (KVL) using a standard universal asynchronous receiver transmitter (UART) peripheral
JP5587530B2 (en) Engine / processor linkage system and linkage method
KR100310229B1 (en) Device for controlling control process of high-level data link for enhancing transmission speed
JP2005228222A (en) Serial data transfer method and device
US11689605B2 (en) In-network compute assistance
JPS62121562A (en) Data communication system
KR950010483B1 (en) The method transmitting a message for an electronic exchanger
JPS63292850A (en) Data communication system
JP2004147243A (en) Packet communication system
KR0123720B1 (en) Data printing method
KR100440199B1 (en) Method for Providing Status Information for Management in Router System
CN108462651A (en) A method of the 1394 asynchronous steaming transfer realized using DMA chain
JPH0477940B2 (en)
JPH0470951A (en) Method and circuit for inter-cpu communication
JPH0415855A (en) Online information processing system

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040520

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040607

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080625

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090625

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100625

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100625

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110625

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110625

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120625

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees