[go: up one dir, main page]

JP2005352658A - Serial communication control method between microcomputer and semiconductor memory card - Google Patents

Serial communication control method between microcomputer and semiconductor memory card Download PDF

Info

Publication number
JP2005352658A
JP2005352658A JP2004171274A JP2004171274A JP2005352658A JP 2005352658 A JP2005352658 A JP 2005352658A JP 2004171274 A JP2004171274 A JP 2004171274A JP 2004171274 A JP2004171274 A JP 2004171274A JP 2005352658 A JP2005352658 A JP 2005352658A
Authority
JP
Japan
Prior art keywords
output
data
terminal
clock
input
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.)
Abandoned
Application number
JP2004171274A
Other languages
Japanese (ja)
Inventor
Kenichi Saito
健一 斉藤
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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP2004171274A priority Critical patent/JP2005352658A/en
Publication of JP2005352658A publication Critical patent/JP2005352658A/en
Abandoned legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

【課題】マイクロコンピュータに通信インターフェイスLSIを付加することなく、マイクロコンピュータと半導体メモリカードとの間の高速のシリアル通信を可能にする。
【解決手段】マイクロコンピュータ10は、同期式シリアル通信インターフェース20と汎用入出力ポート22とを備えている。マイクロコンピュータ10と半導体メモリカード12とは、クロック線14及びデータ線16を介して接続されている。同期式シリアル通信インターフェース20のクロック入出力端子24からのクロック出力と、汎用入出力ポート22の端子28からのクロック出力との間で、クロック出力元を切り替えるようにした。
【選択図】図1
A high-speed serial communication between a microcomputer and a semiconductor memory card is made possible without adding a communication interface LSI to the microcomputer.
A microcomputer includes a synchronous serial communication interface and a general-purpose input / output port. The microcomputer 10 and the semiconductor memory card 12 are connected via a clock line 14 and a data line 16. The clock output source is switched between the clock output from the clock input / output terminal 24 of the synchronous serial communication interface 20 and the clock output from the terminal 28 of the general-purpose input / output port 22.
[Selection] Figure 1

Description

本発明は、マイクロコンピュータと半導体メモリカードとの間のシリアル通信制御方法に関する。   The present invention relates to a serial communication control method between a microcomputer and a semiconductor memory card.

半導体メモリカードは、様々な種類のものが製品化されているが、それぞれが独自の通信方式を採用しているため、データ通信プロトコルは製品によってまちまちであり、標準化されていない。そのためマイクロコンピュータには、多くの場合、半導体メモリカードとの間でデータ転送を行うための専用の通信インターフェイスは内蔵されておらず、マイクロコンピュータに専用の通信インターフェイスLSIを外付けし、その通信インターフェースLSIを介して半導体メモリカードをマイクロコンピュータに接続するようにしている。
半導体メモリカードとの間でデータ転送を行うための専用の通信インターフェイスを内蔵したマイクロコンピュータは一般に高価であり、また、専用の通信インターフェースLSIを外付けする場合にもその分のコストが必要になるので、コスト制限の厳しい機器で半導体メモリカードに対応するのは、現状非常に困難となっている。
マイクロコンピュータと半導体メモリカードとの間のデータ転送に使用することのできるシリアル通信インターフェースを開示した文献としては、例えば特開平7-129484号公報などがある。
特開平7-129484号公報
Various types of semiconductor memory cards have been commercialized, but since each employs a unique communication method, data communication protocols vary depending on the product and are not standardized. For this reason, microcomputers often do not have a dedicated communication interface for transferring data to and from a semiconductor memory card, and a dedicated communication interface LSI is externally attached to the microcomputer. The semiconductor memory card is connected to the microcomputer via the LSI.
Microcomputers with a built-in dedicated communication interface for transferring data to and from a semiconductor memory card are generally expensive, and that cost is also required when a dedicated communication interface LSI is externally attached. Therefore, it is very difficult at present to deal with semiconductor memory cards with devices with severe cost restrictions.
As a document disclosing a serial communication interface that can be used for data transfer between a microcomputer and a semiconductor memory card, there is, for example, JP-A-7-129484.
JP 7-129484 A

本発明は上記問題を解決すべく成されたものであり、本発明の目的は、既存の多くの汎用マイクロコンピュータに装備されている機能のみを用いて、専用の通信インターフェイスLSIを付加することなく、マイクロコンピュータと半導体メモリカードとの間の高速のシリアル通信を可能にすることにある。   The present invention has been made to solve the above problems, and the object of the present invention is to use only functions provided in many existing general-purpose microcomputers without adding a dedicated communication interface LSI. It is to enable high-speed serial communication between the microcomputer and the semiconductor memory card.

上記目的を達成するため本発明に係るシリアル通信制御方法は、中央処理部(CPU)と、クロック入出力端子及びデータ入出力端子を有し前記CPUによってトリガされハードウェアフロー制御により所定ビット数を単位として高速シリアル通信を行う同期式シリアル通信インターフェースと、複数の端子を有し前記CPUによって1ビットずつの入出力制御が可能な汎用入出力ポートとを備えたマイクロコンピュータと、クロック入力端子及びシリアルデータ入出力端子を有する半導体メモリカードとの間の、シリアル通信方式によるデータ通信を制御するためのシリアル通信制御方法において、前記マイクロコンピュータと前記半導体メモリカードとを接続するためのクロック線及びデータ線を用意し、前記同期式シリアル通信インターフェースの前記クロック入出力端子を前記クロック線に接続し、前記同期式シリアル通信インターフェースの前記データ入出力端子を前記データ線に接続し、前記汎用入出力ポートの前記複数の端子のうちの第1端子を前記クロック線に接続し、前記半導体メモリカードの前記クロック入力端子を前記クロック線に接続し、前記半導体メモリカードの前記シリアルデータ入出力端子を前記データ線に接続し、前記CPUが実行するコンピュータプログラムにより構成される通信切り替え手段が、前記同期式シリアル通信インターフェースの前記クロック入出力端子からのクロック出力と、前記汎用入出力ポートの前記第1端子からのクロック出力との間で、クロック出力元切り替えを行うようにすることを特徴とする。   In order to achieve the above object, a serial communication control method according to the present invention comprises a central processing unit (CPU), a clock input / output terminal and a data input / output terminal, and is triggered by the CPU to set a predetermined number of bits by hardware flow control. A microcomputer having a synchronous serial communication interface for performing high-speed serial communication as a unit, a general-purpose input / output port having a plurality of terminals and capable of input / output control bit by bit by the CPU, a clock input terminal, and a serial In a serial communication control method for controlling data communication with a semiconductor memory card having a data input / output terminal by a serial communication method, a clock line and a data line for connecting the microcomputer and the semiconductor memory card Prepare the synchronous serial communication interface The clock input / output terminal of the interface is connected to the clock line, the data input / output terminal of the synchronous serial communication interface is connected to the data line, and the first of the plurality of terminals of the general-purpose input / output port A terminal is connected to the clock line, the clock input terminal of the semiconductor memory card is connected to the clock line, the serial data input / output terminal of the semiconductor memory card is connected to the data line, and the CPU executes A communication switching unit configured by a computer program outputs a clock between a clock output from the clock input / output terminal of the synchronous serial communication interface and a clock output from the first terminal of the general-purpose input / output port. It is characterized in that original switching is performed.

本発明によれば、既存の多くのマイクロコンピュータに内蔵されている、同期式シリアル通信インターフェースと汎用入出力ポートとを用いて、クロック出力元を切り替えることによって、マイクロコンピュータと半導体メモリカードとの間のシリアル通信を行うため、専用の通信インターフェイスLSIを付加する必要がなく、しかも、そのシリアル通信を高速で行うことができる。   According to the present invention, between a microcomputer and a semiconductor memory card, a clock output source is switched using a synchronous serial communication interface and a general-purpose input / output port built in many existing microcomputers. Therefore, it is not necessary to add a dedicated communication interface LSI, and the serial communication can be performed at high speed.

以下に本発明の実施の形態について図面を参照して説明する。図1は本発明に係るシリアル通信制御方法を用いてシリアル通信を行うマイクロコンピュータと半導体メモリカードとを接続する接続形態の第1の具体例を示した模式図であり、図2は同じく第2の具体例を示した模式図である。マイクロコンピュータ10は、半導体メモリカード12を利用する電子機器(例えば携帯用オーディオプレーヤなど)11に装備されている、この電子機器11の構成要素である。半導体メモリカード12には、マイクロコンピュータ10によって読み出し及び/または書き込みが行われるデータ(例えばオーディオデータなど)が格納されている。電子機器11がオーディオプレーヤで、半導体メモリカード12にオーディオデータが格納されている場合には、マイクロコンピュータ10は、その半導体メモリカード12から読み出したオーディオデータに処理を施して音響を再生する。半導体メモリカード12は、電子機器11に対して取り外し可能に接続され、そのために電子機器11には、半導体メモリカード12を挿入するコネクタ13が装備されている。本発明においては、先ず、マイクロコンピュータ10と半導体メモリカード12とを接続するためのクロック線14及びデータ線16を用意し、図1及び図2の具体例では、それらクロック線14及びデータ線16に、マイクロコンピュータ10とコネクタ13とを接続している。   Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a schematic diagram showing a first specific example of a connection form in which a microcomputer performing serial communication and a semiconductor memory card are connected using the serial communication control method according to the present invention, and FIG. It is the schematic diagram which showed the specific example. The microcomputer 10 is a component of the electronic device 11 that is provided in an electronic device (for example, a portable audio player) 11 that uses the semiconductor memory card 12. The semiconductor memory card 12 stores data (for example, audio data) that is read and / or written by the microcomputer 10. When the electronic device 11 is an audio player and audio data is stored in the semiconductor memory card 12, the microcomputer 10 processes the audio data read from the semiconductor memory card 12 to reproduce sound. The semiconductor memory card 12 is detachably connected to the electronic device 11. For this purpose, the electronic device 11 is equipped with a connector 13 for inserting the semiconductor memory card 12. In the present invention, first, a clock line 14 and a data line 16 for connecting the microcomputer 10 and the semiconductor memory card 12 are prepared. In the specific examples of FIGS. 1 and 2, the clock line 14 and the data line 16 are provided. Further, the microcomputer 10 and the connector 13 are connected.

