JP6456649B2 - Electronic device apparatus and serial communication speed adjustment method - Google Patents

Electronic device apparatus and serial communication speed adjustment method Download PDF

Info

Publication number
JP6456649B2
JP6456649B2 JP2014208978A JP2014208978A JP6456649B2 JP 6456649 B2 JP6456649 B2 JP 6456649B2 JP 2014208978 A JP2014208978 A JP 2014208978A JP 2014208978 A JP2014208978 A JP 2014208978A JP 6456649 B2 JP6456649 B2 JP 6456649B2
Authority
JP
Japan
Prior art keywords
command
inversion
serial communication
unit
host device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2014208978A
Other languages
Japanese (ja)
Other versions
JP2016082298A (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.)
Nidec Sankyo Corp
Original Assignee
Nidec Sankyo 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 Nidec Sankyo Corp filed Critical Nidec Sankyo Corp
Priority to JP2014208978A priority Critical patent/JP6456649B2/en
Priority to CN201510652463.0A priority patent/CN105512062B/en
Publication of JP2016082298A publication Critical patent/JP2016082298A/en
Application granted granted Critical
Publication of JP6456649B2 publication Critical patent/JP6456649B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • G06F13/282Cycle stealing DMA

Description

本発明は、電子機器装置、及びシリアル通信速度調整方法に関する。   The present invention relates to an electronic apparatus device and a serial communication speed adjustment method.

従来、ATM(Automated Teller Machine)、入室管理システム、在庫管理システム等において、カード状媒体の挿入や排出、データの読み出しや書き込み等に用いられるカードリーダが存在する。
たとえば、特許文献1には、このようなカード状媒体用のカードリーダの例が記載されている。
Conventionally, in ATM (Automated Teller Machine), room entry management system, inventory management system, etc., there are card readers used for insertion and ejection of card-like media, data reading and writing, and the like.
For example, Patent Document 1 describes an example of a card reader for such a card-like medium.

ここで、特許文献1に記載されたようなカードリーダが上位装置とシリアル通信を行うためには、上位装置とカードリーダ間で同一のボーレートで通信を行う必要がある。一般的に、カードリーダ側では、外部接続の水晶振動子と回路を使った精度の高いクロック信号を用い、カードリーダ側のボーレートの精度を補うように構成されている。   Here, in order for a card reader as described in Patent Document 1 to perform serial communication with a host device, it is necessary to perform communication at the same baud rate between the host device and the card reader. Generally, the card reader side is configured to compensate for the accuracy of the baud rate on the card reader side by using a highly accurate clock signal using an externally connected crystal resonator and circuit.

特開2014−89574号公報JP 2014-89574 A

しかしながら、外部接続の水晶振動子を使用せず、CPU等の制御部に内蔵されるクロックで上位装置とシリアル通信を行った場合、うまく通信できない可能性があった。これは、制御部に内蔵されるクロック信号は温度変化等による変動が大きいためであった。   However, when an externally connected crystal resonator is not used and serial communication is performed with a host device using a clock incorporated in a control unit such as a CPU, communication may not be performed successfully. This is because the clock signal built in the control unit is largely fluctuated due to a temperature change or the like.

本発明は、このような状況に鑑みてなされたものであり、水晶振動子等を使った精度の高いクロック信号を使用しなくても上位装置との間で確実にシリアル通信可能な電子機器装置及びシリアル通信速度調整方法を提供することを目的とする。   The present invention has been made in view of such a situation, and an electronic apparatus device capable of reliably performing serial communication with a host device without using a highly accurate clock signal using a crystal resonator or the like. It is another object of the present invention to provide a serial communication speed adjustment method.

本発明の電子機器装置は、上位装置とシリアル通信可能に接続されており、前記シリアル通信により前記上位装置からコマンドを受信し、当該コマンドに対応した処理を実行する電子機器装置であって、前記シリアル通信により受信したデータの保存のタイミングに必要なクロック信号を生成するクロック生成部と、前記コマンドに含まれる特定コードに対応した反転間隔を、前記クロック生成部により生成された前記クロック信号で計測する反転間隔計測部と、該反転間隔計測部により計測された反転間隔に対応するよう、前記上位装置との通信速度を調整する通信速度調整部と、前記反転ビットの間隔により前記通信速度を調整した後、前記コマンドを解析して前記通信速度を更に補正するコマンド解析実行部とを備えることを特徴とする。
このように構成することで、水晶振動子等を使った精度の高いクロック信号を使用しなくても上位装置との間で確実にシリアル通信することが可能となる。
The electronic device of the present invention is connected to a host device so as to be capable of serial communication, receives a command from the host device through the serial communication, and executes processing corresponding to the command, A clock generation unit that generates a clock signal necessary for timing of storing data received by serial communication, and an inversion interval corresponding to a specific code included in the command is measured by the clock signal generated by the clock generation unit An inversion interval measuring unit that adjusts the communication speed with the host device so as to correspond to the inversion interval measured by the inversion interval measuring unit, and the communication speed is adjusted by the interval between the inversion bits. after, to anda command analyzing unit for further correcting the transmission rate by analyzing the command .
With this configuration, it is possible to reliably perform serial communication with a host device without using a highly accurate clock signal using a crystal resonator or the like.

本発明の電子機器装置は、前記シリアル通信により受信したデータをDMA(ダイレクト・メモリ・アクセス)で保存するバッファを備え、前記反転間隔計測部は、前記バッファに保存されたデータのビット列から前記特定コードに対応した反転間隔を計測し、前記コマンド解析実行部は、前記コマンドのデータ全体に相当する前記DMAのデータから、前記シリアル通信の1ビット分の変調周期に相当する前記クロック信号のカウント値を算出し、算出された値を、次コマンド受信時の補正値とすることを特徴とする。
このように構成することで、負荷をかけずに高速でデータ転送ができ、確実に受信データを取得でき、シリアル通信の速度を高精度に調整可能となる。
The electronic device of the present invention includes a buffer that stores data received by the serial communication by DMA (Direct Memory Access), and the inversion interval measurement unit is configured to identify the specific data from a bit string of the data stored in the buffer. The inversion interval corresponding to the code is measured, and the command analysis execution unit calculates the count value of the clock signal corresponding to the modulation period for one bit of the serial communication from the DMA data corresponding to the entire command data. And the calculated value is used as a correction value when the next command is received .
With this configuration, data can be transferred at high speed without applying a load, received data can be reliably acquired, and the serial communication speed can be adjusted with high accuracy.

本発明の電子機器装置は、前記特定コードは、スタートビットを含む第一の反転ビット列の長さと、その後の第二の反転ビット列の長さとが特定の比となるよう設定され、前記反転間隔計測部は、前記特定の比となる反転ビットの列として前記第一の反転ビット列及び前記第二の反転ビット列を特定し、特定された前記第一の反転ビット列及び前記第二の反転ビット列の前記クロック信号のカウント値を算出して前記反転間隔を計測することを特徴とする。
このように構成することで、シリアル通信の受信データから容易に特定コードを検出できる。
In the electronic device according to the present invention, the specific code is set so that a length of a first inverted bit string including a start bit and a length of a second inverted bit string after that is a specific ratio, and the inversion interval measurement The unit specifies the first inverted bit string and the second inverted bit string as the inverted bit string having the specific ratio, and the clock of the specified first inverted bit string and the second inverted bit string is specified. The inversion interval is measured by calculating a count value of the signal.
With this configuration, the specific code can be easily detected from the serial communication reception data.

本発明の電子機器装置は、前記上位装置からの前記コマンドを受信し、読み取り又は書き込みするカード状媒体に対して、前記コマンドに対応する特定の処理を実行するカードリーダであることを特徴とする。
このように構成することで、特定の処理を安全に行うことができる。
The electronic device of the present invention is a card reader that receives the command from the host device and executes a specific process corresponding to the command on a card-like medium to be read or written. .
With this configuration, specific processing can be performed safely.

本発明の電子機器装置は、前記反転間隔計測部は、前記上位装置から前記コマンドを受信する度に、前記反転間隔を計測することを特徴とする。
このように構成することで、前回のコマンドの受信から時間が経過しクロック等が変動していても、確実に速度を調整してコマンドを受信することが可能となる。
The electronic device apparatus according to the present invention is characterized in that the inversion interval measuring unit measures the inversion interval every time the command is received from the host device.
With this configuration, even if time has elapsed since the previous command was received and the clock or the like has fluctuated, it is possible to reliably adjust the speed and receive the command.

本発明のシリアル通信速度調整方法は、上位装置とシリアル通信可能に接続されており、前記シリアル通信により前記上位装置からコマンドを受信し、当該コマンドに対応した処理を実行する電子機器装置により実行されるシリアル通信速度調整方法であって、前記コマンドに含まれる特定コードに対応した反転間隔を、内蔵されたクロック生成部により生成されたクロック信号で計測し、計測された反転間隔に対応するよう、前記上位装置との通信速度を調整し、前記反転ビットの間隔により前記通信速度を調整した後、前記コマンドを解析して前記通信速度を更に補正することを特徴とする。
このように構成することで、水晶振動子等を使った精度の高いクロック信号を使用しなくても上位装置との間で確実にシリアル通信することが可能となる。
The serial communication speed adjustment method of the present invention is connected to a host device so that serial communication is possible, and is executed by an electronic device that receives a command from the host device through the serial communication and executes processing corresponding to the command. A serial communication speed adjustment method, wherein an inversion interval corresponding to a specific code included in the command is measured with a clock signal generated by a built-in clock generation unit, and corresponds to the measured inversion interval. The communication speed with the host device is adjusted, the communication speed is adjusted according to the interval of the inverted bits, and then the command is analyzed to further correct the communication speed .
With this configuration, it is possible to reliably perform serial communication with a host device without using a highly accurate clock signal using a crystal resonator or the like.

