Share this

Human-computer interface paper

2026-04-06 06:25:54 · · #1
Abstract: In embedded applications based on microcontrollers, a user-friendly human-machine interface plays a crucial role. This paper presents a Chinese window menu interface implemented using the WGM-12864B graphic LCD module. The method used in this design has general applicability. Keywords: Human-machine interface, graphic LCD module, data structure, window menu. With the advancement of LCD technology, high-quality LCD modules are increasingly widely used in various embedded systems. In the overall system design, the design of the human-machine interface often occupies a significant portion of the work. Taking the human-machine interface of a certain embedded system as an example, this paper introduces a method for implementing a Chinese window menu interface using the WGM-12864B graphic LCD module. 1 Introduction to the WGM-12864 LCD Module The WGM-12864B module is a monochrome graphic dot-matrix LCD module with a dot matrix of 64×128. Its dot matrix storage area is divided into left and right sides, with identical structures on both sides. When reading and writing to the module's dot matrix storage area, chip selection is performed using CS1 and CS2, with high-level activation. The module consists of 8 lines per page, with the page address determined by X; Y determines the column number of the dot matrix, and the position of each byte of dot matrix data is uniquely determined by (CSi, X, Y). Each bit in the byte corresponds to a pixel; a value of 1 displays the pixel, while a value of 0 does not. When the LCD module is working, it scans the dot matrix storage area line by line. The first scanned line is displayed on the first line of the LCD screen, and the remaining lines are displayed sequentially. The "starting line" can be set via the Z address register. Z can be any number from 0 to 63. For example, if Z=56, the order of the rows displayed on the LCD screen from top to bottom is: 56, 57, ..., 62, 63, 0, 1, 2, ..., 54, 55. This function of the module facilitates scrolling of windows. 2. Hardware Interface Design of the Human-Machine Interface The system expands with one 8255A chip as the interface for the human-machine interface. The hardware interface circuit is shown in Figure 2. The 8255A's Port A connects to the 8-bit data lines of the graphic LCD, and the lower 6 bits of Port B connect to the corresponding control lines. D/I indicates whether the signal on the data bus is dot matrix data or a control command word, R/W indicates whether the current operation is a read or write operation, E is the enable control terminal, RST is the reset terminal, and CS1 and CS2 are the left and right dot matrix area selection terminals. The keyboard interface is expanded in row scanning mode, with the high nibble of Port C connected to the row lines and the low nibble to the column lines. During 8255A initialization, Ports A and B are defined as mode 0 outputs; the high nibble of Port C is mode 0 output, and the low nibble is mode 0 input. Note that most types of 8255 chips will clear Ports A, B, and C when their mode control registers are initialized; therefore, do not dynamically change the input/output modes of the 8255 ports in the program to avoid affecting the LCD and keyboard. 3. User Interface Software Design The goal of the human-computer interaction interface design is to implement a Chinese window interface, allowing users to interact via menus. Windows are divided into two categories: dialog boxes and menus, and also include combinations of dialog boxes and menus. Dialog boxes are used for parameter input and output display; menus are used to respond to user selections and run programs according to user selections. First, it should be determined how many windows the system needs, how many menus each window has, and draw a transition diagram between windows. It can be seen that all windows should form a tree structure. The size of Chinese characters in the menu is 16×16 dot matrix, and the size of numbers and symbols is 16×8 dot matrix. These dot matrix data can be obtained by the dot matrix extraction program. An LCD module with a dot matrix of 64×128 can only display 4 menu items at the same time, and each menu item occupies 256 bytes of dot matrix storage space. When there are more than 4 menu items in a window, the scrolling function should be used. To facilitate data arrangement, the system specifies the data structure of parameters, menus, windows and LCD buffers. (1) Data structure To facilitate the display and processing of parameters, the input and output format of parameters is represented by a method similar to split BCD code. The data structure is shown in Figure 3. The data length indicates the number of bytes in the data area. Positive and negative signs: 1 indicates a negative number, 0 indicates a positive number. For negative numbers, a negative sign "-" must be added before the data when inputting. Each byte in the data area corresponds to each bit of the parameter. Numbers are represented using split BCD code, and the decimal point is represented using ASCII code. When the "Data Length" field occupies 1 byte, this data structure can represent up to 255 bits of data. The data structure of the menu dot matrix is ​​shown in Figure 4. The menu number indicates the order of the menu item within all menus in the window; the menu length indicates the number of Chinese characters in the menu item. The menu dot matrix data area stores the dot matrix of the Chinese characters in the menu, with each character being a 16×16 dot matrix; the parameter flag is 0 indicating no parameter, and 1 indicating that the menu item is a dialog box followed by a parameter. Parameters are stored in the memory pointed to by the parameter pointer field. If it is a system parameter, it must be read into memory from the E2PROM beforehand. Since the system uses 16-bit addressing memory, 2 bytes are used to store the pointer. The parameter storage format is shown in Figure 3. The data structure of the window dot matrix is ​​shown in Figure 5, which uses the menu data structure. The menu items used in the window are stored sequentially according to their menu numbers, and the meaning of each field is self-evident. Note that the dot matrix data of the window is pre-established according to this format, and all windows in the system are stored in this format on non-volatile storage media, such as ROM. With this format, the system can have 255 windows, and each window can have up to 255 menu items. The system allocates a specific area in memory for an LCD display buffer. The dot matrix data of the entire window to be displayed is assembled according to the following format and stored in this area. The LCD display program reads data from this area into the LCD dot matrix data storage area. The LCD display program manages the user interface using this data structure. Each menu item, excluding the dot matrix of Chinese characters and parameters, has its remaining space padded with 00H to form 256 bytes. The parameters displayed in the dialog box can be retrieved from the parameter pointer field in the menu data structure, and then decoded into displayable 16×8 dot matrix data. The LCD buffer data structure is shown in Figure 6. The current menu field refers to the menu number that has gained focus and needs to be highlighted; it is mainly used for cursor management. The displayed menu item numbers correspond to the four menu items in the current LCD dot matrix storage area; these data are mainly used for scrolling operations. The other domains are similar to the above. (2) Human-computer interaction design The focus of human-computer interaction design is the display of the window interface, scrolling, cursor management, and the display, modification and saving of parameters. Now we will only introduce the scrolling of the window and the input and output display of parameters. Scrolling is only used when the number of menus in the window is greater than 4. In order to improve the system response speed, the window only reads the new menu dot matrix data into the LCD dot matrix storage when scrolling, and the dot matrix data of the other 3 menus remain unchanged. Figure 7 shows the snapshot of the LCD dot matrix storage area and the menu order displayed on the LCD screen during the window scrolling process. Each step of scrolling from A to E is reversible. It can be found that for each adjacent operation, as long as the dot matrix data of the menu item to be displayed is written into the LCD dot matrix storage area, the menu item with the black box in the figure is the newly written one. When scrolling down, the system retrieves the menu item with the smallest sequence number from the "Menu Items in Display" field in the LCD display buffer, inserts the new menu item number into this position, and reads the menu dot matrix data from the "Menu Dot Matrix Data" field in the display buffer into the corresponding position in the LCD dot matrix storage area. Then, it retrieves the updated "Menu Items in Display" field, finds the row number of the smallest menu item, and sets the scan start row Z to this row number. The position indicated by the arrow in the diagram is the scan start row. The last field to be updated is "Current Menu Item," used for cursor display management. When scrolling up, the operation is similar, except that the menu item with the largest sequence number in the "Menu Items in Display" field is replaced. Parameter input/output display is a crucial part of the human-computer interaction interface. The displayed parameters come from keyboard input or internal system data, and the data flow is shown in Figure 8. Parameters are stored in the memory pointed to by the parameter pointer according to the data format corresponding to Figure 3, and then the window is updated. If the parameter needs to be saved, it is stored in the corresponding E2PROM address. This system uses the X5045 as the E2PROM, which also serves as a watchdog timer. 4. Conclusion This paper, primarily from the perspective of data structure and considering the characteristics of the device, proposes a general method for solving human-computer interaction problems in embedded applications using graphic LCDs. It implements Chinese window menus and solves the problems of parameter input, display, modification, and saving. The method presented in this paper has excellent flexibility and maintainability. Programmers can easily modify existing windows or add new windows when needed without affecting the original structure of the system software. These conveniences are all due to the system's well-defined data structure.
Read next

CATDOLL 130CM Nanako (Customer Photos)

Height: 130cm Weight: 27kg Shoulder Width: 31cm Bust/Waist/Hip: 64/60/72cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22