マイクロコンピュータ10は、中央処理部(CPU)18を備えており、また、このCPU18によって制御される、同期式シリアル通信インターフェース20及び汎用入出力ポート22を備えている。同期式シリアル通信インターフェース20は、CPU18によってトリガされハードウェアフロー制御により所定ビット数を単位として高速シリアル通信を行う通信インターフェースである。現在使用されている多くのマイクロコンピュータには標準的な同期式シリアル通信インターフェースが内蔵されており、それは主として、マイクロコンピュータが、EEPROM(電気的に消去可能なプログラマブルROM)やADC(アナログ・デジタル・コンバータ)などの、外付けデバイスとの間で高速シリアル通信を行うために使用されている。本発明は、そのような標準的な同期式シリアル通信インターフェースを用いて実施し得るものである。また、その通信単位である所定ビット数は、8ビットまたは16ビットとされていることが多いが、本発明を実施する上では、所定ビット数がいくつでもあっても構わない。汎用入出力ポート22は、CPU18がコンピュータプログラムに従って制御することにより、1ビットずつの入出力制御を行うことのできるポートであり、既存のマイクロコンピュータの略々全てに装備されているものである。   The microcomputer 10 includes a central processing unit (CPU) 18 and also includes a synchronous serial communication interface 20 and a general-purpose input / output port 22 controlled by the CPU 18. The synchronous serial communication interface 20 is a communication interface that is triggered by the CPU 18 and performs high-speed serial communication in units of a predetermined number of bits by hardware flow control. Many microcomputers in use today have a built-in standard synchronous serial communication interface, which is mainly used by microcomputers (EEPROM (electrically erasable programmable ROM)) and ADC (analog / digital / analog). It is used for high-speed serial communication with external devices such as converters. The present invention can be implemented using such a standard synchronous serial communication interface. The predetermined number of bits as a communication unit is often 8 bits or 16 bits, but any number of the predetermined number of bits may be used in implementing the present invention. The general-purpose input / output port 22 is a port that can perform input / output control for each bit by the CPU 18 according to a computer program, and is provided in almost all existing microcomputers.

図1に示した第1の具体例では、同期式シリアル通信インターフェース20が、クロック入出力端子24及びデータ入出力端子26を備えており、クロック入出力端子24をクロック線14に接続し、データ入出力端子26をデータ線16に接続してある。データ入出力端子26は、信号の入出力方向を動的に制御することのできるものである。図2に示した第2の具体例では、同期式シリアル通信インターフェース20が、クロック入出力端子24、データ入力端子26a、及びデータ出力端子26bを備えており、クロック入出力端子24をクロック線14に接続し、データ入出力端子26a、26bを共にデータ線16に接続してある。第1の具体例と第2の具体例とでは、同期式シリアル通信インターフェース20のデータ入出力端子が、共通端子か、個別端子かということが異なるだけであり、図2の具体例でデータ入出力端子26a、26bを共にデータ線16に接続することによって、マイクロコンピュータ10と半導体メモリカード12との間のデータ通信の機能に関して、図1の具体例と図2の具体例とが実質的に同一のものとなっている。そこで、以下の説明では、図1の第1の具体例に則して説明することにする。   In the first specific example shown in FIG. 1, the synchronous serial communication interface 20 includes a clock input / output terminal 24 and a data input / output terminal 26. The clock input / output terminal 24 is connected to the clock line 14, and the data The input / output terminal 26 is connected to the data line 16. The data input / output terminal 26 is capable of dynamically controlling the input / output direction of the signal. In the second specific example shown in FIG. 2, the synchronous serial communication interface 20 includes a clock input / output terminal 24, a data input terminal 26 a, and a data output terminal 26 b, and the clock input / output terminal 24 is connected to the clock line 14. The data input / output terminals 26 a and 26 b are both connected to the data line 16. The only difference between the first specific example and the second specific example is whether the data input / output terminal of the synchronous serial communication interface 20 is a common terminal or an individual terminal. By connecting both the output terminals 26a and 26b to the data line 16, with respect to the function of data communication between the microcomputer 10 and the semiconductor memory card 12, the specific example of FIG. 1 and the specific example of FIG. It is the same thing. Therefore, in the following description, description will be made in accordance with the first specific example of FIG.

汎用入出力ポートは22は多数の入出力端子を含むものであるが、本発明に係るシリアル通信制御方法と直截的な関係を持たない端子は図示せず、その説明も省略する。汎用入出力ポート22は第1端子28及び第2端子30を含んでおり、第1端子28をクロック線14に接続し、第2端子30をデータ線16に接続してある。CPU18の制御により第1端子28から送出される出力はクロックとして利用され、同じくCPU18の制御により第2端子30から送出される出力は、シリアル通信されるデータの一部を構成する。これらクロック出力及びデータ出力については後に更に詳細に説明する。   The general-purpose input / output port 22 includes a large number of input / output terminals. However, terminals that are not directly related to the serial communication control method according to the present invention are not shown, and the description thereof is also omitted. The general-purpose input / output port 22 includes a first terminal 28 and a second terminal 30. The first terminal 28 is connected to the clock line 14, and the second terminal 30 is connected to the data line 16. The output sent from the first terminal 28 under the control of the CPU 18 is used as a clock, and the output sent out from the second terminal 30 under the control of the CPU 18 constitutes a part of serially communicated data. These clock output and data output will be described in more detail later.

半導体メモリカード12は、クロック入力端子32と、シリアルデータ入出力端子34とを備えている。半導体メモリカード12をコネクタ13に挿入すると、クロック入力端子32はクロック線14に接続され、シリアルデータ入出力端子34はデータ線16に接続される。半導体メモリカード12は、クロック入力端子32及びシリアルデータ入出力端子34以外にも、マイクロコンピュータ10の適当な端子に接続される制御端子を備えているが、それら制御端子は、本発明に係る方法と直截的な関係を持たないものであるため図示せず、その説明も省略する。半導体メモリカード12は、クロック入力端子32を介して受け取るクロックに同期して、シリアルデータ入出力端子34を介してシリアルにデータビットを受信または送信する機能を備えており、このようなシリアル通信機能は、既存の殆ど全ての半導体メモリカードに備えられているものである。   The semiconductor memory card 12 includes a clock input terminal 32 and a serial data input / output terminal 34. When the semiconductor memory card 12 is inserted into the connector 13, the clock input terminal 32 is connected to the clock line 14 and the serial data input / output terminal 34 is connected to the data line 16. The semiconductor memory card 12 includes a control terminal connected to an appropriate terminal of the microcomputer 10 in addition to the clock input terminal 32 and the serial data input / output terminal 34. The control terminal is a method according to the present invention. Since it does not have a direct relationship with the above, it is not shown and its description is omitted. The semiconductor memory card 12 has a function of receiving or transmitting data bits serially via the serial data input / output terminal 34 in synchronization with a clock received via the clock input terminal 32. Such a serial communication function Are provided in almost all existing semiconductor memory cards.

クロック線14及びデータ線16は、各々を、プルアップ用の抵抗を介してプルアップしてある。ただし、使用する半導体メモリカードの通信プロトコルによっては、それらクロック線14及びデータ線16の一方もしくは両方を、プルアップではなくプルダウンしておくようにすることもあり、このプルアップ、プルダウンの詳細については後述する。   Each of the clock line 14 and the data line 16 is pulled up via a pull-up resistor. However, depending on the communication protocol of the semiconductor memory card to be used, one or both of the clock line 14 and the data line 16 may be pulled down instead of pulled up. Will be described later.

これより、以上のようにして接続したマイクロコンピュータ10と半導体メモリカード12との間の、シリアル通信方式によるデータ通信を制御するための、本発明に係るシリアル通信制御方法について説明する。本発明に係るシリアル通信制御方法の重要なポイントは、マイクロコンピュータ10が、半導体メモリカード12との間でシリアル通信方式で連続して転送するデータのうち、連続的にデータ転送できるところは同期式シリアル通信インターフェース20を介して転送し、それ以外の部分は汎用入出力ポート22を介して転送することにある。また更に、以下に説明するシリアル通信制御方法は、同期式シリアル通信インターフェース20を介したデータ転送と、汎用入出力ポート22を介したデータ転送との間の切り替えを、データ波形の乱れなく行い得るものである。   A serial communication control method according to the present invention for controlling data communication by the serial communication method between the microcomputer 10 and the semiconductor memory card 12 connected as described above will now be described. An important point of the serial communication control method according to the present invention is that, among the data that the microcomputer 10 continuously transfers to and from the semiconductor memory card 12 by the serial communication method, the data can be transferred continuously in a synchronous manner. The data is transferred via the serial communication interface 20, and the other part is transferred via the general-purpose input / output port 22. Furthermore, the serial communication control method described below can perform switching between data transfer via the synchronous serial communication interface 20 and data transfer via the general-purpose input / output port 22 without disturbing the data waveform. Is.

先ず、マイクロコンピュータ10が同期式シリアル通信インターフェース20を介して実行する、半導体メモリカード12との間の連続データ転送について説明する。図3は、同期式シリアル通信インターフェース20を介して転送されるデータ波形の具体例を示した波形図であり、図中の上段がクロック波形(クロック線14上の波形)、下段がデータ波形(データ線16上の波形)である。図3の示した具体例は、データ転送単位を8ビット、送信ビット順をMSBファーストとし、データの切り替えをクロック波形の立下りエッジで行い、データの取り込みをクロック波形の立ち上がりエッジで行うようにした場合の例である。ただし、既存のマイクロコンピュータの多くは、クロックエッジや送信ビット順の設定を、そのマイクロコンピュータのレジスタ設定により変更できるように構成されているため、対象となる半導体メモリカードの通信プロトコルに整合するように、それらを設定すればよい。簡単のため以後の説明では、同期式シリアル通信インターフェース20のデータ転送単位以外は、上記条件であることを前提として説明して行くこととし、データ転送単位は、一般化してNビットであるものとする。既述のごとく、同期式シリアル通信インターフェース20を介したデータ転送は、ハードウェアによってフロー制御が行われるため、1ビットのデータを転送するたびにCPU18が介入するということがなく、高速のシリアル通信が可能である。   First, continuous data transfer with the semiconductor memory card 12 executed by the microcomputer 10 via the synchronous serial communication interface 20 will be described. FIG. 3 is a waveform diagram showing a specific example of a data waveform transferred via the synchronous serial communication interface 20, wherein the upper stage in the figure is a clock waveform (waveform on the clock line 14), and the lower stage is a data waveform ( Waveform on the data line 16). In the specific example shown in FIG. 3, the data transfer unit is 8 bits, the transmission bit order is MSB first, data switching is performed at the falling edge of the clock waveform, and data capture is performed at the rising edge of the clock waveform. This is an example. However, many existing microcomputers are configured so that the clock edge and transmission bit order settings can be changed by register settings of the microcomputer, so that they match the communication protocol of the target semiconductor memory card. You can set them. For the sake of simplicity, in the following description, the description will be made on the assumption that the above conditions are satisfied except for the data transfer unit of the synchronous serial communication interface 20, and the data transfer unit is generally N bits. To do. As described above, the data transfer through the synchronous serial communication interface 20 is flow-controlled by hardware, so the CPU 18 does not intervene every time 1-bit data is transferred, and high-speed serial communication is performed. Is possible.

