Design of Human-Machine Interface for Embedded System Based on DSP

Publisher:buzzedyLatest update time:2009-12-10 Source: 电子设计工程Keywords:DSP2812 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

The human-machine interface is an important part of the embedded control system, which is used for real-time exchange of control systems between humans and machines and returning system status. Most embedded systems use LCD screens and keyboards as input and output devices of the human-machine interface. The human-machine interface designed here, as a component of the data acquisition system, provides convenience for system control and operation monitoring, and it itself has wide practicality in various embedded control systems.

2. Realization of LCD display function

The LCD display used here is RT320240B. The controller of this display uses the SED1335 controller produced by SEIKO EPSON. When DSP accesses SED1335, there is no need to judge whether it is idle. SED1335 can be ready to accept DSP access at any time and transmit the instructions and data sent by DSP in a timely and correct manner according to the internal timing. Considering that RT320240B is a large-screen LCD display, a faster screen refresh speed is required to display the data acquisition waveform. Here, parallel data transmission is used to improve the refresh speed of the LCD screen in hardware design.

2.1 SED1335 controller

The SED1335 LCD controller consists of an oscillator, a functional logic circuit, a display RAM, a management circuit character library and its management circuit, and a timing generator that generates a drive timing. The oscillator operating frequency is selectable in the range of 1 to 10 MHz. The display RAM of SED1335 has the following characteristics:

(1) Text Display Characteristics The display RAM area is dedicated to text display. Each byte of data in the display RAM area is considered to be a character code. SED1335 will use the character code to determine the first address of the character in the character library, and then transmit the corresponding font data to the LCD display module. The 8×8 dot matrix block of the character appears on the LCD screen, that is, one byte of the text display RAM corresponds to the 8×8 dot matrix on the display screen.

(2) Graphics display characteristics The display RAM area is dedicated to graphics display. Each byte of data in the display RAM area is directly sent to the LCD module. The level state of each bit determines the display state of a dot on the display screen. 1 means display and 0 means no display. Therefore, one byte of the graphics display RAM corresponds to an 8×1 dot matrix on the display screen.

(3) The character generator SED1335 manages the memory character generator CGROM. The character generator has a fixed font template SED1335 of 160 5×7 dot matrix characters. Since SED1335 can only process 8-bit character codes, it can only display and create 256 characters at a time and give all the contents of the internal character generator in the character table of SED1335. At the same time, the character code range of the external character generator is 80H~9FH and E0H~FFH, a total of 64 characters.

2.2 LCD display hardware circuit design

Considering the characteristics of the SED1335 controller and the speed requirements of the waveform display, the parallel data bus method is applied. The external expansion data bus of DSP2812 just meets the needs of parallel data transmission. The I/O data buffer interface A0 uses the lowest address bus A0 of the external expansion address bus. Through XINTF, the instruction code is written into the external expansion address of "*******1", and the data is written into the external expansion address of "*******1". Therefore, the setting of the A0 port is cleverly and conveniently solved, and it also brings convenience to programming. Based on the above considerations, the hardware connection circuit of the LCD screen is shown in Figure 1.

2.3 LCD screen display software design

The LCD display function is realized by writing to the specified memory area. By reading the contents of the display buffer area through the read instruction and comparing it with the written data, the display buffer area RAM function can be effectively tested. Combined with the instructions provided by various SED1335 controllers, the LCD display can be fully tested.

The system hardware circuit designed in combination with the characteristics of DSP itself, when writing the software program, first define the data segments LCDCMD and LCDDATA, and explain them in the main program:

#pragma DATA_SECTION(LCDCMD,"LCD_CMDFile")

#pragma DATA_SECTION(LCDDATA,"LCD_DATAFile")

Then assign addresses to these two data segments in CMD:

LCD DATA: origin=0x0080000, length=0x00001

LCD CMD: origin=0x0080001, length=0x00001


Figure 2 shows the LCD display software design process.

The screen refresh speed of ordinary serial port LCD of the same size is generally 2 to 3 seconds. The screen refresh speed can be increased to 0.5 seconds by using the parallel port external data bus design method, which meets the design requirements. If the design is developed in assembly language, the screen refresh speed will be even faster.

3. Implementation of PS/2 Keyboard Functions

3.1 Introduction to PS/2 Interface

This design uses a scanning keyboard with a PS/2 interface. PS/2 interface keyboards follow a bidirectional synchronous serial protocol, but the host always has priority on the bus, and communication from the keyboard can be suppressed at any time by simply pulling the clock low. The physical PS/2 interface is one of two types of connectors, a 5-pin DIN or a 6-pin mini-DIN. The commonly used connector is the mini-DIN 6-pin plug, which is also the connector for the 17-key keypad.

3.2 PS/2 interface hardware circuit design

The PS/2 interface only requires two data lines and is easy to connect. Figure 3 shows the PS/2 interface hardware connection circuit.

3.3 PS/2 interface keyboard software design

The DSP processor monitors the key matrix. If a key is found to be pressed, released or held down, it will send a scan code information packet to the computer. Among them, there are two types of scan codes: make code and break code. When a key is pressed or held down, a make code is sent; when a key is released, a break code is sent. Each key is assigned a unique make code and break code, and the host can determine the specific key by looking for the unique scan code. The make and break codes of each key on the keyboard constitute a scan code set. The PS/2 interface keyboard uses the second set of scan codes by default.

The keyboard follows a serial protocol that contains 11 bits per frame. These bits are: 1 start bit, always 0; 8 data bits, low bit first; 1 parity bit, odd parity; 1 stop bit, always 1. In order to reduce system overhead, this design uses interrupt mode and detects scan codes in the interrupt program. Part of the program code is as follows:


In order to reduce the bit error rate, the broken code is detected after the pass code is determined, so that the DSP processor can obtain a more accurate judgment.

4 Conclusion

This article introduces an embedded human-machine interface design with DSP as the core. Practice has proved that this design is simple, practical and widely used. Based on the design ideas of this system, there will be multiple design schemes according to actual needs and processor characteristics, and combined with the development of the BIOS system, it will make the scheduling between multiple tasks more convenient.

Keywords:DSP2812 Reference address:Design of Human-Machine Interface for Embedded System Based on DSP

Previous article:Design of wireless communication transceiver module based on FPGA
Next article:Teclast T8100 Full HD Master Controller Internal Architecture Leaked

Recommended ReadingLatest update time:2024-11-16 19:55

Design and application of SED1335 in single chip microcomputer system
1 Introduction   With the development of information technology, people are facing various display devices more and more frequently, among which liquid crystal display (LCD) is the most promising display device, which has been widely used in mobile communications, instruments, electronic equipment, household applian
[Microcontroller]
Design and application of SED1335 in single chip microcomputer system
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号