本発明によれば、シリアル通信のコマンドに含まれる特定コードに対応した反転間隔を内蔵のクロック信号で計測することで、水晶振動子等を使った精度の高いクロック信号を使用しなくても上位装置との間で確実にシリアル通信可能となる電子機器装置及びシリアル通信速度調整方法を提供することができる。   According to the present invention, an inversion interval corresponding to a specific code included in a serial communication command is measured with a built-in clock signal, so that a high-order clock signal using a crystal resonator or the like is not used. It is possible to provide an electronic device device and a serial communication speed adjustment method that can reliably perform serial communication with the device.

本発明の実施の形態に係るカード制御システムのシステム構成図である。It is a system configuration figure of the card control system concerning an embodiment of the invention. 図1に示すカードリーダが実行するコマンド受信実行処理のフローチャートである。It is a flowchart of the command reception execution process which the card reader shown in FIG. 1 performs. 図2に示す反転間隔計測処理の概念図である。FIG. 3 is a conceptual diagram of inversion interval measurement processing shown in FIG. 2. 図2に示す反転間隔計測処理の概念図である。FIG. 3 is a conceptual diagram of inversion interval measurement processing shown in FIG. 2.

<実施の形態>
〔カード制御システムXの構成〕
図1を参照して、本発明の実施の形態に係るカード制御システムXの構成について説明する。本実施形態のカード制御システムXは、ATM、入室管理システム、在庫管理システム、入出車管理システム等(以下、「ATM等」という。)のカード状媒体3を利用するシステムである。
本実施形態のカード制御システムXは、カードリーダ1、上位装置2、カード状媒体3を含んで構成される。
<Embodiment>
[Configuration of Card Control System X]
With reference to FIG. 1, the structure of the card | curd control system X which concerns on embodiment of this invention is demonstrated. The card control system X of the present embodiment is a system that uses a card-like medium 3 such as an ATM, an entry management system, an inventory management system, an entry / exit management system (hereinafter referred to as “ATM etc.”).
The card control system X of the present embodiment includes a card reader 1, a host device 2, and a card-like medium 3.

カードリーダ1は、ATM等に内蔵されたカードリーダ装置である。カードリーダ1は、上位装置2と、例えば、調歩同期方式で半二重通信方式のシリアル通信で送受信が可能なように接続されている。これにより、カード状媒体3がカードリーダ1に挿入されると、カードリーダ1は、シリアル通信により上位装置2からコマンドを受信し、カード状媒体3に対して、当該コマンドに対応した特定の処理を実行する。   The card reader 1 is a card reader device built in an ATM or the like. The card reader 1 is connected to the host device 2 so that transmission / reception can be performed by serial communication using, for example, a start-stop synchronization method and a half-duplex communication method. Thus, when the card-like medium 3 is inserted into the card reader 1, the card reader 1 receives a command from the host device 2 by serial communication, and performs a specific process corresponding to the command on the card-like medium 3. Execute.

上位装置2は、ATM等の本体である。上位装置2は、カードリーダ1の電源の供給を制御する。また、上位装置2は、カードリーダ1に対してシリアル通信により各種コマンドを送信し、このコマンドの実行結果を受信する。   The host device 2 is a main body such as ATM. The host device 2 controls the power supply of the card reader 1. Further, the host device 2 transmits various commands to the card reader 1 by serial communication, and receives the execution results of these commands.

カード状媒体3は、磁気カードやICカードやRFID(Radio Frequency Identification)カード等の一時的でない記録媒体である。カード状媒体3は、クレジットカード、プリペイドカード、又はキャッシュカード等の金銭的な価値を示す価値情報、ID(Identification)コードのような固有情報等が記録されている。   The card-like medium 3 is a non-temporary recording medium such as a magnetic card, IC card, or RFID (Radio Frequency Identification) card. The card-like medium 3 is recorded with value information indicating a monetary value such as a credit card, prepaid card, or cash card, and unique information such as an ID (Identification) code.

また、カードリーダ1は、制御部10、主記憶部20、補助記憶部30、及びカード読取書込部40を含んでいる。   The card reader 1 includes a control unit 10, a main storage unit 20, an auxiliary storage unit 30, and a card reading / writing unit 40.

制御部10は、CPU(Central Processing Unit)、MPU(Micro Processing Unit)、DSP(Digital Signal Processor)、ASIC(Application Specific Integrated Circuit)等の制御演算手段である。
制御部10は、後述するように、クロック生成回路を内蔵しており、生成されたクロックを用いて、上位装置2との間でシリアル通信が可能である。
The control unit 10 is a control calculation means such as a CPU (Central Processing Unit), an MPU (Micro Processing Unit), a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit).
As will be described later, the control unit 10 has a built-in clock generation circuit and can perform serial communication with the host device 2 using the generated clock.

主記憶部20は、DRAM(Dynamic Random Access Memory)やSRAM(Static Random Access Memory)やMRAM(Magnetoresistive Random Access Memory)等の記録媒体である。
主記憶部20には、後述するように、各種バッファが確保され、当該バッファにデータが保存される。
The main storage unit 20 is a recording medium such as DRAM (Dynamic Random Access Memory), SRAM (Static Random Access Memory), or MRAM (Magnetoresistive Random Access Memory).
As will be described later, various buffers are secured in the main storage unit 20, and data is stored in the buffers.

補助記憶部30は、ROM(Read Only Memory)、フラッシュメモリ(Flash Memory)等の不揮発性の記録媒体である。
補助記憶部30には、カードリーダ1のファームウェア等の制御プログラムと各種データ等とが保存される。
The auxiliary storage unit 30 is a non-volatile recording medium such as a ROM (Read Only Memory) or a flash memory.
The auxiliary storage unit 30 stores a control program such as firmware of the card reader 1 and various data.

カード読取書込部40は、カード状媒体3を読み取り又は書き込むための磁気ヘッドや電磁誘導コイルやIC接続インターフェイスやRFID用アンテナ、カード状媒体3を挿入や排出するための駆動機構やセンサ、状態表示するためのLED(Light Emitting Diode)や液晶等の表示部が備えられている。また、カード読取書込部40に、カードリーダ1の初期設定や各種指示を行うためのディップスイッチやジャンパピンやスイッチ等の入力部が含まれていてもよい。   The card reading / writing unit 40 includes a magnetic head, an electromagnetic induction coil, an IC connection interface, an RFID antenna, a driving mechanism, a sensor, a state for inserting and ejecting the card-like medium 3, and a state for reading or writing the card-like medium 3 A display unit such as an LED (Light Emitting Diode) or a liquid crystal for display is provided. Further, the card reading / writing unit 40 may include an input unit such as a dip switch, a jumper pin, or a switch for performing initial setting of the card reader 1 and various instructions.

なお、制御部10、主記憶部20、及び補助記憶部30は、一体的に構成されたマイコン(Micro Controller)等であってもよい。   Note that the control unit 10, the main storage unit 20, and the auxiliary storage unit 30 may be an integrally configured microcomputer (micro controller) or the like.

より詳細に説明すると、制御部10は、クロック生成部100、反転間隔計測部110、通信速度調整部120、DMA部130(ダイレクト・メモリ・アクセス、Direct Memory Access)、及びコマンド解析実行部140を含んでいる。
また、主記憶部20は、DMAバッファ200(Buffer)、及びコマンドデータバッファ210の領域が確保される。
また、補助記憶部30は、ボーレート設定データ310を記憶する。
More specifically, the control unit 10 includes a clock generation unit 100, an inversion interval measurement unit 110, a communication speed adjustment unit 120, a DMA unit 130 (Direct Memory Access), and a command analysis execution unit 140. Contains.
In the main storage unit 20, areas for the DMA buffer 200 (Buffer) and the command data buffer 210 are secured.
In addition, the auxiliary storage unit 30 stores baud rate setting data 310.

クロック生成部100は、受信したデータの保存のタイミングに必要なクロック信号を生成する。クロック生成部100は、オンチップ・オシレータ等の発振回路から構成されるため、外部の水晶発振子等を接続する必要はない。また、クロック生成部100から生成されるクロック信号は、各部に必要なタイミングに合わせて特定の割合で分周されている。また、クロック生成部100により生成されるクロック信号の速度は、制御部10の温度や供給される電圧等により、既定の速度から特定の幅で変動してもよい。また、クロック生成部100は、制御部10の各種制御に必要なクロック信号を供給することも可能である。また、クロック生成部100により生成されたクロック信号により、各種タイミング計測用のソフトウェアタイマー等を設定することも可能である。   The clock generation unit 100 generates a clock signal necessary for timing of storing received data. Since the clock generation unit 100 includes an oscillation circuit such as an on-chip oscillator, it is not necessary to connect an external crystal oscillator or the like. Further, the clock signal generated from the clock generation unit 100 is divided at a specific ratio in accordance with the timing required for each unit. Further, the speed of the clock signal generated by the clock generation unit 100 may vary within a specific range from a predetermined speed depending on the temperature of the control unit 10, the supplied voltage, and the like. The clock generation unit 100 can also supply clock signals necessary for various controls of the control unit 10. It is also possible to set a software timer or the like for measuring various timings based on the clock signal generated by the clock generation unit 100.

反転間隔計測部110は、コマンドに含まれる特定コードに対応した反転ビットの間隔(以下、「反転間隔」という。)を、クロック生成部100により生成されたクロック信号により計測する。ここで、本実施形態においては、以下、シリアル通信の受信信号について、H(High)レベルである「1」のビットを「非反転ビット」、L(Low)レベルである「0」のビットを「反転ビット」と称する。また、以下において、反転間隔は、上位機器2からのシリアル通信の受信データの1ビット分に相当する変調周期に対応した、クロック生成部100により生成されたクロック信号のカウント値である。
具体的に説明すると、反転間隔計測部110は、主記憶部20に記憶されたDMAバッファ200のDMAデータ500のビット列から、特定コードに対応する反転ビットのビット列を検索する。反転間隔計測部110は、この反転ビットのビット列の長さ、すなわちクロック信号のカウント値を算出し、これを用いて反転間隔を求める。
The inversion interval measurement unit 110 measures the inversion bit interval (hereinafter referred to as “inversion interval”) corresponding to the specific code included in the command, using the clock signal generated by the clock generation unit 100. Here, in the present embodiment, for the serial communication received signal, the “1” bit that is H (High) level is set to “non-inverted bit” and the “0” bit that is L (Low) level is set. This is called “inverted bit”. In the following description, the inversion interval is a count value of a clock signal generated by the clock generation unit 100 corresponding to a modulation period corresponding to one bit of serial communication received data from the host device 2.
Specifically, the inversion interval measurement unit 110 searches the bit string of the inversion bit corresponding to the specific code from the bit string of the DMA data 500 of the DMA buffer 200 stored in the main storage unit 20. The inversion interval measuring unit 110 calculates the bit string length of the inversion bits, that is, the count value of the clock signal, and uses this to determine the inversion interval.