次に、マイクロコンピュータ10が汎用入出力ポート22を介して実行する、半導体メモリカード12との間のデータ転送について説明する。マイクロコンピュータ10から半導体メモリカード12へデータを送信する場合には、マイクロコンピュータ10は、汎用入出力ポート22の第1端子28を駆動してクロック線14上に「0」を出力し、また、第2端子30を駆動して1ビットのデータビットをデータ線16上に出力する。尚、第1端子28の駆動と第2端子30の駆動との順番は、半導体メモリカード12に採用されている通信プロトコルに整合するように定めればよい。その後、マイクロコンピュータ10は、汎用入出力ポート22の第1端子28を駆動してクロック線14上に「1」を出力する。これによって、半導体メモリカード12にデータ線16上のデータビットが取り込まれる。   Next, data transfer with the semiconductor memory card 12 executed by the microcomputer 10 via the general-purpose input / output port 22 will be described. When transmitting data from the microcomputer 10 to the semiconductor memory card 12, the microcomputer 10 drives the first terminal 28 of the general-purpose input / output port 22 to output “0” on the clock line 14, The second terminal 30 is driven to output a 1-bit data bit on the data line 16. Note that the order of driving the first terminal 28 and driving the second terminal 30 may be determined so as to match the communication protocol employed in the semiconductor memory card 12. Thereafter, the microcomputer 10 drives the first terminal 28 of the general-purpose input / output port 22 and outputs “1” on the clock line 14. As a result, the data bit on the data line 16 is taken into the semiconductor memory card 12.

一方、マイクロコンピュータ10が、半導体メモリカード12からデータを受信する場合には、マイクロコンピュータ10は、汎用入出力ポート22の第1端子28を駆動してクロック線14上に「0」を出力する。すると、半導体メモリカード12がデータ線16を駆動して1ビットのデータを出力する。その後、マイクロコンピュータ10は汎用入出力ポート22の第2端子30を介してそのデータ線16上のデータビットを読み取り、また、第1端子28を駆動してクロック線14上に「1」を出力する。第2端子30を介したデータビットの読み取りと、第1端子28からクロック線14への「1」の出力との順番は、半導体メモリカード12に採用されている通信プロトコルに整合するように定めればよい。   On the other hand, when the microcomputer 10 receives data from the semiconductor memory card 12, the microcomputer 10 drives the first terminal 28 of the general-purpose input / output port 22 and outputs “0” on the clock line 14. . Then, the semiconductor memory card 12 drives the data line 16 and outputs 1-bit data. Thereafter, the microcomputer 10 reads the data bit on the data line 16 via the second terminal 30 of the general-purpose input / output port 22, and drives the first terminal 28 to output “1” on the clock line 14. To do. The order of reading the data bits via the second terminal 30 and outputting “1” from the first terminal 28 to the clock line 14 is determined so as to match the communication protocol employed in the semiconductor memory card 12. Just do it.

このように、汎用入出力ポート22を介したデータ転送は、1ビットのデータを転送するたびにCPU18が複数回介入する必要があるため、CPU18の負荷が大きく、データ転送速度は、同期式シリアル通信インターフェース20を介したデータ転送と比べて、格段に低速となる。尚、以上に説明した同期式シリアル通信インターフェース20を介したデータ転送方法と、汎用入出力ポート22を介したデータ転送方法とは、いずれも慣用的な方法である。   As described above, the data transfer via the general-purpose input / output port 22 requires the CPU 18 to intervene a plurality of times each time 1-bit data is transferred. Compared to data transfer via the communication interface 20, the speed is significantly reduced. Note that the data transfer method via the synchronous serial communication interface 20 described above and the data transfer method via the general-purpose input / output port 22 are both conventional methods.

既述のごとく、本発明に係るシリアル通信制御方法は、同期式シリアル通信インターフェース20を介したデータ転送と、汎用入出力ポート22を介したデータ転送とを切り替えることを特徴としている。その切り替えを行うのは、マイクロコンピュータ10のCPU18が実行するコンピュータプログラムにより構成される通信切り替え手段である。その切り替えについて以下に説明する。ここでは具体例として、マイクロコンピュータ10が半導体メモリカード12との間で、Xビットの連続データ転送を行う場合について説明する。図4は、そのXビットの連続データ転送によって転送されるデータ波形を示した波形図であり、図中の上段がクロック波形(クロック線14上の波形)、下段がデータ波形(データ線16上の波形)である。   As described above, the serial communication control method according to the present invention is characterized by switching between data transfer via the synchronous serial communication interface 20 and data transfer via the general-purpose input / output port 22. The switching is performed by communication switching means configured by a computer program executed by the CPU 18 of the microcomputer 10. The switching will be described below. Here, as a specific example, a case where the microcomputer 10 performs X-bit continuous data transfer with the semiconductor memory card 12 will be described. FIG. 4 is a waveform diagram showing data waveforms transferred by the X-bit continuous data transfer. In the figure, the upper stage is a clock waveform (waveform on the clock line 14), and the lower stage is a data waveform (on the data line 16). Waveform).

本発明に係る方法を用いることで利点を享受できるのは、XとNが、以下の式を満たすときである。
X=A×N+B (A及びBはいずれも正の整数であり、0<B<Nである)
ここでは、XとNが、上式を満たすものとする。マイクロコンピュータ10の通信切り替え手段は、一度に連続して転送するXビットのうち、最初のA×Nビットの転送区間では、同期式シリアル通信インターフェース20を使用したNビット単位のデータ転送をA回繰り返させる。例えば、マイクロコンピュータ10から半導体メモリカード12へデータを送信する場合には、マイクロコンピュータ10のCPU18が、送信データをRAM(不図示)から読み込み、同期式シリアル通信インターフェース20の送信データ格納レジスタ(不図示)にこれをセットし、同期式シリアル通信インターフェース20に送信開始命令を出す(即ち、同期式シリアル通信インターフェース20をトリガする)。すると同期式シリアル通信インターフェース20は、それ以後はCPU18の介入を必要とすることなく、ハードウェアフロー制御により、クロック入出力端子24及びデータ入出力端子26を制御して、Nビットのデータの送信を自動で行う。CPU18は、このNビットのデータの送信中は、データ転送以外の他のタスクを実行することができ、このNビットのデータの送信終了を確認したならば、データ転送に関する次の動作に移る。
The advantage of using the method according to the present invention is when X and N satisfy the following equation.
X = A × N + B (A and B are both positive integers, and 0 <B <N)
Here, it is assumed that X and N satisfy the above equation. The communication switching means of the microcomputer 10 performs N-bit unit data transfer using the synchronous serial communication interface A times in the first A × N-bit transfer section of X bits transferred continuously at a time. Let it repeat. For example, when data is transmitted from the microcomputer 10 to the semiconductor memory card 12, the CPU 18 of the microcomputer 10 reads transmission data from a RAM (not shown) and transmits a transmission data storage register (not shown) of the synchronous serial communication interface 20. This is set to (shown) and a transmission start command is issued to the synchronous serial communication interface 20 (that is, the synchronous serial communication interface 20 is triggered). Then, the synchronous serial communication interface 20 does not require the intervention of the CPU 18 and controls the clock input / output terminal 24 and the data input / output terminal 26 by hardware flow control to transmit N-bit data. Is performed automatically. During the transmission of the N-bit data, the CPU 18 can execute a task other than the data transfer. When the CPU 18 confirms the end of the transmission of the N-bit data, the CPU 18 proceeds to the next operation related to the data transfer.

一方、マイクロコンピュータ10が半導体メモリカード12からデータを受信する場合には、マイクロコンピュータ10のCPU18が、同期式シリアル通信インターフェース20に受信開始命令を出す(即ち、同期式シリアル通信インターフェース20をトリガする)。すると同期式シリアル通信インターフェース20は、それ以後はCPU18の介入を必要とすることなく、ハードウェアフロー制御により、クロック入出力端子24及びデータ入出力端子26を制御して、Nビットのデータの受信を自動で行う。CPU18は、このNビットのデータの受信中は、データ転送以外の他のタスクを実行することができ、このNビットのデータの受信終了を確認したならば、同期式シリアル通信インターフェース20の受信データ格納レジスタ(不図示)からデータを読み出し、それをRAMに格納する。   On the other hand, when the microcomputer 10 receives data from the semiconductor memory card 12, the CPU 18 of the microcomputer 10 issues a reception start command to the synchronous serial communication interface 20 (that is, triggers the synchronous serial communication interface 20). ). Then, the synchronous serial communication interface 20 receives the N-bit data by controlling the clock input / output terminal 24 and the data input / output terminal 26 by hardware flow control without requiring the intervention of the CPU 18 thereafter. Is performed automatically. While the N-bit data is being received, the CPU 18 can execute a task other than the data transfer. If the CPU 18 confirms that the N-bit data has been received, the received data of the synchronous serial communication interface 20 is received. Data is read from a storage register (not shown) and stored in RAM.

Nビットを単位とした以上の送信動作または受信動作がA回繰り返されたならば、通信切り替え手段が、同期式シリアル通信インターフェース20を介したデータ転送から、汎用入出力ポート22を介したデータ転送へ切り替える。そして、連続して送信するXビットのうちの残りのBビットの転送は、汎用入出力ポート22を使用して上で説明したようにして実行する。尚、別法として、先に汎用入出力ポート22を使用してBビットの転送を行い、その後に、同期式シリアル通信インターフェース20を使用したデータ転送に切り替えて、残りのN×Aビットの転送を行うようにしてもよい。   If the above transmission operation or reception operation in units of N bits is repeated A times, the communication switching means transfers the data from the data transfer via the synchronous serial communication interface 20 to the data transfer via the general-purpose input / output port 22. Switch to. Then, transfer of the remaining B bits of the X bits to be continuously transmitted is executed using the general-purpose input / output port 22 as described above. As an alternative method, B-bit transfer is first performed using the general-purpose input / output port 22, and then the data transfer using the synchronous serial communication interface 20 is switched to transfer the remaining N × A bits. May be performed.

