Research on H4001 non-contact IC card reading program

Publisher:Jinyu521Latest update time:2011-08-27 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

【Abstract】 This paper introduces the card reading mechanism of a contactless IC card (H4001) based on the P4095 chip, and proposes a Manchester code decoding method. Keywords: contactless IC card, Manchester code, decoding

After more than 20 years of development, IC cards (Integrated Circuit Cards) have been widely used in finance, telecommunications, insurance, commerce, national defense, public utilities and other fields. IC cards can be divided into two categories according to the connection method of the external interface device: contact IC cards and contactless IC cards (also known as radio frequency cards). For contact IC cards, when the IC card communicates data with the outside world, the electrode contacts of the chip must be directly connected to the IC card reader/writer device; when the contactless IC card is in use, it does not need to be directly connected to the IC card reader/writer device, but realizes data communication with the IC card reader/writer device through radio waves or electromagnetic induction. Contactless IC cards have their unique advantages in environments with high card swiping speed requirements, harsh card use environment, and serious pollution.
We used the P4095 chip produced by EM (EM MICROELECTRONICMARIN SA, 2074 MARIN-Switzerland) to make an IC card reader, and on this basis, we wrote the card reading program for EM's H4001 contactless IC card.
1 Working principle

The working principle of the card reader is shown in Figure 1.
When the IC card (H4001) is close to the card reader, the two circuits in Figure 1 resonate at 125kHz. The IC card obtains energy from it and continuously sends signals out. P4095 receives the signal and sends it to the microcontroller to analyze and process the card information.

2 Introduction to P4095 chip
This chip integrates a phase-synchronous logic system, which can obtain a carrier frequency that is the same as the coil resonant frequency; no external crystal oscillator is required; the carrier frequency is 100 to 150kHz; it supports a variety of IC card transmission protocols, such as H400X, P4150, P4069, etc.; the package form is SO16 or PSOP216. The RFID card reader made with P4095 can complete the following functions: (1) Carrier frequency drives the coil. (2) Amplitude modulation of the magnetic field of the writable card. (3) Amplitude demodulation of the modulated signal caused by the card on the coil. (4) Communicate with the microprocessor through simple connections.
The operation of the chip is controlled by SHD and MOD. When SHD is high, it enters sleep mode. After the chip is powered on, SHD must be high to initialize the chip correctly, and then SHD is connected to a low level, so that the chip can emit an RF field, and the demodulation module outputs the signal read from the coil through DEMOD__OUT. MOD is grounded to put the chip into read-only state. The application diagram is shown in Figure 2 below.
3 H4001 Principle
H4001 is a CMOS integrated circuit used in heterodyne wireless transmission. The circuit is driven by a coil placed in a magnetic field and obtains a clock pulse from it. The switch modulated current can send back 64 bits of information contained in the laser programmable logic device.
The serial output data includes 9 start bits, 40 information bits, 14 check bits, and 1 stop bit.
And these 64 bits of information are modulated by Manchester code. Logic "1" generates a falling edge within a bit period, and logic "0" generates a rising edge within a bit period. The 64-bit Manchester code is shown in Figure 3. Once sent, it will be sent continuously. Figure 4 shows the relationship between the logic level and the Manchester code. From the figure, it can be seen that the 64-bit signal is continuously cyclically output.

4 Manchester code decoding method
According to the characteristics of Manchester code, there are two situations in which the duration of the high level in Manchester code lasts: half a bit period and one bit period. The situation in which the high level lasts for one bit period is because the high level in the first half bit period belongs to the previous logic "0", and the high level in the second half bit period belongs to the next logic "1". According to this characteristic, we analyze the waveform shown in Figure 5, first find a down jump, and then find an up jump, the purpose is to confirm whether the signal (Manchester code) is received. Then enter a delay stage t (delay t is greater than half a bit period and less than one bit period). Then read the signal, it must be "1". Then this "1" must be a certain bit in the data sequence (if it is not "1", start over). The next step is to find the down jump of the bit "1", and after finding it, delay t again, and continue to read the next bit of data. Repeat the operation of finding jumps and delays, and the Manchester code sequence can be read correctly. Since H4001 outputs its information in a continuous cycle in the electromagnetic field, in order to ensure that the 64-bit information on the card is fully read, we read 128 bits from each card.

According to the characteristics of H4001, we know that its data sequence starts with 9 consecutive "1", followed by data and check bits. Therefore, as long as 9 consecutive "1"s are found in the above 128 bits of information, and the subsequent data bits and row and column check bits are analyzed, the information of this card can be determined.
5 Research results
During the experiment, the program compiled according to the above principle can correctly read the information on the card every time.
According to the measurement, the card reading distance of the program is 9.5cm~11.5cm. The card reading
time is 0.086s. (Measurement method: put the card on the coil, start the program, and stop when the signal is correctly read.)
6 Program flow chart
See Figure 6 for the program flow chart. The program is omitted.

Reference address:Research on H4001 non-contact IC card reading program

Previous article:MB89163 single chip microcomputer and its application in remote control
Next article:Research on H4001 non-contact IC card reading program

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号