より具体的に説明すると、反転間隔計測部110は、特定コードに対応する第一の反転ビット列及び第二の反転ビット列を特定し、特定された第一の反転ビット列及び第二の反転ビット列についてクロック信号のカウント値を算出して反転間隔を計測する。ここで、本実施形態において、特定コードは、コマンドにおけるテキスト開始用の符号である。このテキスト開始用の符号には、スタートビットを含む第一の反転ビット列の長さと、その後の第二の反転ビット列の長さとが特定の比となるビット列が含まれる。このため、反転間隔計測部110は、DMAバッファ200に保存されたDMAデータ500から、連続する反転ビットの長さがこの特定の比であるようなビット列を特定コードとして検索し、検索された特定コードの第一の反転ビット列及び第二の反転ビット列のクロック信号のカウント値を算出し、反転間隔を計測する。本実施形態において、反転間隔計測部110は、特定コードの1ビット分となる1クロック信号を単位として、反転間隔を算出する。   More specifically, the inversion interval measurement unit 110 specifies the first inversion bit string and the second inversion bit string corresponding to the specific code, and clocks the specified first inversion bit string and the second inversion bit string. The count value of the signal is calculated and the inversion interval is measured. Here, in the present embodiment, the specific code is a code for starting text in the command. The code for starting text includes a bit string having a specific ratio between the length of the first inverted bit string including the start bit and the length of the second inverted bit string thereafter. For this reason, the inversion interval measurement unit 110 searches the DMA data 500 stored in the DMA buffer 200 for a bit string in which the length of successive inversion bits has this specific ratio as a specific code, The count values of the clock signals of the first inverted bit string and the second inverted bit string of the code are calculated, and the inversion interval is measured. In the present embodiment, the inversion interval measurement unit 110 calculates the inversion interval in units of one clock signal that is one bit of the specific code.

また、反転間隔計測部110は、上位装置2からコマンドを受信する毎に、反転間隔を計測する。反転間隔計測部110は、例えば、上位装置2によりカードリーダ1に電源を供給された直後のコマンドの受信時、待機状態からの復帰時のコマンドの受信時等に、毎回、反転間隔を計測する。   The inversion interval measurement unit 110 measures the inversion interval every time a command is received from the host device 2. The inversion interval measuring unit 110 measures the inversion interval every time, for example, when receiving a command immediately after power is supplied to the card reader 1 by the host device 2 or when receiving a command when returning from the standby state. .

通信速度調整部120は、カードリーダ1から上位装置2への通信速度を上位装置2の通信速度に一致させるために、反転間隔計測部110により計測された反転間隔に基づいて、カードリーダ1から上位装置2への通信ボーレート(通信速度)を調整する。
具体的に説明すると、通信速度調整部120は、反転間隔計測部110により算出された反転間隔を、ボーレートに対応する値として、補助記憶部30のボーレート設定データ310に保存する。この保存されたボーレートに対応するクロック信号のカウント値は、反転間隔に対応して通信速度を調整した値となる。
The communication speed adjustment unit 120 is connected to the card reader 1 based on the inversion interval measured by the inversion interval measurement unit 110 in order to match the communication speed from the card reader 1 to the upper device 2 with the communication speed of the upper device 2. The communication baud rate (communication speed) to the host device 2 is adjusted.
More specifically, the communication speed adjustment unit 120 stores the inversion interval calculated by the inversion interval measurement unit 110 in the baud rate setting data 310 of the auxiliary storage unit 30 as a value corresponding to the baud rate. The count value of the clock signal corresponding to the stored baud rate is a value obtained by adjusting the communication speed corresponding to the inversion interval.

DMA部130は、DMAの制御を行う内蔵のDMAコントローラである。DMA部130は、上位装置2からの転送開始信号により、DMA機能を用いてシリアル信号の受信ライン(RxD)の周期データを受信し、受信されたデータを、直接、DMAデータ500として専用のDMAバッファ200に保存する。
なお、制御部10は、後述するように、DMA部130を備えないような構成であってもよい。また、制御部10とは別に、DMAコントローラを別途備えるような構成であってもよい。
The DMA unit 130 is a built-in DMA controller that performs DMA control. The DMA unit 130 receives the periodic data of the serial signal reception line (RxD) using the DMA function in response to the transfer start signal from the higher-level device 2, and directly receives the received data as DMA data 500 as a dedicated DMA. Save to buffer 200.
The control unit 10 may be configured not to include the DMA unit 130, as will be described later. Further, a configuration in which a DMA controller is provided separately from the control unit 10 may be employed.

コマンド解析実行部140は、コマンドを解析し、解析されたコマンドに対応する特定の処理を実行する。コマンド解析実行部140は、通信速度調整部120により調整された速度で、DMAバッファ200のDMAデータ500からコマンドを解析する。このコマンドは、カードリーダ1の初期化、ステータス(状態情報)の取得や表示、カード状媒体3の挿入や排出、カード状媒体3のデータの読み込みや書き出し、ファームウェアの更新等の特定の処理の指示が含まれるデータである。また、コマンドデータ510には、カードリーダ1のファームウェアのプログラムやデータ等が含まれていてもよい。
コマンド解析実行部140は、コマンドの実行の結果を、シリアル信号の送信ライン(TxD)により、上位装置2に送信する。
The command analysis execution unit 140 analyzes the command and executes specific processing corresponding to the analyzed command. The command analysis execution unit 140 analyzes a command from the DMA data 500 in the DMA buffer 200 at the speed adjusted by the communication speed adjustment unit 120. This command is used for specific processing such as initialization of the card reader 1, acquisition and display of status (status information), insertion and ejection of the card-like medium 3, reading and writing of data on the card-like medium 3, and updating of firmware. Data that includes instructions. Further, the command data 510 may include a firmware program or data of the card reader 1.
The command analysis execution unit 140 transmits the execution result of the command to the higher-level device 2 through the serial signal transmission line (TxD).

DMAバッファ200は、DMA部130により受信されたDMAデータ500が保存される専用のバッファである。このDMAデータ500は、クロック生成部100で生成されたクロック信号に基づいたサンプリング速度でサンプリングされたビット列となる。また、このDMAデータ500のサンプリング速度は、シリアル通信のボーレートを調整するために必要な速度であり、例えば、上位装置2と通信可能なシリアル通信の規定のボーレートの数倍以上の速度である。
なお、DMAデータ500は、クロック信号により作成されたリアルタイムタイマによる、特定の周期で取得されたビット列であってもよい。
The DMA buffer 200 is a dedicated buffer in which the DMA data 500 received by the DMA unit 130 is stored. The DMA data 500 is a bit string sampled at a sampling rate based on the clock signal generated by the clock generation unit 100. The sampling speed of the DMA data 500 is a speed necessary for adjusting the baud rate of serial communication, and is, for example, a speed that is several times the specified baud rate of serial communication that can communicate with the host device 2.
The DMA data 500 may be a bit string acquired at a specific cycle by a real-time timer created by a clock signal.

コマンドデータバッファ210は、DMAデータ500から解析されたコマンドデータ510を保存するためのバッファである。
コマンドデータ510は、コマンド解析実行部140によりDMAバッファ200に保存されたDMAデータ500から、ボーレート設定データ310に設定されたボーレートに対応する値であるクロック信号のカウント値をサンプリング間隔として用いて読み出されたデータである。
The command data buffer 210 is a buffer for storing command data 510 analyzed from the DMA data 500.
The command data 510 is read from the DMA data 500 stored in the DMA buffer 200 by the command analysis execution unit 140 using the clock signal count value corresponding to the baud rate set in the baud rate setting data 310 as a sampling interval. This is the data that was issued.

ボーレート設定データ310は、シリアル通信のボーレートに関するデータである。ボーレート設定データ310には、上位装置2のボーレートに対応して算出されたクロック信号のカウント値が含まれている。このクロック信号のカウント値は、RS−232C等のシリアル通信で規定されたボーレートに対応する値、又は反転間隔に対応して通信速度を調整した値、次コマンド受信時の補正値等である。   The baud rate setting data 310 is data related to the baud rate of serial communication. The baud rate setting data 310 includes the count value of the clock signal calculated corresponding to the baud rate of the higher-level device 2. The count value of the clock signal is a value corresponding to a baud rate defined by serial communication such as RS-232C, a value obtained by adjusting a communication speed corresponding to an inversion interval, a correction value when the next command is received, or the like.

また、ボーレート設定データ310には、電源投入直後に上位装置2から送信された最初のコマンド(以下、「初回コマンド」という。)を受信する際のボーレートのデフォルト値を含んでいる。たとえば、このボーレートのデフォルト値は、ファームウェアにより設定され、又は入力部のディップスイッチやジャンパピンの組み合わせ等を読み込んで設定される。このボーレートのデフォルト値は、工場出荷時の初期値として、例えば、9,600bps〜115.2Kbpsのような、RS−232Cで規定された特定値が設定される。   Further, the baud rate setting data 310 includes a default value of the baud rate when receiving the first command (hereinafter referred to as “first command”) transmitted from the host apparatus 2 immediately after the power is turned on. For example, the default value of the baud rate is set by firmware, or is set by reading a dip switch or jumper pin combination of the input unit. As the default value of the baud rate, a specific value defined by RS-232C, such as 9,600 bps to 115.2 Kbps, is set as an initial value at the time of factory shipment.