通信切り替え手段は、同期式シリアル通信インターフェース20を介したデータ転送と汎用入出力ポート22を介したデータ転送との間で、切り替えを行うタイミングを判断するために、例えば、Xビットのデータの送信を開始するのに先立って、XをNで除する除算を実行し、上掲の式に示したA及びBの値を算出して記憶しておくようにすればよく、その記憶しておいたAないしBの値に基づいて、切り替えのタイミングを判断することができる。   The communication switching means transmits, for example, X-bit data in order to determine the timing for switching between data transfer via the synchronous serial communication interface 20 and data transfer via the general-purpose input / output port 22. Prior to starting, division by dividing X by N may be performed to calculate and store the values of A and B shown in the above formula. The switching timing can be determined based on the values of A to B.

また、マイクロコンピュータ10から半導体メモリカード12へデータを送信する場合であれば、同期式シリアル通信インターフェース20のハードウェアが送信データ格納レジスタにセットする送信データを常時モニタしておき、そこにセットされた送信データのデータビットがNビット未満になったときに、そのことを通信切り替え手段に知らせるようにしてもよい。通信切り替え手段は、それに応答して、同期式シリアル通信インターフェース20を介したデータ転送から、汎用入出力ポート22を介したデータ転送に切り替えて、そのNビット未満の残りのデータビットを、汎用入出力ポート22から出力させるようにすればよい。   In the case of transmitting data from the microcomputer 10 to the semiconductor memory card 12, the hardware of the synchronous serial communication interface 20 constantly monitors the transmission data set in the transmission data storage register and is set there. When the data bit of the transmitted data becomes less than N bits, this may be notified to the communication switching means. In response to this, the communication switching means switches from data transfer via the synchronous serial communication interface 20 to data transfer via the general-purpose input / output port 22, and the remaining data bits less than N bits are input to the general-purpose input. What is necessary is just to make it output from the output port 22. FIG.

以上に説明したシリアル通信制御方法では、マイクロコンピュータ10のCPU18が実行するコンピュータプログラムにより構成される通信切り替え手段が、マイクロコンピュータ10と半導体メモリカード12との間で1つの通信メッセージを通信しているときに、同期式シリアル通信インターフェース20による所定ビット数(Nビット)を単位としたデータ転送と、汎用入出力ポート22によるデータ転送との間で切り替えを行う。そして、それによって、同期式シリアル通信インターフェース20を介して転送される所定ビット数の整数倍のビット数(N×Aビット)から成るデータビット列と、汎用入出力ポート22を介して転送されるデータビット列または単一データビットとで、その1つの通信メッセージが構成されるようにしている。尚、汎用入出力ポート22がデータビット列を転送するというのはB≧2の場合であり、単一データビットを転送するというのはB=1の場合である。   In the serial communication control method described above, communication switching means configured by a computer program executed by the CPU 18 of the microcomputer 10 communicates one communication message between the microcomputer 10 and the semiconductor memory card 12. Sometimes, switching is performed between data transfer in units of a predetermined number of bits (N bits) by the synchronous serial communication interface 20 and data transfer by the general-purpose input / output port 22. As a result, a data bit string consisting of a number of bits (N × A bits) that is an integral multiple of a predetermined number of bits transferred via the synchronous serial communication interface 20 and data transferred via the general-purpose input / output port 22 One communication message is composed of a bit string or a single data bit. The general-purpose input / output port 22 transfers the data bit string when B ≧ 2, and the single data bit is transferred when B = 1.

既に述べたように、汎用入出力ポート22を使用してデータ転送をする場合には、同期式シリアル通信インターフェース20を使用する場合と比べてデータ転送速度がかなり低下するが、これは、そのデータ転送に関係する全ての制御をマイクロコンピュータ10のCPU18が実行しなければならないからである。例えば、汎用入出力ポート22の1つの端子の出力を1回変えるだけでも、複数の命令が必要になるため、マイクロコンピュータ10のシステムクロック数周期分の時間を要する。その上に更に、各ビットごとのループ判定等の処理が上乗せされるので、総転送時間はかなり長くなる。これに対して、同期式シリアル通信インターフェース20を用いる場合には、データ転送単位であるNビットの転送はハードウェア的に自動で行われるため、転送に使われるクロック周波数はマイクロコンピュータのシステムクロックと同等まで上げることができる。このため、非常に高速な転送が可能になり、しかも、そのNビットの転送の間は、マイクロコンピュータ10のCPU18は別の処理をしていることができるので、システム全体のスループットも上げることができる。そして、半導体メモリカード12との通信においては、通信全体に対して、連続したデータ転送を単純に行っている部分が大部分を占めるので、この部分に同期式シリアル通信インターフェース20を利用することによるデータ転送高速化の効果は非常に大きい。   As described above, when data transfer is performed using the general-purpose input / output port 22, the data transfer speed is considerably lower than that when the synchronous serial communication interface 20 is used. This is because the CPU 18 of the microcomputer 10 must execute all the control related to the transfer. For example, even if the output of one terminal of the general-purpose input / output port 22 is changed only once, a plurality of instructions are required, so that it takes time corresponding to several system clock cycles of the microcomputer 10. Furthermore, since processing such as loop determination for each bit is added, the total transfer time becomes considerably long. On the other hand, when the synchronous serial communication interface 20 is used, N-bit transfer, which is a data transfer unit, is automatically performed by hardware, so that the clock frequency used for transfer is the system clock of the microcomputer. Can be raised to the same level. For this reason, very high-speed transfer is possible, and during the N-bit transfer, the CPU 18 of the microcomputer 10 can perform another process, so that the throughput of the entire system can be increased. it can. In communication with the semiconductor memory card 12, the portion where the continuous data transfer is simply performed occupies most of the communication, and therefore the synchronous serial communication interface 20 is used for this portion. The effect of speeding up data transfer is very large.

以上に説明したシリアル通信制御方法では、通信切り替え手段が、同期式シリアル通信インターフェース20によるデータ転送と、汎用入出力ポート22によるデータ転送とを切り替える際に、(1)同期式シリアル通信インターフェース20のクロック入出力端子24からのクロック出力と、汎用入出力ポート22の第1端子28からのクロック出力との間で、クロック出力元切り替えを行い、またそれと同時に、(2)同期式シリアル通信インターフェース20のデータ入出力端子26と、汎用入出力ポート22の第2端子30との間で、半導体メモリカード12との間のデータ転送に使用する端子を切り替える、データ端子切り替えを行うようにしている。従って、通信切り替え手段が、これら2つの切り替えを共に行うことで、上記利点を得ているのであるが、本発明の別の実施の形態として、通信切り替え手段が(1)のクロック出力元切り替えだけを行い、(2)のデータ端子切り替えを行わないような形態とすることも可能であり、そのような実施の形態については、後に図7及び図8を参照して説明する。   In the serial communication control method described above, when the communication switching unit switches between data transfer by the synchronous serial communication interface 20 and data transfer by the general-purpose input / output port 22, (1) the synchronous serial communication interface 20 The clock output source is switched between the clock output from the clock input / output terminal 24 and the clock output from the first terminal 28 of the general-purpose input / output port 22, and at the same time, (2) the synchronous serial communication interface 20 The data terminal is switched between the data input / output terminal 26 and the second terminal 30 of the general-purpose input / output port 22 to switch the terminal used for data transfer with the semiconductor memory card 12. Therefore, the communication switching unit obtains the above-mentioned advantage by performing both of these switching operations. However, as another embodiment of the present invention, the communication switching unit performs only the clock output source switching in (1). It is possible to adopt a form in which the data terminal switching in (2) is not performed, and such an embodiment will be described later with reference to FIGS.

同期式シリアル通信インターフェース20と汎用入出力ポート22との切り替えに関しては、その切り替えに際して、通信線(クロック線14及びデータ線16)上の波形の乱れが発生しないようにすることが重要であり、さもないと通信エラーが発生するおそれがある。図1及び図2に示した具体例では、波形の乱れを防止するための手段として、クロック線14及びデータ線16をプルアップしている。これについて、以下に、図5A〜図5Cと、図6とを参照して説明する。   Regarding the switching between the synchronous serial communication interface 20 and the general-purpose input / output port 22, it is important that the waveform disturbance on the communication line (clock line 14 and data line 16) does not occur during the switching. Otherwise, a communication error may occur. In the specific examples shown in FIGS. 1 and 2, the clock line 14 and the data line 16 are pulled up as a means for preventing waveform disturbance. This will be described below with reference to FIGS. 5A to 5C and FIG.

図5A〜図5Cは、同期式シリアル通信インターフェース20の受信バッファ42及び出力バッファ44、汎用入出力ポート22の受信バッファ46及び出力バッファ48、それに、半導体メモリカード12のデータ入出力回路50の受信バッファ52及び出力バッファ54を示しており、それら受信バッファ及び出力バッファはいずれも、上述した夫々の端子(図5A〜図5Cでは省略した)及びコネクタ(これも図5A〜図5Cでは省略した)を介してデータ線16に接続されている。これらの図は、同期式シリアル通信インターフェース20から汎用入出力ポート22への切り替えを行う際に、データ線16に接続されている夫々の出力バッファの状態がどのように変化するかを、模式的に示したものである。図中に実線で示した出力バッファが、有効状態(データ線16上に出力を送出している状態)にあるバッファである。図中に点線で示した出力バッファは、ハイインピーダンス状態(データ線16から回路的に切り離された状態)にあり、ハイインピーダンス状態にある出力バッファが接続されている端子は、入力状態(その出力バッファに対応した受信バッファがデータを受信できる状態)になっている。   5A to 5C show the reception buffer 42 and output buffer 44 of the synchronous serial communication interface 20, the reception buffer 46 and output buffer 48 of the general-purpose input / output port 22, and the reception of the data input / output circuit 50 of the semiconductor memory card 12. A buffer 52 and an output buffer 54 are shown, both of which are the respective terminals described above (not shown in FIGS. 5A-5C) and connectors (also omitted in FIGS. 5A-5C). Is connected to the data line 16. These figures schematically show how the state of each output buffer connected to the data line 16 changes when switching from the synchronous serial communication interface 20 to the general-purpose input / output port 22. It is shown in. An output buffer indicated by a solid line in the drawing is a buffer in a valid state (a state in which an output is being transmitted on the data line 16). The output buffer indicated by a dotted line in the figure is in a high impedance state (state separated from the data line 16), and a terminal to which the output buffer in the high impedance state is connected is in an input state (its output). The reception buffer corresponding to the buffer is ready to receive data.

