This design takes ARM7 microprocessor as the core, and uses high-speed A/D in ARM7 as pressure measurement unit, which improves the reliability of data transmission; data results are displayed in real time through LCD, and the display mode is friendly and intuitive; RAM and UART are used to store and transmit data respectively, realizing long-term storage of monitoring data and communication transmission with PC. Instruments using 31/2-bit or 41/2-bit segment LCD digital displays are not uncommon, but the functions of segment LCD displays are relatively limited. For multi-functional intelligent instruments, dot matrix LCD display modules are used to provide richer and more flexible display content. Dot matrix LCD display module is a display device that integrates display, control and drive. In order to simplify the circuit and give full play to the performance of ARM, a 320×240 16-level grayscale LCD is used.
System overall design
This system requires the software to complete the following functions.
Real-time data acquisition function. The system is required to be able to collect real-time data of external voltage.
Sampling data processing function. After the system completes real-time data acquisition, it needs to process the data in real time. Real-time processing mainly involves high-speed A/D conversion of external voltage and then dynamic display. The system can also use buttons to dynamically modify the alarm setting value.
LED display and RTC function. This experiment makes full use of the LED display and real-time clock functions.
Alarm processing function. Compare the real-time data with the maximum voltage measurement value set by the human-machine dialogue, and then make an alarm action.
Display maximum value function: Save and display the maximum value in real-time data.
By using the EEPROM read and write data function, the system can read 110 bits of real-time data from the last operation when powered on, and use it as the historical data for this operation. The system can also store the current 110 bits of real-time data by pressing a button.
Serial port data sending function: The system can send 100-bit real-time data to the host computer through the serial port by pressing a button.
In order to realize the clear module structure of the system, this system adopts μC/OS-II operating system. According to the above requirements, this system divides the software into 4 functional modules: A/D acquisition module, LED display and key processing module, LCD display module, alarm, storage and serial port processing module. The sampling module completes the sampling and storage of real-time data; the main function of the LED display key processing module is to process the sampled data and convert them into meaningful parameters; the LCD display module displays various parameters on the LCD; the alarm, storage and serial port processing module mainly processes the real-time data accordingly. Figure 1 is the overall structure diagram of the overall system design.
Figure 1 System overall block diagram
System hardware composition and functions
1 LCD display part
Liquid crystal display (LCD) has many advantages that other displays cannot match, such as low power consumption, small size, light weight, and thin thickness. It is widely used in terminal display and human-machine interface of microprocessor-based instruments and intelligent devices such as monitoring and control. STN LCD - Most of the monochrome LCDs sold on the market are of this type. STN LCD can choose STN LCD module with built-in LCD driver/controller. TFT LCD - commonly known as "true color" liquid crystal. TFT LCD usually must choose bus-type LCD display, or external ARM LCD driver board can also be used. In short, it must be able to connect to a microcontroller or arm.
2 LED display and keyboard module
The keyboard display part uses the 8-bit LED digital display and 8-bit keyboard input that we are most familiar with. Figure 2 is the circuit diagram of the self-made LED display and keyboard module. It uses the SPI bus of Philips, which is simple and practical, and has five pins.
Figure 2 LED display and keyboard module
System software design
1 Design Concept
In this simple oscilloscope system, we use the high-performance ARM LPC2138, because the ARM processor has a very fast processing speed and it has 4 A/D conversion channels. We know that Fpclk in ARM is the frequency of ARM peripherals. Under normal circumstances, it is 1/4 of the operating frequency of the ARM core, but we can modify and set Fpclk to be equal to the frequency Fcclk of the ARM core. Then we set the A/D conversion function to be non-frequency-divided, and we can set the sampling accuracy to 8 bits. In this way, the time for each A/D conversion is equal to 9 times the operating frequency of the ARM core, so the time for each A/D conversion is quite fast. At this time, we use two-way A/D interval sampling, so that the time for each A/D conversion is shortened by half. Theoretically, the sampling time for each A/D conversion is about 2μs. In this way, the response speed of this system to the external voltage is improved by a level, so the A/D performance of this system is relatively high.
2 Division of tasks
According to the principle of task division, six tasks are analyzed: delayed creation sampling task, sampling task, alarm task, real-time clock display task, serial port task, and sampling data display task. Among them, the sampling task has the highest priority of 4, the sampling data display task has a priority of 7, the serial port task has a priority of 8, the alarm task has a priority of 9, and the real-time clock display task has a priority of 10. In order to perform initialization work, the initialization and tasks of the target board, the creation of mutex semaphores, and semaphores are added to the delayed creation sampling task.
3 Analysis of shared resources
In this test requirement, the sampled data must be displayed on the LCD screen in real time and can also be uploaded to the host computer through the serial port. Therefore, resource synchronization methods must be adopted, otherwise the time may be disrupted. There are generally two ways to achieve resource synchronization: turn off interrupts; use mutually exclusive semaphores. Mutually exclusive signals are used in this test.
4 Behavioral synchronization
In this test, two behavior synchronizations are used. The first is the display of sampled data. The test requires that the currently sampled data be displayed on the LCD screen, so in the data display task, you need to wait for the signal that the sampling task is completed. When the sampling is completed, send the signal to display the current sampling result. The second is to query the historical records. The records will be displayed only when the user wants to query the historical records, so set the waiting query signal in the historical record query task. Only when the tasks cooperate and coordinate with each other can the predetermined effect be achieved, so that the synchronization of tasks can be achieved.
Figure 3 Sampling task flow chart
5 Software Design Module Flowchart
The embedded operating system is the interface between the embedded system hardware and the application software. Its use can improve the efficiency of software development, and its reliability and stability directly affect the system's operating performance. This software design uses the open source μC/OS-II multi-task real-time operating system. As a real-time microkernel, μC/OS-II is actually an efficient task scheduler. The scheduling is thread-level. The scheduling strategy is to use a static priority allocation method and a preemptive scheduling principle. In order to realize the basic task scheduling function, μC/OS-II provides the necessary inter-task communication means, including semaphores, mailboxes, etc. In order to realize task delay, it also has basic clock management.
Previous article:ARM Linux development phase summary
Next article:Research on Wireless Monitoring System Based on Embedded Windows CE5.0
Recommended ReadingLatest update time:2024-11-16 14:30
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
- Analog electronics elective test + DC and AC parameters
- Can anyone confirm what device this is? Thanks!
- Welcome to the 5G era: There are countermeasures for mobile phone antenna design
- EEWORLD University - Solar System Design Made Simple
- EEWORLD University ---- Medical monitoring and wearable devices
- Photodetector Array Signal Processing
- Application of wireless power transmission technology in underwater transmission
- EEWORLD University Hall----Live Replay: ST's IO-Link-based environmental monitoring and predictive maintenance solutions
- FAQ_About the pulse problem when the output port of BlueNRG-2 remains at a low level in low power mode
- There are still some problems with the PCB diagram drawn by a novice