1. Hardware Design of Card Reader
The STCllF32XE microcontroller is a single clock/machine cycle (IT) microcontroller designed and produced by Hongjing Technology Co., Ltd. It is a new generation of 8051 microcontroller with high speed, low power consumption and super anti-interference. The instruction code is fully compatible with the traditional 8051, but the speed is 8 to 12 times faster. It has an internal integrated high-reliability reset circuit and can be used in high-speed communication, intelligent control, strong interference and other occasions. The STCllF32XE has 32 KB of Flash, 29 KB of EEPROM and 1 280 bytes of SRAM. The STCllF32XE used in this article is an LQFP-44 pin. In addition to the EA, ALE, PSEN and RST pins that can be defined as general I/O, there is also an additional P4 port. The programming supports ISP download function, which is convenient to use.
TRF7960 is one of the high-frequency (13.56MHz) multi-standard radio frequency identification (RFID) reader IC product series launched by TI (Texas Instruments). TRF7960 adopts the advanced package design of ultra-small 32-pin QFN, supporting ISO/IEC 14443A/B, ISO/IEC 15693, ISO/IEC 18000-3 and TI's contactless payment business and Tag-It transponder product series. The card reader using TRF7960 provides an internal clock for the microcontroller, and only needs a 13.56 MHz crystal oscillator to work, instead of two standard crystals, which helps to reduce the total bill of materials cost of the terminal card reader product. Due to the small number of components, the card reader IC consumes little power and occupies little space, so sensitivity and noise attenuation problems can be solved. Other integrated functions include fault checking, data formatting, framing, and anti-collision support suitable for multi-card reader environments. The communication between TRF7960 and the microcontroller can use flexible communication methods such as 8-bit parallel or serial (SPI). The chip also has a wide operating voltage range (2.7 to 5.5 V). The TRF7960 is ideal for applications such as secure access control, product authentication, and contactless payment systems.
In order to use the 1 KB extended SRAM inside the STCllF32XE microcontroller, an 8-bit parallel analog bus interface is used here. The P1 port of the microcontroller is connected to the DO~D7 of the TRF7960, and P2.6, P2.7, and P3.2 are used as control lines to connect to the DATA CLK, EN, and IRQ pins of the TRF7960 respectively. It should be noted that in order for the TRF7960 communication interface to support a 5 V logic level, the VDD_I/O pin of the TRF7960 should be connected to a 5 V voltage. Using an analog bus is a common method, especially for microcontrollers that do not support bus expansion. The use of an analog bus in this design can prevent bus conflicts between the TRF7960 and the SRAM inside the microcontroller. Figure 1 is a system hardware schematic diagram of the card reader.
PL2303 is a USB bus adapter chip produced by Prolific: It can realize USB to serial port conversion and is used to expand asynchronous serial ports for computers, or directly upgrade ordinary serial port devices to USB bus. PL2303 is fully compatible with USBl.1 and USB2.0; 3~5 V regulated output can meet different voltage output interfaces; full-duplex transmission and reception (RXD, TXD); MODEM control lines (RTS, CTS, DTR, DSR, DCD and RI); 5, 6, 7 or 8-bit data format; parity or no parity; 1 bit, 1.5 bit or 2 bits of stop bits; programmable baud rate 75 b/s~6 Mb/s, etc. Therefore, PL2303 is an ideal choice for mobile systems and embedded systems, and its small package can be embedded in any connector and handheld device. PL2303 has very low power consumption in both working mode and sleep mode, which is very suitable for bus-powered applications. The USB chip enables the card reader to eliminate the serial port and power supply port, and can communicate with PC management software through the USB interface.
The display screen uses a graphic dot matrix LCD module based on the ST7565S controller with a resolution of 128×64, supports serial interface, and does not have a Chinese character library. In order to enable the card reader to be used in library book management and other occasions that require Chinese character display, the serial memory W25X80 produced by Winbond is used to design the GB2312 Chinese character library and other picture libraries. Serial Flash memory is popular for its small size, high density, low power consumption, low price and simple operation. The Flash memory W25X80 produced by Winbond is an 8 Mb serial Flash with a size of 1 MB, divided into 4096 pages, each page is a 256-byte storage unit, and has a 256-byte buffer and an SPI interface. Using Flash to design a Chinese character library is not only very simple to operate, but also can be flexibly applied to multiple design schemes.
The following points should be noted in the system hardware circuit design:
① Try to keep the filter capacitor close to the chip, especially the 10 nF capacitor, so as to effectively filter the high-frequency signal;
②Try to reduce the wiring ground loop, so the grounding vias are required to be as close to the grounding terminal of the components or IC as possible;
③ The two inductors should be placed at 90°, which mainly reduces the coupling between the two inductors;
④The digital ground and analog ground are preferably in different places, preferably connected through magnetic beads or inductors;
⑤ Ensure that the middle part of the chip is sufficiently grounded. You can drill 9 holes on the circuit board to allow the chip to be fully grounded and dissipate heat;
⑥ When wiring, try to reduce the length of auxiliary lines, especially the RF front end, so that the components can be kept compact and the RF output front end can maintain smooth output;
⑦ It is best to add some test points in the circuit to facilitate the adjustment of the hardware circuit;
⑧Try to avoid passing digital signals through RF lines.
2 Card Reader Software Design
After designing the hardware platform, it is necessary to design the system software module. In the software module design, the analog communication between the STCllF32XE microcontroller and the TRF7960 is the most critical step, because only by opening up the key link of the underlying communication can the STCllF32XE further realize the basic operation of reading/writing the card by controlling the TRF7960. In order to achieve this step, we must first figure out the read and write timing of the TRF7960.
The starting condition is that CLK is high, then the 8-bit address is sent first, and then the data is sent. The sending format is sent on the falling edge of the clock. When CLK is high, there is a falling edge on the A/D, indicating the end. According to the timing diagram, the C language implementation code for the STCllF32XE microcontroller to read/write 1 byte from the TRF7960 can be written:
The STCllF32XE microcontroller mainly implements complex read/write control of TRF7960 by calling these two most basic functions. The biggest advantage of using analog bus communication is that the code written in C language can be easily transplanted to various microcontrollers that do not support bus expansion, which increases the reusability and portability of software modules.
After the key links of the underlying communication are opened, each software module can be written and debugged step by step. Figure 3 is the software module flow of the card reader multi-protocol adaptive function.
3 Conclusion
This paper uses Hongjing's high-speed, low-cost single-chip microcomputer and TI's TRF7960 multi-protocol card reader chip and corresponding peripheral circuits to design a contactless radio frequency card reader. The design is based on ISO/IEC 14443A/B and ISO/IEC 15693 multi-protocol standards, and completes the system hardware circuit construction and system software design. Actual use has proved that the card reader has stable operation, strong anti-interference ability, high cost performance, flexible and convenient operation, and the product has strong market competitiveness. It will produce good economic benefits when put into use.
Previous article:Design of Streaming Media System Based on CDMA2000 1X
Next article:Current status and development of CMMB, the industry standard for mobile multimedia broadcasting
- Popular Resources
- Popular amplifiers
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- Basic principles of STM32 serial communication
- 09. Anlu SparkRoad domestic FPGA evaluation [practical] key control VGA display
- Several interesting GIF animations
- Several issues on the second-order low-pass filter circuit of voltage-controlled voltage source
- 74 series chip information
- EEWORLD University Hall----Live Replay: Application of TI Precision ADC in Transmitter
- TPS23861 48V power supply has a small probability of burning out.
- Free resource download | Five trends driving change in power management
- My Journey of MCU Development (Part 2)
- 【Development and application based on NUCLEO-F746ZG motor】13. Parameter configuration - USART3 configuration