図5Aに示したのは、同期式シリアル通信インターフェース20が半導体メモリカード12へデータを送信している状態である。この状態では、同期式シリアル通信インターフェース20の出力バッファ44のみが有効(端子が出力状態)となっており、それ以外の出力バッファはハイインピーダンス(端子が入力状態)となっている。データ線16に接続されている出力バッファ44、48、54は、いかなる場合にも、それらのうちの2つ以上のものが同時に有効になってはならず、なぜならば、同時に複数の出力バッファが有効となった場合には、電源とグラウンドとが短絡して過大な電流が流れることによって、素子の破壊が生じるおそれがあるからである。   FIG. 5A shows a state where the synchronous serial communication interface 20 is transmitting data to the semiconductor memory card 12. In this state, only the output buffer 44 of the synchronous serial communication interface 20 is valid (terminal is in the output state), and the other output buffers are in high impedance (terminal is in the input state). In any case, two or more of the output buffers 44, 48, 54 connected to the data line 16 must not be enabled at the same time, since multiple output buffers can be simultaneously active. This is because, when it becomes effective, the power source and the ground are short-circuited and an excessive current flows, so that the element may be destroyed.

同期式シリアル通信インターフェース20によるデータ転送を行っている状態から、汎用入出力ポート22によるデータ転送に切り替える際には、それらの出力バッファ44、48が同時に有効になるのを確実に防止するために、図5Bに示したように、一旦、全ての出力バッファ44、48、54を同時にハイインピーダンス状態にする。この後、汎用入出力ポート22の出力バッファ48を有効にすることで、図5Cに示した状態となり、これによって汎用入出力ポート22による送信が可能になる。しかるに、図5Bに示した状態では、データ線16を駆動しているバッファが存在していないため、データ線16は浮いている状態になる。そのため、もしデータ線16がプルアップもプルダウンもされていなかったならば、このとき、データ線16の電位は浮遊容量によってのみ決まるため、非常に不安定な挙動を示すことになる。データ線16のプルアップは、そのような事態を防止する役割を果たしているのである。   When switching from the state in which data is transferred by the synchronous serial communication interface 20 to the data transfer by the general-purpose input / output port 22, to reliably prevent the output buffers 44 and 48 from being enabled at the same time. As shown in FIG. 5B, all the output buffers 44, 48, and 54 are once set in a high impedance state. Thereafter, by enabling the output buffer 48 of the general-purpose input / output port 22, the state shown in FIG. 5C is obtained, and transmission by the general-purpose input / output port 22 becomes possible. However, in the state shown in FIG. 5B, since there is no buffer driving the data line 16, the data line 16 is in a floating state. For this reason, if the data line 16 is not pulled up or pulled down, the potential of the data line 16 is determined only by the stray capacitance at this time, so that the behavior becomes very unstable. The pull-up of the data line 16 serves to prevent such a situation.

次にクロック線14のプルアップについて、図6を参照して説明する。図6は、図4の波形図のうちの、同期式シリアル通信インターフェース20から汎用入出力ポート22への切り替え部分を拡大したものを下段に示し、上段には比較例としてクロック線14をプルアップもプルダウンもしていない場合を示した波形図である。この図6から明らかなように、プルアップしている場合には、切り替えの際にクロック線14の電位がハイ状態に保たれるのに対し、プルアップもプルダウンもしていない場合には、クロック線14の電位が不安定となっている。クロック線14において、図6の上段に示したようにクロック波形が変化した場合には、半導体メモリカード12が、その不安定な電位によって発生した立上りエッジLEを、クロックエッジとして誤認識してしまうおそれがある。半導体メモリカード12の通信プロトコル上、このような誤認識が問題となる場合には、プルアップないしプルダウンは必須である。プルアップとプルダウンとのどちらにすべきかは、実際に使用している半導体メモリカードの通信プロトコルに依存するが、切り替え前のクロック線14の状態が「1」ならプルアップ、「0」ならプルダウンとすればよい。尚、以上のプルアップ/プルダウンはクロック線14及びデータ線16の電位を保持するだけあり、それらを充放電することはないので、プルアップ/プルダウン用抵抗の抵抗値は大きな値で構わない。   Next, the pull-up of the clock line 14 will be described with reference to FIG. FIG. 6 shows an enlarged view of the switching portion from the synchronous serial communication interface 20 to the general-purpose input / output port 22 in the waveform diagram of FIG. 4, and the upper portion pulls up the clock line 14 as a comparative example. It is the wave form diagram which showed the case where neither pulls down. As is apparent from FIG. 6, when the pull-up is performed, the potential of the clock line 14 is kept high during switching, whereas when the pull-up and pull-down are not performed, the clock The potential of the line 14 is unstable. When the clock waveform changes on the clock line 14 as shown in the upper part of FIG. 6, the semiconductor memory card 12 erroneously recognizes the rising edge LE generated by the unstable potential as the clock edge. There is a fear. When such misrecognition becomes a problem in the communication protocol of the semiconductor memory card 12, pull-up or pull-down is essential. Whether pull-up or pull-down should be performed depends on the communication protocol of the semiconductor memory card that is actually used. If the state of the clock line 14 before switching is “1”, the pull-up is performed. And it is sufficient. Note that the above pull-up / pull-down only holds the potential of the clock line 14 and the data line 16 and does not charge or discharge them, so the resistance value of the pull-up / pull-down resistor may be large.

半導体メモリカードの通信プロトコルとして、上記以外にも制御線が必要になる場合には、汎用入出力ポートで使用する入出力端子を増やし、これを制御線に割り当てた上で、既に述べたような方法で制御してやればよい。一般に、制御線が制御される区間は通信全体のごく一部であるため、この部分を制御してやることによるデータ転送速度の低下は殆どない。その1つの具体例を図7及び図8に示した。この具体例はまた、先に述べた、通信切り替え手段がクロック出力元切り替えだけを行い、データ端子切り替えを行わないようにした実施の形態の具体例でもある。   If a control line other than the above is required as a communication protocol for a semiconductor memory card, increase the number of input / output terminals used in the general-purpose input / output port, assign it to the control line, and It may be controlled by the method. In general, since the section in which the control line is controlled is only a part of the entire communication, there is almost no decrease in the data transfer rate due to the control of this part. One specific example is shown in FIGS. This specific example is also a specific example of the embodiment described above in which the communication switching means performs only clock output source switching and does not perform data terminal switching.

図7は、マイクロコンピュータ10が、メモリースティック(「メモリースティック」はソニー株式会社の商標である)と呼ばれている半導体メモリカード12との間でデータ通信を行う場合の、両者間の接続形態の具体例を示した模式図であり、図8は、その制御方法の一部を示したタイミングチャートである。マイクロコンピュータ10は携帯用オーディオプレーヤ11に装備されており、メモリースティック12には、マイクロコンピュータ10によって読み出されるオーディオデータが格納されている。マイクロコンピュータ10は、メモリースティック12から読み出したオーディオデータに処理を施して音響を再生する。メモリースティック12は、携帯用オーディオプレーヤ11に対して取り外し可能に接続され、そのために携帯用オーディオプレーヤ11には、メモリースティック12を挿入するコネクタ13が装備されている。メモリースティック12は、クロック入力端子(SCLK)32と、シリアルデータ入出力端子(SDIO)34と、制御端子(BS)56とを備えており、この具体例では、マイクロコンピュータ10とメモリースティック12とを接続するためのクロック線14、データ線16、及び制御線58が用意されている。図7の具体例では、それら各線は、マイクロコンピュータ10とメモリースティック用コネクタ13との間を接続しており、メモリースティック12をコネクタ13に挿入すると、クロック入力端子(SCLK)32はクロック線14に接続され、シリアルデータ入出力端子(SDIO)34はデータ線16に接続され、制御端子(BS)56は制御線58に接続される。   FIG. 7 shows a concrete example of the connection form between the microcomputer 10 and the semiconductor memory card 12 called “Memory Stick” (“Memory Stick” is a trademark of Sony Corporation). FIG. 8 is a schematic diagram showing an example, and FIG. 8 is a timing chart showing a part of the control method. The microcomputer 10 is mounted on a portable audio player 11, and audio data read by the microcomputer 10 is stored in the memory stick 12. The microcomputer 10 processes the audio data read from the memory stick 12 to reproduce sound. The memory stick 12 is detachably connected to the portable audio player 11, and for this purpose, the portable audio player 11 is equipped with a connector 13 for inserting the memory stick 12. The memory stick 12 includes a clock input terminal (SCLK) 32, a serial data input / output terminal (SDIO) 34, and a control terminal (BS) 56. In this specific example, the microcomputer 10 and the memory stick 12 are connected. A clock line 14, a data line 16, and a control line 58 are prepared. In the specific example of FIG. 7, these lines are connected between the microcomputer 10 and the memory stick connector 13. When the memory stick 12 is inserted into the connector 13, the clock input terminal (SCLK) 32 is connected to the clock line 14. The serial data input / output terminal (SDIO) 34 is connected to the data line 16, and the control terminal (BS) 56 is connected to the control line 58.

図1及び図2の具体例と同様に、図7の具体例でも、マイクロコンピュータ10は、中央処理部(CPU)18と、このCPU18によって制御される、同期式シリアル通信インターフェース20及び汎用入出力ポート22とを備えている。メモリースティック12は、その通信プロトコルとして、データ転送を常に8ビット単位で行うようにしているため、同期式シリアル通信インターフェース20は、その送信単位を8ビットとしてある。データ線16は同期式シリアル通信インターフェース20のデータ入出力端子26だけに接続されており、汎用入出力ポート22には接続されていない。同期式シリアル通信インターフェース20は、クロック入出力端子(Serial_SCK)24及びデータ入出力端子(Serial_SDO)26を備えており、クロック入出力端子24をクロック線14に接続し、データ入出力端子26をデータ線16に接続してある。データ入出力端子26は、信号の入出力方向を動的に制御することのできるものである。   As in the specific examples of FIGS. 1 and 2, in the specific example of FIG. 7, the microcomputer 10 includes a central processing unit (CPU) 18, a synchronous serial communication interface 20 controlled by the CPU 18, and general-purpose input / output. Port 22. Since the memory stick 12 always performs data transfer in units of 8 bits as its communication protocol, the synchronous serial communication interface 20 has a transmission unit of 8 bits. The data line 16 is connected only to the data input / output terminal 26 of the synchronous serial communication interface 20 and is not connected to the general-purpose input / output port 22. The synchronous serial communication interface 20 includes a clock input / output terminal (Serial_SCK) 24 and a data input / output terminal (Serial_SDO) 26. The clock input / output terminal 24 is connected to the clock line 14, and the data input / output terminal 26 is connected to data. Connected to line 16. The data input / output terminal 26 is capable of dynamically controlling the input / output direction of the signal.

