1 Introduction
In traditional microcomputerized data acquisition systems, the bus is used to expand various functional components, such as A/D converters, program memory, data memory, calendar/clock devices, display devices and micro printers. The data acquisition system composed of three buses has the prominent problem that the bus leads out and is easily disturbed, which reduces the reliability of the system. It also brings problems such as high wiring density, large circuit board space, many peripheral components, and complex timing. In recent years, with the introduction of non-bus microcontrollers with FLASH memory on the chip and peripheral devices with serial interfaces, it has become possible to design data acquisition systems based on serial interfaces.
2 Hardware Structure
The hardware system block diagram of the single-chip general data acquisition system based on the serial interface is shown in Figure 1.
Figure 1 Block diagram of single-chip data acquisition system using serial interface
According to the actual needs of data collection, this system has designed analog quantity collection interface circuit, switch quantity collection interface circuit, digital quantity collection interface circuit and frequency quantity collection interface circuit, which basically covers the collection of various data information. In order to save the collected information, a 64K-byte E2PROM AT24C512 is expanded, a real-time clock calendar chip SD2001E is expanded to realize the timing collection of data and save data according to time and date, the keyboard interface management device SK5278 is expanded to facilitate the input of various data, the Chinese LCD graphic display OCMJ4X8C is expanded to facilitate the real-time display of collected data and human-computer interaction, the MP-A16-8 Chinese character micro printer is expanded to facilitate the printing and output of collected data, and the RS-232 interface is expanded using MAX232 to facilitate the transmission of collected data to the host computer for data processing and analysis. The above serial interface devices are introduced below.
2.1 Analog-to-digital converter TLC2543
TLC2543 is an A/D converter with 11 analog input channels and 12-bit resolution. Therefore, this system can realize up to 11 analog acquisition tasks. In order to ensure the accuracy of the measurement results, the device has 3 built-in self-test modes, which can test REF+ high reference voltage value, REF- low reference voltage value and REF+/2 value respectively. The analog input range of the device is REF+-REF-, and the general analog quantity range is 0-5V. However, in order to meet the data acquisition tasks of non-standard voltage values output by some sensors, the reference voltage setting function of TLC2543 is used here, and the analog input range setting adjustment circuit is designed, and the acquisition reference voltage value is set by resistor voltage division. Among them, R1 and RP1 are used to set the full-scale voltage value. Adjusting RP1 can make the full-scale voltage value change between 1/2VDD-VDD. R2 and RP2 are used to set the zero-value voltage. Adjusting RP2 can make the zero reference voltage change between 0-1/2 VDD. RP1 and RP2 should use multi-turn precision potentiometers. The reference voltage setting function of TLC2543 enables this system to meet various sensor data acquisition tasks that are not 0-5V standard outputs. The interface between TLC2543 and the microcontroller adopts a 4-wire SPI serial interface. The three control input terminals are "CS" (chip select), input/output clock (CLK) and address input terminal "DI". The 14-channel multiplexer in the chip can select any one of the 11 input terminals or one of the three internal self-test voltages, and the sampling and holding is automatically completed. After the conversion is completed, the "EOC" output becomes high, and the conversion result is output by the three-state output terminal "DO". The hardware interface circuit between AT89C52 microcontroller and TLC2543 is shown in Figure 2.
2.2 I/O Expander GM8164
In order to realize the functions of switch quantity acquisition and switch quantity output control, a serial chip GM8164 with a large number of I/O expansion functions is used here. The main features of this device are as follows:
Figure 2 Hardware interface circuit between MCU and TLC2543
⑴ A large number of expansion I/O ports can provide 32-bit data input ports and 40-bit data output ports;
⑵ It also provides 8 open-drain output ports, which is convenient for level conversion and driving;
⑶ The full-rate synchronous serial interface can reach 1MHz, which is very convenient for interfacing with general MCUs;
⑷ Multiple chips can be cascaded to expand the number of I/O ports;
Using GM8164 can enable this system to realize data acquisition tasks of up to 32 switch quantities, and can provide 40 switch quantity control output functions.
2.3 High-precision real-time clock/calendar SD2001E
The real-time clock device uses a real-time clock device SD2001E with an I2C bus interface. The device integrates the battery, crystal oscillator, power management and other circuits required for the real-time clock into the chip. The clock can also be guaranteed to run when the system is powered off. This chip does not require any peripheral components to form a high-precision real-time clock calendar, and can provide the system with 32k byte non-volatile SRAM with a write-erasure limit of 10 billion times. The main performance indicators of the device are as follows:
⑴ BCD code input/output for year, month, day, week, hour, minute and second;
⑵ I2C bus interface (including real-time clock part and SRAM part);
⑶ Automatic calendar to 2099 (including leap year automatic conversion function);
⑷ Built-in high-precision crystal oscillator, accuracy ≤±5ppm, that is, within a month, the travel time error does not exceed 13 seconds (25℃);
the clock travel time exceeds 10 years;
2.4 Serial E2PROM AT24C512
Since SD2001E provides the system with a non-volatile data storage capacity of 32k bytes, it can meet the needs of general data acquisition systems. If the data storage capacity of the acquisition system is large, it can be expanded with an E2PROM AT24C512 with a capacity of 64k bytes. Since the erase and write life of this device is limited, the data can be written into the NVRAM on the SD2001E chip when it is used. When the NVRAM is full, the data can be stored in the AT24C512. This can greatly reduce the read and write frequency of the AT24C512, thereby greatly extending the service life of the memory. [page]
2.5 Chinese Graphic LCD Display Module OCMJ4X8C
In order to display the collected data in real time and realize a friendly all-Chinese graphic human-machine interface, a graphic dot matrix LCD module OCMJ4XC8 with a serial interface and a Chinese character library is used here. OCM4X8C is an LCD display module with a serial/parallel interface and a Chinese character library inside. The control/driver of this module adopts ST7920 of Taiwan Silicon Creation Electronics Company, so that this module has a strong control and display function. The LCD dot matrix of this module is 128*64, which can display 4 lines, 8 Chinese characters per line. In order to display Chinese characters simply and conveniently, the module has a 2Mbit Chinese font CGROM inside. The font ROM contains 8192 16*16 dot Chinese font libraries. At the same time, in order to facilitate the display of English characters and other commonly used characters, the module also has a 16Kbit 16*8 dot ASCII character library inside. In order to facilitate the construction of user graphics, the module also provides a 64*256 dot GDRM drawing area, and in order to facilitate the construction of user-required fonts, the module provides 4 groups of 16*16 dot character creation space. Using the above functions, OCMJ4X8C realizes the same-screen display of Chinese characters, ASCII codes, dot graphics, and self-selected fonts. In order to facilitate the interface with various microprocessors, the module provides 8-bit parallel, 4-bit parallel, 2-wire parallel, and 3-wire parallel interface modes.
2.6 Mini Chinese Character Printer
In order to print out the collected data, a serial Chinese printer MP-A (D) 16-8 with a Chinese character library is used here. The main features of this printer are as follows: convenient Chinese character printing function. In addition to storing character sets one and two, it also comes with 16×16 dot matrix and 12×12 dot matrix national standard one and two Chinese character libraries. Therefore, it can not only print all ASCⅡ characters and German, French, Russian, Japanese, digital symbols, special symbols, optional characters, dot matrix curves and bar codes, but also can print 16×16, 12×12, 8×16, 16×8, 8×8, 6×12, dot matrix Chinese characters or 5×7, 6×8, 8×12, 8×16 dot matrix ASCⅡ characters in the same line. Because it comes with a 2k-byte data buffer and Chinese character library, the speed of printing Chinese characters and icons is as fast as English characters; rich text modification functions; convenient interface method.
2.7 Collection of digital quantity and frequency quantity
The collection of digital quantity and frequency quantity directly uses the hardware resources of the single-chip microcomputer itself. For the digital signal output by the digital sensor, the single-chip microcomputer port line can be directly used to complete the task of collecting digital information. Here, the P1 port of the single-chip microcomputer is used as the digital quantity collection interface. The collection of frequency quantity such as speed, flow, wind direction, etc. can use the timer/counter of the single-chip microcomputer. Here, timer 0 and timer 1 are used for frequency quantity collection. When the frequency quantity collection function is not used, it can be used for other purposes.
3 Monitoring Software Design
The monitoring software of this system adopts modular structure design and is compiled in ASM assembly language. The function of the monitoring program is to initialize each serial interface device, and then call the analog quantity acquisition module, digital quantity acquisition module, switch quantity acquisition module and frequency quantity acquisition module respectively. If there is external analog quantity, switch quantity, digital quantity, and frequency quantity signal input, the corresponding algorithm program is called to process and transform the corresponding variables and send them to the NVRAM of SD2001E for data storage. At the same time, the corresponding values are sent to the LCD display for display or printed out as needed. If there is no external signal input, "Welcome" and the system time and date are displayed on the LCD screen. The monitoring program flow is given below. As shown in Figure 3.
Conclusion
The development of the single-chip data acquisition system based on the serial interface mode abandons the traditional single-chip bus expansion mode and adopts serial expansion technology to expand the peripheral function circuit. Although the AT89C52 single-chip microcomputer does not directly support various serial bus interfaces, the general I/O port line of the single-chip microcomputer is used here to simulate the I2C bus, SPI bus and two-wire serial bus, and the communication function with various peripheral devices is realized through software programming. The serial expansion technology simplifies the complexity of the system interface design and improves the reliability of the system operation. However, it is worth noting that the simple hardware interface of the serial expansion technology is at the expense of complex interface timing. Therefore, the operation timing of the device must be strictly followed during software programming. The system can be widely used in intelligent instrumentation systems, data acquisition systems and computer measurement and control systems with single-chip microcomputers as the core. At the same time, it also builds a better hardware platform for intelligent instrumentation systems.
References
1. Meng Chen, Li Min. High performance ferroelectric memory FM24C256 and its application in single chip microcomputer. Electronic Technology, 2003.1:38-41
2. Li Min, Meng Chen. Application of serial Chinese graphic LCD display module in single chip microcomputer system. Electronic Products World. 2002.11. (B)
3. Li Min, Meng Chen. Large capacity serial E2PROM AT24C512 and its application. Electronic Components Application. 2003.5 (1): 29-31
4. Li Min, Meng Chen. Serial chip GM8164 with a large number of I/O port expansion and its application. Foreign Electronic Components Application. 2003. (1): 35-38
Previous article:The Principle and Application of Single Chip Microcomputer Real-time Clock Circuit
Next article:Application of Serial E2PROMAT 24C512 in Single Chip Microcomputer
- 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
- EEWORLD University Hall----Live Replay: Smaller, faster, more reliable connectors drive new developments in IoT applications
- How to achieve aperture tuning
- Black Gold's FPGA is really bad
- This amplifier is a bit figurative, isn't it?
- ad19.0.10 3D display problem
- LPC1114 temperature sensor DS18B20 program
- Why is there only one channel with data when using STM32's TIMER to capture DMA?
- Amazing! TI launches smart high-tech clothing to help curb teenage obesity
- EEWORLD University ---- TPS65218D0: User Programming of Multi-Rail Power Management IC (PMIC)
- DAPLink version upgraded to 0254