1 Introduction
In the development and application of embedded systems, choosing low-priced, high-performance LCD devices has always been the goal pursued by designers. Small and medium-sized LCDs are favored by developers for their multiple specifications, low prices, and the characteristics of being very suitable for "tailor-made" embedded systems. T6963CFG is an LCD controller produced by TOSHIBA, which can be used for LCDs of different specifications. The HS240128 display produced by Shenzhen Hansheng Company uses this LCD controller, with a resolution of 240×128, self-scanning circuit, and text display, graphic display, and mixed text and graphic display functions.
2 T6963CFG control commands and timing
The T6963CFG is an LCD controller that works with large-scale LCD drivers and data storage. The controller has 8 parallel data, read/write control, mode selection, brightness and backlight control interface lines, which can be easily connected directly to various types of processors or microcontrollers. The T6963CFG has a built-in font of 128 characters; the external expansion memory is up to 64 KB (HS240128 display expands 32 KB) for display buffers, such as text areas, graphics areas, and custom character areas; the LCD display window can be easily moved within the display buffer.
2.1 Control commands and status words
The T6963CFG command word has three basic formats:
Format 1: Data 1 Data 2 Command code
Format 2: Data 1 Command code
Format 3: Command code
When using format 1, you need to write data 1, data 2, and command code in order, one byte at a time. If you choose format 3, you only need to write command codes. Before reading or writing data to the LCD, you must perform a status check. Only when the LCD allows can you perform the corresponding operation. Its status word and its function are shown in Table 1.
2.2 Interface Signals and Timing
After the HS240128-1 display is packaged, 21 interface signal lines remain:
C/D: command/data (high/low) selection signal;
CE: chip select (low) signal;
WR: write (low) signal;
RD: read (low) signal;
D0~D7: data signal;
FS: font selection signal (high: 6×8, low: 8×8);
FG: casing safety ground;
VSS: GND (ground);
VDD: power supply for logic circuit and LCD (5 V);
VD: drive voltage adjustment input (brightness);
VEE: LCD drive power supply (output, -15 V);
RST: reset (low) signal;
K: backlight (ground);
A: backlight (5 V).
The read and write timing of the LCD interface control signal is shown in Figure 1. The timing of each control signal can be simulated by the general input and output (GPIO) interface of the microcontroller. For example, when C/D is high, CE is low, WR is high, and RD is low, the status word of T6963CFG can be read from the data line (D0~D7).
3 Hardware interface circuits in embedded systems
Usually LCD products have corresponding hardware interface circuits, but their types are not the same. LCDs with self-scanning circuits that can provide text, graphics, and mixed text and graphics display functions can be easily connected to embedded microcontrollers or single-chip microcomputers available on the market, such as LPC2104, 2119, etc. S3C44B0X is a cost-effective embedded system-on-chip solution provided by Samsung. It uses the ARM7TDMI core and integrates a wealth of peripheral components on the chip, which is particularly suitable for applications that are sensitive to cost and power consumption. Although S3C44BOX integrates LCD control logic, the control interface of the HS240128 display has a built-in control circuit. Using the rich GPIO port resources (71) of S3C44BOX, it is easy to achieve matching. In this system design, PD0~PD7, PE0~PE2, PG4~PG5 are selected as the control lines and data lines of the LCD. Its circuit connection is shown in Figure 2. [page]
According to the read and write timing of T6963CFG and the corresponding circuit matching, the functions of the read and write operations are:
char read(char type) ∥Read data from T6963CFG
4 Display Control and Programming
4.1 Display Buffer Settings
The display buffer can be divided into the system memory display buffer and the LCD display buffer. Of course, the system can also only set the LCD display buffer, and the program can only operate on the LCD display buffer. Usually the LCD display buffer is set in the I/O interface circuit, such as the display buffer size of HS240128 is 32 KB. According to the needs, the LCD display buffer can define one, two or three different display areas, such as: text area, graphic area and custom character font area. The size of each area can be customized. As shown in Figure 3. The LCD controller can automatically output and refresh the display information of the text area and graphic area in the LCD display buffer to the screen. The display position of the screen has a mapping correspondence with the position of the display buffer.
Setting up a display buffer in the system memory is usually to standardize program design and improve work efficiency. The program first reads/writes the display buffer in the system memory, and then updates its data to the LCD display buffer. The system memory display buffer is divided into a text area and a graphic area. This design sets an 8 KB text area and a 16 KB graphic area. In character mode, the text area can map 17 display pages, and in graphic mode, the graphic area can map 4 display pages.
4.2 Character and Graphic Display Process
4.2.1 Character display process
In character mode, HS240128-1 is equipped with 128 commonly used character fonts. By writing the corresponding character code 00H~7FH in the specified text display buffer, the LCD output characters can be realized [1]. The LCD display also provides an extended character function with character codes of 80H~FFH. Its font code (8×8 dot font) needs to be written in advance into the custom character font buffer. Its address is 7800H~7FFFH. In the application, the font size (1: 6×8 or 0: 8×8) is selected by controlling the FS pin. In 6×8 mode, the screen can display 40 characters in one line, and in 8×8 mode, 30 characters in one line. The entire screen can display 16 lines of characters. [page]
The system memory text buffer has a mapping relationship with the LCD text display buffer. Its data format is set according to the screen format size. For example: a line of 30 characters corresponds to 30 consecutive bytes of memory. A screen (page) of 16 lines corresponds to 480 consecutive bytes of memory. If the memory text buffer is 8 KB, 17 pages (272 lines in total) can be mapped, and its buffer is set to: Text_Buffer[272][30] (row and column two-dimensional array). The process of transferring data from the memory text buffer to the LCD text buffer can be implemented by the following code:
The LCD controller automatically scans and displays the first page of the 17 pages of data sent from the memory. If you want to display the second page or other pages, just reset the text area start address to the LCD controller. Therefore, the LCD can start displaying from any position in the display buffer. For example, to start displaying from the second line, the LCD text area start address should be 30 (0x001E).
The process of setting the start address of the text area is as follows:
4.2.2 Graphics display process
In graphics mode, the display method is to write points to draw. Each time data is written to the graphics buffer, the unit is one byte (8 points). The HS240128 has a resolution of 240x128, and a full screen (page) has a total of 3840 bytes. The controller T6963CFG of HS240128-1 automatically scans and displays the information in the graphics buffer. The system memory graphics display buffer has a mapping relationship with the LCD graphics display buffer, and its data format is set according to the screen format size.
For example: a row of 240 dots corresponds to 30 consecutive bytes of memory. A screen (page) has 128 rows, corresponding to 3,840 consecutive bytes of memory. Set the memory graphics buffer to 16 kB and map 4 pages of the LCD screen (512 rows in total). The memory graphics buffer is set to: Graphic_buffer[512][30] (row and column array), then the process of transferring data from the memory graphics buffer to the LCD graphics buffer can be implemented by the following code:
In addition, the screen scrolling function is realized by setting the starting address of the graphics area. Each time a line is scrolled, the starting address of the graphics area is modified by +30. For example, if the graphics starts to be displayed from the second line, the address of the graphics area sent to the T6963CFG controller should be 0x201E, that is, the first address of the graphics area is 2000H+30=0x201E.
The process is as follows:
4.2.3 Chinese Character Display Process
The display process of Chinese characters is carried out in graphic mode. There is no Chinese character library in HS240128-1. When displaying Chinese characters, users need to customize the font and write it into the LCD graphic display buffer. The display position can be mapped according to the display page. The Chinese character font is in 16×16 dot matrix format (32 bytes). Users who need a 16x16 Chinese character font can obtain it from general Chinese character font extraction software, which will not be described in this article.
4.3 Programming Process
When programming HS240128, first prepare the data in the memory display buffer and write the data into the LCD buffer. The LCD automatically realizes the scanning display function. To realize the screen scrolling function, simply modify the starting address of the LCD text area and graphic area. The basic process is shown in Figure 4.
5 Conclusion
This article systematically introduces the working principle of the T6963CFG controller and the LCD software and hardware application interface, and discusses in detail the application methods of dot matrix LCDs and design examples in embedded systems, hoping to provide a reference for embedded system developers when selecting and using LCDs. The methods described in this article have been well applied in some embedded system designs.
参考文献:
[1]. T6963CFG datasheet http://www.dzsc.com/datasheet/T6963CFG_1714170.html.
[2]. LPC2104 datasheet http://www.dzsc.com/datasheet/LPC2104_454512.html.
[3]. S3C44B0X datasheet http://www.dzsc.com/datasheet/S3C44B0X_589522.html.
[4]. ARM7TDMI datasheet http://www.dzsc.com/datasheet/ARM7TDMI_139812.html.
[5]. PE0 datasheet http://www.dzsc.com/datasheet/PE0_1248869.html.
[6]. PE2 datasheet http://www.dzsc.com/datasheet/PE2_1200684.html.
Previous article:Driver design of I2C bus device in embedded Linux system
Next article:Implementing personalized calligraphy input on PDA through ADS7846
Recommended ReadingLatest update time:2024-11-16 20:34
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
- STC8A8K64 MCU ADC input is disturbed
- Four memory protection issues of TI C66x DSP
- Synopsys latest IP resource recommendations
- Outsourcing Motor Drive Control Project
- MicroPython Hands-on (20) - Three-axis acceleration of the control board
- CXN2000-6KVA power supply maintenance case
- Design of wireless sensor nodes based on the characteristics of wireless sensor networks
- LSM6DSL 3D Accelerometer and 3D Gyroscope PCB Package and Code
- Ultrasonic Flow Measurement EVM
- The TS3DV642A0RUAR chip specification says it does not support 4K 60HZ, but the Ruiping can support 60HZ. Why?