なお、反転間隔計測部110、通信速度調整部120、及びコマンド解析実行部140は、補助記憶部30については、記憶された制御プログラム(図示せず)を主記憶部20に展開し、制御部10が実行することで、各部の機能を実現することが可能である。また、その他の各部は、回路のハードウェアとして実現される。   The inversion interval measurement unit 110, the communication speed adjustment unit 120, and the command analysis execution unit 140 develop a stored control program (not shown) in the main storage unit 20 for the auxiliary storage unit 30, and The functions of each unit can be realized by executing the process 10. The other units are realized as circuit hardware.

〔カードリーダ1によるコマンド受信実行処理〕
次に、図2〜図4により、本発明の実施の形態に係るコマンド実行処理について説明する。
本実施形態のコマンド受信実行処理では、上位装置2からのコマンド受信を開始し、シリアル通信の速度を調整し、ボーレートの補正をしてコマンドの実行結果を応答する。ここで、上述したように、上位装置2とカードリーダ1は、シリアル送受信にて接続されている。カードリーダ1は、上位装置2から送信された受信データから反転間隔を測定し、カードリーダ1自身が上位装置2に対してデータを送信する際のボーレートを上位装置2と同じになるよう設定する。また、この補正は、上位装置2からのシリアル通信のコマンドの受信毎に実行する。その後、カードリーダ1は、受信したコマンドに対応した特定の処理を開始し、通信速度の最終的な補正を行って、コマンドの実行結果を上位機器2に応答する。
[Command reception execution processing by the card reader 1]
Next, a command execution process according to the embodiment of the present invention will be described with reference to FIGS.
In the command reception execution process of this embodiment, command reception from the host device 2 is started, the serial communication speed is adjusted, the baud rate is corrected, and the command execution result is returned. Here, as described above, the host device 2 and the card reader 1 are connected by serial transmission / reception. The card reader 1 measures the inversion interval from the received data transmitted from the host device 2 and sets the baud rate when the card reader 1 itself transmits data to the host device 2 to be the same as that of the host device 2. . This correction is executed every time a serial communication command is received from the host device 2. Thereafter, the card reader 1 starts specific processing corresponding to the received command, performs final correction of the communication speed, and responds to the host device 2 with the execution result of the command.

本実施形態のコマンド受信実行処理は、主に制御部10が、記憶媒体に記憶された制御プログラム(図示せず)を、各部と協働し、ハードウェア資源を用いて実行する。これにより、本実施形態のシリアル通信速度調整方法、及びシリアル通信速度調整プログラムの処理を実現することができる。
以下で、図2のフローチャートにより、本実施形態のコマンド受信実行処理の詳細をステップ毎に説明する。
In the command reception execution processing of this embodiment, the control unit 10 mainly executes a control program (not shown) stored in a storage medium using hardware resources in cooperation with each unit. As a result, the serial communication speed adjustment method and the serial communication speed adjustment program of this embodiment can be realized.
The details of the command reception execution process of this embodiment will be described step by step with reference to the flowchart of FIG.

(ステップS101)
まず、DMA部130が、シリアル通信スタート処理を行う。
DMA部130は、上位装置2よりシリアル通信でデータが送信されると、RxD信号の反転間隔を、DMA機能を用いてDMAバッファ200へDMAデータ500として保存する。
(Step S101)
First, the DMA unit 130 performs serial communication start processing.
When data is transmitted from the host device 2 by serial communication, the DMA unit 130 stores the inversion interval of the RxD signal as DMA data 500 in the DMA buffer 200 using the DMA function.

(ステップS102)
次に、コマンド解析実行部140が、解析されたコマンドデータ510に整合性があったか否かを判定する。
(Step S102)
Next, the command analysis execution unit 140 determines whether or not the analyzed command data 510 is consistent.

まず、コマンド解析実行部140は、このDMAバッファ200のDMAデータ500を、コマンドに変換し、コマンドデータバッファ210に保存する。コマンド解析実行部140は、この際、補助記憶部30からボーレート設定データ310を読み出す。コマンド解析実行部140は、ボーレート設定データ310に設定されたクロック信号のカウント値をサンプリング間隔としてDMAデータ500を読み出し、コマンドデータ510に変換する。この際に、クロック信号のカウント値として、電源投入直後の初回コマンド受信時には、特定のデフォルト値に対応した値を算出して使用する。また、コマンド解析実行部140は、二回目以降には、後述するステップS110でボーレート設定データ310にセットされた値をカウント値として使用する。つまり、二回目以降、コマンド解析実行部140は、直前のコマンドの受信の際に補正された値、後述する「次コマンド受信時の補正値」をカウント値として使用する。   First, the command analysis execution unit 140 converts the DMA data 500 in the DMA buffer 200 into a command and stores it in the command data buffer 210. At this time, the command analysis execution unit 140 reads the baud rate setting data 310 from the auxiliary storage unit 30. The command analysis execution unit 140 reads the DMA data 500 using the count value of the clock signal set in the baud rate setting data 310 as a sampling interval, and converts it into command data 510. At this time, as a count value of the clock signal, a value corresponding to a specific default value is calculated and used when the first command is received immediately after the power is turned on. Further, after the second time, the command analysis execution unit 140 uses the value set in the baud rate setting data 310 in step S110 described later as the count value. That is, after the second time, the command analysis execution unit 140 uses the value corrected when the immediately previous command is received, “correction value when receiving the next command”, which will be described later, as the count value.

この上で、コマンド解析実行部140は、コマンドデータバッファ210に保存されたコマンドデータ510について、パリティチェック、電文途切れのチェック、CRC(Cyclic Redundancy Check)等により、データの整合性を検査する。
コマンド解析実行部140は、コマンドデータ510の整合性があった場合に、Yesと判定する。コマンド解析実行部140は、それ以外の場合には、Noと判定する。
Yesの場合、コマンド解析実行部140は、処理をステップS108に進める。
Noの場合、コマンド解析実行部140は、処理をステップS103に進める。
Then, the command analysis execution unit 140 checks the data consistency of the command data 510 stored in the command data buffer 210 by a parity check, a message break check, a CRC (Cyclic Redundancy Check), or the like.
The command analysis execution unit 140 determines Yes when the command data 510 is consistent. The command analysis execution unit 140 determines No in other cases.
In the case of Yes, the command analysis execution unit 140 proceeds with the process to step S108.
In No, the command analysis execution part 140 advances a process to step S103.

(ステップS103)
コマンドデータ510に整合性がなかった場合、コマンド解析実行部140が、初回コマンドであったか否かを判定する。コマンド解析実行部140は、解析されたコマンドデータ510が、初回コマンドであった場合に、Yesと判定する。コマンド解析実行部140は、それ以外の場合、つまり、二回目以降のコマンドであった場合は、Noと判定する。
Yesの場合、コマンド解析実行部140は、処理をステップS104に進める。
Noの場合、コマンド解析実行部140は、処理をステップS107に進める。
(Step S103)
If the command data 510 is not consistent, the command analysis execution unit 140 determines whether the command is the first command. The command analysis execution unit 140 determines Yes when the analyzed command data 510 is the first command. In other cases, that is, in the case of the second and subsequent commands, the command analysis execution unit 140 determines No.
In the case of Yes, the command analysis execution unit 140 proceeds with the process to step S104.
In No, command analysis execution part 140 advances a process to Step S107.

(ステップS104)
初回コマンドであった場合、反転間隔計測部110が、反転間隔計測処理を行う。
反転間隔計測部110は、DMAバッファ200に保存されたDMAデータ500から特定コードに体操した反転間隔を計測する。
(Step S104)
If it is the first command, the inversion interval measurement unit 110 performs inversion interval measurement processing.
The inversion interval measurement unit 110 measures the inversion interval in which a specific code is manipulated from the DMA data 500 stored in the DMA buffer 200.

図3(a)は、この特定コードとして、例えば、コマンドのテキスト開始符号である「STX」のコードである「0xF2」のビット列を使用する例を示している。シリアル通信のデータは、1ビットのスタートビット、8ビットのデータビット、1ビットのストップビット、1ビットのパリティビットを単位とする、計10ビットを単位で伝送される。この際に、スタートビットは、必ず「0」、ストップビットは必ず「1」となる。また、データビットであるB0〜B7は、最下位ビット(LSB)から最上位ビット(MSB)に向けて順に伝送される。   FIG. 3A shows an example in which a bit string “0xF2” that is a code of “STX” that is a text start code of a command is used as the specific code. Serial communication data is transmitted in units of a total of 10 bits, with 1 start bit, 8 data bits, 1 stop bit, and 1 parity bit as units. At this time, the start bit is always “0” and the stop bit is always “1”. Data bits B0 to B7 are sequentially transmitted from the least significant bit (LSB) to the most significant bit (MSB).

このため、特定コードが「0xF2」の場合、第一の反転ビット列である「00」、非反転ビット列「1」、その後の第二の反転ビット列である「00」、その後の非反転ビット列「1111」、ストップビットの「1」、最後にパリティビットが送信される。よって、この例の場合、第一の反転ビット列の長さT0と、その後の第二の反転ビット列の長さT2とが等しくなる、つまり、1:1の特定の比となる。   For this reason, when the specific code is “0xF2”, the first inverted bit string “00”, the non-inverted bit string “1”, the subsequent second inverted bit string “00”, and the subsequent non-inverted bit string “1111” ", Stop bit" 1 ", and finally a parity bit. Therefore, in this example, the length T0 of the first inverted bit string is equal to the length T2 of the second inverted bit string thereafter, that is, a specific ratio of 1: 1.

