0 Introduction
The digital transaction terminal of the electronic transaction system for agricultural and sideline products is referred to as the IC card intelligent transaction integrated machine or POS machine. It is used in the transaction process of agricultural and sideline products. When the power supply and communication are normal, the system can provide a reliable, fast and convenient transaction platform for buyers and sellers. Buyers and sellers conduct transactions on the IC card transaction terminal. The digital transaction terminal can perform multiple cumulative weighing, peeling, preset peeling, and weighing by kilogram for the same variety by reading and processing the data of the electronic scale. The IC card digital transaction terminal automatically identifies the management fee rate of the buyer and seller during the transaction, automatically transfers the transaction amount of the two parties from the buyer's IC card to the seller's IC card, and automatically deducts the management fee receivable from the IC cards of both parties.
1 Overall structural design of the system
The electronic settlement system is a very real-time system. If there is a deviation in logic and timing, it will cause serious consequences. This paper builds a new electronic settlement terminal that integrates card reading, display, keyboard, weighing, printing and communication functions.
In terms of hardware, Philips' LPC2292 is used as the central processor, and PCA82C251 is used to realize the interface between the CAN protocol controller and the physical bus, so that the POS machine has the ability of two-way communication. In terms of software, the embedded real-time operating system μC/OS-Ⅱ is transplanted to realize the advantages of multi-task scheduling. On the embedded platform, the control program is written to complete the control of each functional module to meet the requirements of the processing equipment with high processing speed and processing power, and has strong real-time task scheduling capabilities.
2 System hardware design
The hardware platform of this system is mainly composed of an embedded processor, power supply, CAN bus interface, and various external devices. The overall structure diagram of the system is shown in Figure 1.
2.1
The main control chip of the microprocessor is the ARM7 series microprocessor LPC2292. LPC2292 is a microprocessor based on a 32/16-bit ARM7TDMI-S core that supports real-time simulation and embedded tracing. It can use 16-bit Thumb mode to reduce the code size by more than 30% for applications that have strict control over the code size, while the performance loss is very small. It has 16 KB on-chip static RAM and 256 KB on-chip FLASH program memory. 128-bit wide interface/accelerator. Two interconnected CAN interfaces with advanced acceptance filters, up to 112 general IO ports (withstand 5 V voltage), and 9 edge or level triggered external interrupt pins. Multiple serial interfaces, including two 16C550 industrial standard UARTs, high-speed I2C interface (400 Kb/s) and two SPI interfaces. It has an internal integrated PWM unit, real-time clock and watchdog. The rich on-chip resources make LPC2292 particularly suitable for industrial production control, medical systems, access control and POS machines.
2.2 Power supply and reset circuit
In order to keep the power supply pure, the LPC2292 core and on-chip peripherals are powered by 1.8 V and 3.3 V respectively. The LDO chip uses SPX1117M3-1.8 and SPX1117M3-3.3, which are characterized by large output current and high output voltage accuracy. Since the LPC2292ARM7 controller has independent analog power supply and analog ground pins, in order to reduce noise and error probability, the analog power supply and digital power supply should be isolated, so a 10 mH inductor is used to achieve isolation, and a large area of ground is used when designing the PCB to reduce noise. Figures 2 and 3 are 1.8 V and 3.3 V power interface circuits respectively.
[page]
The reset circuit uses the MAX811 chip. The MAX811 is a 4-pin microprocessor voltage monitor with the characteristics of precise power supply monitoring and low power consumption. It can monitor the power supply voltages of 3 V, 3.3 V and 5 V. The operating voltage of the MAX811 is 1.0~5.5 V. The MAX811 is a low-level active reset. The MAX811 has a manual reset function, the power supply current is 6μA, the reset threshold voltage has five types: 4.63 V, 4.38 V, 3.08 V, 2.93 V and 2.63 V, and the minimum pulse width of the power-on reset is 140 ms. When the voltage VCC of the microprocessor is lower than the threshold voltage of the MAX811, the internal timer is reset to 0 and the reset output is kept at a low level. When VCC is higher than the threshold voltage, the internal timer starts counting, and when the count reaches a given value (the overflow period of the timer), the output becomes a high level. Figure 4 shows the interface circuit of the MAX811.
2.3 The CAN bus
uses an independent CAN protocol controller SJA1000. It is a replacement for the CA82CZOOCAN controller (BasleCAN) of Philips Semiconductor, and also adds a new operating mode - PeliCAN, which supports the CAN 2.0B protocol with many new features. It is mainly used for regional network control in mobile targets and general industrial environments. Figure 5 provides a preliminary understanding of the internal structure of the CAN controller and its position in the field bus system.
The PCA82C251 is the interface between the CAN protocol controller and the physical bus. It is mainly used in applications with speeds up to 1Mbaud. This device provides differential transmit capability to the bus and differential receive capability to the CAN controller. It fully complies with the ISO "11898-24 V" standard. A current limiting circuit prevents the transmitter output stage from shorting the positive and negative terminals of the battery voltage. Although power consumption will increase when this fault condition occurs, this feature prevents damage to the transmitter output stage. Figure 6 is a diagram of the internal structure of the PcA82C251, and Figure 7 is the interface circuit between the CAN protocol controller and the physical bus.
The interface between PCA82C251 and CAN bus also adopts certain safety and anti-interference measures. The CANH and CANL pins of PCA82C251 are connected to the CAN bus through a resistor respectively. The resistor can play a certain current limiting role and protect PCA82C251 from overcurrent impact. Two 30 pF small capacitors are connected in parallel between CANH and CANL and ground, which can filter out high-frequency interference on the bus and have a certain ability to prevent electromagnetic radiation.
[page]
3. Design of terminal software structure of electronic trading system
Due to the particularity of electronic settlement, the terminal control system needs to process a large amount of transaction data in a short time and respond to external events in a timely manner. The open source embedded operating system μC/OS-Ⅱ is selected. μC/OS-Ⅱ has the characteristics of small scale, scalability, good real-time performance and easy portability. For electronic settlement systems with high requirements for real-time and stability, the introduction of μC/OS-Ⅱ will undoubtedly greatly improve its performance. In programming, ARM and Thumb instruction sets are used for mixed programming to optimize code density.
3.1 Porting of the operating system μC/OS-Ⅱ
The μC/OS-Ⅱ operating system has good portability. If the composition of the hardware platform changes, only the hardware-related content in the operating system code needs to be modified, and the application code that is not related to the hardware does not need to be modified.
The software and hardware architecture of μC/OS-Ⅱ is shown in Figure 8. It can be clearly seen from the figure that the transplantation of μC/OS-Ⅱ is actually to rewrite or modify the processor-related code. The transplantation work mainly includes three parts: modification of OS_CPU.H file, modification of OS_CPU_A.ASM file, and modification of OS_CPU_C.C file.
3.2 System main process
The system software adopts modular design, including main program, initialization program, card reading subroutine, keyboard scanning subroutine, display subroutine, transmission subroutine, etc. The software part of the system adopts modular design. Several small programs or modules are independently designed, programmed, tested and checked for errors, and finally connected to form a complete application. There are corresponding routines for each peripheral, which can be easily transplanted. The main process of the system is shown in Figure 9.
The sample code (IC card password input section) is as follows:
4 Conclusion
The system uses the combination of LPC2292 and CAN bus to realize the rapid real-time collection of market information stored in the database in the electronic settlement system, and realizes real-time settlement and deduction of transaction fees. The configured LCD and key modules enable the system to have a certain independent working ability. The μC/OS-Ⅱ operating system is used in the software design, which gives the system a powerful multi-task management capability and greatly improves the stability and reliability of the system. Good performance, low cost and excellent scalability make this terminal have great promotion value in the field of electronic settlement.
Previous article:Multi-mode buoy shore-based data transceiver platform based on ARM9260
Next article:Stepper Motor Control System Based on ARM
Recommended ReadingLatest update time:2024-11-16 18:07
- Popular Resources
- Popular amplifiers
- Universal controller for elevator detection based on μCOS-Ⅲ real-time operating system
- Design of integrated power supply protector based on μCOS-Ⅲ and emWin
- Practical Deep Neural Networks on Mobile Platforms: Principles, Architecture, and Optimization
- ARM Embedded System Principles and Applications (Wang Xiaofeng)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications