In recent years, the popularity of LCD displays and the development of microprocessors to large capacity have significantly improved the human-computer interaction function of embedded systems. In many cases, a good graphical user interface (GUI) and a convenient operating environment are one of the key factors affecting the success or failure of a product. How to make full use of low-cost, low-resource single-chip microcomputer systems to achieve perfect human-computer interaction functions has become a problem that single-chip microcomputer designers need to solve.
At present, many advanced intelligent instruments at home and abroad not only have high performance indicators in terms of measurement accuracy and sampling rate, but also have many unique features in terms of the friendliness of human-computer interaction. In the process of developing an intelligent pressure monitor for German TOX Stamping Technology Co., Ltd., the author has accumulated some design experience in human-computer interaction technology for embedded systems. This article takes this as an example to introduce its design method.
1 Overview of Intelligent Pressure Monitor
The intelligent pressure monitor is a special instrument developed for TOX Stamping Technology Co., Ltd. in Germany. The company specializes in the production of metal sheet connection stamping equipment. In order to ensure the quality of the connection, it is necessary to monitor the pressure during the stamping process; and compare the measured value with the set upper and lower pressure limits to determine whether it is qualified. Figure 1 is a block diagram of the hardware system of the TOX intelligent pressure monitor. It is based on the microcontroller and is equipped with pressure and displacement sensors, signal conditioning circuits, LCD display circuits, buttons, RS232 and RS485 communication interfaces, and input/output interfaces connected to PLCs.
In addition to the measurement, data processing and communication functions of ordinary intelligent instruments, the TOX intelligent pressure controller also provides users with a friendly human-computer interaction menu. Through the buttons and LCD display, the following information can be flexibly set and queried: the measurement program number and the corresponding upper and lower pressure limits; the type, specification and sensitivity of the sensor; the zero offset of the sensor and the maximum allowable offset range; whether the automatic zero calibration function is enabled; whether the communication interface is enabled; the mode and address of the communication interface; the latest 10 sets of measurement data; user password; text type (Chinese or English); equipment maintenance cycle and number of operations, etc. In addition, there is a memory protection function. [page]
2 Control panel and operation interface
Figure 2 shows the control panel of the TOX intelligent pressure monitor. The panel has a 160×80 dot matrix LCD display and 6 buttons. The LCD display can display 20 English or 10 Chinese symbols per line, a total of 5 lines; the 6 buttons are 0, ENTER and ESC. Using these 6 buttons, users can switch between the "measurement" and "menu" interfaces at will. After entering the menu interface, users can also easily set and query relevant information.
After turning on the power, the device will display the version number, then perform "Sensor Calibration" (this function can be turned off), and then enter the "Measurement" interface shown in Figure 3.
In the measurement interface, if a measurement command is received from the PLC, or the user presses the "F1" or "F2" key, the pressure of channel 1 or channel 2 will be measured, and then the measurement results will be processed and displayed; if the user presses the "ESC" key, the "Main Menu" interface shown in Figure 4 will be entered.
After entering the main menu interface, press
the " key to move the cursor; press the "ESC" key to return to the upper menu (i.e., the "Measurement" menu); press the "ENTER" key to enter the selected submenu. For example, when the cursor is on the "Measurement Program" option, if the "ENTER" key is pressed, the "Measurement Program" input submenu shown in Figure 5 will be entered.
The "Measurement Program" submenu has 5 options, namely the program number and the upper and lower pressure limits (i.e., minimum and maximum values) of channel 1 and channel 2, and the set value selected by the user is also given at the same time. Similarly, press the key to move the cursor; press the "ESC" key to return to the upper menu (i.e., main menu); press the "ENTER" key to enter the submenu under the cursor position. For example, when the cursor is on the "Minimum Value" option of channel 1, if you press the "ENTER" key, you will enter the "Minimum Value" setting interface shown in Figure 6. [page]
In Figure 6, "30.00" indicates that the minimum pressure value of channel 1 is 30.00, and "_" is the cursor prompt. If the user wants to modify the set value, he can press
the
and
keys to move the cursor to the corresponding position, and then press
the key to modify the set value. For example, when the cursor is at the current position, if you press the "▲" key, the set value changes from 30.00 to 31.00; if you press
the key, the set value 30.00 changes to 29.00. In this way, you can easily enter the set value with only 4 keys.
Different numbers of first-level, second-level or even multi-level submenus are also nested under the "Sensor Configuration", "Data" and "Other" options under the main menu for users to query, modify data and configure parameters.
It can be seen that although the instrument has 6 operating buttons and 1 LCD display, the TOX intelligent pressure monitor still provides a friendly operating environment for the operator and realizes human-computer interaction.
3 Design of human-computer interaction menu
In this design, the main menu and submenus have more than 20 pages, and there are two languages in Chinese and English for users to choose from, which increases the difficulty of application layer program design. The program adopts a modular structure, mainly including the following modules:
Interface switching control module: In order to switch the operation interface according to user requirements, a Page_Point image register is defined, and its value varies between O and Pl, where P is the number of operation interfaces. If Page_Point=O, the LCD display will display the page 0 form (the measurement interface shown in Figure 3); if Page_Point=l, the LCD display will display the page 1 form (the main menu interface shown in Figure 4). When the user presses the "ENTER" or "ESC" key, the value of Page_Point is modified according to the position of the option cursor, and then the display form is updated to realize human-computer interaction.
Key scanning module: Scan the 6 operation keys and store the results in the Key_Status image register. This register has 6 valid bits, namely Key_Up, Key_Down, Key_Left, Key_Right, Key_Esc and Key_Enter, which correspond to the 6 keys
"ESC" and "ENTER" on the operation panel. If the flag bit is 1, it means that the corresponding key is pressed; otherwise, it is released.
Option management control module: If the current operation interface belongs to the "option interface" (the main menu interface shown in Figure 4 and the measurement program sub-interface shown in Figure 5 both belong to the option interface), press
the key, and the position of the cursor ">" moves up or down by 1 item. For this purpose, an Option_Point image register is defined, and its value is 0 to N-1 (N is the number of options). If the main menu has 4 options, then N=4, and Option_Point is 0 to 3; if the measurement program submenu has 5 options, then N=5, and Option_Point is 0 to 4.
Data input module: If the current operation interface belongs to the "number setting interface" (the minimum value setting interface shown in Figure 6 belongs to the number setting interface), press
the
and
keys to move the cursor "_" to the left or right by 1 bit. For this purpose, a Bit_Point image register is defined to record the position of the data bit that can be modified. Press
the key to add "1" or subtract "1" from the value at the data bit where the current cursor is located. For example, in the minimum value setting interface shown in Figure 6, if the "▲" key is pressed, the set value changes from 30.00 to 31.00; if the "v" key is pressed, the set value changes from 30.00 to 29.00. With
4 keys, any value that meets the user's requirements can be easily entered. Figure 8 is a program flow chart of the data input module.
Using the above module, only a small amount of program code is needed to flexibly implement functions such as options, data modification, and switching operation interfaces.
This design is programmed in assembly language. The microcontroller used is the low-performance PICl6F877A. Although its program memory is only 8KB, it can realize the display and switching of more than 20 pages of operation interfaces, as well as human-computer interaction functions such as setting and querying dozens of data. It also realizes measurement, monitoring and communication functions.
4 Conclusion
The human-computer interaction technology of embedded systems is becoming more and more perfect. Through LCD display and a few buttons, the human-computer interaction functions such as parameter setting and data management are realized in the embedded system design by software, which enhances the fun and functionality of the operation and helps to improve the added value of the system.
Previous article:A Brief Analysis of Optimization Problems in Embedded Programming
Next article:Reliability Design of Military Embedded Systems
Recommended ReadingLatest update time:2024-11-16 19:46
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
- DIY an I2C level conversion board
- I hope this book "PCB Design Secrets" will be passed on to you!
- [National Technology Low Power Series N32L43x Evaluation] 3. Key Driver + SPI_LCD Screen Driver
- A comic book about CircuitPython and Mu
- Is there any ADR3433 chip that can be replaced by PINTOPIN?
- About the reset function of capacitor in microcontroller
- [National Technology N32G457 Review] Comparison of two N32G457 development tools and lighting programs
- 【Distributed temperature and humidity acquisition system】+temperature and humidity acquisition module
- MSP430 Remote Upgrade Solution
- Calculate the frequency of the sinusoidal signal collected by msp430