汎用入出力ポートは22は多数の入出力端子を含むものであるが、図2はそれらのうちの入出力A端子60、入出力B端子(PIO_SCK)62、及び入出力C端子(PIO_BS)64の、3つの端子だけを示した。それらのうち、入出力A端子60は使用していない。入出力B端子(PIO_SCK)62は、クロック出力端子として使用しており、クロック線14に接続してある。入出力C端子(PIO_BS)64は、制御信号出力端子として使用しており、制御線58に接続してある。この図8の具体例では、汎用入出力ポート22を介したデータビットの送受信は行わないため、汎用入出力ポート22はデータ線16には接続していない。また、クロック線14及びデータ線16は、各々を、プルアップ用の抵抗を介してプルアップしてあり、このプルアップは、図1及び図2の具体例と同様、それら各線の状態が不安定になるのを防止するためのものである。   The general-purpose input / output port 22 includes a large number of input / output terminals. FIG. 2 shows an input / output A terminal 60, an input / output B terminal (PIO_SCK) 62, and an input / output C terminal (PIO_BS) 64. Only three terminals are shown. Of these, the input / output A terminal 60 is not used. The input / output B terminal (PIO_SCK) 62 is used as a clock output terminal and is connected to the clock line 14. The input / output C terminal (PIO_BS) 64 is used as a control signal output terminal and is connected to the control line 58. In the specific example of FIG. 8, since data bits are not transmitted / received via the general-purpose input / output port 22, the general-purpose input / output port 22 is not connected to the data line 16. Each of the clock line 14 and the data line 16 is pulled up via a pull-up resistor, and this pull-up is not in the state of each line as in the specific examples of FIGS. It is for preventing it becoming stable.

メモリースティック12の通信プロトコルは、メモリースティック12が待機状態にあるときにクロックを受け取ったならば、そのときの制御線58上の制御出力を読み取り、更にそれに続いて受け取る8個のクロックに同期して、データ線16から8個のデータビットを読み取り、それら制御出力と8個のデータビットの組合せをもって、1つの通信コマンドとして認識するように定められている。ここで、例えば汎用入出力ポート22の入出力A端子60をデータ線16に接続しておき、この入出力A端子60からデータビットを送出するようにしておけば、通信コマンドの8個のデータビットの転送を、汎用入出力ポート22を介して行うことができるが、そのようにすると比較的長い時間がかかり、CPU18の負荷も比較的大きなものとなる。そこで、本発明に係るシリアル通信制御方法を、通信コマンドの送信に適用することによって、より高速で低負荷のコマンド送信を行えるようになる。   The communication protocol of the memory stick 12 reads the control output on the control line 58 when the memory stick 12 is in the standby state, reads the control output on the control line 58 at that time, and further synchronizes with the eight clocks received thereafter, It is determined that eight data bits are read from the data line 16 and a combination of these control outputs and eight data bits is recognized as one communication command. For example, if the input / output A terminal 60 of the general-purpose input / output port 22 is connected to the data line 16 and data bits are transmitted from the input / output A terminal 60, eight data of the communication command are transmitted. Although bit transfer can be performed via the general-purpose input / output port 22, doing so takes a relatively long time and the load on the CPU 18 is also relatively large. Therefore, by applying the serial communication control method according to the present invention to transmission of communication commands, it becomes possible to perform command transmission at a higher speed and with a lower load.

通信コマンドの送信を、本発明に係るシリアル通信制御方法に従って行う場合には、通信コマンドの送信に適用した場合には、マイクロコンピュータ10のCPU18が実行するコンピュータプログラムにより構成される通信切り替え手段が、同期式シリアル通信インターフェース20のクロック入出力端子(Serial_SCK)24からのクロック出力と、汎用入出力ポート22の入出力B端子(PIO_SCK)62からのクロック出力との間で、クロック出力元切り替えを行う。   When transmitting the communication command according to the serial communication control method according to the present invention, when applied to the transmission of the communication command, the communication switching means configured by a computer program executed by the CPU 18 of the microcomputer 10 includes: The clock output source is switched between the clock output from the clock input / output terminal (Serial_SCK) 24 of the synchronous serial communication interface 20 and the clock output from the input / output B terminal (PIO_SCK) 62 of the general-purpose input / output port 22. .

より詳しく述べるならば、通信切り替え手段は、汎用入出力ポート22の入出力C端子(PIO_BS)64から制御線58上へ出力された制御出力をメモリースティック12に読み取らせるときには汎用入出力ポート22の入出力B端子(PIO_SCK)62からクロック出力を送出させ、一方、同期式シリアル通信インターフェース20のデータ入出力端子(Serial_SDO)26とメモリースティック12のシリアルデータ入出力端子(SDIO)34との間のデータ転送を行わせるときには同期式シリアル通信インターフェース22のクロック入出力端子(Serial_SCK)24からクロック出力を送出させるようにする。既述のごとく、メモリースティック12の通信プロトコルは、制御端子(BS)56を介して受信する制御出力と、シリアルデータ入出力端子(SDIO)34を介して受信する連続する複数のデータビットとの組合せによって構成されるコマンドを使用しているため、通信切り替え手段が、以上のようにクロック出力切り替えを行うことで、そのコマンドをメモリースティック12に読み取らせることができる。   More specifically, when the communication switching means causes the memory stick 12 to read the control output output from the input / output C terminal (PIO_BS) 64 of the general-purpose input / output port 22 onto the control line 58, the communication switching means A clock output is sent from the output B terminal (PIO_SCK) 62, while data transfer between the data input / output terminal (Serial_SDO) 26 of the synchronous serial communication interface 20 and the serial data input / output terminal (SDIO) 34 of the memory stick 12 is performed. Is performed, the clock output is sent from the clock input / output terminal (Serial_SCK) 24 of the synchronous serial communication interface 22. As described above, the communication protocol of the Memory Stick 12 is a combination of a control output received via the control terminal (BS) 56 and a plurality of consecutive data bits received via the serial data input / output terminal (SDIO) 34. Therefore, the communication switching unit can cause the memory stick 12 to read the command by switching the clock output as described above.

図8は、図7の接続形態において以上のシリアル通信制御を行う際のクロック線14、データ線16、及び制御線58上の波形を示した波形図である。図8において、上段はデータ線16上の波形であり、MSで示したのは、メモリースティック12のシリアルデータ入出力端子(SDIO)34が有効状態にある期間、Serial_SDOで示したのは、マイクロコンピュータ10の同期式シリアル通信インターフェース20のデータ入出力端子(Serial_SDO)26が有効状態にある期間、そして斜線で示したのは、データ線16がプルアップされることでハイ状態に維持されている期間である。中段はクロック線14上の波形であり、Serial_SCKで示したのは、同期式シリアル通信インターフェース22のクロック入出力端子(Serial_SCK)24が有効状態にある期間、PIO_SCKで示したのは、汎用入出力ポート22の入出力B端子(PIO_SCK)62が有効状態にある期間、そして斜線で示したのは、クロック線14がプルアップされることでハイ状態に維持されている期間である。下段は制御線58上の波形であり、PIO_BSという表記は、汎用入出力ポート22の入出力C端子(PIO_BS)64が有効状態にあることを表している。   FIG. 8 is a waveform diagram showing waveforms on the clock line 14, the data line 16, and the control line 58 when performing the above serial communication control in the connection form of FIG. In FIG. 8, the upper part is a waveform on the data line 16, and MS indicates a period in which the serial data input / output terminal (SDIO) 34 of the memory stick 12 is in a valid state, and Serial_SDO indicates a microcomputer. 10 is a period in which the data input / output terminal (Serial_SDO) 26 of the synchronous serial communication interface 20 is in a valid state, and a hatched line indicates a period in which the data line 16 is maintained in a high state by being pulled up. It is. The middle stage is the waveform on the clock line 14, and Serial_SCK indicates the period when the clock input / output terminal (Serial_SCK) 24 of the synchronous serial communication interface 22 is in the valid state, and PIO_SCK indicates the general-purpose input / output. A period during which the input / output B terminal (PIO_SCK) 62 of the port 22 is in a valid state, and a hatched line indicates a period during which the clock line 14 is maintained in a high state by being pulled up. The lower part is a waveform on the control line 58, and the notation PIO_BS indicates that the input / output C terminal (PIO_BS) 64 of the general-purpose input / output port 22 is in the valid state.

以上のシリアル通信制御方法によれば、専用の通信インターフェイスLSIを使用することなく、マイクロコンピュータ10とメモリースティック12との間のシリアルデータ転送を行うことができ、しかも、その通信を比較的高速で行うことができる。   According to the serial communication control method described above, serial data can be transferred between the microcomputer 10 and the memory stick 12 without using a dedicated communication interface LSI, and the communication is performed at a relatively high speed. be able to.

本発明に係るシリアル通信制御方法を用いてシリアル通信を行うマイクロコンピュータと半導体メモリカードとを接続する接続形態の第1の具体例を示した模式図である。It is the schematic diagram which showed the 1st specific example of the connection form which connects the microcomputer which performs serial communication using the serial communication control method which concerns on this invention, and a semiconductor memory card. 本発明に係るシリアル通信制御方法を用いてシリアル通信を行うマイクロコンピュータと半導体メモリカードとを接続する接続形態の第2の具体例を示した模式図である。It is the schematic diagram which showed the 2nd specific example of the connection form which connects the microcomputer which performs serial communication using the serial communication control method which concerns on this invention, and a semiconductor memory card. 同期式シリアル通信インターフェースを介して転送されるデータ波形の具体例を示した波形図である。It is the wave form diagram which showed the specific example of the data waveform transferred via a synchronous serial communication interface. Xビットの連続データ転送によって転送されるデータ波形を示した波形図である。It is a wave form diagram which showed the data waveform transferred by X bit continuous data transfer. 同期式シリアル通信インターフェースから汎用入出力ポートへの切り替えを行う際に、データ線に接続されている夫々の出力バッファの状態がどのように変化するかを示した模式図である。It is the schematic diagram which showed how the state of each output buffer connected to a data line changes, when switching from a synchronous serial communication interface to a general purpose input / output port. 同期式シリアル通信インターフェースから汎用入出力ポートへの切り替えを行う際に、データ線に接続されている夫々の出力バッファの状態がどのように変化するかを示した模式図である。It is the schematic diagram which showed how the state of each output buffer connected to a data line changes, when switching from a synchronous serial communication interface to a general purpose input / output port. 同期式シリアル通信インターフェースから汎用入出力ポートへの切り替えを行う際に、データ線に接続されている夫々の出力バッファの状態がどのように変化するかを示した模式図である。It is the schematic diagram which showed how the state of each output buffer connected to a data line changes, when switching from a synchronous serial communication interface to a general purpose input / output port. 図4の波形図のうちの、同期式シリアル通信インターフェースから汎用入出力ポートへの切り替え部分を拡大したものを下段に示し、上段には比較例としてクロック線をプルアップもプルダウンもしていない場合を示した波形図である。In the waveform diagram of FIG. 4, the lower part shows an enlarged part of switching from the synchronous serial communication interface to the general-purpose input / output port. The upper part shows a case where the clock line is not pulled up or pulled down as a comparative example. It is the shown waveform diagram. マイクロコンピュータが、メモリースティック(「メモリースティック」はソニー株式会社の商標である)と呼ばれている半導体メモリカードとの間でデータ通信を行う場合の、両者間の接続形態の具体例を示した模式図である。Schematic diagram showing a specific example of the connection between the two when a microcomputer performs data communication with a semiconductor memory card called a Memory Stick ("Memory Stick" is a trademark of Sony Corporation) It is. 図7の接続形態においてシリアル通信制御を行う際の、クロック線、データ線、及び制御線上の波形を示した波形図である。FIG. 8 is a waveform diagram showing waveforms on a clock line, a data line, and a control line when performing serial communication control in the connection form of FIG. 7.

符号の説明Explanation of symbols

10……マイクロコンピュータ、12……半導体メモリカード、14……クロック線、16……データ線、18……中央処理部(CPU)、20……同期式シリアル通信インターフェース、22……汎用入出力ポート、24……クロック入出力端子、26……データ入出力端子、26a……データ入力端子、26b……データ出力端子、32……クロック入力端子、34……シリアルデータ入出力端子、42……受信バッファ、44……出力バッファ、46……受信バッファ、48……出力バッファ、50……データ入出力回路、52……出力バッファ、54……受信バッファ、56……制御端子、58……制御線。   DESCRIPTION OF SYMBOLS 10 ... Microcomputer, 12 ... Semiconductor memory card, 14 ... Clock line, 16 ... Data line, 18 ... Central processing part (CPU), 20 ... Synchronous serial communication interface, 22 ... General-purpose input / output Port 24, clock input / output terminal 26, data input / output terminal 26 a, data input terminal 26 b, data output terminal 32, clock input terminal 34, serial data input / output terminal 42,. ... Reception buffer, 44 ... Output buffer, 46 ... Reception buffer, 48 ... Output buffer, 50 ... Data input / output circuit, 52 ... Output buffer, 54 ... Reception buffer, 56 ... Control terminal, 58 ... ... control line.

Claims (12)

