introduction
In the construction field such as road and bridge construction, there are many raw material processing control equipment imported from abroad. The operating system on these devices is not the common WINDOWS operating system. Although it can realize the data printing function, these data cannot be stored in the management PC of the WINDOWS operating system as files, so it is not convenient to count and analyze these data, which seriously affects the management efficiency. For this reason, it is necessary to expand the functions of these devices so that they can store the required data as required and provide corresponding data analysis and processing functions, so as to facilitate the work of the management department and improve production efficiency and project management quality.
Solution Analysis
Under the premise of not affecting the normal operation of the original equipment, the data collection function of the parallel printer is completed. The following two solutions are considered:
(1) After the data is output to the printed paper, use the scanner to identify the data on the printed paper and input the identified data into the data management software of the management PC.
(2) Add a data acquisition device between the control device and the printer. The device intercepts data from the parallel port of the control device connected to the printer and completes the data forwarding to the management PC. The management PC is responsible for receiving, counting and analyzing data, as shown in Figure 1.
Figure 1 Schematic diagram of data collection scheme
Compared with the above two solutions, solution (1) requires regular manual operation of the scanner, which is labor-intensive and requires high investment, and it is impossible to guarantee that the data will be completely correctly identified. The data acquisition device in solution (2) can be completely independent of human intervention, is easy to use, and has a high cost-effectiveness. Therefore, solution (2) is adopted.
In March 1994, the IEEE committee announced the new IEEE1284 parallel interface standard, which defines five working modes of the parallel port. These five modes are Centronics compatible mode (also called standard mode), byte transfer mode, nibble transfer mode, enhanced parallel port (EPP) mode, and extended function port (ECP) mode. The parallel port connected to the printer usually works in Centronics compatible mode, and the other four modes are fully compatible with the parallel port pin definition of this mode. Therefore, the data acquisition system is designed according to the characteristics of this mode, which is also conducive to the expansion and upgrading of other parallel port equipment data acquisition systems in the future.
There are two types of parallel ports: 25-pin and 36-pin. The printer is equipped with a 36-pin standard plug and socket, which actually only uses the signals in the 25-pin plug and socket. The 25-pin signals can be divided into three categories: data signals, control signals, and status signals.
The fastest communication speed of Centronics parallel port can only reach 150kB/S. The author tested the control device and the target printer EPSON LQ-1600K III and found that the communication speed between the two is 50kB/S.
Hardware Design
According to the working characteristics of the parallel port, the author uses a hardware circuit with a 51 series single-chip microcomputer as the core to complete the parallel port data acquisition and forwarding functions. The system circuit block diagram is shown in Figure 2, which mainly includes 6 components:
(1) Central Processing Unit. The communication speed between the control device and the printer is not very high, so the cost-effective AT89C52 is used as the core processing unit. The chip includes 256 bytes of RAM, most of which can be used as a data receiving buffer, so there is no need to expand the RAM unit. The STROBE signal is used as the external interrupt source 0. Whenever the falling edge of the STROBE signal appears, it indicates that the data is in a valid state, and the CPU reads the collected data through the P1 port. The operating frequency of the CPU is selected at 22.1184MHz to ensure that there is a sufficiently long interrupt program response time.
(2) Signal preprocessing. The acquisition system cannot affect the normal operation of the control equipment and printer, so the parallel port input signal needs to be buffered and optically isolated. The buffer chip is 74HC245 and the optical coupler is 6N137.
(3) Data latch. The data retention time of the data line on the parallel port is very short. The latch unit ensures the accuracy of the data read by the CPU each time. The latch chip is 74HC573.
(4) Watchdog and power supply monitoring: The X5045 chip is selected to complete the functions of system power-on reset, system crash reset and power supply voltage abnormality reset.
(5) Communication circuit: The MAX232 asynchronous communication interface chip is used here to complete the function of forwarding data to the management PC.
(6) Power supply. This part is responsible for providing the required power to each circuit module.
Figure 2 System circuit block diagram
The main circuit diagram of the hardware design is shown in Figure 3.
Figure 3 Main hardware circuit diagram of the system
Software Design
Figure 4 Program flow chart
Figure 4 is a flow chart of the microcontroller program. The program consists of a main program and an interrupt service program. The interrupt service program is responsible for timely collecting valid data sent to the parallel port by the receiving control device and storing it in the buffer. The main program is mainly responsible for serial communication with the management PC and forwarding the data in the buffer. In this way, the management PC only needs to use a visual programming language to implement a software with data reception and file storage functions to lay the foundation for future data statistics and analysis.
Conclusion
Based on the analysis of the working characteristics of the parallel printing interface, this paper designs a parallel port data acquisition system with 51 single chip microcomputer as the core. This system has been successfully applied to several construction units of expressways. The operation experience shows that the design is simple, stable and reliable, which greatly facilitates the construction units to count and analyze various raw material data.
Previous article:Simulation of High Power Factor Rectifier Based on Single Cycle Control
Next article:Design of LD driver power supply with adjustable continuous or pulse output power
- 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!
- 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
- Nexperia Award-winning Live Broadcast: Introduction and Application of Automotive Power MOSFET and GaN Devices in Electric Vehicles
- Nordic Bluetooth sensor monitors guitar temperature and humidity
- EEWORLD University Hall - Altium Designer 22 Electronic Design Introduction Practice 56 Lectures
- ztool cannot connect
- IEEE Spectrum Top Programming Language Rankings April 2022
- #Idle Market# Exchange Downloader
- ADS1278 data acquisition chip data distortion problem
- Could you please advise what is wrong with this circuit?
- USB power supply and DC power supply issues
- Analysis of the advantages of single chip microcomputer in power supply design application