Design of TFT LCD display and touch screen in elevator car based on StellarisWare

Publisher:星辰古泉Latest update time:2014-04-06 Source: 互联网Keywords:StellarisWare  LPC2478 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    With the emergence of touch screens and the rapid development and increasing maturity of touch screen technology, touch screen technology has been widely used in public service fields and electronic products and equipment, and has become increasingly popular. Touch screens are replacing traditional input devices such as mice and keyboards and becoming an important part of electronic products. Thin-film transistor liquid crystal display (TFT-LCD) is one of the most ideal display devices for digital terminal display. The touch screen is attached to the surface of the display and can display content based on the corresponding touch point characters to understand the intention of the toucher, making graphical human-computer interaction simpler, more intuitive and more user-friendly [1]. TFT-LCD with touch screen is widely used in embedded system design due to its convenience, large capacity, high definition and full-color video [2].
    The display system in the elevator car is an important channel for elevator passengers to exchange information with the elevator. It provides elevator operation information to passengers so that passengers can easily and comprehensively understand the operation status of the elevator. At present, most elevator cars use traditional LED displays to display elevator information, and the display content is monotonous and limited. In addition, the display system for building advertisements in elevator cars mostly uses independent advertising machines, which are costly. Therefore, it is necessary to design and develop an elevator car display system that integrates display and touch-type floor selection. It can play color pictures, numbers and other comprehensive information, improve the closed car environment and reduce costs. For graphic display, the StellarisWare graphics library provides a relatively complete and fast MCU graphic display solution, which is easy to transplant. Its powerful drawing function can design a human-computer interaction interface with diverse content according to specific application scenarios. The interface is beautiful and can be applied to high-end elevators.
1 Hardware design of car display
    The car display is mainly based on the microprocessor. It processes and displays information according to the toucher's intention, and controls the CAN communication module to send and receive data with the elevator main controller. The external memory is to meet the needs of storing large amounts of image data. The functional module block diagram of the car display is shown in Figure 1.

1.1 LCD display
    LPC2478 has an internal integrated LCD controller, supports thin-film transistor (TFT) displays, and provides interfaces for TFT-LCD control signals HSYNV (horizontal synchronization signal), VSYNC (vertical synchronization signal), VDEN (data enable signal) and LCDCLK (LCD clock signal), simplifying the hardware design. The
    in-car display uses Mitsubishi's 10.4-inch LVDS (Low Voltage Differential Signaling) interface TFT-LCD AA104SG01, and the LCD back drive circuit integrates an LVDS receiver. Therefore, a differential signal transmitter is required to convert the TTL signal output by the LPC2478 main controller into an LVDS signal, and transmit it to the LVDS receiver on the LCD panel side to drive the TFT-LCD. The differential signal transmitter is a video interface conversion chip DS90C383. DS90C383 can convert 16-bit TTL data into three mixed LVDS data streams to drive LCD in one clock cycle, namely TxOUT0, TxOUT1, and TxOUT2, and one data stream contains 7-bit data. The mapping relationship of DS90C383 input and output signals and the connection between LPC2478 built-in LCD controller and DS90C383 pins in RGB (R[4:0]G[5:0]B[4:0]) mode are shown in Table 1.


1.2 Touch screen interface design
    Touch screens can be divided into resistive, capacitive, infrared, surface acoustic wave, etc. based on their working principles. The most common four-wire resistive touch screen is used here [3]. The back of the LCD display is attached with a touch screen drive circuit, which is a resistive four-wire touch screen. The four wires are X+ (TSXP), X- (TSXM), Y+ (TSYP), and Y- (TSYM), which are the positive and negative electrodes of the X electrode and the Y electrode, and are also the input terminals for the coordinate data of the touch screen contact point. The
    four-wire resistive touch panel consists of two transparent resistive layers, namely the X plate and the Y plate [4]. If an external force causes the upper and lower layers to contact at a certain point, the voltage at the contact point can be measured based on the voltage gradient on the layer where no voltage is applied to the electrode, and the coordinates of the contact point can be obtained through A/D conversion. The microprocessor outputs four control signals to control the on and off of the four MOS tubes, thereby controlling the on and off of the four electrodes Y+, Y-, X+, and X- of the touch screen.
