With the promotion of the Golden Tax Project, the tax control market will develop rapidly. As one of the four major tax control products, the tax controller has a market share that cannot be underestimated. Tax control manufacturers need to consider the performance and cost of their products in many aspects. In the past, various manufacturers' tax controller solutions may have chosen 8-bit microcontrollers due to cost considerations , or 16-bit or 32-bit MCUs as the main control chips for tax controllers due to the need for performance expansion. Today, ST (STMicroelectronics) has continued its previous STR7-based tax controller architecture, and drawing on its experience in the STR9 tax-banking integrated solution, it has launched a tax controller solution using the STM32, a high-performance, low-cost chip.
Solution Introduction
Compared with the previous solution (Figure 1), the STM32 solution (Figure 2) has a simple structure and modular functionality, which reduces the number of external data buses, effectively reduces the board area, and well ensures the reliability and security of the system. ST also provides detailed design reports, which greatly shortens the manufacturer's development time for both software and hardware development. During formal production, ST can provide most of the chips in the solution, avoiding the situation of multiple suppliers and chaotic procurement channels during procurement, and ensuring that its products can be quickly brought to market.
Development Tools:
Two development tools are recommended: IAR and KEIL (some domestic engineers may be accustomed to ADS, but ARM no longer maintains and updates the ADS software, so it cannot support new ICs, such as STM32). IAR's ISO/ANSI C/C++ compiler can generate concise and fast code, and can support extended embedded C++ features, including templates and standard template libraries (STL). KEIL is a tool that engineers who have used 51 microcontrollers are very familiar with. After being acquired by ARM, ARM's tool chain can be used directly in the IDE. It has powerful software simulation functions. For engineers who are accustomed to using ADS, KEIL is a good choice, because the code basically does not need to be modified, and you only need to rebuild the project in KEIL to achieve platform conversion and transplantation.
The main control chip
ST's STM32 series 32-bit flash microcontroller is based on the ARM Cortex-M3 core, which is a core developed specifically for embedded applications. STM32 has made many improvements on the Cortex-M3 architecture, including the Thumb-2 instruction set that improves performance while increasing code density, greatly improved interrupt response, and all new functions have excellent power consumption levels at the same time. The structure is shown in Figure 3.
Compared with 8-bit and 16-bit microcontrollers, the advantages of the ARM core are low power consumption and high performance, and the same software can be compatible between different cores. Compared with other chips in the ARM series, the STM32 runs faster and has greatly improved performance. A hardware trigger for single-cycle multiplication is designed on the core. In terms of code density, it saves 30% to 45% compared to ordinary 32-bit microcontrollers; compared with 16-bit microcontrollers, the code space can be saved by 50%; if compared with 8-bit microcontrollers, the code space can be saved by about 70%. In terms of power consumption, STM32 consumes 0.15mW at 1MHz, which is only half of ARM7. Therefore, under the same working mode, STM32 can reduce power consumption by 30%. The core voltage is 1.8V and the chip voltage is 3.3V. Sleep mode and standby mode can be selected to ensure the requirements of low-power applications.
The system has rich peripheral control: maximum 256kB FLASH (equivalent to 450kB space of ARM7), maximum 20kB RAM, 2 I2C interfaces, 2 SPI interfaces, 3 smart IC card interfaces (multiplexed with UART) in accordance with ISO7816 protocol, USB 2.0 interface, 80 fast I/O ports, 16-channel 12-bit A/D converter, 7 timers (including an RTC), support for IAP function through UART, IC card reader.
The 3 UART ports of STM32 can be configured into smart card mode through internal registers, which conforms to the asynchronous protocol defined by ISO7816-3 standard. In addition, a hardware protection circuit is designed in the solution to monitor the circuit status at any time and provide the system with complete IC card short-circuit protection.
USB communication
STM32's USB interface complies with the technical specifications of USB2.0 full-speed devices. The software design follows the CDC (Communication Device Class) specification, and is virtualized into a simulated serial port to communicate with the host computer. When using it, there is no need to change the host computer program. You only need to install the virtual serial port driver stmcdc.inf when using it for the first time, and then select the USB virtual serial port number when connecting online. It can be connected "simultaneously" with another standard serial port without causing communication abnormalities.
Calendar clock
[page]
The M41T83 is a factory-calibrated serial real-time clock (RTC) chip (Figure 4), including a 400kHz I2C interface, analog calibration, a programmable auto-reload counter/timer, and two alarms. It uses a package with a built-in crystal, with an advance calibration accuracy of about 5ppm. A one-time programmable (OTP) register can be used to fine-tune the internal load capacitance of the on-chip 32.768kHz oscillator during factory testing, ensuring that these products have a monthly timing accuracy of within 12s. In addition, when the power supply voltage VCC is disconnected, the chip automatically switches to the backup power supply, with a backup current as low as 450nA (typical), and a built-in battery monitor is responsible for checking the backup power supply voltage and issuing a prompt signal when the battery needs to be replaced. A 200ms reset signal is generated after the power is restored. This power-on reset/low-voltage detection function can save design engineers a separate on-board reset IC. ST also provides a low-cost solution for the M41T82 in response to the needs of different customer applications: the watchdog, square wave signal generator and alarm reminder functions are removed, but the 400kHz I2C bus interface, analog user calibration, power switching high-precision voltage reference tube, battery monitor, 12 bytes of NVRAM and reset output are retained, and a small 8-pin SOIC low-cost package is used.
The entire system can be powered
by a USB connection to a PC or by an external power supply through the socket on the board. In addition, a dedicated voltage detection circuit is designed to monitor the external power supply, and a 2.7V, 3.3F capacitor is used as a backup power supply after the external power supply stops, ensuring the integrity of the current tax control process and preventing data loss during operation. The protection time can reach 15s.
Data storage
FLASH M25P64 is connected to MCU via SPI serial interface, which greatly simplifies system design, reduces the number of package pins and bus interference. FLASH adopts high-quality CMOS manufacturing process, data retention period is at least 20 years, and the number of erase and write times per sector is guaranteed to be 100,000 times, including overall erase and sector erase instructions. Its data transmission clock frequency can reach 50MHz, data read throughput is up to 50Mbps, and it is designed with deep power-saving mode (power-down), consuming only 1mA current, thus greatly reducing system power consumption. In the design, in order to cater to the needs of different users, the chip hardware and software of 2MB~16MB capacity models are fully compatible, and the software is divided into two layers: the bottom API is the read, write and erase operation based on pages and sectors; the high-level API is the read and write transparent operation based on the entire unified storage space, without taking into account the various restrictions caused by the particularity of the hardware (such as cross-page programming, cross-sector programming, updating content in an area with existing content, cross-page updating content, cross-sector updating content, etc.). The write operation process of FLASH is shown in Figure 5.
U disk reading and writing
CH375 is a USB bus universal interface chip with UART interface. It integrates PLL frequency multiplier, master-slave USB interface SIE, data buffer, passive parallel interface, asynchronous serial interface, command interpreter, protocol processor for controlling transmission and general firmware program, etc.; the serial interface speed can reach 460800bps, and its dynamic link library is used to realize USB-HOST host mode reading and writing U disk. It supports commonly used FAT12, FAT16 and FAT32 file systems, and supports a maximum capacity of 100GB for U disk. In the reading and writing operation, there is no need to consider the file system, only the basic information such as the file name and file length needs to be understood.
The STM32 tax controller is suitable for places where
PCs issue tax control invoices. Through mutual authentication of tax control IC cards, it can connect to external tax control printers to print tax control anti-counterfeiting invoices, store relevant tax control data, and complete all tax control applications for tax declaration and verification. Its software and hardware design has passed the tax control test of the National Computer Quality Supervision and Inspection Center and fully complies with national tax control standards.
Conclusion
Compared with tax controller solutions from other manufacturers, this solution has greatly improved security, power consumption and performance while greatly reducing production and R&D costs.
References
1. STM32F103xx, M25P64, M41T83, CH375 datasheets
2. ST Tax Box Application Note
3. GB 18240 National Standard for Tax Control Cash Registers
Previous article:Design of portable mobile phone Bluetooth attendance machine system based on STM32
Next article:Mobile robot system solution based on H-bridge control
Recommended ReadingLatest update time:2024-11-16 16:19
- Popular Resources
- Popular amplifiers
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
- NXP Rapid IoT Review] +⑥NXP Rapid IoT self-exploration program, review summary and impressions
- RF Circuit PCB Design Processing Techniques
- RSL10-002GEVB Plant Manager Node Design
- Development environment preparation
- Random notes small total small picture signal reflection picture
- Basic knowledge of radome structure
- (Repost) Getting Started with Bluetooth Development
- [Shanghai Hangxin ACM32F070 development board evaluation] 5. Run the watchdog
- The rules for adding core points have been adjusted, and new products have been added to the core redemption mall!
- How does a magnetostrictive sensor work? What is the working principle of a magnetostrictive sensor?