図3(b)は、DMAバッファ200に保存されたDMAデータ500において、T0:T2=1:1のデータの例である。反転間隔計測部110は、このように、T0:T1=1:1となる箇所のビット列を検索して、第一の反転ビット列と第二の反転ビット列として特定する。反転間隔計測部110は、特定された第一の反転ビット列と第二の反転ビット列から、特定コードの1ビット分となるクロック信号のカウント値である反転間隔を算出する。図3(b)の例の場合、反転間隔計測部110は、反転間隔=(T0の長さ+T2の長さ)/4、として算出する。この例では、T0の長さ=6、T2の長さ=6であるので、反転間隔=3(周期)と算出する。   FIG. 3B shows an example of T0: T2 = 1: 1 data in the DMA data 500 stored in the DMA buffer 200. As described above, the inversion interval measurement unit 110 searches for a bit string at a location where T0: T1 = 1: 1, and specifies the first inversion bit string and the second inversion bit string. The inversion interval measurement unit 110 calculates an inversion interval, which is a count value of the clock signal corresponding to one bit of the specific code, from the specified first inversion bit sequence and second inversion bit sequence. In the case of the example of FIG. 3B, the inversion interval measurement unit 110 calculates as inversion interval = (length of T0 + length of T2) / 4. In this example, since the length of T0 = 6 and the length of T2 = 6, the inversion interval = 3 (period) is calculated.

なお、反転間隔計測部110は、反転間隔の算出の際に、T1の長さも用いてもよい。この場合、反転間隔計測部110は、反転間隔=(T0の長さ×2+T1の長さ+T2の長さ×2)/5、のような式で算出することが可能である。また、DMAバッファ200に保存されたDMAデータ500は、実際には、誤差が少なくなる程度に細かくサンプリングされていてもよい。   The inversion interval measurement unit 110 may also use the length of T1 when calculating the inversion interval. In this case, the inversion interval measurement unit 110 can calculate the inversion interval = (T0 length × 2 + T1 length + T2 length × 2) / 5. In addition, the DMA data 500 stored in the DMA buffer 200 may actually be sampled fine enough to reduce the error.

(ステップS105)
次に、通信速度調整部120が、通信速度調整処理を行う。
通信速度調整部120は、反転間隔計測部110により計測された反転間隔に対応するよう、上位装置2との通信速度を調整する。具体的には、通信速度調整部120は、計測された反転間隔を、補助記憶部30のボーレート設定データ310に保存する。これにより、上位装置2との通信速度を調整することが可能になる。
上述の図3(b)の例においては、通信速度調整部120は、反転間隔が3(周期)であるので、これをボーレート設定データ310に、通信速度が調整された値として設定する。
(Step S105)
Next, the communication speed adjustment unit 120 performs communication speed adjustment processing.
The communication speed adjustment unit 120 adjusts the communication speed with the host device 2 so as to correspond to the inversion interval measured by the inversion interval measurement unit 110. Specifically, the communication speed adjustment unit 120 stores the measured inversion interval in the baud rate setting data 310 of the auxiliary storage unit 30. Thereby, it becomes possible to adjust the communication speed with the high-order apparatus 2. FIG.
In the example of FIG. 3B described above, the communication speed adjustment unit 120 sets the inversion interval to 3 (cycle), and sets this in the baud rate setting data 310 as a value adjusted for the communication speed.

このように構成することで、通信速度調整部120は、9,600bpsや38,400bps、115,200bps、といった固定値のボーレートを設定する必要がなくなる。また、温度変動等でクロック信号の速度の変動が起こっても、上位装置2と同じボーレートが保たれ、シリアル通信が可能な状態を維持できる。   With this configuration, the communication speed adjustment unit 120 does not need to set a fixed baud rate such as 9,600 bps, 38,400 bps, 115,200 bps. Even when the speed of the clock signal fluctuates due to temperature fluctuation or the like, the same baud rate as that of the host device 2 is maintained, and a state where serial communication is possible can be maintained.

(ステップS106)
次に、コマンド解析実行部140が、データ復調ができるか否かを判定する。
コマンド解析実行部140は、調整された通信速度で、DMAバッファ200に保存されたDMAデータ500から、コマンドデータ510への復調を試みる。つまり、コマンド解析実行部140は、DMAバッファ200に保存されたDMAデータ500を、ボーレート設定データ310に設定されたクロック信号のカウント値の間隔でサンプリングし直して、改めてコマンドデータ510に変換する。
(Step S106)
Next, the command analysis execution unit 140 determines whether data demodulation is possible.
The command analysis execution unit 140 attempts to demodulate the command data 510 from the DMA data 500 stored in the DMA buffer 200 at the adjusted communication speed. That is, the command analysis execution unit 140 resamples the DMA data 500 stored in the DMA buffer 200 at the interval of the count value of the clock signal set in the baud rate setting data 310 and converts it to the command data 510 again.

コマンド解析実行部140は、変換されたコマンドデータ510について、上述のステップS102と同様に整合性を検査する。上述の図3(b)の例では、コマンド解析実行部140が、DMAデータ500を3(周期)で読み出して、コマンドデータ510に変換した場合の整合性を検査する。コマンド解析実行部140は、整合性があった場合には、Yesと判定する。コマンド解析実行部140は、整合性がなかった場合には、Noと判定する。
Yesの場合、コマンド解析実行部140は、処理をステップS108に進める。
Noの場合、コマンド解析実行部140は、復調できなかったとして、処理をステップS101に戻して、上位装置2からの再度のコマンド送信を待つ。
The command analysis execution unit 140 checks the consistency of the converted command data 510 as in step S102 described above. In the example of FIG. 3B described above, the command analysis execution unit 140 checks the consistency when the DMA data 500 is read at 3 (cycle) and converted into the command data 510. The command analysis execution unit 140 determines Yes when there is consistency. The command analysis execution unit 140 determines No when there is no consistency.
In the case of Yes, the command analysis execution unit 140 proceeds with the process to step S108.
In the case of No, the command analysis execution unit 140 returns the process to step S101 and waits for another command transmission from the host device 2 because it cannot be demodulated.

(ステップS107)
二回目以降のコマンドであった場合、コマンド解析実行部140が、NAK応答処理を行う。
カードリーダ1の電源供給又は待機状態からの初回のコマンドではなく、二回目以降のコマンドである場合は、機器の故障、ノイズの混入、及び不正操作等による通信エラーの可能性がある。
このため、コマンド解析実行部140は、否定応答符号の「NAK」のコードである「0x15」等を、送信ラインのTxDにより上位装置2へ応答する。
その後、コマンド解析実行部140は、処理をステップS101に戻す。
(Step S107)
In the case of the second and subsequent commands, the command analysis execution unit 140 performs NAK response processing.
If the command is not the first command from the power supply or standby state of the card reader 1 but the command from the second time onward, there is a possibility of a communication error due to equipment failure, noise contamination, unauthorized operation, or the like.
For this reason, the command analysis execution unit 140 responds “0x15”, which is the code of the negative response code “NAK”, to the higher-level device 2 by TxD of the transmission line.
Thereafter, the command analysis execution unit 140 returns the process to step S101.

(ステップS108)
ここで、コマンドデータ510に整合性があった場合、コマンド解析実行部140が、ACK応答処理を行う。
図4によると、カードリーダ1のコマンド解析実行部140は、上位装置2に対して、肯定応答符号の「ACK」のコードである「0x06」等を、TxDにより上位装置2へ応答する。
(Step S108)
If the command data 510 is consistent, the command analysis execution unit 140 performs ACK response processing.
According to FIG. 4, the command analysis execution unit 140 of the card reader 1 responds to the higher order apparatus 2 with “0x06”, which is the code of the acknowledgment code “ACK”, to the higher order apparatus 2 by TxD.

(ステップS109)
次に、コマンド解析実行部140が、コマンド対応処理を行う。
コマンド解析実行部140は、コマンドデータバッファ210に保存されたコマンドデータ510を解釈し、コマンドに対応する特定の処理を実行開始する。たとえば、コマンド解析実行部140は、カード読取書込部40に対してカード状媒体3の挿入、排出、読み込み、若しくは書き込み等の指示を行う。また、例えば、コマンド解析実行部140は、カードリーダ1自体の状態読み出し、若しくはファームウェア更新等の処理を実行する。
(Step S109)
Next, the command analysis execution unit 140 performs command response processing.
The command analysis execution unit 140 interprets the command data 510 stored in the command data buffer 210 and starts executing a specific process corresponding to the command. For example, the command analysis execution unit 140 instructs the card reading / writing unit 40 to insert, eject, read, or write the card-like medium 3. Further, for example, the command analysis execution unit 140 executes processing such as status reading of the card reader 1 itself or firmware update.

(ステップS110)
次に、コマンド解析実行部140が、通信速度補正処理を行う。
コマンド解析実行部140は、コマンドを受信した際にDMA部130により記憶されたDMAバッファ200に保存されたDMAデータ500により、通信速度を補正する。コマンド解析実行部140は、コマンドデータ510として解釈された全てのDMAデータ500に対応するクロック信号のカウント値(長さ)を、コマンドデータ510の全ビット数で割り、コマンドデータ510の1ビット分に対応するクロック信号のカウント値を算出する。つまり、コマンド解析実行部140は、コマンドデータ510全体に相当するDMAデータ500から、シリアル通信の1ビット分の変調周期に相当するクロック信号のカウント値を算出する。コマンド解析実行部140は、この算出された値を、次コマンド受信時の補正値として、ボーレート設定データ310に設定する。
(Step S110)
Next, the command analysis execution unit 140 performs communication speed correction processing.
The command analysis execution unit 140 corrects the communication speed based on the DMA data 500 stored in the DMA buffer 200 stored by the DMA unit 130 when the command is received. The command analysis execution unit 140 divides the count value (length) of the clock signal corresponding to all the DMA data 500 interpreted as the command data 510 by the total number of bits of the command data 510, and outputs one bit of the command data 510. The count value of the clock signal corresponding to is calculated. That is, the command analysis execution unit 140 calculates the count value of the clock signal corresponding to the modulation period for one bit of serial communication from the DMA data 500 corresponding to the entire command data 510. The command analysis execution unit 140 sets the calculated value in the baud rate setting data 310 as a correction value when the next command is received.