1.3 External Synchronous Dynamic Random Access Memory
      In order to meet the need of temporary storage of large amounts of data during high-speed image display of LCD, a high-speed image storage solution, namely intermediate cache, is adopted. As an intermediate data cache, SDRAM (Synchronous Dynamic RAM) has the advantages of large capacity, high speed, low price and low power consumption[5]. It is a very effective method and truly meets the requirements of high-speed and real-time image display.
    LPC2478 has a built-in SDRAM controller that can realize the logic control of SDRAM[6]. The main signals include chip select signal (SCS), clock signal (SCLK), clock enable signal (SCKE), read/write signal (WE), page address selection signal (BA[1:0]), row address selection signal (A0~A12), and column address selection signal (A0~A8). It adopts time-division multiplexing addressing mode and uses RAS and CAS signals to determine whether it is a row address or a column address. When RAS is valid, A0~A12 is the row address; when CAS is valid, A0~A8 is the column address signal. Data signal DATA[15:0], its enable is controlled by the DQM signal. The address range of SDRAM is 0xA000 0000~0xA200 0000 (32 MB).
2 Software Design
2.1 StellarisWare Graphics Library Porting

    For graphics display, the StellarisWare graphics library provides a fast software development solution, which can perform basic graphics and text drawing, and can also easily realize the drawing of common message controls (Widgets).
2.1.1 Button Control Graphics Generation and Graphics Preprocessing
    StellarisWare software includes two tools: LMI-button and pnmtoc. Graphics generation and preprocessing can be completed through these two tools.
    (1) The LMI-button tool can save images in other formats into the pnm format that the graphics library can recognize, and combined with the GIMP image processing program, it can generate various types of controls.
    (2) The pnmtoc tool compresses images into C files, mainly converting pnm format images into C files that the graphics library can recognize. Run Windows Service Manager and enter the command: pnmtoc Image.pnm>Image.c, and the Image.pnm image will be generated into a C array file that can be recognized by the graphics library. The default name is const unsigned char g_pucImage[]. Calling the function GrImageDraw(&MyContext,g_pucImage,0,0) in the main function will draw the g_pucImage image from point (0,0).
2.1.2 Control definition and drawing
    The Stellaris graphics library can implement many controls, including canvas and button controls. The canvas control is a simple drawing panel on which users can draw graphics and text, and it also supports displaying pictures. Each control has three properties: parent control (Parent), next control (Next), and child control (Child). For easy management, the graphics library manages many controls in a tree-like form. Each control tree has a virtual WIDGET_ROOT control as the top-level control, and other controls are its child nodes or lower-level child nodes [7].
    (1) Define the canvas control function Canvas() and the button control function RectangularButtonStruct
(). When defining controls, users configure various parameters according to actual conditions and define event response functions.
    (2) Draw control tree function. Use WidgetAdd() to add controls to the control tree WIDGET_ROOT, and then call the function WidgetPaint(WIDGET_ROOT) to draw the entire control tree.
    (3) The message adding function WidgetMessageQueueAdd() can add messages to the message queue for subsequent processing.
2.2 Software Design of LCD Display
    The software operation of the LPC2478 built-in LCD controller is mainly to correctly set various registers. First, the LCD must be initialized. LCD initialization includes setting LCD registers, LCD working mode to BGR 5:6:5, display data buffer address to SDRAM address, LCD backlight, etc. The process of LCD display is also the process of control definition, addition, drawing and message processing. The software design process of LCD display is shown in Figure 2. The function Widget-MessageQueueProcess() processes the control tree information queue and refreshes the LCD.

