Share this

Design of a Low-Power Chinese Human-Machine Interface Based on MSP430 Microcontroller

2026-04-06 07:59:13 · · #1
In modern portable smart instruments or handheld devices, Chinese human-machine interfaces (HMIs) have become a de facto industry standard. Graphical dot-matrix LCDs capable of displaying Chinese characters and numeric keypads for inputting numbers have become indispensable components of smart devices. Meanwhile, low power consumption, a fundamental requirement for portable devices, is consistently emphasized in the design of Chinese HMIs. This low-power Chinese HMI requires designers to consider special considerations when selecting MCUs and specific components. Low power consumption and small size should be the primary requirements for selecting relevant components. In this design, the author uses the MSP430F149 microcontroller as the system's MCU and constructs a low-power Chinese HMI at 3V by selecting a suitable LCD module. This Chinese HMI constitutes an important part of the low-power data acquisition system. I. Low Power Consumption Characteristics of the MSP430 Series FLASH Microcontrollers The MSP430F14x series from Texas Instruments (TI) is an ultra-low-power Flash-type 16-bit RISC instruction set microcontroller. It adopts a "Von Neumann" architecture, with RAM, ROM, and all peripheral modules located in the same address space. It has rich on-chip and peripheral features and is extremely cost-effective. The MSP430F14x series is the most powerful sub-series of TI's MSP430F1x series (FLASH memory type) microcontrollers. The F14x has a larger program and data storage area, more peripheral modules, and even includes a hardware multiplier on-chip. At the same time, the F14x series microcontrollers have simple development tools, and the programs solidified in the FLASH memory are easy to upgrade and debug online, making them very suitable for developing consumer portable electronic products. The MSP430F14x microcontroller embodies the advanced low-power design concept of modern microcontrollers. Its design structure is entirely based on the low-power operation of the system. This low-power structure is specifically reflected in the following four points: (1) High integration and complete single-chip design. Many peripheral modules are integrated into the MCU chip, increasing hardware redundancy. The internal design is based on the principles of low power consumption and low voltage, so that the system is not only powerful, reliable, and cost-effective, but also easy to further miniaturize and portability. (2) The internal circuit can work selectively. The F14x microcontroller can select different functional circuits through special function registers, that is, it relies on software to select different peripheral functional modules. Unused modules are stopped to reduce power consumption. (3) It has two sets of clocks, high speed and low speed. The higher the system operating frequency, the greater the power consumption. To better reduce power consumption, the F14x microcontroller can use three independent clock sources: high speed main clock, low frequency clock (such as 32.768kHz) and DCO on-chip clock. The MCU main clock frequency can be reduced by a certain proportion to reduce power consumption when functional requirements are met. When high speed is not required, the secondary clock can be used to run at low speed to further reduce power consumption. The CPU clock frequency can be changed by assigning values ​​to special function registers in software, or the main clock and secondary clock can be switched. (4) It has multiple energy-saving working modes. The F14x microcontroller has five energy-saving modes: LPM0, LPM1, LPM2, LPM3, and LPM4. These five modes provide excellent performance guarantees for its power consumption management. Figure 1 shows the actual operating current consumed in the active state (AM) and various energy-saving modes. Figure 1 shows the relationship between the operating modes and operating current of the F14x. The MSP430F14x series is specifically developed for ultra-low power portable applications. Utilizing advanced integrated circuit technology and manufacturing processes, its power consumption has surpassed the milliamp level, truly reaching the microamp level. Furthermore, the F14x's software structure is also designed for low power consumption. For example, waking the MCU from standby mode takes only 6μS. Its interrupt and subroutine calls have no hierarchical restrictions; this rich interrupt capability reduces the need for system polling and facilitates the design of interrupt-driven control programs. Using the F14x series microcontrollers, a low-voltage operating platform can be easily built. By combining intelligent operation management of each functional module with the MCU's energy-saving mode, the contradiction between operating speed, data flow, and low-power design can be resolved, minimizing the current consumption of each functional module and limiting activity to the lowest possible level. Through this optimization, extremely low power consumption of the microcontroller can be achieved. At a 1MHz operating frequency, the F14x consumes only 0.1–400μA of current (1.8–3.6V power supply). With a 1.8V power supply, it consumes only 160uA during execution and 0.1uA in standby mode, while still effectively retaining the data in RAM. In summary, the MSP430F14x microcontroller features extremely low power consumption, powerful processing capabilities, rich on-chip peripheral modules, and a convenient and efficient development approach. The MSP430F149 microcontroller used in this system is the most powerful model in the F14x series. It features a hardware multiplier, six I/O ports (each with eight I/O pins), a precise analog comparator, two timers with capture/compare registers, an eight-channel 12-bit A/D converter, an on-chip watchdog timer, two serial communication interfaces, 60KB of Flash ROM, and 2KB of RAM. The F149 also has powerful expansion capabilities, with 48 I/O pins. Each I/O port corresponds to multiple registers such as input, output, function selection, and interrupt, allowing function ports and general-purpose I/O ports to be reused, greatly enhancing port functionality and flexibility, and improving the ability to develop peripheral devices. The above features of the MSP430F149 make it very suitable for constructing a full-featured portable microcontroller application system. II. LCD Display Module and Interface Circuit Graphic dot matrix LCDs can display any user-defined symbols and graphics, and can be scrolled. As an important part of the human-machine interface of portable microcontroller systems, it is widely used in instruments for real-time detection and display. Graphical dot matrix LCDs that support Chinese character display are a very common display device in modern microcontroller application systems. The display screens on Chinese character pagers and mobile phones are graphic dot matrix LCDs. It, together with the matrix keypad, forms the most commonly used human-machine interface in modern microcontroller application systems. Compared with other display methods, the use of graphic dot matrix LCD displays has the following advantages: (1) Low operating voltage and extremely low power consumption. The working voltage is 3-5V and the working current is ≤10uA/cm2, which is especially suitable for portable instruments. (2) The LCD display is a passive display and is less affected by external light interference. (3) The graphic dot matrix LCD can display a large amount of information and has a high resolution. (4) It does not generate electromagnetic interference. (5) It has high reliability and long service life. In the design, the author used the MG-12232 LCD display module from Truly. The typical power supply voltage of the MG-12232 module is 3V and the typical working current is 0.3mA, which is very suitable for the low power consumption environment of the 3V level in this system. Its display range is 122×32 dot matrix, which can realize the so-called "dual row Chinese display". The controller used by MG-12232 is two SED1520 chips. One SED1520 controller can drive 16 rows × 80 columns. The SED1520 controller can work normally under 3V logic, thus avoiding the problem of mismatch with the logic level of the MSP430 microcontroller. The specific structural block diagram is shown in Figure 2. Figure 2 shows the pin definitions and structural block diagram of the SED1520. The SED1520 controller serves as the interface between the LCD screen and the MCU, directly driving the MG-12232 LCD and controlling the display of characters, Chinese characters, and graphics. Since the MSP430F149 has 48 I/O pins, the SED1520 allows direct simulation of LCD read/write and control timing using the MSP430's I/O ports. This transforms the MCU's operation of the LCD into the MCU's operation of the SED1520 LCD controller, significantly simplifying the hardware connection and software programming of the interface circuit. The "V5" pin in Figure 2 provides the contrast voltage for the MG-12232 LCD, which can be generated by a -12V voltage generator circuit (such as MAX765) and then divided by a 100K potentiometer. The MCU can access the LCD module through some control pins and 13 commonly used instructions of the SED1520. For example, "RST" is used to restart the SED1520, and "E1" and "E2" are used to enable two SED1520 chips respectively. "R/W" controls reading or writing to the SED1520. "A0" determines whether the operation is an instruction read/write or a data read/write. One SED1520 display controller can control the display of an 80×16 dot matrix LCD. Its display RAM has 16 rows, divided into 2 pages, with 8 rows per page. The data registers of each page correspond to 8 rows of pixels on the LCD screen. Once the page address and column address are set, a unique unit in the display RAM is determined. Each column on the screen corresponds to a byte of content in the display RAM, with the bottom bit of each column being the MSB and the top bit being the LSB. That is, each bit of the data in the RAM unit from low to high corresponds to the 8 data bits from high to low in a certain column on the display screen. Assigning a value to a byte unit in the display RAM controls whether the pixels in the current column (one page) are displayed. As shown in Figure 3, the P5 port of the MSP430F149 microcontroller is used as the data port for communication with the LCD module. Figure 3 shows the circuit connection diagram between the MSP430F149 and the MG-12232. The MG-12232 display module has several models, all using the same SED1520 controller. The operation and usage are completely identical, only the size differs. Commonly used models include MG-12232-5 (76×29.1×5.7mm), MG-12232-6 (45.05×22.32×6.3mm), and MG-12232-7 (84×44×10mm), which can be used in portable instruments or devices of different sizes. For the LCD module, the backlight type also needs to be considered, as different backlight types consume significantly different currents. Commonly available backlight types include LED (Light Emitting Diode), EL (Electronic Luminous Lamps), and CCFL (Cold Cathode Fluorescent Lamps). EL (Elastic Compute Unit) is a surface-emitting cold light source that can be made very large and thin. Although its brightness is relatively low, it emits light very uniformly without any spots, and its power consumption is particularly low. The disadvantage is that it requires a high-voltage AC drive, thus necessitating a dedicated voltage conversion circuit (such as the IMP803). CCFL (Computer-Coated Fluorescent Lamp) has a larger illumination area and is suitable for instruments or equipment requiring large-area LCD displays. III. Keyboard Interface: The MSP430F149's P1 and P2 ports support hardware interrupts in addition to input and output. Each of the eight pins on ports P1 and P2 has its own control register, allowing for individual control and enabling of interrupts. Each pin can also be used as an interrupt source, with its own interrupt trigger edge and interrupt enable. Ports P1 and P2 each use an interrupt vector; P1.0–P1.7 and P2.0–P2.7 generate the same interrupt. This structure of ports P1 and P2 is well-suited for implementing interrupt-based keyboard input response programs. This system uses a 2×2 matrix keyboard. The keyboard program employs a row-scanning method. P1.0 and P1.1 are connected to two column lines, defined as output ports, and P1.2 and P1.3 are connected to two row lines, defined as input ports. Both row lines require 10K pull-up resistors. Considering the system's low power consumption requirements, the keyboard input response program should be designed to run in interrupt mode. That is, when a key is pressed, an interrupt is generated to wake the MCU from sleep mode and start a 12ms timer, after which the MCU enters sleep mode again. When the timer generates an interrupt, it wakes the MCU from sleep mode again, scans the keyboard, calculates the key value if a key is pressed, and executes the function program corresponding to that key value. After executing this program, the MCU enters sleep mode again. IV. Principles and Some Program Examples of Chinese Character Display 1. The Chinese Character Fonts of Graphic Dot Matrix LCDs differ from those displayed in DOS. Graphic dot matrix LCDs do not simply draw dots to depict Chinese characters. Chinese character fonts extracted directly from the Chinese system's character library cannot be directly displayed on the LCD; they usually require format adjustments and conversions. The arrangement of standard 16-dot matrix Chinese character (e.g., HZK16 for the desired Chinese character) font data is shown in Figure 4. Since an SED1520 display controller can control an 80×16 dot matrix LCD display, its display RAM consists of 16 rows, divided into 2 pages, with 8 rows per page. The 32 bytes of display RAM across 16 consecutive columns and 2 adjacent pages can control the display area of ​​a Chinese character (as shown in Figure 5). Assigning corresponding values ​​to these display RAMs will display a Chinese character. Figure 4: Standard Chinese character font arrangement; Figure 5: SED1520 Chinese character font arrangement. As shown in Figures 4 and 5, the arrangement order and method of the Chinese character fonts in the SED1520 graphic dot matrix LCD display controller are completely different from those of the standard Chinese character fonts. LCD font data can be obtained by performing bitwise operations on the standard font data. In actual programming, the LCD font data for a specific Chinese character should be stored in the FLASH memory of the MSP430F149 microcontroller. 2. LCD Initialization Process: Before displaying information on the LCD, it is necessary to initialize the LCD. The initialization process is as follows: Note that although the actual control area of ​​the SED1520 controller in the MG-12232 module is 61 columns, when clearing the display RAM, it should still be cleared as 80 RAM units. 3. Some program examples The program is written in assembly language under the IAR Embedded Workbench development platform for the MSP430 microcontroller, and the simulator uses TI's MSP-FET430P410. Since the MSP430F149 microcontroller is selected in this system, the following settings need to be made to the IAR Embedded Workbench platform before compiling the source program: A. Click the Options… command under the Project menu to enter the settings window, and set the “Include” page under the “XLINK” option in the Category box on the left. Set the content of the “XCL file name” box to “C:\Program Files\IAR Systems\ew23\430\icc430\MSP430F149A.xcl”. B. Click the Options… command under the Project menu to enter the settings window. In the Category box on the left, under the “C-SPY” option, configure the “Setup” page. Set the content of the “Chip Description” box to “C:\Program Files\IAR Systems\ew23\430\cw430\MSP430F149.ddf”. The following provides some constant definitions and the source code for the command sending subroutine (SEND_COM), data sending subroutine (SEND_DATA), and LCD status query subroutine (LCD_STE). #include "MSP430x14x.h" ; The program displays “Chinese character LCD” on the LCD. ;————————- Define LCD pins LCD_RST EQU 04H ;P4.2 LCD_E1 EQU 40H ;P4.6 LCD_E2 EQU 20H ;P4.5 LCD_RW EQU 10H ;P4.4 LCD_A0 EQU 08H ;P4.3 ;—————————— Define the data register used by the LCD LCD_PAGE EQU 0200h ; Define the display page LCD_ORDER EQU 0201h ; Temporarily store LCD control instructions LCD_DATA EQU 0202h ; Temporarily store LCD data LCD_CNT EQU 0203h ; LCD counter memory LCD_ROW EQU 0204h ; Store column address data LCD_LINE EQU 0205h ; Store row address data LCD_CHAR EQU 0206h ; Store the starting address of the current character data LCD_BYTECNT EQU 0207h ; Store the number of bytes to be displayed LCD_STATUS EQU 0208h ; Store the current state data of the LCD SEND_COM ; Send command word subroutine, with LCD_ORDER as the input parameter BIS.B #LCD_E1,&P4OUT ; SET E1=1 , Enable CHIP1 CALL #LCD_STE BIC.B #LCD_A0,&P4OUT ; A0=0,SEND OUT INSTRUCTION BIC.B #LCD_RW,&P4OUT ; R/W=0,WRITABLE BIS.B #0FFH,&P5DIR ; SET P5 PINS OUTPUT MOV.B LCD_ORDER,&P5OUT ;SEND ORDER BYTE TO LCD BIC.B #LCD_E1,&P4OUT ; SET E1=0 RET ; Send data subroutine, with LCD_DATA as the input parameter SEND_DATA BIS.B #LCD_E1,&P4OUT ;SET E1=1 CALL #LCD_STE BIS.B #LCD_A0,&P4OUT ;A0=1,SEND OUT DATA BIC.B #LCD_RW,&P4OUT ;R/W=0,WRITABLE BIS.B #0FFH,&P5DIR ;SET P5 PINS OUTPUT MOV.B LCD_DATA,&P5OUT ;SEND DATA BYTE TO LCD BIC.B #LCD_E1,&P4OUT ;SET E1=0 RET ;Subroutine for reading the current status of the liquid crystal LCD_STE LCD_STE BIC.B #LCD_A0,&P4OUT ;A0=0,SEND OUTINSTRUCTION BIS.B #LCD_RW,&P4OUT ;R/W=1,READABLE BIC.B #0FFH,&P5DIR ;SET P5 PINS INPUT STE_AGN MOV.B &P5IN,LCD_STATUS ;GET STATUS DATA FROM LCD BIT.B #80H,LCD_STATUS ;If bit 7 of the status memory is 1, busy, then wait for JC STE_AGN RET V. Conclusion This system utilizes the MSP430F149 microcontroller, MG-12232 graphic dot matrix LCD module, and matrix keyboard interface to construct a low-voltage, low-power Chinese human-machine interface based on 3V level. In actual use, this human-machine interface consumes less than 1mA of current, and this design scheme achieves excellent low-power performance.
Read next

Energy-saving and light pollution reduction solutions based on LED facade lighting

The use of LEDs (Light Eraser Diodes) for facade lighting was relatively rare a few years ago, still considered a novelt...

Articles 2026-02-22