Design a low-power Chinese human-machine interface based on TMS320LF2407.
2026-04-06 08:00:35··#1
Abstract: Industrial control instruments, consumer electronics, embedded systems, and other systems require excellent human-machine interfaces, including English, numeric, Chinese character, static and dynamic graphic displays, and menu displays. This paper details the design concept and method of a low-power Chinese human-machine interface based on the TMS320LF2407, including its functional description, hardware connection diagram, software flowchart, and related programs. Keywords: TMS320LF2407, Chinese human-machine interface, LCD display Introduction In modern intelligent instruments and equipment, graphic dot-matrix LCDs capable of displaying Chinese characters and keypads for inputting information have become indispensable components of the human-machine interface. Low power consumption is also a consistent feature in the design of Chinese human-machine interfaces. In recent years, with the emergence of low-cost, high-performance DSP chips, DSPs have been increasingly applied in fields such as digital motor control, high-speed signal acquisition, voice processing, and image analysis, demonstrating their significant advantages. LCD displays, with their intuitive display and ease of operation, are used as the display front end for various portable systems. Traditional LCD displays often employ microcontroller control. However, when the system handles a large amount of high-speed real-time data, the microcontroller becomes inadequate due to its processing speed limitations. To address these issues, this paper proposes a design for an LCD screen controlled by the high-speed, low-power DSP chip TMS320LF2407, effectively solving the problems encountered above. In the design, the author uses TMS320LF2407 as the system's control chip and constructs a low-power Chinese human-machine interface at a 3V level by selecting a suitable LCD module. This Chinese human-machine interface is an important component of the motion control system based on TMS320LF2407. I. TMS320LF2407 DSP The TMS320LF2407 is a 16-bit fixed-point DSP launched by Texas Instruments (TI). It has the basic functions of the TMS320 series DSPs and also has the following features: 1. It uses high-performance static CMOS technology, which reduces the supply voltage to 3.3V, thus reducing the power consumption of the controller. 2. It has up to 32K×16-bit Flash program memory, up to 2.5K×16-bit data/program RAM, 544×16-bit dual-port RAM (DARAM), and 2K×16-bit single-port RAM (SARAM). 3. It has two event management modules, EVA and EAB, suitable for controlling AC induction motors, brushless DC motors, switched reluctance motors, stepper motors, multi-stage motors, and inverters. 4. It has a total of 192K×16-bit expandable external memory, including 64K×16-bit program memory, 64K×16-bit data memory, and 64K×16-bit I/O addressing space. 5. It includes a watchdog timer (WDT), a 10-bit ADC converter, a CAN2.0 B controller area network module, a serial communication interface module (SCI), a 16-bit serial external device interface module (SPI), and a phase-locked loop-based clock generator. 6. Five external interrupts (two for motor drive protection, reset, and two maskable interrupts); three low-power power management modes, capable of independently switching peripheral devices to low-power operating modes. Furthermore, the chip has up to 41 individually programmable or multiplexed general-purpose I/O pins (GPIOs), allowing users to customize software settings according to their needs, providing great flexibility in applications. In summary, the TMS320LF2407 features extremely low power consumption, powerful processing capabilities, rich on-chip peripheral modules, and a convenient and efficient development approach. II. LCD Display Module and Interface Circuit To achieve a user-friendly Chinese HMI display, the LCD module selected is the MG-12232 from Truly Technology. The module's typical supply voltage is 3V, and its typical operating current is 0.3µA. Its display range is 122×32 dot matrix. Its controller consists of two SED1520F0A chips, which can operate normally at 3.3V, thus avoiding the problem of logic level mismatch with the TMS320LF2407. An SED1520F0A can control an 80×16 dot matrix display. Its display RAM has 16 rows, divided into 2 pages, with 8 rows per page. The data registers of each page correspond to the 8 rows of dots on the LCD screen. Setting the page address and column address determines a specific unit in the display RAM. Each column on the screen corresponds to a byte of content in the display RAM, with the bottom bit of each column being the most significant bit and the top bit being the LSB. This means that the byte data of that RAM unit, from least significant bit to most significant bit, corresponds to the 8 data bits of a specific column on the display screen, from high to low. Assigning a value to a byte in the display RAM controls whether the pixels in the current column (one page) are displayed; a data bit of "1" indicates display, and "0" indicates no display. The interface signals between the SED1520F0A and TMS320LF2407 (using M6800 timing) are as follows: DB0~DB7: Data bus; A0: Data/instruction select signal, A0=1 indicates that data is appearing on the data bus, A0=0 indicates that an instruction or read status is appearing on the data bus; : Interface timing type selection, =1 for M6800 timing, its operation signals are E, R/W, =0 for Intel8080 timing. In M6800 timing, R/W=1 is read, R/W=0 is write. When E1=1, block E1 is selected, that is, the left half of the LCD module works, when E2=1, block E2 is selected, that is, the right half of the LCD module works. The interface circuit between TMS320LF2407 and MG-12232 module is shown in Figure 1. The corresponding control pins of TMS320LF2407 are all set to I/O port mode, and the M6800 operation timing is simulated by software. In Figure 1, V0 is the negative voltage drive power input terminal required by the LCD. Its external resistor should be adjusted using an adjustable resistor to avoid inappropriate drive voltage causing the display to be invisible. [b]III. Keyboard Interface[/b] Based on the low power consumption requirements of the system, the keyboard input response program should be designed to run in interrupt mode. That is, when a key is pressed, the DSP external interrupt 1 (XINT1) generates an interrupt (which can wake it from sleep mode), and a 20ms timer is started to debounce and remove interference. Then the DSP enters sleep mode. When the 20ms timer generates an interrupt, the DSP is woken up from sleep mode again. At this time, the keyboard is scanned to determine if a key is pressed. If a key is pressed, the key value is read from IOPB0 to IOPB7, and the function program corresponding to the key value is executed. After the program is executed, the DSP can enter sleep mode again, in a low-power state. IV. Software Design The main program flowchart is shown in Figure 2. Before the LCD module displays information, the LCD module must be initialized. The initialization flowchart is shown in Figure 3. The DSP system initialization program and key scanning program are given below. DSP System Initialization Program: SYS: SETC INTM; Disable maskable interrupts CLRC CNF; B0 is configured as data storage space SPLK #81FEH, SCSR1; Clock multiplied by 4; CLKIN=6MHz, CLKOUT=24MHz SPLK #0E8H, WDCR; Disable watchdog LDP #0 SPLK #0001H, IMR; Enable interrupt level 1 INT1 SPLK #0FFFFH, IFR; Clear all interrupt flags CLRC INTM; Enable interrupts RET LCD Initialization Program: LDP #0E1H; DP (7080H~70FFH) LACL MCRA AND #000FH; Configure IOPA[4~7], IOPB[0~7] as; General I/O port function SACL PADATDIR OR #0F000H; IOPA[4~7] as output mode AND #0FF0FH sample; IOPA[4~7]=0 SACL PADATDIR LDP #5H SPLK #00E2H, LCDCMD; Reset command E2H CALL COMWE SPLK #0A4H, LCDCMD; Normal display drive command A4H CALL COMWE SPLK #0A9H, LCDCMD; Duty cycle is 1/32 CALL COMWE SPLK #0A0H, LCDCMD; CALL COMWE SPLK #0C0H, LCDCMD; Display start line CALL COMWE CALL CLEAR SPLK #0AFH, LCDCMD; Display on command AFH CALL COMWE RET After external interrupt 1 response and 20ms timer interrupt debouncing, read key value subroutine: LDP #0E1H; DP (7080H~70FFH) LACL PBDATDIR; Retrieve key value SACL KEYDATA ; Send the key value to KEYDATA for storage RET V. Conclusion This system utilizes the TMS320LF2407 DSP, MG-12232 graphic dot matrix LCD module, and keyboard to construct a low-voltage, low-power Chinese human-machine interface based on 3V level. In actual experiments, this Chinese human-machine interface consumes less than 1mA of current, and this design scheme achieves excellent low-power performance. References 1. TMS320LF240X DSP Structure, Principle and Application, Liu Heping, et al. Beijing University of Aeronautics and Astronautics Press, 2002. 2. Liquid Crystal Display Application Technology, Li Weiti, Guo Qiang. Electronic Industry Press, 2000. 3. DSP Controller Principle and Its Application in Motion Control System, Han Antai, et al. Tsinghua University Press, 2003.