中央処理部(CPU)と、クロック入出力端子及びデータ入出力端子を有し前記CPUによってトリガされハードウェアフロー制御により所定ビット数を単位として高速シリアル通信を行う同期式シリアル通信インターフェースと、複数の端子を有し前記CPUによって1ビットずつの入出力制御が可能な汎用入出力ポートとを備えたマイクロコンピュータと、クロック入力端子及びシリアルデータ入出力端子を有する半導体メモリカードとの間の、シリアル通信方式によるデータ通信を制御するためのシリアル通信制御方法において、
前記マイクロコンピュータと前記半導体メモリカードとを接続するためのクロック線及びデータ線を用意し、
前記同期式シリアル通信インターフェースの前記クロック入出力端子を前記クロック線に接続し、前記同期式シリアル通信インターフェースの前記データ入出力端子を前記データ線に接続し、
前記汎用入出力ポートの前記複数の端子のうちの第1端子を前記クロック線に接続し、
前記半導体メモリカードの前記クロック入力端子を前記クロック線に接続し、前記半導体メモリカードの前記シリアルデータ入出力端子を前記データ線に接続し、
前記CPUが実行するコンピュータプログラムにより構成される通信切り替え手段が、前記同期式シリアル通信インターフェースの前記クロック入出力端子からのクロック出力と、前記汎用入出力ポートの前記第1端子からのクロック出力との間で、クロック出力元切り替えを行うようにする、
ことを特徴とするシリアル通信制御方法。
A central processing unit (CPU), a synchronous serial communication interface that has a clock input / output terminal and a data input / output terminal, is triggered by the CPU, and performs high-speed serial communication in units of a predetermined number of bits by hardware flow control; Serial communication between a microcomputer having a general-purpose input / output port having a terminal and capable of input / output control bit by bit by the CPU, and a semiconductor memory card having a clock input terminal and a serial data input / output terminal In a serial communication control method for controlling data communication by a method,
Preparing a clock line and a data line for connecting the microcomputer and the semiconductor memory card;
Connecting the clock input / output terminal of the synchronous serial communication interface to the clock line; connecting the data input / output terminal of the synchronous serial communication interface to the data line;
Connecting a first terminal of the plurality of terminals of the general-purpose input / output port to the clock line;
Connecting the clock input terminal of the semiconductor memory card to the clock line; connecting the serial data input / output terminal of the semiconductor memory card to the data line;
A communication switching unit configured by a computer program executed by the CPU includes a clock output from the clock input / output terminal of the synchronous serial communication interface and a clock output from the first terminal of the general-purpose input / output port. Switch the clock output source between
And a serial communication control method.
前記クロック線をプルアップまたはプルダウンしておき、
前記通信切り替え手段が、前記クロック出力元切り替えに際して、前記同期式シリアル通信インターフェースの前記クロック入出力端子からのクロック出力と、前記汎用入出力ポートの前記第1端子からのクロック出力とが同時に有効状態にならぬようにし、それら2つのクロック出力が共に無効状態にあるときには、前記クロック線がプルアップまたはプルダウンされた状態にあるようにする、
ことを特徴とする請求項1記載のシリアル通信制御方法。
Pull up or pull down the clock line,
When the communication switching means switches the clock output source, the clock output from the clock input / output terminal of the synchronous serial communication interface and the clock output from the first terminal of the general-purpose input / output port are simultaneously enabled. And when the two clock outputs are both in an invalid state, the clock line is in a pulled up or pulled down state.
The serial communication control method according to claim 1.
前記汎用入出力ポートの前記複数の端子のうちの第2端子を前記データ線に接続し、
前記通信切り替え手段が、前記クロック元出力切り替えに際して、前記同期式シリアル通信インターフェースの前記データ入出力端子と、前記汎用入出力ポートの前記第2端子との間で、前記半導体メモリカードとの間のデータ転送に使用する端子を切り替える、データ端子切り替えを行うようにする、
ことを特徴とする請求項1記載のシリアル通信制御方法。
A second terminal of the plurality of terminals of the general-purpose input / output port is connected to the data line;
The communication switching means, when switching the clock source output, between the data input / output terminal of the synchronous serial communication interface and the second terminal of the general-purpose input / output port, between the semiconductor memory card Switch the terminal used for data transfer, switch the data terminal,
The serial communication control method according to claim 1.
前記データ線をプルアップまたはプルダウンしておき、
前記通信切り替え手段が、前記データ端子切り替えに際して、前記同期式シリアル通信インターフェースの前記データ入出力端子からのデータビット出力と、前記汎用入出力ポートの前記第2端子からのデータビット出力とが同時に有効状態にならぬようにし、それら2つのデータビット出力が共に無効状態にあるときには、前記データ線がプルアップまたはプルダウンされた状態にあるようにする、
ことを特徴とする請求項3記載のシリアル通信制御方法。
Pull up or pull down the data line,
When the communication switching means switches the data terminal, the data bit output from the data input / output terminal of the synchronous serial communication interface and the data bit output from the second terminal of the general-purpose input / output port are simultaneously effective. The data line is in a pulled up or pulled down state when both of these two data bit outputs are in an invalid state.
The serial communication control method according to claim 3.
連続する複数のデータビットから成る1つの通信メッセージを前記マイクロコンピュータと前記半導体メモリカードとの間で通信しているときに、前記通信切り替え手段が前記クロック出力元切り替え及び前記データ端子切り替えを行うことで、前記同期式シリアル通信インターフェースの前記クロック入出力端子から前記クロック線上へ出力される前記所定ビット数を単位とするクロック出力により制御される前記所定ビット数を単位とするデータ転送と、前記汎用入出力ポートの前記第1端子から前記クロック線上へ出力されるクロック出力により制御されるデータ転送との間で、データ転送切り替えを行うようにすることを特徴とする請求項3記載のシリアル通信制御方法。   The communication switching means performs the clock output source switching and the data terminal switching when a communication message composed of a plurality of continuous data bits is communicated between the microcomputer and the semiconductor memory card. The data transfer in units of the predetermined number of bits controlled by the clock output in units of the predetermined number of bits output from the clock input / output terminal of the synchronous serial communication interface to the clock line, and the general purpose 4. The serial communication control according to claim 3, wherein data transfer switching is performed between data transfer controlled by a clock output output from the first terminal of the input / output port onto the clock line. Method. 前記半導体メモリカードが制御端子を有し、
前記マイクロコンピュータと前記半導体メモリカードとを接続するための制御線を用意し、
前記汎用入出力ポートの前記複数の端子のうちの第2端子を前記制御線に接続し、
前記半導体メモリカードの前記制御端子を前記制御線に接続し、
前記通信切り替え手段が、前記汎用入出力ポートの前記第2端子から前記制御線上へ出力された制御出力を前記半導体メモリカードに読み取らせるときには前記汎用入出力ポートの前記第1端子からクロック出力を送出させ、前記同期式シリアル通信インターフェースの前記データ入出力端子と前記半導体メモリカードの前記データ入出力端子との間のデータ転送を行わせるときには前記同期式シリアル通信インターフェースの前記クロック入出力端子からクロック出力を送出させるようにする、
ことを特徴とする請求項1記載のシリアル通信制御方法。
The semiconductor memory card has a control terminal;
Prepare a control line for connecting the microcomputer and the semiconductor memory card,
A second terminal of the plurality of terminals of the general-purpose input / output port is connected to the control line;
Connecting the control terminal of the semiconductor memory card to the control line;
When the communication switching means causes the semiconductor memory card to read a control output output from the second terminal of the general-purpose input / output port onto the control line, a clock output is transmitted from the first terminal of the general-purpose input / output port. When the data transfer between the data input / output terminal of the synchronous serial communication interface and the data input / output terminal of the semiconductor memory card is performed, the clock output from the clock input / output terminal of the synchronous serial communication interface To send
The serial communication control method according to claim 1.
前記半導体メモリカードの通信プロトコルが、前記制御端子を介して受信する制御出力と、前記データ入出力端子を介して受信する連続する複数のデータビットとの組合せによって構成されるコマンドを使用しており、
前記通信切り替え手段が、前記クロック出力切り替えを行うことで、前記コマンドを前記半導体メモリカードに読み取らせる、
ことを特徴とする請求項6記載のシリアル通信制御方法。
The communication protocol of the semiconductor memory card uses a command composed of a combination of a control output received via the control terminal and a plurality of consecutive data bits received via the data input / output terminal. ,
The communication switching means causes the semiconductor memory card to read the command by performing the clock output switching.
The serial communication control method according to claim 6.
前記マイクロコンピュータは、オーディオプレーヤに装備されており、
前記半導体メモリカードには、オーディオデータが格納されている、
前記マイクロコンピュータは、前記半導体メモリカードから読み出した前記オーディオデータに処理を施して音響を再生する、
ことを特徴とする請求項1記載のシリアル通信制御方法。
The microcomputer is equipped in an audio player,
Audio data is stored in the semiconductor memory card,
The microcomputer performs processing on the audio data read from the semiconductor memory card to reproduce sound,
The serial communication control method according to claim 1.
中央処理部(CPU)と、クロック入出力端子及びデータ入出力端子を有し前記CPUによってトリガされハードウェアフロー制御により所定ビット数を単位として高速シリアル通信を行う同期式シリアル通信インターフェースと、複数の端子を有し前記CPUによって1ビットずつの入出力制御が可能な汎用入出力ポートとを備えたマイクロコンピュータと、クロック入力端子及びシリアルデータ入出力端子を有する半導体メモリカードとの間の、シリアル通信方式によるデータ通信を制御するためのシリアル通信制御方法において、
前記マイクロコンピュータと前記半導体メモリカードとを接続するためのクロック線及びデータ線を用意し、
前記同期式シリアル通信インターフェースの前記クロック入出力端子を前記クロック線に接続し、前記同期式シリアル通信インターフェースの前記データ入出力端子を前記データ線に接続し、
前記汎用入出力ポートの前記複数の端子のうちの第1端子を前記クロック線に接続し、前記汎用入出力ポートの前記複数の端子のうちの第2端子を前記データ線に接続し、
前記半導体メモリカードの前記クロック入力端子を前記クロック線に接続し、前記半導体メモリカードの前記シリアルデータ入出力端子を前記データ線に接続し、
前記CPUが実行するコンピュータプログラムにより構成される通信切り替え手段が、前記マイクロコンピュータと前記半導体メモリカードとの間で1つの通信メッセージを通信しているときに、前記同期式シリアル通信インターフェースによる前記所定ビット数を単位としたデータ転送と、前記汎用入出力ポートによるデータ転送との間で切り替えを行い、それによって、前記同期式シリアル通信インターフェースを介して転送される前記所定ビット数の整数倍のビット数から成るデータビット列と、前記汎用入出力ポートを介して転送されるデータビット列または単一データビットとで、その1つの通信メッセージが構成されるようにする、
ことを特徴とするシリアル通信制御方法。
A central processing unit (CPU), a synchronous serial communication interface that has a clock input / output terminal and a data input / output terminal, is triggered by the CPU, and performs high-speed serial communication in units of a predetermined number of bits by hardware flow control; Serial communication between a microcomputer having a general-purpose input / output port having a terminal and capable of input / output control bit by bit by the CPU, and a semiconductor memory card having a clock input terminal and a serial data input / output terminal In a serial communication control method for controlling data communication by a method,
Preparing a clock line and a data line for connecting the microcomputer and the semiconductor memory card;
Connecting the clock input / output terminal of the synchronous serial communication interface to the clock line; connecting the data input / output terminal of the synchronous serial communication interface to the data line;
A first terminal of the plurality of terminals of the general-purpose input / output port is connected to the clock line; a second terminal of the plurality of terminals of the general-purpose input / output port is connected to the data line;
Connecting the clock input terminal of the semiconductor memory card to the clock line; connecting the serial data input / output terminal of the semiconductor memory card to the data line;
When the communication switching means configured by a computer program executed by the CPU is communicating one communication message between the microcomputer and the semiconductor memory card, the predetermined bit by the synchronous serial communication interface Switching between data transfer in units of numbers and data transfer by the general-purpose input / output port, whereby the number of bits that is an integral multiple of the predetermined number of bits transferred via the synchronous serial communication interface A single communication message is composed of a data bit string comprising: a data bit string or a single data bit transferred via the general-purpose input / output port;
And a serial communication control method.
前記クロック線をプルアップまたはプルダウンしておき、
前記通信切り替え手段が、前記切り替えに際して、前記同期式シリアル通信インターフェースの前記クロック入出力端子からのクロック出力と、前記汎用入出力ポートの前記第1端子からのクロック出力とが同時に有効状態にならぬようにし、それら2つのクロック出力が共に無効状態にあるときには、前記クロック線がプルアップまたはプルダウンされた状態にあるようにする、
ことを特徴とする請求項9記載のシリアル通信制御方法。
Pull up or pull down the clock line,
When the communication switching means performs the switching, the clock output from the clock input / output terminal of the synchronous serial communication interface and the clock output from the first terminal of the general-purpose input / output port do not become valid simultaneously. And when the two clock outputs are both in an invalid state, the clock line is in a pulled up or pulled down state.
The serial communication control method according to claim 9.
前記データ線をプルアップまたはプルダウンしておき、
前記通信切り替え手段が、前記切り替えに際して、前記同期式シリアル通信インターフェースの前記データ入出力端子からのデータビット出力と、前記汎用入出力ポートの前記第2端子からのデータビット出力とが同時に有効状態にならぬようにし、それら2つのデータビット出力が共に無効状態にあるときには、前記データ線がプルアップまたはプルダウンされた状態にあるようにする、
ことを特徴とする請求項9記載のシリアル通信制御方法。
Pull up or pull down the data line,
When the communication switching means switches, the data bit output from the data input / output terminal of the synchronous serial communication interface and the data bit output from the second terminal of the general-purpose input / output port are simultaneously enabled at the time of switching. And when the two data bit outputs are both in an invalid state, the data line is in a pulled up or pulled down state.
The serial communication control method according to claim 9.
前記マイクロコンピュータは、オーディオプレーヤに装備されており、
前記半導体メモリカードには、オーディオデータが格納されている、
前記マイクロコンピュータは、前記半導体メモリカードから読み出した前記オーディオデータに処理を施して音響を再生する、
ことを特徴とする請求項9記載のシリアル通信制御方法。
The microcomputer is equipped in an audio player,
Audio data is stored in the semiconductor memory card,
The microcomputer performs processing on the audio data read from the semiconductor memory card to reproduce sound.
The serial communication control method according to claim 9.
JP2004171274A 2004-06-09 2004-06-09 Serial communication control method between microcomputer and semiconductor memory card Abandoned JP2005352658A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004171274A JP2005352658A (en) 2004-06-09 2004-06-09 Serial communication control method between microcomputer and semiconductor memory card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004171274A JP2005352658A (en) 2004-06-09 2004-06-09 Serial communication control method between microcomputer and semiconductor memory card

Publications (1)

Publication Number Publication Date
JP2005352658A true JP2005352658A (en) 2005-12-22

Family

ID=35587112

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004171274A Abandoned JP2005352658A (en) 2004-06-09 2004-06-09 Serial communication control method between microcomputer and semiconductor memory card

Country Status (1)

Country Link
JP (1) JP2005352658A (en)

Similar Documents

Publication Publication Date Title
US10007628B2 (en) Dynamically adjustable multi-line bus shared by multi-protocol devices
US7095247B1 (en) Configuring FPGAs and the like using one or more serial memory devices
US20180046595A1 (en) Dynamically adjustable multi-line bus shared by multi-protocol devices
EP3218813B1 (en) Multi-channel i2s transmit control system and method
US20110289243A1 (en) Communication control device, data communication method and program
CN104991876B (en) A kind of serial bus control method and device
CN110765058A (en) Method, system, equipment and medium for realizing SPI slave function by GPIO
CN101770443A (en) Time sequence adjusting method for internal IC (integrated circuit) bus, corresponding device and system thereof
CN1326057C (en) Bus system and bus interface for connection to a bus
JP2007011788A (en) Memory card and its host device
US20150195211A1 (en) Low-voltage differential signaling or 2-wire differential link with symbol transition clocking
KR100474221B1 (en) Data transfer control device, electronic equipment, and data transfer control method
US9880895B2 (en) Serial interface with bit-level acknowledgement and error correction
US20070250652A1 (en) High speed dual-wire communications device requiring no passive pullup components
JP5332428B2 (en) Level shift circuit and method thereof
US20150074343A1 (en) Logic device
CN100367258C (en) Direct memory access controller and bus structure in master-slave system
US20090063736A1 (en) Low power digital interface
EP1820110B1 (en) Multimedia card interface method, computer program product and apparatus
CN115563049A (en) Method for implementing SPI sending mode assignment structure
JP2005352658A (en) Serial communication control method between microcomputer and semiconductor memory card
KR100423017B1 (en) Microcomputer
KR100424850B1 (en) System of Transferring Data Transmission Velocity
JP2003141062A (en) IIC bus control system
CN209911956U (en) Improved double-wire to single-wire conversion module and serial-port to single-wire communication circuit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070328

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090421

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090519

A762 Written abandonment of application

Free format text: JAPANESE INTERMEDIATE CODE: A762

Effective date: 20090824