このように構成し、一旦、反転間隔により通信速度を調整した後、コマンドを解析して更に補正することで、より高精度に上位装置2との間の通信速度を調整することが可能となる。これにより、上位装置2から、制御部10が熱等の変動が少ない時間で次回のコマンドが送信された際に、より解析しやすくなる可能性を高めることができる。よって、コマンドに対する特定の処理の実行までの待ち時間等を減らす効果が期待できる。   With this configuration, once the communication speed is adjusted by the inversion interval, the command is analyzed and further corrected, so that the communication speed with the host device 2 can be adjusted with higher accuracy. . As a result, when the next command is transmitted from the host device 2 in the time when the control unit 10 has a small fluctuation in heat or the like, it is possible to increase the possibility of easier analysis. Therefore, the effect of reducing the waiting time until execution of a specific process for the command can be expected.

(ステップS111)
次に、コマンド解析実行部140が、コマンド結果応答処理を行う。
図4によると、コマンド解析実行部140は、コマンドの実行が終了した後、上述の算出された平均値で補正されたボーレートにより、コマンドの実行結果の応答(レスポンス)を上位装置2へ送信する。
(Step S111)
Next, the command analysis execution unit 140 performs command result response processing.
According to FIG. 4, after the command execution is completed, the command analysis execution unit 140 transmits a response (response) of the command execution result to the higher-level device 2 at the baud rate corrected with the calculated average value. .

これに対して、上位装置2が、ACKの応答をカードリーダ1に対して応答する。
その後、コマンド解析実行部140は、処理をステップS101に戻し、再び上位装置2からコマンドが送信されるまで待機状態になる。
なお、カードリーダ1の待機状態が特定の時間より長く続いた場合、上位装置2は、カードリーダ1への電源供給を停止してもよい。
以上により、本発明の実施の形態に係るコマンド受信実行処理の説明を終了する。
In response to this, the host device 2 responds to the card reader 1 with an ACK response.
Thereafter, the command analysis execution unit 140 returns the process to step S101 and enters a standby state until a command is transmitted from the higher-level device 2 again.
Note that when the standby state of the card reader 1 continues longer than a specific time, the host device 2 may stop supplying power to the card reader 1.
This is the end of the description of the command reception execution process according to the embodiment of the present invention.

〔本実施形態の主な効果〕
以上のように構成することで、以下のような効果を得ることができる。
本発明の実施の形態に係るカードリーダ1は、上位装置2とシリアル通信で接続されており、シリアル通信により上位装置からコマンドを受信し、当該コマンドに対応した処理を実行する電子機器装置であって、シリアル通信により受信したデータの保存のタイミングに必要なクロック信号を生成するクロック生成部100と、コマンドに含まれる特定コードに対応した反転間隔を、クロック生成部100により生成されたクロック信号で計測する反転間隔計測部110と、反転間隔計測部110により計測された反転間隔に対応するよう、上位装置との通信速度を調整する通信速度調整部120とを備えることを特徴とする。
[Main effects of this embodiment]
With the configuration described above, the following effects can be obtained.
A card reader 1 according to an embodiment of the present invention is an electronic device that is connected to a host device 2 through serial communication, receives a command from the host device through serial communication, and executes processing corresponding to the command. The clock generation unit 100 that generates a clock signal necessary for the timing of storing data received by serial communication, and the inversion interval corresponding to the specific code included in the command are represented by the clock signal generated by the clock generation unit 100. A reversing interval measuring unit 110 for measuring and a communication speed adjusting unit 120 for adjusting a communication speed with a host device so as to correspond to the reversing interval measured by the reversing interval measuring unit 110 are provided.

つまり、本実施形態のカードリーダ1は、上位装置2からのシリアル信号ライン(RxD信号)の受信データから、カードリーダ1自身の制御部10のクロック信号により、ボーレートに対応する値を算出する。
このように構成することで、制御部10の温度変化等によるカードリーダ1の制御部10のクロック信号の変動が生じても、上位装置2との間で確実にシリアル通信することができる。この結果、カードリーダ1及び上位装置2において、回路構成上、精度の高いクロック信号を発生する、外部の水晶発信子を含む回路を使用しないことが可能となる。また、外部の水晶発信子を含む回路よりも、内蔵クロックの精度が高くない安価な制御部10を用いることも可能となる。よって、システム全体のコスト削減効果を期待できる。
That is, the card reader 1 of the present embodiment calculates a value corresponding to the baud rate from the received data of the serial signal line (RxD signal) from the host device 2 by the clock signal of the control unit 10 of the card reader 1 itself.
With this configuration, even if the clock signal of the control unit 10 of the card reader 1 fluctuates due to a temperature change of the control unit 10 or the like, serial communication can be reliably performed with the host device 2. As a result, the card reader 1 and the host device 2 can avoid using a circuit including an external crystal oscillator that generates a highly accurate clock signal in terms of circuit configuration. In addition, it is possible to use an inexpensive control unit 10 in which the accuracy of the built-in clock is not higher than that of a circuit including an external crystal oscillator. Therefore, the cost reduction effect of the whole system can be expected.

また、カードリーダ1は、規定のボーレートで通信する必要がなく、上位装置2からのDMAデータ500に基づいてボーレートを設定し通信することが可能になる。つまり、上位装置2からのDMAデータ500に基づいて、カードリーダ1のシリアル通信のボーレートを設定可能な仕組みを実現することができる。これにより、上位装置2がRS−232C規格等の規定のボーレートを使用していなかったり、ボーレートがコマンド送信の度に変更されることがあったりするような構成でも、確実にシリアル通信を行うことができる。   Further, the card reader 1 does not need to communicate at a prescribed baud rate, and can communicate by setting a baud rate based on the DMA data 500 from the higher-level device 2. That is, based on the DMA data 500 from the higher-level device 2, it is possible to realize a mechanism that can set the serial communication baud rate of the card reader 1. As a result, serial communication can be reliably performed even in a configuration in which the host device 2 does not use a prescribed baud rate such as the RS-232C standard or the baud rate is changed every time a command is transmitted. Can do.

また、外部接続の水晶振動子は、コストが高いという問題があった。本実施形態のカードリーダ1は、外部接続の水晶振動子を使用しないため製造コストを低減することができる。   In addition, the externally connected crystal resonator has a problem of high cost. Since the card reader 1 according to the present embodiment does not use an externally connected crystal resonator, the manufacturing cost can be reduced.

なお、カードリーダ1は、通常、上位装置2に内蔵されており、金銭的な価値を扱うカード状媒体3の処理を行う。よって、上位装置2とのシリアル通信において速度を調整した上で、上位装置2との処理を実行することで、カードリーダ1と上位装置2との間のデータ通信を解読されにくくすることができる。このため、結果として、カード状媒体3のカード情報のスキミングやハッキング等の可能性を減らすことができ、セキュリティを向上させられる。   The card reader 1 is usually built in the host device 2 and processes the card-like medium 3 that handles monetary value. Therefore, the data communication between the card reader 1 and the host device 2 can be made difficult to be decoded by executing the processing with the host device 2 after adjusting the speed in the serial communication with the host device 2. . For this reason, as a result, the possibility of skimming or hacking of card information of the card-like medium 3 can be reduced, and security can be improved.

また、本発明の実施の形態に係るカードリーダ1は、シリアル通信のコマンドをDMA(ダイレクト・メモリ・アクセス)で保存するバッファを備え、反転間隔計測部110は、DMAバッファ200に保存されたDMAデータ500のビット列から特定コードに対応した反転間隔を計測することを特徴とする。   The card reader 1 according to the embodiment of the present invention includes a buffer for storing serial communication commands by DMA (Direct Memory Access), and the inversion interval measuring unit 110 includes a DMA stored in the DMA buffer 200. The inversion interval corresponding to the specific code is measured from the bit string of the data 500.

このように構成することで、上位装置2が115,200bps等の高速なボーレートで送信してきた場合でも、制御部10に負荷をかけずに高速でデータ転送ができ、確実にシリアル通信のDMAデータ500を取得できる。また、制御部10が動作するクロックの速度に制限がなく、通信速度の調整を行うことが可能になる。また、制御部10が直接DMAデータ500を取得するのと比べて、DMAデータ500をサンプリングする際の誤差が少なくなるため、より確実にクロック信号の周期を算出可能となり、高精度な速度の調整や補正が可能となる。   With this configuration, even when the host device 2 transmits at a high baud rate of 115, 200 bps or the like, data can be transferred at high speed without imposing a load on the control unit 10, and DMA data for serial communication can be reliably transmitted. 500 can be acquired. Further, there is no limitation on the clock speed at which the control unit 10 operates, and the communication speed can be adjusted. Further, since the error in sampling the DMA data 500 is reduced compared to the case where the control unit 10 directly acquires the DMA data 500, the clock signal cycle can be calculated more reliably and the speed can be adjusted with high accuracy. And correction becomes possible.

また、本発明の実施の形態に係るカードリーダ1は、特定コードが、スタートビットを含む第一の反転ビット列の長さと、その後の第二の反転ビット列の長さとが特定の比となるよう設定され、反転間隔計測部110は、特定の比となる反転ビットの列として第一の反転ビット列及び第二の反転ビット列を特定し、特定された第一の反転ビット列及び第二の反転ビット列のクロック信号のカウント値を算出して反転間隔を計測することを特徴とする。
このように構成することで、シリアル通信のDMAデータ500から容易に特定コードを検出でき、確実に反転間隔を計測し、通信速度を調整することができる。
In the card reader 1 according to the embodiment of the present invention, the specific code is set so that the length of the first inverted bit string including the start bit and the length of the subsequent second inverted bit string have a specific ratio. The inversion interval measuring unit 110 identifies the first inversion bit sequence and the second inversion bit sequence as the inversion bit sequence having a specific ratio, and the identified first inversion bit sequence and second inversion bit sequence are clocks. The counter value is measured by calculating the count value of the signal.
With this configuration, the specific code can be easily detected from the serial communication DMA data 500, the inversion interval can be reliably measured, and the communication speed can be adjusted.

