TWI571814B - Method for emulating card reader interface and control device using the same - Google Patents

Method for emulating card reader interface and control device using the same Download PDF

Info

Publication number
TWI571814B
TWI571814B TW105106746A TW105106746A TWI571814B TW I571814 B TWI571814 B TW I571814B TW 105106746 A TW105106746 A TW 105106746A TW 105106746 A TW105106746 A TW 105106746A TW I571814 B TWI571814 B TW I571814B
Authority
TW
Taiwan
Prior art keywords
unit
processing unit
control device
interrupt
interrupt request
Prior art date
Application number
TW105106746A
Other languages
Chinese (zh)
Other versions
TW201732698A (en
Inventor
翁啟騰
林高煌
顧崇輝
Original Assignee
絡達科技股份有限公司
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 絡達科技股份有限公司 filed Critical 絡達科技股份有限公司
Priority to TW105106746A priority Critical patent/TWI571814B/en
Priority to CN201610168157.4A priority patent/CN107153956B/en
Application granted granted Critical
Publication of TWI571814B publication Critical patent/TWI571814B/en
Publication of TW201732698A publication Critical patent/TW201732698A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/20Point-of-sale [POS] network systems
    • G06Q20/202Interconnection or interaction of plural electronic cash registers [ECR] or to host computer, e.g. network details, transfer of information from host to ECR or from ECR to ECR
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/20Point-of-sale [POS] network systems
    • G06Q20/204Point-of-sale [POS] network systems comprising interface for record bearing medium or carrier for electronic funds transfer or payment credit
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/34Payment architectures, schemes or protocols characterised by the use of specific devices or networks using cards, e.g. integrated circuit [IC] cards or magnetic cards
    • G06Q20/356Aspects of software for card payments

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Economics (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Cash Registers Or Receiving Machines (AREA)
  • Bus Control (AREA)
  • Telephone Function (AREA)
  • Credit Cards Or The Like (AREA)

Description

模擬讀卡介面的方法及應用其的控制裝置 Method for simulating card reading interface and control device using same

本發明是有關於一種模擬讀卡介面的方法以及應用其的控制裝置,特別是關於用於行動銷售點裝置的控制裝置。 The present invention relates to a method of simulating a card reading interface and a control device therefor, and more particularly to a control device for an action point of sale device.

隨著行動裝置(例如手機或平板電腦)的普及,行動裝置可藉由實體線路或無線的方式連接行動銷售點裝置(mobile Point of Sale,mPOS),並透過行動裝置本身安裝的應用程式以及周圍環境的無線網路,行動裝置可以成為行動刷卡機,讓使用者可以隨處進行簽單交易,使得刷卡機不必侷限於設置在櫃台。而如何設計mPOS裝置,乃目前業界所致力的課題之一。 With the popularity of mobile devices (such as mobile phones or tablets), mobile devices can be connected to mobile point of sale (mPOS) by physical line or wireless, and applications installed around the mobile device itself and surrounding The wireless network of the environment, the mobile device can become a mobile credit card machine, allowing users to make sign-off transactions everywhere, so that the credit card machine is not necessarily limited to being set at the counter. How to design an mPOS device is one of the topics that the industry is currently working on.

本發明的目的在於提供一種模擬讀卡介面的方法及應用其的控制裝置,以實現一種mPOS裝置,此方法及控制裝置具有降低生產成本的優點。 It is an object of the present invention to provide a method for simulating a card reading interface and a control device therefor, to realize an mPOS device, which has the advantage of reducing production costs.

根據本發明的第一方面,提出一種模擬讀卡介面的方法,應用於控制裝置,控制裝置包括處理單元、通用輸入輸出 單元、計時單元,此方法用以將通用輸入輸出單元模擬成讀卡介面。此方法包括下列步驟:將來自計時單元的中斷請求設定為處理單元中具有最高優先權的中斷請求;處理單元通知計時單元發出中斷請求的間隔時間;以及當處理單元收到來自計時單元的中斷請求時,進入中斷處理程序,其中於中斷處理程序中,處理單元從通用輸入輸出單元讀取輸入數值。 According to a first aspect of the present invention, a method for simulating a card reading interface is provided, which is applied to a control device, the control device comprising a processing unit, a universal input and output Unit, timing unit, this method is used to simulate the universal input and output unit into a card reading interface. The method comprises the steps of: setting an interrupt request from a timing unit to an interrupt request having the highest priority in the processing unit; the processing unit notifying the timing unit of the interval at which the interrupt request is issued; and when the processing unit receives the interrupt request from the timing unit The interrupt handler is entered, wherein in the interrupt handler, the processing unit reads the input value from the general purpose input and output unit.

根據本發明的第二方面,提出一種控制裝置,包括無線收發單元、通用輸入輸出單元、計時單元、記憶單元、處理單元、以及匯流排。無線收發單元用以無線收發資料。記憶單元用以儲存一程式。處理單元用以於載入該程式時執行一方法,該方法用以將通用輸入輸出單元模擬成一讀卡介面,該方法包括下列步驟:將來自計時單元的中斷請求設定為處理單元中具有最高優先權的中斷請求;通知計時單元發出中斷請求的間隔時間;以及當收到來自計時單元的中斷請求時,進入中斷處理程序,其中於中斷處理程序中,處理單元從通用輸入輸出單元讀取輸入數值。匯流排耦接無線收發單元、通用輸入輸出單元、計時單元、記憶單元、以及處理單元。 According to a second aspect of the present invention, a control apparatus is provided, comprising a wireless transceiver unit, a universal input/output unit, a timing unit, a memory unit, a processing unit, and a bus bar. The wireless transceiver unit is configured to wirelessly send and receive data. The memory unit is used to store a program. The processing unit is configured to execute a method for loading the general-purpose input/output unit into a card reading interface when loading the program, the method comprising the steps of: setting an interrupt request from the timing unit to have the highest priority in the processing unit The interrupt request of the right; notifying the timing unit of the interval at which the interrupt request is issued; and when receiving the interrupt request from the timing unit, entering the interrupt handler, wherein in the interrupt handler, the processing unit reads the input value from the general input/output unit . The bus bar is coupled to the wireless transceiver unit, the universal input/output unit, the timing unit, the memory unit, and the processing unit.

為了對本發明之上述及其他方面有更佳的瞭解,下文特舉較佳實施例,並配合所附圖式,作詳細說明如下: In order to better understand the above and other aspects of the present invention, the preferred embodiments are described below, and in conjunction with the drawings, the detailed description is as follows:

1‧‧‧行動銷售點裝置 1‧‧‧Mobile point of sale device

2‧‧‧行動裝置 2‧‧‧Mobile devices

3‧‧‧伺服器 3‧‧‧Server

10‧‧‧控制裝置 10‧‧‧Control device

101‧‧‧處理單元 101‧‧‧Processing unit

102‧‧‧記憶單元 102‧‧‧ memory unit

103‧‧‧通用輸入輸出單元 103‧‧‧General purpose input and output unit

104‧‧‧計時單元 104‧‧‧Time unit

105‧‧‧無線收發單元 105‧‧‧Wireless transceiver unit

110‧‧‧匯流排 110‧‧‧ busbar

191‧‧‧處理器IC 191‧‧‧Processing IC

192‧‧‧無線模組IC 192‧‧‧Wireless Module IC

193‧‧‧晶片卡讀卡IC 193‧‧‧wafer card reader IC

194‧‧‧磁條卡讀卡IC 194‧‧‧Magnetic Strip Card Reader IC

S202‧‧‧將來自計時單元的中斷請求設定為處理單元中具有最高優先權的中斷請求 S202‧‧‧Set the interrupt request from the timing unit to the highest priority interrupt request in the processing unit

S204‧‧‧處理單元通知計時單元發出中斷請求的間隔時間 S204‧‧‧Processing unit notifies the timing unit of the interval between interrupt requests

S206‧‧‧當處理單元收到來自計時單元的中斷請求時,進入中斷處理程序。於中斷處理程序中,處理單元從通用輸入輸出單元讀取輸入數值 S206‧‧‧ When the processing unit receives an interrupt request from the timing unit, it enters the interrupt handler. In the interrupt handler, the processing unit reads the input value from the general purpose input and output unit

CLK‧‧‧時脈 CLK‧‧‧ clock

GPIO‧‧‧通用輸入輸出 GPIO‧‧‧General purpose input and output

ISR‧‧‧中斷處理程序 ISR‧‧‧ interrupt handler

第1圖繪示一種範例行動收單服務系統的示意圖。 FIG. 1 is a schematic diagram of an example action acquiring service system.

第2圖繪示一種範例mPOS裝置的示意圖。 Figure 2 is a schematic diagram of an exemplary mPOS device.

第3圖繪示依據本發明一實施例的控制裝置的示意圖。 FIG. 3 is a schematic diagram of a control device according to an embodiment of the invention.

第4圖繪示依據本發明一實施例的模擬讀卡介面的方法流程圖。 FIG. 4 is a flow chart of a method for simulating a card reading interface according to an embodiment of the invention.

第5圖繪示依據本發明一實施例的寫入輸出數值至通用輸入輸出單元的信號時序圖。 FIG. 5 is a timing diagram of signals for writing an output value to a general-purpose input/output unit according to an embodiment of the invention.

第6圖繪示依據本發明一實施例的從通用輸入輸出單元讀取輸入數值的信號時序圖。 FIG. 6 is a timing diagram of signals for reading an input value from a general-purpose input/output unit according to an embodiment of the invention.

第1圖繪示一種範例行動收單服務系統的示意圖。此系統中包括mPOS裝置1、行動裝置2、以及伺服器3。行動裝置2例如是手機或是平板電腦,在圖示中以手機表示,行動裝置2可以透過本身的無線網路(例如WiFi或是LTE)連接到遠端的伺服器3,另外行動裝置2可以透過藍牙(Bluetooth)或是近場通訊(Near Field Communication,NFC)等等無線通訊技術連接到mPOS裝置1。mPOS裝置1例如可以讀取晶片卡(例如智慧卡的晶片)以及磁條卡(例如信用卡的磁條),當使用者刷卡時,mPOS裝置1可將讀取到的資料傳送給行動裝置2,行動裝置2可安裝有對應於行動刷卡的應用程式,以處理相關於交易的動作,行動裝置2並可進一步透過無線網路將交易資料傳送至遠端的伺服器3,以完成此筆交易。 FIG. 1 is a schematic diagram of an example action acquiring service system. The system includes an mPOS device 1, a mobile device 2, and a server 3. The mobile device 2 is, for example, a mobile phone or a tablet computer, and is represented by a mobile phone in the illustration. The mobile device 2 can be connected to the remote server 3 through its own wireless network (for example, WiFi or LTE), and the mobile device 2 can be Connect to the mPOS device 1 via wireless communication technology such as Bluetooth or Near Field Communication (NFC). The mPOS device 1 can, for example, read a wafer card (such as a chip of a smart card) and a magnetic stripe card (such as a magnetic stripe of a credit card). When the user swipe the card, the mPOS device 1 can transmit the read data to the mobile device 2, The mobile device 2 can be installed with an application corresponding to the action card to handle the action related to the transaction, and the mobile device 2 can further transmit the transaction data to the remote server 3 via the wireless network to complete the transaction.

第2圖繪示一種範例mPOS裝置的示意圖。如第1 圖所繪示範例中的mPOS裝置1,可以讀取晶片卡以及磁條卡,同時亦具有無線資料傳輸能力,因此一種範例mPOS裝置的實現方法如第2圖所示,mPOS裝置包括處理器積體電路(Integrated Circuit,IC)191、無線模組IC 192、晶片卡讀卡IC 193、磁條卡讀卡IC 194。處理器IC 191耦接至其他積體電路,包括無線模組IC 192、晶片卡讀卡IC 193、磁條卡讀卡IC 194,處理器IC 191可以是中央處理器或微控制器,用以執行關於資料運算以及周邊單元的操作控制。無線模組IC 192例如是藍牙通訊模組。晶片卡讀卡IC 193可將從晶片卡讀取的資料,轉換為處理器IC可以處理的信號型態。類似地,磁條卡讀卡IC 194可將從磁條卡讀取的資料,轉換為處理器IC 191可以處理的信號型態。然而,在第2圖所示的範例mPOS裝置中,總共需要四個獨立的積體電路晶片,所佔用的實體電路面積大,且所需的生產成本高。以下提出一種以單一積體電路實現的方法及應用其的裝置。 Figure 2 is a schematic diagram of an exemplary mPOS device. As number 1 The mPOS device 1 in the illustrated example can read the chip card and the magnetic stripe card, and also has wireless data transmission capability. Therefore, an example mPOS device is implemented as shown in FIG. 2, and the mPOS device includes a processor product. An integrated circuit (IC) 191, a wireless module IC 192, a chip card reader IC 193, and a magnetic stripe card reader IC 194. The processor IC 191 is coupled to other integrated circuits, including a wireless module IC 192, a chip card reader IC 193, and a magnetic stripe card reader IC 194. The processor IC 191 can be a central processing unit or a microcontroller. Perform operation control on data calculation and peripheral units. The wireless module IC 192 is, for example, a Bluetooth communication module. The wafer card reader IC 193 can convert the data read from the wafer card into a signal type that the processor IC can process. Similarly, the magnetic stripe card reader IC 194 can convert the data read from the magnetic stripe card into a signal type that the processor IC 191 can process. However, in the exemplary mPOS device shown in FIG. 2, a total of four independent integrated circuit chips are required, occupying a large physical circuit area and requiring high production cost. A method implemented by a single integrated circuit and an apparatus using the same are presented below.

第3圖繪示依據本發明一實施例的控制裝置的示意圖。控制裝置10包括無線收發單元105、通用輸入輸出單元103、計時單元104、記憶單元102、處理單元101、以及匯流排110。無線收發單元105用以無線收發資料。記憶單元102用以儲存一程式。處理單元101用以於載入該程式時執行一方法,該方法用以將通用輸入輸出單元103模擬成一讀卡介面,該方法包括下列步驟:將來自計時單元104的中斷請求設定為處理單元101中具有最高優先權的中斷請求;通知計時單元104發出中斷請求的間 隔時間;以及當收到來自計時單元104的中斷請求時,進入中斷處理程序,其中於中斷處理程序中,處理單元101從通用輸入輸出單元103讀取輸入數值。匯流排110耦接無線收發單元105、通用輸入輸出單元103、計時單元104、記憶單元102、以及處理單元101。各元件詳細說明如下。 FIG. 3 is a schematic diagram of a control device according to an embodiment of the invention. The control device 10 includes a wireless transceiving unit 105, a general-purpose input-output unit 103, a timing unit 104, a memory unit 102, a processing unit 101, and a bus bar 110. The wireless transceiver unit 105 is configured to wirelessly transmit and receive data. The memory unit 102 is configured to store a program. The processing unit 101 is configured to execute a method for loading the general-purpose input/output unit 103 into a card reading interface when loading the program. The method includes the following steps: setting an interrupt request from the timing unit 104 as the processing unit 101. The highest priority interrupt request; the notification timing unit 104 issues an interrupt request The interrupt processing routine is entered when an interrupt request from the timing unit 104 is received, wherein the processing unit 101 reads the input value from the general-purpose input-output unit 103 in the interrupt processing routine. The bus bar 110 is coupled to the wireless transceiver unit 105, the universal input/output unit 103, the timing unit 104, the memory unit 102, and the processing unit 101. Each component is described in detail below.

控制裝置10可設置於行動銷售點裝置1當中,控制裝置10可以是微控制器(microcontroller),可以由單一積體電路實現,且控制裝置10可整合第2圖所示的處理器IC 191、無線模組IC 192、晶片卡讀卡IC 193、以及磁條卡讀卡IC 194的功能。控制裝置10中以匯流排(bus)110連接各個單元,處理單元101例如是微處理器(microprocessor),可以經由設計程式,使得處理單元101藉由載入程式而執行相對應的功能。程式可儲存於記憶單元102,記憶單元102例如是記憶體。舉例而言,記憶單元102可以是隨機存取記憶體(Random Access Memory,RAM),程式可以軟體方式儲存於RAM當中,或者記憶單元102可以是快閃記憶體(Flash),程式可以韌體形式嵌入在快閃記憶體。 The control device 10 can be disposed in the mobile point of sale device 1, the control device 10 can be a microcontroller, can be implemented by a single integrated circuit, and the control device 10 can integrate the processor IC 191 shown in FIG. The functions of the wireless module IC 192, the chip card reader IC 193, and the magnetic stripe card reader IC 194. The control unit 10 is connected to each unit by a bus 110. The processing unit 101 is, for example, a microprocessor. The processing unit 101 can be configured to execute a corresponding function by loading a program. The program can be stored in the memory unit 102, which is, for example, a memory. For example, the memory unit 102 can be a random access memory (RAM), the program can be stored in the RAM in a software manner, or the memory unit 102 can be a flash memory (Flash), and the program can be in a firmware form. Embedded in flash memory.

在此實施例中,記憶單元102所儲存的程式,經由處理單元101載入後,處理單元101可執行一方法以將通用輸入輸出單元103模擬成一讀卡介面。通用輸入輸出(General Purpose Input/Output,GPIO)單元103例如可包括多個通用輸入輸出接腳(GPIO pins)、輸入資料暫存器、輸出資料暫存器、方向暫存器。GPIO接腳為雙向接腳,可作為輸入或輸出接腳,其資料傳輸方 向可以由方向暫存器的值所決定。當方向暫存器決定作為輸入接腳時,可將接收的數值儲存於輸入資料暫存器;當方向暫存器決定作為輸出接腳時,內部電路可將要傳送的數值寫入到輸出資料暫存器,輸出資料暫存器儲存的數值由GPIO接腳輸出。於以下說明中,為簡化文字說明起見,當GPIO接腳作為輸入接腳時,內部電路從輸入資料暫存器讀取資料的操作,表示為從通用輸入輸出單元103讀取輸入數值;當GPIO接腳作為輸出接腳時,內部電路寫入資料到輸出資料暫存器,表示為寫入輸出數值至通用輸入輸出單元103。 In this embodiment, after the program stored in the memory unit 102 is loaded via the processing unit 101, the processing unit 101 can perform a method to simulate the general-purpose input-output unit 103 as a card reading interface. The General Purpose Input/Output (GPIO) unit 103 may include, for example, a plurality of general purpose input/output pins (GPIO pins), an input data register, an output data register, and a direction register. The GPIO pin is a bidirectional pin and can be used as an input or output pin. It can be determined by the value of the direction register. When the direction register is determined as the input pin, the received value can be stored in the input data register; when the direction register is determined as the output pin, the internal circuit can write the value to be transmitted to the output data. The value stored in the register and output data register is output by the GPIO pin. In the following description, for simplification of the text description, when the GPIO pin is used as an input pin, the operation of the internal circuit to read data from the input data register is indicated as reading the input value from the general-purpose input-output unit 103; When the GPIO pin is used as an output pin, the internal circuit writes the data to the output data register, which is indicated as writing the output value to the general-purpose input/output unit 103.

由於控制裝置10的通用輸入輸出單元103可以是由使用者藉由編寫程式以控制其操作,在本案實施例中,可藉由適當編寫程式,控制通用輸入輸出單元103的輸入及輸出信號操作,模擬為讀卡介面的操作。可模擬的讀卡介面包括晶片卡讀卡介面以及磁條卡讀卡介面,晶片卡讀卡介面例如ISO7816介面,磁條卡讀卡介面例如ISO7811介面。在一實施例中,通用輸入輸出單元103包括有多個GPIO接腳,其中部分的GPIO接腳(例如Pin 1~Pin 5)用以模擬ISO7816介面,另外一部分的GPIO接腳(例如Pin 6~Pin 8)用以模擬ISO7811介面。因此,應用控制裝置10的mPOS裝置1可兼具晶片卡以及磁條卡的讀卡能力。 Since the universal input/output unit 103 of the control device 10 can be controlled by the user to control the operation thereof, in the embodiment of the present invention, the input and output signals of the universal input/output unit 103 can be controlled by appropriately programming the program. The simulation is an operation of the card reader interface. The emulated card reading interface includes a chip card reading interface and a magnetic stripe card reading interface, the wafer card reading interface such as an ISO7816 interface, and a magnetic stripe card reading interface such as an ISO7811 interface. In an embodiment, the universal input/output unit 103 includes a plurality of GPIO pins, and some of the GPIO pins (for example, Pin 1~Pin 5) are used to simulate the ISO7816 interface, and another part of the GPIO pins (for example, Pin 6~). Pin 8) is used to simulate the ISO7811 interface. Therefore, the mPOS device 1 of the application control device 10 can have both the chip card and the card reading capability of the magnetic stripe card.

在第3圖所繪示的實施例中,由於使用軟體或韌體控制,使得控制裝置10的通用輸入輸出單元103可模擬成讀卡介面,因此第3圖所示的控制裝置10,不需要如第2圖所示的晶 片卡讀卡IC 193以及磁條卡讀卡IC 194作為橋接裝置,而能夠直接以GPIO接腳連接到卡片。此外,在此實施例中,無線收發單元105亦可整合於同一個積體電路中,因此也不需要如第2圖所示的無線模組IC 192。控制裝置10能夠以單一積體電路實現,可以節省電路面積,減少所需使用的積體電路元件,並且有效降低生產成本。第2圖的實施例需4顆獨立的IC,第3圖的實施例則僅需1顆IC。 In the embodiment illustrated in FIG. 3, since the general-purpose input-output unit 103 of the control device 10 can be simulated as a card reading interface by using software or firmware control, the control device 10 shown in FIG. 3 does not need to be Crystal as shown in Figure 2 The chip card reader IC 193 and the magnetic stripe card reader IC 194 function as bridge devices and can be directly connected to the card with GPIO pins. In addition, in this embodiment, the wireless transceiver unit 105 can also be integrated into the same integrated circuit, and thus the wireless module IC 192 as shown in FIG. 2 is not required. The control device 10 can be realized in a single integrated circuit, which can save circuit area, reduce integrated circuit components that are required to be used, and effectively reduce production costs. The embodiment of Figure 2 requires four independent ICs, and the embodiment of Figure 3 requires only one IC.

在一實施例中,無線收發單元105是雙模藍牙收發器,例如可兼容於藍牙3.0通訊協定以及藍牙4.0通訊協定,可用以連接具有藍牙傳輸介面的行動裝置。無線收發單元105透過匯流排110與處理單元101溝通,可受處理單元101控制而對應進行動作,以及將收到的資料傳送至處理單元101。控制裝置10可應用於一個藍牙傳輸介面的mPOS機器。 In one embodiment, the wireless transceiver unit 105 is a dual mode Bluetooth transceiver, for example compatible with the Bluetooth 3.0 protocol and the Bluetooth 4.0 protocol, and can be used to connect mobile devices having a Bluetooth transmission interface. The wireless transceiver unit 105 communicates with the processing unit 101 through the bus bar 110, can be controlled by the processing unit 101, and transmits the received data to the processing unit 101. The control device 10 can be applied to an mPOS machine of a Bluetooth transmission interface.

以下更進一步說明將通用輸入輸出單元103模擬成讀卡介面的方法。第4圖繪示依據本發明一實施例的模擬讀卡介面的方法流程圖,方法包括下列步驟。步驟S202:將來自計時單元的中斷請求設定為處理單元中具有最高優先權的中斷請求。步驟S204:處理單元通知計時單元發出中斷請求的間隔時間。步驟S206:當處理單元收到來自計時單元的中斷請求時,進入中斷處理程序,其中於中斷處理程序中,處理單元從通用輸入輸出單元讀取輸入數值。在一實施例中,於中斷處理程序中,處理單元更用以寫入輸出數值至通用輸入輸出單元。 A method of simulating the general-purpose input/output unit 103 as a card reading interface will be further described below. FIG. 4 is a flow chart of a method for simulating a card reading interface according to an embodiment of the invention, the method comprising the following steps. Step S202: The interrupt request from the timing unit is set as the interrupt request having the highest priority in the processing unit. Step S204: The processing unit notifies the timing unit of the interval time for issuing the interrupt request. Step S206: When the processing unit receives the interrupt request from the timing unit, it enters an interrupt processing program, wherein in the interrupt processing program, the processing unit reads the input value from the general-purpose input/output unit. In an embodiment, in the interrupt handler, the processing unit is further configured to write the output value to the general purpose input and output unit.

請同時參考第3圖以及第4圖,當使用通用輸入輸出單元103模擬讀卡介面,表示處理單元101要在正確的時間點,去讀取通用輸入輸出單元103的數值,或是處理單元101要在正確的時間點,寫入數值到通用輸入輸出單元103,以使得在通用輸入輸出單元103的信號符合讀卡介面的操作信號。而由於不同的讀卡介面皆有標準協定規範信號時序,例如前述的ISO7816以及ISO7811,當藍牙收發器亦整合於控制裝置10時,因為藍牙傳輸亦有標準協定,需遵守特定的信號時序規範,為了避免在進行讀卡相關動作時,可能造成藍牙連線斷線的情況,或是因為在藍牙傳輸中可能造成磁條卡讀錯資料的情形,對於通用輸入輸出單元103的信號時序控制必須夠精確。舉例而言,讓輸出數值能夠在夠精確的時間點寫入到通用輸入輸出單元103,以模擬一個符合ISO7816時序規範的讀卡介面。 Referring to FIG. 3 and FIG. 4 simultaneously, when the general-purpose input/output unit 103 is used to simulate the card reading interface, it is indicated that the processing unit 101 is to read the value of the general-purpose input-output unit 103 at the correct time point, or the processing unit 101 At the correct point in time, a value is written to the general purpose input and output unit 103 such that the signal at the universal input and output unit 103 conforms to the operational signal of the card reader interface. Since different card reader interfaces have standard protocol specification signal timing, such as the aforementioned ISO7816 and ISO7811, when the Bluetooth transceiver is also integrated into the control device 10, since the Bluetooth transmission also has a standard agreement, it is necessary to comply with a specific signal timing specification. In order to avoid the situation that the Bluetooth connection is disconnected when the card reading related action is performed, or because the magnetic stripe card may read the wrong data during the Bluetooth transmission, the signal timing control for the universal input/output unit 103 must be sufficient. accurate. For example, the output value can be written to the general purpose input and output unit 103 at a sufficiently accurate point in time to simulate a card reading interface that conforms to the ISO7816 timing specification.

在本案實施例中,為了能夠精確控制通用輸入輸出單元103的信號時序,所採用的方法是使用計時單元104所發送的中斷請求(Interrupt Request,IRQ)進行控制。計時單元104例如是包括電子振盪器(oscillator)的硬體計時器,能夠產生特定頻率的時脈信號,以精確計算時間。在控制裝置10中,處理單元101可接收周邊裝置的多個中斷請求來源,中斷請求源可以來自晶片上,亦可以從晶片外部電路接收。中斷請求可對應至中斷處理程序(Interrupt Service Routine,ISR),當處理單元101接收到中斷請求時,可先暫存目前正執行的程序狀態,優先跳到中斷請求所對 應的中斷處理程序在記憶單元102當中的位址,以執行中斷處理程序,待處理單元101執行完中斷處理程序後,再取回暫存的原程序狀態,跳回原程式在記憶單元102當中的位址,繼續執行原程式。 In the embodiment of the present invention, in order to accurately control the signal timing of the general-purpose input/output unit 103, the method adopted is controlled by using an Interrupt Request (IRQ) transmitted by the timing unit 104. The timing unit 104 is, for example, a hardware timer including an electronic oscillator capable of generating a clock signal of a specific frequency to accurately calculate time. In the control device 10, the processing unit 101 can receive a plurality of interrupt request sources of the peripheral devices, and the interrupt request source can be from the wafer or can be received from the external circuit of the chip. The interrupt request may correspond to an Interrupt Service Routine (ISR). When the processing unit 101 receives the interrupt request, the program state currently being executed may be temporarily stored, and the interrupt request is preferentially jumped to the interrupt request. The address of the interrupt processing program in the memory unit 102 is executed to execute the interrupt processing program. After the processing unit 101 executes the interrupt processing program, the temporary program state is retrieved, and the original program is jumped back to the memory unit 102. The address, continue to execute the original program.

在本案實施例中,處理單元101所執行的中斷處理程序,即是處理單元101從通用輸入輸出單元103讀取輸入數值,或是處理單元101將輸出數值寫入通用輸入輸出單元103。亦即,每當從計時單元104收到中斷請求時,處理單元101即對於通用輸入輸出單元103進行讀或寫的動作。因此,處理單元101需依據讀卡介面所對應的規範,通知計時單元104隔多久時間發出中斷請求,以使得處理單元101在正確的時間點對通用輸入輸出單元103進行讀或寫的操作。 In the embodiment of the present invention, the interrupt processing program executed by the processing unit 101 is that the processing unit 101 reads the input value from the general-purpose input/output unit 103, or the processing unit 101 writes the output value to the general-purpose input/output unit 103. That is, each time the interrupt request is received from the timing unit 104, the processing unit 101 performs an operation of reading or writing to the general-purpose input-output unit 103. Therefore, the processing unit 101 needs to notify the timing unit 104 how long to issue an interrupt request according to the specification corresponding to the card reading interface, so that the processing unit 101 performs a read or write operation on the general-purpose input-output unit 103 at the correct time.

如前所述,處理單元101可接收多個中斷請求來源,包括無線收發單元105(例如是雙模藍牙收發器)亦可發出相關於藍牙傳輸的中斷請求至處理單元101。為使得在通用輸入輸出單元103的資料讀寫操作的信號時序能夠精確,可將來自計時單元104的中斷請求設定為處理單元101中具有最高優先權的中斷請求,將來自其他單元的中斷請求設定為優先權較低。因此,來自無線收發單元105的中斷請求,其優先權低於來自計時單元104的中斷請求。藉由對於不同中斷請求源的優先權設定,使得處理單元101每次收到來自計時單元104的中斷請求時,立即優先處理其對應的中斷處理程序,而對通用輸入輸出單元103進行讀或 寫的動作,以達成在通用輸入輸出單元103信號時序精確的目標。 As previously mentioned, the processing unit 101 can receive a plurality of interrupt request sources, including the wireless transceiver unit 105 (eg, a dual mode Bluetooth transceiver) or can issue an interrupt request related to Bluetooth transmission to the processing unit 101. In order to make the signal timing of the data read/write operation of the general-purpose input-output unit 103 accurate, the interrupt request from the timing unit 104 can be set as the interrupt request having the highest priority in the processing unit 101, and the interrupt request from the other unit can be set. For lower priority. Therefore, the interrupt request from the wireless transceiver unit 105 has a lower priority than the interrupt request from the timing unit 104. By setting the priority of different interrupt request sources, the processing unit 101 immediately prioritizes its corresponding interrupt handler and receives the read or write to the general-purpose input/output unit 103 each time it receives an interrupt request from the timing unit 104. The action is written to achieve an accurate target of the signal timing at the general purpose input and output unit 103.

處理單元101係藉由載入程式以執行上述實施例的方法,而程式可儲存於記憶單元102中。於此程式中可設定各個中斷請求源的優先順序,包括將來自計時單元104的中斷請求設定為處理單元101中具有最高優先權的中斷請求。程式中並可以設定對應於計時單元104的中斷處理程序中,處理單元101要寫入什麼數值到通用輸入輸出單元103,以及處理單元101要如何處理從通用輸入輸出單元103讀取的數值。 The processing unit 101 executes the method of the above embodiment by loading a program, and the program can be stored in the memory unit 102. The priority order of each interrupt request source can be set in this program, including setting the interrupt request from the timing unit 104 to the interrupt request having the highest priority in the processing unit 101. In the program, it is possible to set what value to be written by the processing unit 101 to the general-purpose input-output unit 103 in the interrupt processing program corresponding to the timing unit 104, and how the processing unit 101 is to process the value read from the general-purpose input-output unit 103.

首先說明從通用輸入輸出單元103讀取數值的情形,第5圖繪示依據本發明一實施例的從通用輸入輸出單元讀取輸入數值的信號時序圖。在此實施例中,以模擬ISO7811介面讀取磁條卡作為範例說明。控制裝置10外部可耦接類比電路,類比電路例如包括運算放大器(OP-Amp)以及類比數位轉換器(Analog-to-Digital Converter,ADC)。當使用者刷磁條卡時,由於電磁感應原理產生小電流,小電流經類比電路放大後並且轉換成數位信號,由通用輸入輸出單元103接收數位信號,處理單元101藉由程式控制讀取或是取樣(sample)此數位信號的時間點。 First, the case where the numerical value is read from the general-purpose input-output unit 103 will be described. FIG. 5 is a timing chart showing the signal reading the input value from the general-purpose input-output unit according to an embodiment of the present invention. In this embodiment, the magnetic stripe card is read by simulating the ISO7811 interface as an example. The control device 10 can be externally coupled with an analog circuit, for example, including an operational amplifier (OP-Amp) and an analog-to-digital converter (ADC). When the user brushes the magnetic stripe card, a small current is generated due to the principle of electromagnetic induction, the small current is amplified by the analog circuit and converted into a digital signal, and the digital input signal is received by the universal input/output unit 103, and the processing unit 101 reads or reads by the program control. It is the point in time at which this digital signal is sampled.

舉例而言,處理單元101可以通知計時單元104以一個固定的頻率發出中斷請求,此固定頻率即代表處理單元101去取樣通用輸入輸出單元103的頻率。如第5圖所示,CLK代表時脈信號,GPIO代表通用輸入輸出接腳上的信號,ISR代表每次計時單元104發出中斷請求的時間點,即處理單元101進入中斷 處理程序的時間點。ISR可以為固定頻率,使得處理單元101以一個固定頻率進入中斷處理程序,在此中斷處理程序中處理單元101從通用輸入輸出單元103讀取輸入數值,如第5圖所繪示的例子中,處理單元101可依序讀到{1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,...},其中1代表為對應於輸入數值的高邏輯位準,0代表對應於輸入數值的低邏輯位準。需說明的是,為使圖示清楚,第5圖所繪示的信號頻率關係僅為示意圖,實際電路所使用的信號頻率可以與第5圖中所示的比例不同。舉例而言,在電路實作中,GPIO的一個信號週期內,可以發出數十次或是數百次的ISR,而每一次的ISR之間可以有數十個或數百個CLK週期。 For example, the processing unit 101 can notify the timing unit 104 to issue an interrupt request at a fixed frequency, that is, the frequency at which the processing unit 101 desamples the general-purpose input-output unit 103. As shown in FIG. 5, CLK represents a clock signal, GPIO represents a signal on a general-purpose input/output pin, and ISR represents a time point at which each timing unit 104 issues an interrupt request, that is, the processing unit 101 enters an interrupt. The point in time at which the program was processed. The ISR can be a fixed frequency such that the processing unit 101 enters an interrupt handler at a fixed frequency, in which the processing unit 101 reads the input values from the general purpose input and output unit 103, as in the example illustrated in FIG. The processing unit 101 can sequentially read {1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,0,0 , 0,0,1,...}, where 1 represents a high logic level corresponding to the input value and 0 represents a low logic level corresponding to the input value. It should be noted that, in order to make the illustration clear, the signal frequency relationship shown in FIG. 5 is only a schematic diagram, and the signal frequency used by the actual circuit may be different from the ratio shown in FIG. For example, in a circuit implementation, IFIO can issue tens or hundreds of ISRs in one signal cycle, and there can be tens or hundreds of CLK cycles between each ISR.

依據ISO7811介面標準,讀卡介面上的信號係以信號寬度區別邏輯1或是邏輯0,例如邏輯0對應於信號的1倍週期,而邏輯1對應於信號的2倍週期。因此,在一實施例中,當處理單元101從通用輸入輸出單元103讀取輸入數值時,處理單元101更計算對應於輸入數值的高邏輯位準期間以及低邏輯位準期間,處理單元101分別從計時單元104接收到的中斷請求的數目。如第5圖所示的例子,在一開始的高邏輯位準期間,接收到8個中斷請求,緊接著的低邏輯位準期間,接收到8個中斷請求,再接著的下一個高邏輯位準期間,接收到3個中斷請求,而再下一個低邏輯位準期間,接收到4個中斷請求。根據這些數目,處理單元101可以判斷出先接收到一個2倍週期的信號,再接收到 一個1倍週期的信號,因此可以得知先接收到邏輯1,再接收到邏輯0。此處的數值僅為範例說明,於電路實作中,在一個高邏輯位準期間,處理單元101可能收到數十個中斷請求。 According to the ISO7811 interface standard, the signal on the card interface distinguishes between logic 1 or logic 0 by the signal width. For example, logic 0 corresponds to 1 time period of the signal, and logic 1 corresponds to 2 times period of the signal. Therefore, in an embodiment, when the processing unit 101 reads the input value from the general-purpose input-output unit 103, the processing unit 101 further calculates a high logic level period corresponding to the input value and a low logic level period, and the processing unit 101 respectively The number of interrupt requests received from timing unit 104. As in the example shown in Figure 5, during the initial high logic level, 8 interrupt requests are received, followed by 8 low interrupt levels, followed by 8 interrupt requests, followed by the next high logic bit. During the quasi-period, three interrupt requests are received, and during the next low logic level, four interrupt requests are received. According to these numbers, the processing unit 101 can determine that a signal of 2 times period is received first, and then received. A signal with 1 cycle, so it can be known that logic 1 is received first and then logic 0 is received. The values herein are merely illustrative. In circuit implementations, processing unit 101 may receive dozens of interrupt requests during a high logic level.

接著說明寫入數值到通用輸入輸出單元103的情形,第6圖繪示依據本發明一實施例的寫入輸出數值至通用輸入輸出單元的信號時序圖。在此實施例中,以模擬ISO7816介面傳送資料至晶片卡作為範例說明。當使用者插入晶片卡,控制裝置10需傳送指令至晶片卡時,處理單元101寫入數值到通用輸入輸出單元103。類似於讀取數值的操作,每當處理單元101接收到來自計時單元104的中斷請求時,處理單元101執行中斷處理程序,於中斷處理程序中,程式指定要寫入通用輸入輸出單元103的數值,因此處理單元101可以在正確的時間點(藉由程式通知計時單元104發出中斷請求的間隔時間)寫入依據程式設定的數值到通用輸入輸出單元103。 Next, the case where the value is written to the general-purpose input/output unit 103 will be described. FIG. 6 is a timing chart showing the signal output to the general-purpose input/output unit according to an embodiment of the present invention. In this embodiment, the data is transferred to the wafer card by simulating the ISO 7816 interface as an example. When the user inserts the wafer card and the control device 10 needs to transmit an instruction to the wafer card, the processing unit 101 writes the value to the general purpose input/output unit 103. Similar to the operation of reading a value, each time the processing unit 101 receives an interrupt request from the timing unit 104, the processing unit 101 executes an interrupt processing program in which the program specifies the value to be written to the general-purpose input-output unit 103. Therefore, the processing unit 101 can write the value set according to the program to the general-purpose input-output unit 103 at the correct time point (by the program notifying the timing unit 104 of the interval at which the interrupt request is issued).

以ISO7816規範為例,一個位元組(byte)的資料由1個起始位元(start bit)、8個資料位元(data bit)、1個校驗位元(parity bit)、以及2個結束位元(stop bit)所組成。其中每一個位元所佔用的時間為一個基本時間單元(Elementary Time Unit,ETU),一個ETU為372個時脈週期。以使用頻率3MHz的CLK信號為例,1個ETU長度為372*(1/3MHz)=124μs。因此,處理單元101可以通知計時單元104發出中斷請求的間隔時間為124μs,每當進入中斷處理程序時,即寫入1個位元的數值到通用輸入輸出單元 103。以第6圖為例,首先寫入起始位元為0,接著可依序從資料的最低有效位元(Least Significant Bit,LSB)D0寫到資料的最高有效位元(Most Significant Bit,MSB)D7,再寫入校驗碼,最後寫入2個位元的結束位元為1,即完成1個位元組的傳輸。控制裝置10可以一次傳送多個位元組的指令到晶片卡,其中每一個位元組皆可如同第6圖所示,藉由多個中斷請求以達成於正確的時間點寫入輸出數值到通用輸入輸出單元103。 Taking the ISO7816 specification as an example, a byte (byte) data consists of one start bit, eight data bits, one parity bit, and two bits. The end bits are composed of stop bits. The time occupied by each bit is an Elementary Time Unit (ETU), and one ETU is 372 clock cycles. Taking the CLK signal with a frequency of 3 MHz as an example, one ETU length is 372*(1/3MHz)=124μs. Therefore, the processing unit 101 can notify the timing unit 104 that the interval for issuing the interrupt request is 124 μs, and each time the interrupt handler is entered, the value of 1 bit is written to the general-purpose input and output unit. 103. Taking Figure 6 as an example, first write the start bit to 0, and then write the most significant bit (Most Significant Bit, MSB) of the data from the Least Significant Bit (LSB) D0 of the data. D7, write the check code again, and finally write the end bit of 2 bits to 1, that is, complete the transmission of 1 byte. The control device 10 can transmit instructions of a plurality of byte groups to the wafer card at a time, wherein each of the byte groups can be written into the output value by a plurality of interrupt requests to achieve the correct time point as shown in FIG. General purpose input and output unit 103.

如以上第5圖以及第6圖實施例所述,不論是在讀取數值或是寫入數值的情形,中斷處理程序皆僅需要讀取1個位元或是寫入1個位元的數值,因此所需的時間非常短,處理單元101在執行完短暫的中斷處理程序之後,能夠立刻跳回原程式執行。因此,使用本案實施例所揭露的模擬讀卡介面的方法,藉由中斷請求控制讀取與寫入信號的時序,不僅能夠達到時序精確控制的優點,更由於中斷處理程序簡單可以快速結束,而不致影響處理單元原先處理的程式。 As described in the fifth and sixth embodiments above, the interrupt handler only needs to read 1 bit or write 1 bit value, whether in the case of reading a value or writing a value. Therefore, the time required is very short, and the processing unit 101 can immediately jump back to the original program execution after executing the short interrupt handler. Therefore, by using the method of the analog card reading interface disclosed in the embodiment of the present invention, by controlling the timing of the read and write signals by the interrupt request, not only the advantages of the timing precision control but also the interrupt processing program can be quickly ended. A program that does not affect the processing unit's original processing.

在第3圖所繪示的實施例中,係繪示一個計時單元104。當控制裝置10同時模擬兩種讀卡介面時,例如包括ISO7816介面以及ISO7811介面,於一實施例中,兩種介面可以分別對應到不同的GPIO接腳,且兩種介面可以分別對應到各自獨立的計時單元,例如分別使用不同振盪頻率的兩個計時器,以適用於不同的讀卡介面。於一實施例中,兩種介面亦可以對應到同一個計時單元,藉由程式控制計時單元在模擬這兩種讀卡介面時,分別 要以多長的間隔時間發送中斷請求。由於在實際操作中,mPOS裝置不會同時讀取晶片卡以及磁條卡,因此mPOS裝置內模擬兩種讀卡介面可以使用同一個計時單元,藉由軟體進行對應的時序控制。 In the embodiment illustrated in FIG. 3, a timing unit 104 is illustrated. When the control device 10 simultaneously simulates two types of card reading interfaces, for example, including an ISO7816 interface and an ISO7811 interface, in one embodiment, the two interfaces can respectively correspond to different GPIO pins, and the two interfaces can respectively correspond to the respective ones. The timing unit, for example two timers with different oscillation frequencies, respectively, is suitable for different card reading interfaces. In an embodiment, the two interfaces may also correspond to the same timing unit, and the program timing unit controls the two card reading interfaces separately. How long to send an interrupt request. In the actual operation, the mPOS device does not read the chip card and the magnetic stripe card at the same time. Therefore, the analog two interface devices in the mPOS device can use the same timing unit, and the corresponding timing control is performed by the software.

使用本發明上述實施例所揭露的模擬讀卡介面的方法及應用其的控制裝置,可以使用單一積體電路實現具有無線傳輸能力的讀卡介面。由於直接以控制裝置的通用輸入輸出單元模擬讀卡介面,因此無須額外的轉接電路,具有節省電路面積以及降低生產成本的優點。此外,藉由將計時單元發出的中斷請求優先權設定為最高,可以使得讀卡介面的信號時序精確,有效避免於讀取卡片上重要資料時發生資料讀取錯誤的問題,並且可以於讀卡操作的同時,維持無線傳輸(例如藍牙傳輸)不斷線。 The method for simulating the card reading interface disclosed in the above embodiments of the present invention and the control device using the same can realize the card reading interface with wireless transmission capability by using a single integrated circuit. Since the card reading interface is directly simulated by the universal input/output unit of the control device, no additional switching circuit is required, which has the advantages of saving circuit area and reducing production cost. In addition, by setting the priority of the interrupt request issued by the timing unit to the highest, the signal timing of the card reading interface can be made accurate, effectively avoiding the problem of data reading errors when reading important data on the card, and can read the card. While operating, maintain wireless transmission (such as Bluetooth transmission) continuously.

綜上所述,雖然本發明已以較佳實施例揭露如上,然其並非用以限定本發明。本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾。因此,本發明之保護範圍當視後附之申請專利範圍所界定者為準。 In conclusion, the present invention has been disclosed in the above preferred embodiments, and is not intended to limit the present invention. A person skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, the scope of the invention is defined by the scope of the appended claims.

S202‧‧‧將來自計時單元的中斷請求設定為處理單元中具有最高優先權的中斷請求 S202‧‧‧Set the interrupt request from the timing unit to the highest priority interrupt request in the processing unit

S204‧‧‧處理單元通知計時單元發出中斷請求的間隔時間 S204‧‧‧Processing unit notifies the timing unit of the interval between interrupt requests

S206‧‧‧當處理單元收到來自計時單元的中斷請求時,進入中斷處理程序。於中斷處理程序中,處理單元從通用輸入輸出單元讀取輸入數值 S206‧‧‧ When the processing unit receives an interrupt request from the timing unit, it enters the interrupt handler. In the interrupt handler, the processing unit reads the input value from the general purpose input and output unit

Claims (12)

一種模擬讀卡介面的方法,應用於一控制裝置,該控制裝置包括一處理單元、一通用輸入輸出單元、一計時單元,該方法用以將該通用輸入輸出單元模擬成一讀卡介面,該方法包括:將來自該計時單元的一中斷請求設定為該處理單元中具有最高優先權的中斷請求;該處理單元通知該計時單元發出該中斷請求的一間隔時間;以及當該處理單元收到來自該計時單元的該中斷請求時,進入一中斷處理程序,其中於該中斷處理程序中,該處理單元從該通用輸入輸出單元讀取一輸入數值。 A method for simulating a card reading interface is applied to a control device, the control device includes a processing unit, a universal input and output unit, and a timing unit, and the method is used to simulate the universal input/output unit as a card reading interface. The method includes: setting an interrupt request from the timing unit as an interrupt request having the highest priority in the processing unit; the processing unit notifying the timing unit of an interval time for issuing the interrupt request; and when the processing unit receives the interrupt request When the interrupt request of the timing unit is requested, an interrupt processing routine is entered, in which the processing unit reads an input value from the general-purpose input/output unit. 如申請專利範圍第1項所述之方法,其中於該中斷處理程序中,該處理單元寫入一輸出數值至該通用輸入輸出單元。 The method of claim 1, wherein the processing unit writes an output value to the universal input/output unit in the interrupt processing routine. 如申請專利範圍第1項所述之方法,其中該讀卡介面是ISO7816介面。 The method of claim 1, wherein the card reading interface is an ISO7816 interface. 如申請專利範圍第1項所述之方法,其中該讀卡介面是ISO7811介面。 The method of claim 1, wherein the card reading interface is an ISO 7811 interface. 如申請專利範圍第1項所述之方法,其中當該處理單元從該通用輸入輸出單元讀取該輸入數值時,該處理單元計算對應於該輸入數值的一高邏輯位準期間以及一低邏輯位準期間,該處理單元分別從該計時單元接收到的該中斷請求的數目。 The method of claim 1, wherein when the processing unit reads the input value from the universal input and output unit, the processing unit calculates a high logic level period corresponding to the input value and a low logic The number of interrupt requests received by the processing unit from the timing unit during the level. 一種控制裝置,包括: 一無線收發單元,用以無線收發資料;一通用輸入輸出單元;一計時單元;一記憶單元,用以儲存一程式;一處理單元,用以於載入該程式時執行一方法,該方法用以將該通用輸入輸出單元模擬成一讀卡介面,該方法包括:將來自該計時單元的一中斷請求設定為該處理單元中具有最高優先權的中斷請求;通知該計時單元發出該中斷請求的一間隔時間;以及當收到來自該計時單元的該中斷請求時,進入一中斷處理程序,其中於該中斷處理程序中,該處理單元從該通用輸入輸出單元讀取一輸入數值;以及一匯流排,耦接該無線收發單元、該通用輸入輸出單元、該計時單元、該記憶單元、以及該處理單元。 A control device comprising: a wireless transceiver unit for wirelessly transmitting and receiving data; a universal input/output unit; a timing unit; a memory unit for storing a program; and a processing unit for executing a method for loading the program, the method for Simulating the universal input/output unit into a card reading interface, the method comprising: setting an interrupt request from the timing unit as an interrupt request having the highest priority in the processing unit; notifying the timing unit to issue the interrupt request Interval time; and when receiving the interrupt request from the timing unit, entering an interrupt handler, wherein in the interrupt handler, the processing unit reads an input value from the universal input output unit; and a bus The wireless transceiver unit, the universal input/output unit, the timing unit, the memory unit, and the processing unit are coupled. 如申請專利範圍第6項所述之控制裝置,其中於該中斷處理程序中,該處理單元寫入一輸出數值至該通用輸入輸出單元。 The control device of claim 6, wherein in the interrupt processing program, the processing unit writes an output value to the universal input/output unit. 如申請專利範圍第6項所述之控制裝置,其中該讀卡介面是ISO7816介面。 The control device of claim 6, wherein the card reading interface is an ISO7816 interface. 如申請專利範圍第6項所述之控制裝置,其中該讀卡介面是ISO7811介面。 The control device of claim 6, wherein the card reading interface is an ISO7811 interface. 如申請專利範圍第6項所述之控制裝置,其中當該處理單元從該通用輸入輸出單元讀取該輸入數值時,該處理單元計算 對應於該輸入數值的一高邏輯位準期間以及一低邏輯位準期間,該處理單元分別從該計時單元接收到的該中斷請求的數目。 The control device of claim 6, wherein the processing unit calculates when the processing unit reads the input value from the universal input/output unit A number of the interrupt requests received by the processing unit from the timing unit during a high logic level period and a low logic level period corresponding to the input value. 如申請專利範圍第6項所述之控制裝置,其中該無線收發單元係為一雙模藍牙收發器,該雙模藍牙收發器發出一藍牙傳輸中斷請求至該處理單元。 The control device of claim 6, wherein the wireless transceiver unit is a dual mode Bluetooth transceiver, and the dual mode Bluetooth transceiver sends a Bluetooth transmission interrupt request to the processing unit. 如申請專利範圍第6項所述之控制裝置,其中該控制裝置係以單一積體電路實現。 The control device of claim 6, wherein the control device is implemented in a single integrated circuit.
TW105106746A 2016-03-04 2016-03-04 Method for emulating card reader interface and control device using the same TWI571814B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
TW105106746A TWI571814B (en) 2016-03-04 2016-03-04 Method for emulating card reader interface and control device using the same
CN201610168157.4A CN107153956B (en) 2016-03-04 2016-03-23 Method for simulating card reading interface and control device applying same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW105106746A TWI571814B (en) 2016-03-04 2016-03-04 Method for emulating card reader interface and control device using the same

Publications (2)

Publication Number Publication Date
TWI571814B true TWI571814B (en) 2017-02-21
TW201732698A TW201732698A (en) 2017-09-16

Family

ID=58608524

Family Applications (1)

Application Number Title Priority Date Filing Date
TW105106746A TWI571814B (en) 2016-03-04 2016-03-04 Method for emulating card reader interface and control device using the same

Country Status (2)

Country Link
CN (1) CN107153956B (en)
TW (1) TWI571814B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112003958A (en) * 2020-07-03 2020-11-27 拉卡拉支付股份有限公司 System and method for positioning transaction address

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI260553B (en) * 2005-01-13 2006-08-21 Phison Electronics Corp Virtual universal serial bus card reader having peripheral component interchange express bus
TW200951847A (en) * 2008-06-13 2009-12-16 Hyweb Technology Co Ltd Electronic data capturing system that simulates the functionality of a physical electronic data capture
US20120205451A1 (en) * 2005-03-26 2012-08-16 Privasys, Inc. Electronic Financial Transaction Cards and Methods
CN102932505A (en) * 2012-10-22 2013-02-13 深圳桑菲消费通信有限公司 NFC (Near Field Communication) mobile terminal
TW201442464A (en) * 2013-04-24 2014-11-01 Sunix Co Ltd The controlling system and the method of the remote device and the server

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AUPS331402A0 (en) * 2002-07-01 2002-07-25 S4 Technology Pty Limited Intelligent printer interface for managing data content and presentation
CN100524240C (en) * 2006-12-21 2009-08-05 英业达股份有限公司 Method for reading input/output port data
CN101123454B (en) * 2007-09-21 2011-04-20 北京交通大学 Data transmission method and system for mobile phone bank union card based on Bluetooth technology
CN102306434A (en) * 2011-09-16 2012-01-04 上海智翔信息科技股份有限公司 Mobile POS (point of sales) machine
CN203503070U (en) * 2013-09-30 2014-03-26 福建联迪商用设备有限公司 POS (point of sale) machine and device for protecting sensitive data in POS machine

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI260553B (en) * 2005-01-13 2006-08-21 Phison Electronics Corp Virtual universal serial bus card reader having peripheral component interchange express bus
US20120205451A1 (en) * 2005-03-26 2012-08-16 Privasys, Inc. Electronic Financial Transaction Cards and Methods
TW200951847A (en) * 2008-06-13 2009-12-16 Hyweb Technology Co Ltd Electronic data capturing system that simulates the functionality of a physical electronic data capture
CN102932505A (en) * 2012-10-22 2013-02-13 深圳桑菲消费通信有限公司 NFC (Near Field Communication) mobile terminal
TW201442464A (en) * 2013-04-24 2014-11-01 Sunix Co Ltd The controlling system and the method of the remote device and the server

Also Published As

Publication number Publication date
TW201732698A (en) 2017-09-16
CN107153956B (en) 2020-09-08
CN107153956A (en) 2017-09-12

Similar Documents

Publication Publication Date Title
US9467511B2 (en) Techniques for use of vendor defined messages to execute a command to access a storage device
US9824004B2 (en) Methods and apparatuses for requesting ready status information from a memory
US8639852B2 (en) Burst access protocol
TWI401593B (en) Electronic apparatus with touch panel and updating method for touch panel
CN113849433B (en) Execution method and device of bus controller, computer equipment and storage medium
US20100207905A1 (en) Method of Performing Timely Calibration of a Touch Parameter and Related Apparatus and System
US11314418B2 (en) Extensible storage system and method
CN108304334B (en) Application processor and integrated circuit including interrupt controller
US8176209B2 (en) Data communication system
TWI571814B (en) Method for emulating card reader interface and control device using the same
US9251107B2 (en) Immediate direct memory access descriptor-based write operation
CN114153674A (en) Authentication method, authentication apparatus, electronic device, and computer-readable storage medium
US7921334B2 (en) Program and method for error determination, and electronic apparatus
US9563586B2 (en) Shims for processor interface
CN113177388B (en) Device, system and method for testing and verifying IP (Internet protocol) core
CN109214144A (en) The soft core property right protection of IP and infringement identification method based on USB3.2 agreement TS2 training sequence
CN106406154B (en) debugging system and control method thereof
CN109725621A (en) A kind of secondary bus program based on 1553B bus and CAN bus is in line writing method
US20120191444A1 (en) Simulation device, simulation method, and computer program therefor
CN103984586A (en) Interface drive method for EMIF (external memory interface) and FPGA (field programmable gate array) under embedded type Linux system
CN114253784A (en) Configuration method and device of chip test mode, SOC chip and electronic equipment
TWI581103B (en) Method and system for implementing bus operations with precise timing
US9886406B2 (en) Electronic device and detecting method
CN109214143A (en) The soft core property right protection of IP and infringement identification method based on USB3.2 agreement TS1 training sequence
US11698875B2 (en) IC, monitoring system and monitoring method thereof