2.3 Touch screen software design
    The touch screen is attached to the display surface, and uses a microprocessor to control the LCD screen and touch screen. As long as the position of the touch point is measured, the intention of the toucher can be known based on the display content or characters at the corresponding coordinate point, and then the information can be processed. The function of the touch screen callback function TouchScreenCallbackSet (WidgetPointerMessage) is to connect the user action event with the user-defined event response function. When the user takes action, the user input driver can call the WidgetPointerMessage() function to pass in the action information (such as the x, y coordinates of the action, the action mode, etc.). The graphics output driver responds to the user input event and refreshes the display screen. The touch screen software design process is shown in Figure 3.

2.4 CAN communication software design
    The elevator car controller and the main controller realize data transmission through the CAN bus. The CAN bus is the bridge for communication between the car and the main controller. It can support multiple master nodes at the same time, with fast data transmission speed and long communication distance.
    The format of the car display message: destination ID number + command byte + data byte 1 + data byte 2 + ... + data byte 6. The ID number is the identifier assigned to the main controller, car controller, and outbound call floor indicator. The command byte is the core of the protocol and is usually used in conjunction with the data byte. There are door opening and closing commands, floor display commands, arrival prompt commands, and registration floor commands. The data bytes mainly include the floor number, elevator operation status, and registration floor information.
3 Test Results and Analysis
    The car display controller is connected to the elevator main controller for on-site debugging. Figure 4 shows the LCD display process of the elevator from the 10th floor to the 5th floor and then to the 1st floor. It can be seen from the figure that the button control has door opening and closing and floor buttons. The button control has two different color status attributes: pressed and not pressed. When the user presses the destination floor number button, the button control appearance color status changes, and the LCD displays the floor number and the elevator operation status; when the elevator reaches the destination floor selected by the user, the floor button will return to the not pressed state, and the door opening button will display the door opening state. When closing the door, the door closing button control will also display the corresponding state.

 

    In order to be efficient and convenient, this paper uses the StellarisWare graphics library to simplify the difficulty of software design and improve development efficiency. After many field tests, the communication between the car display controller and the elevator main controller is reliable and stable, the display interface is clear and the effect is good. The TFT-LCD display in the elevator car with touch function is a simple, convenient and natural human-computer interaction method. The interface is beautiful and generous, which can better improve the quality of the elevator and has a good application prospect.
References
[1] Guo Benzhen, Li Shengjin, Lu Gang, et al. Design of vehicle information system based on DSP and LCD touch screen [J]. Liquid Crystal and Display, 2011, 26(1): 83-87.
[2] Guo Ruiling, Zou Xiangyang, Hei Rui. Human-machine interface design of a certain type of radar jammer based on touch screen [J]. Electrical Measurement and Instrumentation, 2010, 47(536A): 149-141.
[3] Song Cheng, Sun Guangfu. Application example of touch screen on S3C2410 [J]. Microcontroller and Embedded System Application, 2005(1): 35-38.
[4] Chen Shili, Sun Mojie, Li Dachao, et al. Working principle and typical application of touch screen [J]. Microcontroller and Embedded System Application, 2002(2): 11-13.
[5] Pan Guangrong, Wang Qin, Qi Yue. SDRAM for logic design Controller performance measurement model [J]. Computer Application Research, 2009, 26(9): 3432-3435.
[6] Liu Yanyan, Li Guoning, Jin Longxu. SDRAM image cache technology in remote sensing image acquisition [J]. Television Technology, 2012, 36(17): 52-54.
[7] Texas Instruments. StellarisWare? graphics library user′s Guide [S]. [2013-03-01].

Keywords:StellarisWare  LPC2478 Reference address:Design of TFT LCD display and touch screen in elevator car based on StellarisWare

Previous article:How to Minimize Crosstalk in Cable Design
Next article:Wideband frequency/voltage conversion circuit based on LM331

Latest Power Management 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号