また、本発明の実施の形態に係るカードリーダ1は、上位装置2からのコマンドを受信し、読み取り又は書き込みするカード状媒体3に対して、コマンドに対応する特定の処理を実行することを特徴とする。
このように構成することで、上位装置2からのコマンドをカードリーダ1が確実に受信して、カード状媒体3に対する特定の処理を確実に行うことができる。
The card reader 1 according to the embodiment of the present invention receives a command from the host device 2 and executes a specific process corresponding to the command on the card-like medium 3 to be read or written. And
With this configuration, the card reader 1 can reliably receive a command from the higher-level device 2, and specific processing for the card-like medium 3 can be reliably performed.

また、本発明の実施の形態に係るカードリーダ1は、反転間隔計測部110が、上位装置2からコマンドを受信する度に、反転間隔を計測することを特徴とする。
このように構成することで、コマンド受信の度に速度を調整するため、前回のコマンド受信から時間が経過して制御部10のクロック等が変動していても、確実に上位装置2からのコマンドデータ510を受信することが可能となる。カードリーダ1にカード状媒体3が挿入されて特定の処理が実行され、次に他のカード状媒体3が挿入されるまで、通常は、数分〜数時間、時間が経過する。このため、毎回、反転間隔を計測することで、より確実に通信速度を調整できる。
The card reader 1 according to the embodiment of the present invention is characterized in that the inversion interval measurement unit 110 measures the inversion interval every time a command is received from the host device 2.
With this configuration, the speed is adjusted each time a command is received. Therefore, even if the clock of the control unit 10 fluctuates after a lapse of time from the previous command reception, the command from the higher-level device 2 can be surely received. Data 510 can be received. Usually, several minutes to several hours pass until the card-like medium 3 is inserted into the card reader 1 and a specific process is executed, and then another card-like medium 3 is inserted. For this reason, the communication speed can be adjusted more reliably by measuring the inversion interval each time.

〔他の実施の形態〕
なお、上述の実施形態においては、カード制御システムXにおいて、上位装置2との間の受信データにより、カードリーダ1と上位装置2との間のシリアル通信のボーレートの調整について説明した。
しかしながら、カードリーダ1は、制御部10のクロック生成部100のクロック信号を用いたソフトウェアタイマーを生成し、定期的なセンサ状態の監視やLED点滅制御などの用途に使用している。このため、上位装置2からの通信速度が既に設定されている場合、調整されたボーレート設定データ310に基づいて、ソフトウェアタイマーの時間を補正することが可能である。
これにより、制御部10のクロック信号の変動等にかかわらずソフトウェアタイマーの時間を補正でき、センサ状態の監視やLED点滅制御等の動作が確実になる。
[Other Embodiments]
In the above-described embodiment, the adjustment of the baud rate of the serial communication between the card reader 1 and the higher-level device 2 in the card control system X based on the received data between the higher-level device 2 has been described.
However, the card reader 1 generates a software timer using the clock signal of the clock generation unit 100 of the control unit 10 and uses it for purposes such as periodic sensor state monitoring and LED blinking control. For this reason, when the communication speed from the host device 2 has already been set, it is possible to correct the time of the software timer based on the adjusted baud rate setting data 310.
As a result, the time of the software timer can be corrected regardless of fluctuations in the clock signal of the control unit 10, and operations such as sensor state monitoring and LED blinking control are ensured.

また、上述の実施形態においては、上位装置2からカードリーダ1へのシリアル信号ライン(RxD信号)からのDMAデータ500の取得に、制御部10に内蔵されたDMA部130の機能を用いる例について説明した。
しかしながら、例えば、クロック速度が25MHz程度の制御部10を用いても、ボーレート38,400bps程度の速度であれば、このDMAを使用せずに、PIO(Programmed I/O)でDMAデータ500を取得することが十分に可能である。このため、例えば、ボーレートの上限が38,400bpsまでの通信仕様のカードリーダ1であれば、DMA機能を用いずにボーレートの自動補正をしてもよい。
これにより、DMA機能のない制御部10を使用可能となり、コストを削減できる。
Further, in the above-described embodiment, an example in which the function of the DMA unit 130 built in the control unit 10 is used to acquire the DMA data 500 from the serial signal line (RxD signal) from the host device 2 to the card reader 1. explained.
However, for example, even if the control unit 10 having a clock speed of about 25 MHz is used, if the baud rate is about 38,400 bps, the DMA data 500 is acquired by PIO (Programmed I / O) without using this DMA. It is possible enough to do. For this reason, for example, if the card reader 1 has a communication specification with an upper limit of the baud rate of 38,400 bps, the baud rate may be automatically corrected without using the DMA function.
As a result, the control unit 10 without the DMA function can be used, and the cost can be reduced.

また、上述の実施形態においては、通信速度を調整するための反転間隔としてコマンドデータ510の1ビット分に対応するクロック信号のカウント値を算出して使用した。
しかしながら、このように、クロック信号のカウント値を直接用いずに、ボーレートの設定を行うことも可能である。たとえば、クロック信号のカウント値から、規定のボーレートと、この規定のボーレートからのずれを算出して、これを上位機器2との通信速度の調整に用いてもよい。
In the above-described embodiment, the count value of the clock signal corresponding to one bit of the command data 510 is calculated and used as the inversion interval for adjusting the communication speed.
However, it is possible to set the baud rate without directly using the count value of the clock signal. For example, a prescribed baud rate and a deviation from this prescribed baud rate may be calculated from the count value of the clock signal, and this may be used for adjusting the communication speed with the host device 2.

この場合、通信速度調整部120は、9,600bpsや38,400bps、115,200bpsといったRS−232Cのシリアル通信の固定値のボーレートと一番近い値を選択し、これとの「ずれ」の値をオフセット値として算出する。たとえば、DMAデータ500のサンプリングの既定のビットレート(bps)が338kbpsで、1ビット分の反転間隔となるクロック信号のカウント値が「3」であった場合、反転間隔の時間は約8.68μsとなるため、ボーレートを115,200bpsと算出する。通信速度調整部120は、主記憶部20に選択されたボーレートとオフセット値とを保存し、これらを用いて、上位装置2との通信速度を調整する。   In this case, the communication speed adjustment unit 120 selects a value closest to the baud rate of the fixed value of RS-232C serial communication such as 9,600 bps, 38,400 bps, 115,200 bps, and the value of “deviation” from this value. Is calculated as an offset value. For example, when the predetermined bit rate (bps) of sampling of the DMA data 500 is 338 kbps and the count value of the clock signal that is the inversion interval for 1 bit is “3”, the inversion interval time is about 8.68 μs. Therefore, the baud rate is calculated as 115,200 bps. The communication speed adjustment unit 120 stores the selected baud rate and offset value in the main storage unit 20, and uses these to adjust the communication speed with the host device 2.

このように構成することで、上位装置2やカードリーダ1に設定されたボーレートとのずれを容易に算出できる。このため、上述のソフトウェアタイマーの設定や、他の各部のタイミング調整を行いやすくなる。   With this configuration, it is possible to easily calculate a deviation from the baud rate set in the host device 2 or the card reader 1. For this reason, it becomes easy to perform the setting of the above-mentioned software timer and the timing adjustment of each other part.

また、上述の実施の形態では、カード制御システムXについて、シリアル通信の速度調整を行う例について説明した。
これに対して、上位装置2とのシリアル通信を実行する電子機器であれば、本実施形態の速度調整方法と同様に速度調整を行うことが可能である。また、RS−232C以外の特定コードを使用するシリアル通信にも適用することが可能である。
このように構成することで、各種電子機器のシリアル通信の調整に係る処理時間やコストを削減することができる。
In the above-described embodiment, an example in which the speed of serial communication is adjusted for the card control system X has been described.
In contrast, any electronic device that performs serial communication with the host device 2 can perform speed adjustment in the same manner as the speed adjustment method of the present embodiment. Further, the present invention can also be applied to serial communication using a specific code other than RS-232C.
With this configuration, it is possible to reduce processing time and cost related to adjustment of serial communication of various electronic devices.

また、上述の実施の形態では、第一の反転ビット列の長さと、その後の第二の反転ビット列の長さとが1:1になる特定コードを使用する例について記載した。しかしながら、特定コードとして、これらの長さが1:n(任意倍)となるような特定コードを使用してもよい。また、特定コードとして、特定のパターンとなるようなデータを使用し、このパターンを検出するようにしてもよい。
このように構成することで、シリアル通信の信号の特性に合わせて確実な通信時間の調整が可能となる。
In the above-described embodiment, an example in which the specific code in which the length of the first inverted bit string and the length of the second inverted bit string thereafter is 1: 1 is described. However, a specific code whose length is 1: n (arbitrary multiple) may be used as the specific code. Further, as the specific code, data that has a specific pattern may be used to detect this pattern.
With this configuration, it is possible to reliably adjust the communication time according to the characteristics of the serial communication signal.

なお、上記実施の形態の構成及び動作は例であって、本発明の趣旨を逸脱しない範囲で適宜変更して実行することができることは言うまでもない。   Note that the configuration and operation of the above-described embodiment are examples, and it is needless to say that the configuration and operation can be appropriately changed and executed without departing from the gist of the present invention.

1 カードリーダ
2 上位装置
3 カード状媒体
10 制御部
20 主記憶部
30 補助記憶部
40 カード読取書込部
100 クロック生成部
110 反転間隔計測部
120 通信速度調整部
130 DMA部
140 コマンド解析実行部
200 DMAバッファ
210 コマンドデータバッファ
310 ボーレート設定データ
500 DMAデータ
510 コマンドデータ
X カード制御システム
DESCRIPTION OF SYMBOLS 1 Card reader 2 Host apparatus 3 Card-like medium 10 Control part 20 Main memory part 30 Auxiliary memory part 40 Card reading / writing part 100 Clock generation part 110 Inversion interval measurement part 120 Communication speed adjustment part 130 DMA part 140 Command analysis execution part 200 DMA buffer 210 Command data buffer 310 Baud rate setting data 500 DMA data 510 Command data X Card control system

