Introduction
Birth History
"Card Reader", as the name implies, is a device that reads data, but it can not only support data reading, but also Support data writing. The initial design idea is mainly to make up for the defects of digital camera data output. Since the USB interface was not popular in the early days, the output ports of digital cameras were all connected to the serial port of the computer. Since the data transmission speed of the serial port was very low, it would take a lot of waiting time to copy these data to the hard disk. . Therefore, the card reader came into being.
Development
With the development of digital products such as MP3 and PDA, the development of card readers has been strongly promoted. The standard 32M or 64M flash memory of MP3 is obviously not enough to meet our needs, so adding 128M flash memory has become our standard configuration, but if we want to copy MP3 songs to the flash memory, we can only do it through an MP3 player. , And at this time we need a dedicated connection, driver and software to complete, so the portability of the MP3 player is much worse, and if we use a card reader at this time, there is no need for the intervention of the MP3 player. , You can directly store MP3 songs on the flash memory, so that MP3 becomes more convenient to use.
In addition, the IC card reader can also be a smart card reader that we usually use. For example, we use prepaid electricity cards, gas meter cards, water meter cards, and public transit cards. It can be seen on the market that card readers are integrated into self-service all-in-one payment machines or connected to the computers of bank counter attendants. There are contact type and non-contact type, used to read different contact type cards and non-contact type cards. IC card readers are mainly used to read and write data for smart card balance inquiry and recharge.
Principle
The reader is composed of microcontroller, keyboard, display, monitoring circuit and other parts. IC card uses X76F100Y. X76F100 is a secure serial FLASH E2PROM of 128×8 bits, in which the read password and write password are 64 bits respectively. Package the chip on a card, insert the card into the card holder of the IC card reader, the reader can read and write to it, and realize functions such as encryption, inquiry, deposit, and withdrawal. The IC card socket has 8 pins. When the X76F100Y is inserted, it happens to be connected to these pins. There are also two fixed ends, one of which is connected to a spring plate on the card seat, and the two contacts and the spring plate are equivalent to a normally closed switch. When the card is not inserted, the reed is closed and the P3.2 pin remains low; when the card is inserted, the reed is pushed open, and the P3.2 pin becomes high. When the microcontroller detects that the P3.2 pin becomes high, it will reset the RST pin of the X76F100 through P1.3.
Single-chip microcomputer
The single-chip microcomputer uses GMS97C52. It has 8K bytes of ROM, 256 bytes of RAM, and 32 I/O ports. Port P1 is connected to serial devices X25045 and X76F100. Ports P0 and P2 are used for keyboard and display. P3.2 of port P3 is used for Check whether the IC card is inserted. The remaining 7 ports can be used for other function expansion.
Keyboard circuit
For convenience, the keyboard interface circuit is implemented with I/O ports. It has a 4×4 structure and 16 keys. Among them, there are 11 number keys, 4 function keys, and 1 enter key. Number keys: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ← (backspace). Function key: query? , Storage +, withdrawal -, change password*. Inquiry: The user can inquire about the amount of money deposited in the card by reading the password. Deposit+: The user can deposit money into the card by writing a password. Withdrawal -: The user can withdraw money from the card by writing a password. Password change*: It is divided into reading password modification and writing password. For convenience, make the read password and write password the same. Press this key to modify the read password and write password at the same time. Enter key: the 8-digit password or deposit and withdrawal amount is input to confirm, and the new password is input to confirm.
Display circuit
The display part adopts LED display, which is also realized by I/O port. Used to display the system status, the entered password or the amount to be deposited and withdrawn, and error messages. Because the drive current of GMS97C52 is limited, add inverter SN74F04 to P0 and P2 to increase the drive capacity. Its sink current is 64mA and output current is 15mA, which can guarantee the sink current required for position selection.
Monitoring circuit
The monitoring circuit includes watchdog timer, voltage monitoring circuit and E2PROM memory. Its function is: generate RESET signal to GMS97C52 when power on and off; watchdog monitors the system to prevent crash.
Technical indicators
Communication interface: Standard RS232
Deck life: 100,000 times
Main controller: 8-bit 51 series Single chip microcomputer
Electromagnetic radiation: Anti-interference CE89/336
Card self-test: Determine the card's forward and reverse direction and card type
Communication rate: Automatic wave selection Special rate (57600bp and 9600bps)
Read and write card type: SIEMENS: SLE4404/4406/4432/4442/4428
ATMELl: AT24C01/24C02/24C16/24C64/AT45D041 AT93C46/ 88S102/88SC1608
CPU card: T=0, T=1
Support CPU card that conforms to ISO7816-3, 4 standard and EMV standard (T=0, T=1) , SAM card, logic encryption card and memory card; support two-way demonstration of CPU card and SAM card
Development environment: 16-bit operating platform supports Turbo C and FoxPro in DOS environment
Development environment: VB, VC++, powerbuilder, delphi, VFP under win95/98/2000 environment of 32-bit operating platform
Classification
By interface
From the interface point of view, the card readers mainly include: parallel port card reader, serial port card reader, USB card reader, PCMICA card reader and IEEE 1394 card reader. The first two card readers have basically been eliminated due to slow interface speed or inconvenient installation. USB card readers are currently the most popular card readers on the market. PCMICA card readers are mainly used in notebook computers, while IEEE 1394 card readers are not widely used because the supported interfaces are not yet popular.
According to the protocol
The card reader can be divided into two types from the card reading protocol, one is the 485 card reader and the other is the Wiegand card reader. Wiegand 26 and 34 agreements, these two agreements are conventional agreements.
According to the card reading type
The card reader is divided into the IC card reader and the ID card reader from the card reader type. The IC card reader is a non-contact IC card Read and write equipment, it realizes the connection with the PC through the USB interface, a separate 5V power supply or keyboard port to get electricity, it supports access to all functions of the radio frequency card. This series of equipment is used in card issuance systems for access control, attendance, conference sign-in, highways, tourism, parking lots, bus tolls, shopping malls, membership systems, and various application systems.
The ID card reader is used to read ID cards. The reader supports plug-and-play. It can be plugged and unplugged at will during use. No external power supply is required. The user does not need to load any drivers. Windows system Think of it directly as a HID device keyboard. After the computer's USB port is connected to the card reader, the card reader starts self-checking and initialization with a beep, and then the initialization is successful with a beep, and it enters the state of waiting for card swiping.
The ID card reader is used in data entry, information query, Internet cafe registration, book borrowing, conference sign-in, access control and other occasions.
The main flash memory or multimedia cards on the market are: SM card, CF card, MicroDrive, MemoryStick, MMC card and SD card. According to the type of flash memory to be read, card readers are divided into single-function card readers and multi-function card readers. Single-function card readers generally can only read one type of flash memory card. For example, CF card readers can only read CF flash memory cards, and SM card readers can only read SM flash memory cards. This type of card reader is more expensive Low, as long as 100 yuan; while the multi-function card reader is for all kinds of flash memory cartoons, whether it is SM card, CF card or MemoryStick, it can easily read, but the price of this kind of product is slightly higher, according to reading flash memory How many types of cards, the price ranges between 200-500.
Data exchange method
According to the data exchange method between IC card and reading and writing equipment, IC card can be divided into contact type IC card and non-contact type IC card.
When in use, a contact IC card is an IC card that directly contacts and connects the card's integrated circuit with an external interface device through tangible electrode contacts for data exchange. The non-contact IC card communicates the data in the integrated circuit in the card with the interface device of the external device through radio waves or electromagnetic field induction. The card can read and write data without directly contacting the electrodes of the interface device.
Frequently Asked Questions
1. The problem that the chip of the card is facing up or down
The problem of the chip facing up or down in the card reader is based on the card reader The model of the device is different. For my RDM-EB, the card chip is facing down; RDM-ET, the chip is facing up; S3 series products, the card chip is facing up.
2. Problems with automatic card test
The automatic card test function in the RDM demo program is for reference only, not the only criterion for judging the card type, because it is the characteristics that are read when the card is tested The characteristic byte of the card may be different depending on the manufacturer of the card. When the test card is inaccurate, please select the card model manually.
3. Password verification problem
When the contact card reader is verifying the password, if it is not powered off after the previous verification of the password, no matter what password is entered They are all considered to be correct, and the correctness of the password can only be judged after the power is turned off.
4, MF-50U
When using the MF-50U card reader, you cannot connect the card reader first, but you should install the USB driver first, and then connect the USB reader Card device, the system will automatically set the default port at this time.
5, M F-50
In the MF demonstration program, after using the automatic test function, if you continue other operations, you must first power off the card (that is, remove the card from the induction area). Remove); If you want to change the baud rate of the radio frequency card reader to continue working, you should power off the reader first, and then the baud rate can be modified successfully, because the card reader can only be changed when it is just powered on. It is in the state of automatically detecting the baud rate.
6, IC_InitType
This function is not a card testing function. It does not have a card testing function. Its function is to tell the reader the card model to be operated.
7. Error in initializing the serial port
Serial port resources have been occupied, (including the abnormal exit after initializing the serial port without closing the serial port, and then to initialize the serial port); computer and reader The baud rate of communication is inconsistent with the default baud rate of the reader; the serial port for communication between the computer and the reader is inconsistent with the default serial port of the reader; the device is connected incorrectly and the contact is poor.
8. DES algorithm plus and minus encryption
In VB, some data is different from the original text after using DES algorithm to encrypt and reduce encryption. The solution is: ciphertext can be defined It is a global variable and is directly passed to the decryption function for decryption; or the encrypted ciphertext is expressed as BYTE and passed by address.
9. Erase
10. The ic card can only write new data correctly after the data is successfully erased; the starting address must be when writing data to the 102 card It is an even number, and the data length must also be an even number.
Precautions
Plug-in card socket
1. For the plug-in card socket, pay attention to prevent the card from being used too hard, which will damage the card The seat switch is in place, and it also has a certain degree of damage to the card.
2. Pay attention to keeping the card clean. If the chip of the card is not clean, not only the card will not work normally, but also the contact points of the card socket will be polluted.
3. It is very important to operate the card after the card is in place. In an unstable situation, the reader will power on the card, which may cause damage to the card.
4. After the operation of the card in the plug-in card holder is completed, the application program should first send a command to the reader to power off the card, and pull out the card after the power off is completed. Pulling out the card without powering off may damage the card.
Push-type card holder
1. Push-type card holder adopts a push-in card, and the card will pop up when the card is pushed in when it is taken out. This structure reduces the friction between the card and the electric shock, and has certain advantages for protecting the card. But it can also damage the card if it is used incorrectly.
2. The most common error situation is that when the card is removed, it is not pushed in again to automatically eject the card, and the card is pulled out directly. This situation will seriously damage the card, and it will also seriously damage the card. Seat.
3. Pay attention to keeping the card clean. The card socket of any structure must be in close contact with the card chip in the end, so if the card chip is dirty, it will affect the contacts of any kind of card socket Cause pollution.
Using environment and methods
The proper custody and correct use of cardholders are the most economical and effective means to prolong the service life and reliability of IC cards. Keep it properly, do not bend at will, do not touch the contacts at will, do not approach the strong static environment at will, pay attention to keeping the surface of the card clean, etc., will help improve the reliability of the IC card and extend its service life.
Use of the cleaning card
The cleaning card is a cleaning measure adopted after the contacts of the card socket are contaminated after the reader is used for a period of time. The method of using the cleaning card is: insert the cleaning card into the reader when the power is cut off, and then clean the card holder by electric shock after inserting it back and forth.
The cleaning card is made of polyester, polyethylene, polypropylene or hard paper as a raw material to make a cleaning card substrate. The surface of the cleaning card substrate is heat-bonded or bonded with a layer of non-woven fabric and abrasive (oxidized Aluminum or silicon carbide) non-woven cloth, fine sandpaper, fine sand cloth or textiles with cleaning ability and other cleaning materials, which are made according to the above structure, and a certain specification cleaning card is inserted into the card machine, and the cleaning card is inserted and removed several times , You can clean the contact surface of the card machine, which is extremely convenient and effective, which can effectively ensure the long-term normal operation of the card machine.
Components
Reader and radio frequency tag reading and writing equipment is one of the two important components of the radio frequency identification system (tag and reader). Radio frequency tag reading and writing equipment also has some other popular aliases according to the characteristics of specific realization functions, such as: Reader, Interrogator, Communicator, Scanner, Reader and Writer, Programmer, Reading Device, Portable Readout Device, AEI Equipment (Automatic Equipment Identification Device), etc. Under normal circumstances, the radio frequency tag reading and writing equipment should be designed according to the reading and writing requirements of the radio frequency tag and application requirements. With the development of radio frequency identification technology, radio frequency tag reading and writing equipment has also formed some typical system implementation modes. From the perspective of the most basic principles, radio frequency tag reading and writing devices generally follow the basic pattern shown in the figure.
Communication method
The reader can send commands to the radio frequency tag through the space channel
Between the reading and writing device and the radio frequency tag The reader must send commands to the radio frequency tag through the space channel, and the radio frequency tag will make the necessary response after receiving the command from the reader, thereby realizing radio frequency identification. In addition, in the radio frequency identification application system, in general, the non-contact collection of radio frequency tag data realized by the reader or the tag information written by the reader to the radio frequency tag must be returned to the application system or from the application system. Application system, which forms the API (Application Program Interface) between the radio frequency tag reading and writing device and the application system program.
Under normal circumstances, the reader is required to be able to receive commands from the application system and respond accordingly (return the collected tag data, etc.) according to the application system's commands or the agreed protocol.
RF module (RF channel) and baseband module
From the perspective of circuit implementation, the reader itself can be divided into two parts, namely : RF module (RF channel) and baseband module.
There are two main tasks implemented by the radio frequency module. The first is to modulate (load) the command that the reader wants to send to the radio frequency tag to the radio frequency signal (also called the reader/radio frequency tag). The radio frequency working frequency) is sent out via the transmitting antenna. The sent radio frequency signal (which may contain command information to the tag) is transmitted (irradiated) to the radio frequency tag through space, and the radio frequency tag responds to the radio frequency signal irradiated on it, forming a reflected echo back to the reader antenna Signal.
The second task of the radio frequency module is to realize the necessary processing of the echo signal of the radio frequency tag back to the reader, and demodulate (unload) from it to extract the data sent back by the radio frequency tag . The baseband module also includes two tasks. The first is to process (encode) the commands issued by the reader's intelligent unit (usually the computer unit CPU or MPU) to facilitate modulation (loading) onto the RF signal. Signal. The second task is to achieve the necessary processing (including decoding) of the tag return data signal that has been demodulated and processed by the radio frequency module, and the processed result is sent to the reader's intelligent unit.
Under normal circumstances, the intelligent unit of the reader is also classified as the baseband module part. In principle, the intelligent unit is the control core of the reader. From the implementation point of view, the embedded MPU is usually used, and the corresponding MPU control program is compiled to realize the intelligent processing of the sending and receiving signals and the interaction with the final application program. Interface API. The interface between the RF module and the baseband module is modulation (loading)/demodulation (unloading). In the system implementation, the RF module usually includes the modulation/demodulation part, and also includes the necessary processing of the echo small signal after demodulation ( Such as magnification, shaping) and so on. The separation of the transceiver of the radio frequency module is a key issue that the radio frequency module must handle when a single antenna system is used.