CN101719053A - Method for reading IIC storage card by SPI interface - Google Patents
Method for reading IIC storage card by SPI interface Download PDFInfo
- Publication number
- CN101719053A CN101719053A CN200910230992A CN200910230992A CN101719053A CN 101719053 A CN101719053 A CN 101719053A CN 200910230992 A CN200910230992 A CN 200910230992A CN 200910230992 A CN200910230992 A CN 200910230992A CN 101719053 A CN101719053 A CN 101719053A
- Authority
- CN
- China
- Prior art keywords
- spi
- interface
- iic
- card reader
- processor mcu
- 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.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method for reading an IIC storage card by an SPI interface. A power supply, a crystal oscillator, an LED indicating lamp, an SPI interface, a processor MCU and an IIC interface storage card reader are comprised, wherein the power supply, the crystal oscillator, the LED indicating lamp, the SPI interface and the IIC interface storage card reader are connected with the processor MCU by a data line, and the operation on the IIC interface storage card reader is realized by the communication between the SPI interface and the processor MCU; the IIC interface storage card reader is set to be an SPI ancillary machine, and the processor MCU is set to be an SPI host machine; the IIC interface storage card reader is connected to the processor MCU by an SPI bus to realize the SPI communication; and the processor MCU has the functions of receiving data transmitted by the processor MCU through the communication between the SPI interface and a processor MCU of equipment, analyzing a command and a parameter for operating an IC card according to a prearranged format and then converting the command and the parameter into a protocol format of an IIC to carry out corresponding operation on the IIC interface storage card.
Description
Technical field
The present invention relates to a kind of tax controlling equipment technical field, specifically a kind of method that reads the IIC storage card by the SPI interface.
Background technology
The card reader majority is communicated by letter with miscellaneous equipment as interface with serial ports or USB at present.
In system, serial port resource is limited, but is to use very frequently, and a lot of devices and peripheral hardware use serial ports and devices communicating, and this has just caused the in short supply of serial port resource.Frequent switching serial equipment not only causes damage but also the exploitation of influence or the efficient of use of interface easily.
USB interface does not have integrated in some middle and high shelves MCU, need add the USB chip if want to realize usb communication, and in internal system, usb communication is seldom adopted in communicating by letter of MCU and other components and parts.
In addition, part MCU does not have the IIC communication interface, and its GPIO can not be arranged to the transmitted in both directions pattern of input and output, can not Simulation with I IC communication, components and parts that therefore can not direct control IIC interface.
Summary of the invention
The purpose of this invention is to provide a kind of method that reads the IIC storage card by the SPI interface.
A kind of method that reads the IIC storage card by the SPI interface of the present invention, realize in the following manner, hardware configuration is made up of power supply, crystal oscillator, LED light, SPI interface, processor MCU and IIC interface memory card card reader, power supply, crystal oscillator, LED light, SPI interface and IIC interface memory card card reader are connected with processor MCU by data line, utilize the SPI interface with processor MCU communicate by letter, realization is to the operation of IIC interface memory card card reader, and read step is as follows:
IIC interface memory card card reader is set to the SPI slave, processor MCU is set to the SPI main frame, IIC interface memory card card reader is connected to processor MCU by spi bus, realize SPI communication, the function of processor MCU is to be connected with the processor MCU communication interface of equipment by the SPI interface, the data that receiving processor MCU sends, and the order and the parameter that go out to operate IC-card according to the format analysis of appointing in advance, the protocol format that converts IIC then to is operated accordingly to the storage card on the IIC interface.
Processor MCU realizes communicating by letter with SPI by the SPI interface that carries and IIC interface and communicates by letter with IIC, or simulates the SPI interface or the realization of IIC interface is communicated by letter with SPI or IIC communicates by letter by GPIO.
LED is the card reader relay indicating light, and when card reader was worked, LED is luminous to be produced and maintenance with convenient.
Excellent effect of the present invention is: overcome the deficiency that prior art exists, develop a kind of card reader of read-write IIC storage card that can external SPI interface that again can be built-in, to save serial port resource, the unmatched problem of solution interface.
Description of drawings
Fig. 1 is the circuit theory diagrams of card reader.
Embodiment:
The present invention will be further described below in conjunction with the drawings and specific embodiments:
Of the present inventionly a kind ofly read the method for IIC storage card by the SPI interface, as shown in Figure 1, hardware is by power supply, crystal oscillator, and LED light, the SPI interface, processor and IIC interface memory card card reader are formed.Described card reader utilizes the SPI interface to be connected with the MCU communication interface of equipment, realizes the operation to IC-card.Card reader is set to the SPI slave, and the MCU of described equipment is set to the SPI main frame, and card reader is connected to the MCU of equipment by spi bus, realizes SPI communication.
Processor is middle-grade or low-grade MCU, can communicate by letter with IIC interface realization SPI by the SPI interface that carries and communicate by letter with IIC, maybe can simulate SPI interface or IIC interface realization SPI communication or IIC communication by GPIO.The function of processor is to communicate by letter with the MCU of equipment by the SPI interface, receive the data that MCU sends, and the order and the parameter that go out to operate IC-card according to the format analysis of appointing in advance, the protocol format that converts IIC then to is operated accordingly to the storage card on the IIC interface.
Processor MCU realizes communicating by letter with SPI by the SPI interface that carries and IIC interface and communicates by letter with IIC, or simulates the SPI interface or the realization of IIC interface is communicated by letter with SPI or IIC communicates by letter by GPIO.
LED is the card reader relay indicating light, and when card reader was worked, LED is luminous to be produced and maintenance with convenient.
Embodiment
Card reader of the present invention is by power supply, crystal oscillator, and LED light, the SPI interface, processor and IIC interface memory card card reader are formed.
Typical embodiment of the present invention is that system is built-in.SPI interface among the figure directly is connected with the SPI interface of MCU, can realize that the communication of many slaves of single host communicates by letter with single host list slave.The CS of SPI can omit and not connect when being configured to the communication of single host list slave.When adopting external mode, system will reserve the SPI interface.
After processor receives the data that the SPI main frame sends, according to data layout resolve command and the parameter appointed with main frame, so, require when the program of exploitation MCU, will cooperate with card reader and carry out.In addition, the basic communication agreement of SPI and IIC is all fairly simple, has just repeated no more here.
During this card reader is utilized, low-grade MCU is as processor, realized the conversion of SPI agreement and IIC agreement, solved the unmatched problem of interface, saved serial port resource, it is low to have a cost, portable strong advantage.
Claims (3)
1. method that reads the IIC storage card by the SPI interface, it is characterized in that, comprise power supply, crystal oscillator, LED light, SPI interface, processor MCU and IIC interface memory card card reader, power supply, crystal oscillator, LED light, SPI interface and IIC interface memory card card reader are connected with processor MCU by data line, utilize the SPI interface with processor MCU communicate by letter, realization is to the operation of IIC interface memory card card reader, and concrete steps are as follows:
IIC interface memory card card reader is set to the SPI slave, processor MCU is set to the SPI main frame, IIC interface memory card card reader is connected to processor MCU by spi bus, realize SPI communication, the function of processor MCU is to be connected with the processor MCU communication interface of equipment by the SPI interface, the data that receiving processor MCU sends, and the order and the parameter that go out to operate IC-card according to the format analysis of appointing in advance, the protocol format that converts IIC then to is operated accordingly to the storage card on the IIC interface.
2. card reader according to claim 1 is characterized in that, processor MCU realizes communicating by letter with SPI by the SPI interface that carries and IIC interface and communicates by letter with IIC, or simulates the SPI interface or the realization of IIC interface is communicated by letter with SPI or IIC communicates by letter by GPIO.
3. card reader according to claim 1 is characterized in that, LED is the card reader relay indicating light, and when card reader was worked, LED is luminous to be produced and maintenance with convenient.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200910230992A CN101719053A (en) | 2009-11-27 | 2009-11-27 | Method for reading IIC storage card by SPI interface |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200910230992A CN101719053A (en) | 2009-11-27 | 2009-11-27 | Method for reading IIC storage card by SPI interface |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101719053A true CN101719053A (en) | 2010-06-02 |
Family
ID=42433633
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN200910230992A Pending CN101719053A (en) | 2009-11-27 | 2009-11-27 | Method for reading IIC storage card by SPI interface |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101719053A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102591783A (en) * | 2010-11-03 | 2012-07-18 | 辉达公司 | Programmable memory controller |
CN109799770A (en) * | 2019-04-09 | 2019-05-24 | 杭州勤诚微电子科技有限公司 | Dynamic environment monitoring device |
CN114721317A (en) * | 2022-06-02 | 2022-07-08 | 中国船舶重工集团公司第七0七研究所 | Network communication control system and method based on SPI controller |
-
2009
- 2009-11-27 CN CN200910230992A patent/CN101719053A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102591783A (en) * | 2010-11-03 | 2012-07-18 | 辉达公司 | Programmable memory controller |
CN102591783B (en) * | 2010-11-03 | 2015-08-26 | 辉达公司 | Programmable memory controller |
CN109799770A (en) * | 2019-04-09 | 2019-05-24 | 杭州勤诚微电子科技有限公司 | Dynamic environment monitoring device |
CN114721317A (en) * | 2022-06-02 | 2022-07-08 | 中国船舶重工集团公司第七0七研究所 | Network communication control system and method based on SPI controller |
CN114721317B (en) * | 2022-06-02 | 2022-09-16 | 中国船舶重工集团公司第七0七研究所 | Network communication control system and method based on SPI controller |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102289359B (en) | Wireless light emitting diode (LED) display screen control system based on ZigBee | |
CN103136138A (en) | Chip, chip debugging method and communication method for chip and external devices | |
CN102801818B (en) | Universal sensor interface acquisition system based on ZigBee technology | |
CN204028959U (en) | A kind of portable IC card supplements read write line with money | |
CN102637453B (en) | Phase change memory including serial input/output interface | |
CN102445981B (en) | Data transmission system and data transmission method | |
CN101719053A (en) | Method for reading IIC storage card by SPI interface | |
CN203278279U (en) | Multifunctional mobile power supply | |
CN102938659A (en) | NFC (Near Field Communication) external member and realization method thereof | |
CN203167288U (en) | Internet of Things gateway development platform facing heterogeneous network environments | |
CN102693203A (en) | Embedded USB (universal serial bus) host | |
CN201628975U (en) | IIC memory card read-write device with SPI interface | |
CN201788900U (en) | Relay board and control system thereof | |
CN109447627B (en) | Remote recharging device based on Lora wireless communication | |
CN203720584U (en) | Mini-size COM Express processor module based on ARM processor | |
CN108628793B (en) | SPI communication circuit and method | |
CN204613818U (en) | A kind of handheld terminal based on COM-Express module | |
CN106782131A (en) | A kind of electronics welcome guest's board of the bulk transfer information based on bluetooth Mesh technologies | |
CN208444269U (en) | Keyboard and mouse isochronous controller | |
CN101893856A (en) | Relay board and control method and device thereof | |
CN201285527Y (en) | Network computer based on FPGA | |
CN101923631B (en) | CPLD-based low-frequency ID card real-time simulator | |
CN217428119U (en) | Portable Bluetooth communication device and equipment | |
CN204883192U (en) | Controller | |
CN204229427U (en) | Intelligence Kato |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Open date: 20100602 |