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.
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
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
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
- Today at 10:00 AM, live broadcast with prizes: Infineon MERUS Class D audio amplifier's multi-level technology and its advantages
- Proteus MSP430 MCU simulation example 17-sawtooth, triangle, square wave generator
- A 5G base station is worth this price. Do you think it is expensive?
- One week evaluation information, delivered on time~
- Tips for selecting brushless DC motor driver chips
- EEWORLD University Hall----Live Replay: TI 60G mmWave Sensor Overview and Application Introduction
- Full-wave precision rectifier circuit composed of comparators
- NUCLEO-474 Download the official example prompt No debug probe... Solution
- SERDES interface circuit design
- TMS320C55x DSP Library