Claims (6)

上位装置とシリアル通信可能に接続されており、
前記シリアル通信により前記上位装置からコマンドを受信し、当該コマンドに対応した処理を実行する電子機器装置であって、
前記シリアル通信により受信したデータの保存のタイミングに必要なクロック信号を生成するクロック生成部と、
前記コマンドに含まれる特定コードに対応した反転ビットの間隔を、前記クロック生成部により生成された前記クロック信号で計測する反転間隔計測部と、
該反転間隔計測部により計測された反転ビットの間隔に対応するよう、前記上位装置との通信速度を調整する通信速度調整部と
前記反転ビットの間隔により前記通信速度を調整した後、前記コマンドを解析して前記通信速度を更に補正するコマンド解析実行部とを備える
ことを特徴とする電子機器装置。
It is connected to the host device so that serial communication is possible.
An electronic device device that receives a command from the host device through the serial communication and executes processing corresponding to the command,
A clock generation unit that generates a clock signal necessary for the timing of storage of data received by the serial communication;
An inversion interval measurement unit that measures an interval of inversion bits corresponding to a specific code included in the command, using the clock signal generated by the clock generation unit;
A communication speed adjusting unit that adjusts the communication speed with the host device so as to correspond to the interval between the inverted bits measured by the inversion interval measuring unit ;
An electronic device apparatus comprising: a command analysis execution unit that analyzes the command and further corrects the communication speed after adjusting the communication speed according to the interval of the inverted bits .
前記シリアル通信により受信したデータをDMA(ダイレクト・メモリ・アクセス)で保存するバッファを備え、
前記反転間隔計測部は、前記バッファに保存されたデータのビット列から前記特定コードに対応した反転ビットの間隔を計測し、
前記コマンド解析実行部は、前記コマンドのデータ全体に相当する前記DMAのデータから、前記シリアル通信の1ビット分の変調周期に相当する前記クロック信号のカウント値を算出し、算出された値を、次コマンド受信時の補正値とする
ことを特徴とする請求項1に記載の電子機器装置。
A buffer for storing data received by the serial communication by DMA (Direct Memory Access);
The inversion interval measurement unit measures an interval between inversion bits corresponding to the specific code from a bit string of data stored in the buffer ,
The command analysis execution unit calculates a count value of the clock signal corresponding to a modulation period for one bit of the serial communication from the DMA data corresponding to the entire data of the command, and calculates the calculated value, The electronic device apparatus according to claim 1, wherein the correction value is set when the next command is received .
前記特定コードは、スタートビットを含む第一の反転ビット列の長さと、その後の第二の反転ビット列の長さとが特定の比となるよう設定され、
前記反転間隔計測部は、前記特定の比となる反転ビットの列として前記第一の反転ビット列及び前記第二の反転ビット列を特定し、特定された前記第一の反転ビット列及び前記第二の反転ビット列の前記クロック信号のカウント値を算出して前記反転ビットの間隔を計測する
ことを特徴とする請求項1又は2に記載の電子機器装置。
The specific code is set so that the length of the first inverted bit string including the start bit and the length of the second inverted bit string after that is a specific ratio,
The inversion interval measurement unit specifies the first inversion bit string and the second inversion bit string as an inversion bit string having the specific ratio, and specifies the specified first inversion bit string and the second inversion bit string. The electronic device apparatus according to claim 1, wherein a count value of the clock signal of a bit string is calculated and an interval between the inverted bits is measured.
前記上位装置からの前記コマンドを受信し、読み取り又は書き込みするカード状媒体に対して、前記コマンドに対応する特定の処理を実行するカードリーダである
ことを特徴とする請求項1乃至3のいずれか1項に記載の電子機器装置。
4. The card reader according to claim 1, wherein the card reader receives the command from the host device and executes a specific process corresponding to the command on a card-like medium to be read or written. The electronic device apparatus according to 1.
前記反転間隔計測部は、前記上位装置から前記コマンドを受信する度に、前記反転ビットの間隔を計測する
ことを特徴とする請求項4に記載の電子機器装置。
The electronic device apparatus according to claim 4, wherein the inversion interval measurement unit measures the inversion bit interval each time the command is received from the host device.
上位装置とシリアル通信可能に接続されており、
前記シリアル通信により前記上位装置からコマンドを受信し、当該コマンドに対応した処理を実行する電子機器装置により実行されるシリアル通信速度調整方法であって、
前記コマンドに含まれる特定コードに対応した反転ビットの間隔を、内蔵されたクロック生成部により生成されたクロック信号で計測し、
計測された反転ビットの間隔に対応するよう、前記上位装置との通信速度を調整し、
前記反転ビットの間隔により前記通信速度を調整した後、前記コマンドを解析して前記通信速度を更に補正する
ことを特徴とするシリアル通信速度調整方法。
It is connected to the host device so that serial communication is possible.
A serial communication speed adjustment method executed by an electronic device that receives a command from the host device through the serial communication and executes processing corresponding to the command,
Measure the interval of the inverted bits corresponding to the specific code included in the command with the clock signal generated by the built-in clock generator,
Adjust the communication speed with the host device so as to correspond to the measured inverted bit interval ,
A serial communication speed adjustment method, wherein the communication speed is further adjusted by analyzing the command after adjusting the communication speed according to the interval of the inverted bits .
JP2014208978A 2014-10-10 2014-10-10 Electronic device apparatus and serial communication speed adjustment method Active JP6456649B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2014208978A JP6456649B2 (en) 2014-10-10 2014-10-10 Electronic device apparatus and serial communication speed adjustment method
CN201510652463.0A CN105512062B (en) 2014-10-10 2015-10-10 Electronic apparatus and serial communication speed adjustment method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014208978A JP6456649B2 (en) 2014-10-10 2014-10-10 Electronic device apparatus and serial communication speed adjustment method

Publications (2)

Publication Number Publication Date
JP2016082298A JP2016082298A (en) 2016-05-16
JP6456649B2 true JP6456649B2 (en) 2019-01-23

Family

ID=55720060

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014208978A Active JP6456649B2 (en) 2014-10-10 2014-10-10 Electronic device apparatus and serial communication speed adjustment method

Country Status (2)

Country Link
JP (1) JP6456649B2 (en)
CN (1) CN105512062B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020066207A1 (en) * 2018-09-27 2020-04-02 日本電産株式会社 Signal transmission and reception method

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04117841A (en) * 1990-09-07 1992-04-17 Furukawa Electric Co Ltd:The Communication speed detection method in start-stop synchronizing communication system
JPH05174201A (en) * 1991-07-05 1993-07-13 Toppan Printing Co Ltd Ic card reader/writer
JP3602233B2 (en) * 1995-11-30 2004-12-15 パナソニック コミュニケーションズ株式会社 AT command analyzer
JPH11154941A (en) * 1997-11-20 1999-06-08 Keyence Corp Communication equipment, communication system and communication method
GB0226872D0 (en) * 2002-11-18 2002-12-24 British Telecomm Video transmission
CN101741424B (en) * 2009-12-24 2013-08-28 航天恒星科技有限公司 Method for rapidly capturing multi-mode high dynamic spread spectrum signal
CN102467477B (en) * 2010-11-12 2014-10-15 施耐德电器工业公司 Baud rate self-adapting Modbus relay and Baud rate self-adapting system and method
JP5896602B2 (en) * 2011-01-06 2016-03-30 ミツミ電機株式会社 Communication circuit and sampling adjustment method
CN103329477B (en) * 2011-01-27 2015-09-30 三菱电机株式会社 Communication interface

Also Published As

Publication number Publication date
CN105512062A (en) 2016-04-20
CN105512062B (en) 2019-04-23
JP2016082298A (en) 2016-05-16

Similar Documents

Publication Publication Date Title
US7418297B2 (en) Frame length modulation and pulse position modulation system
TW536636B (en) Method, system and apparatus for calibrating a pulse position modulation (PPM) decoder to a PPM signal
US7911322B2 (en) Information processing apparatus and method, and non-contact IC card device
TWI332632B (en) Radio frequency identification tags capable of embedding receiver signal strength indications
US8458483B1 (en) Techniques for message-passing using shared memory of an RF tag
US20150145652A1 (en) Apparatuses and methods using command sets specific for controlling the operation of a type of the rfid transponder to which the commands are transmitted
US7957473B2 (en) Data transmission apparatus enabling communication without being interfered by environmental noise
JP6456649B2 (en) Electronic device apparatus and serial communication speed adjustment method
JP2002042085A (en) Card system, and ic card and card reader/writer for use therein
US20150350909A1 (en) Card device
US8363737B2 (en) Wireless data transmission between a base station and a transponder via inductive coupling
JP3568772B2 (en) Non-contact data transmission / reception device
CN107580711B (en) RFID transponder, RFID transponder device and method for communication between an RFID transponder and a reading device
JP6217344B2 (en) Method and apparatus for controlling access to shared memory
US20080143479A1 (en) Digital Device Being Worked with Exterior Power Supply and Control Method Thereof
JP2010097280A (en) Rfid system construction method, and rfid system
US20220308893A1 (en) Host device, slave device, and data transfer system
KR20120056591A (en) Radio frequency identification tag with automatic frequency adjusting function
JP4357327B2 (en) Non-contact IC card system
JP2949249B2 (en) Communication device
JP2018010484A (en) Electronic circuit, RFID system, and data acquisition method of RFID system
JP4763406B2 (en) IC tag semiconductor device, IC tag system, and IC tag control method
JPH05174201A (en) Ic card reader/writer
JP2004362617A (en) Ic card connection device and its connection method
US20050219038A1 (en) Method and system for contactless data transmission

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170905

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180820

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180828

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20181024

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20181219

R150 Certificate of patent or registration of utility model

Ref document number: 6456649

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150