Interface Design between LCD and ARM7 Based on T6963C

Publisher:淡雅时光Latest update time:2011-06-17 Keywords:T6963C Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
As a commonly used display device, the LCD module has the characteristics of low power consumption, rich display content, and flexible control. Among the medium-sized graphic LCD display modules, the LCD module with built-in T6963C controller is currently the more commonly used built-in controller type graphic LCD display module. The module can be initialized and set by hardware circuits, so it can save software overhead. In terms of software, the T6963C controller also provides a rich instruction set, and the control method is flexible and diverse. The 32-bit microprocessor with ARM as the core has the characteristics of high performance and low power consumption, and is widely used in the field of industrial control. Therefore, for the low-end ARM7 chip without LCD interface, its general purpose input and output (GPIO) pins can be used to connect to the LCD and control the LCD to realize its display function.


1 LCD hardware interface design
The T6963C controller can be connected to the row and column drivers and display buffer RAM of the LCD module, and the LCD screen structure (single or dual screen), display window length, width, font, etc. can be set through this hardware connection method. The principle block diagram of the single-screen structure dot matrix graphic LCD display module with built-in T6963C is shown in Figure 1.

In Figure 1, the data bus and the control bus are directly connected to the IO port line of the CPU. The liquid crystal can use the SMG240128A dot matrix graphic liquid crystal display module; and the CPU can use the 32-bit microprocessor chip LPC2134 based on the ARM7TD-MI-S core. The chip is designed based on the principle of RISC, and the instructions and decoding are simple and convenient. It adopts three-level pipeline technology, the CPU operating frequency can reach up to 60MHz, and it has 47 general I/O ports. At the same time, it contains rich peripheral resources, which is very suitable for use in the field of industrial measurement and control. The interface circuit between the liquid crystal module and LPC2134 is shown in Figure 2.
The liquid crystal module in Figure 2 adopts data parallel transmission mode and is connected to LPC2134 through two driver chips 74L3245 and 74HC14. Among them, 74LS245 is an eight-bit bidirectional bus transceiver, which can connect the data bus of the LCD module to the eight lines of the CPU's P0 port, is responsible for controlling the transmission of data, and has data latching and buffering functions: 74HC14 is a six-input inverting driver that can drive the four control lines of the LCD module. Pin 21 of the LCD module is the backlight ground terminal, which is controlled by p0.23 to turn the backlight on and off. The backlight brightness can be adjusted by potentiometer W2, and the contrast of the LCD display can be controlled by potentiometer W1. The FG pin is the frame ground and must be grounded to prevent static electricity and lightning strikes. The FS pin is grounded to control the font to 8x8 dot matrix.

2 Implementation of display function
The LCD display function can be realized by controlling the LCD controller T6963C by LPC2134. The T6963C controller has a rich set of built-in instructions, and the display function can be set by instructions. Instructions can have one or two parameters, or no parameters. The execution of each instruction is to first enter the parameters and then the instruction code. Before each operation, the status word needs to be detected. [page]

2.1 Low-level sub-function design
At the program level, whether it is the detection of status words or the transmission of parameters and instruction codes, it involves the read and write operations of the LCD controller. According to the read and write timing provided in the T6963C manual and combined with the hardware design of this system, the read and write timing diagram shown in Figure 3 can be obtained.

When designing a program, you can simulate the read and write timing diagram of the LPC2134 GPIO pin to achieve data transmission. According to the data and read and write types, four underlying sub-functions can be designed to complete the transmission function. The functional description is listed in Table 1.

The source codes of the write command word sub-function and the read data sub-function are as follows:
Define the following constants in the header file in advance:
#define WR 1<<25 // p0.25 write control bit
#define CD 1<<17 // p1.17 data instruction selection control bit
#define RD 1<<26 // p0.26 read control bit
#define CE 1<<27 // p0.27 LCD chip select
#define DIR 1<<22 // p1.22 74LS245 data transfer direction control bit
#define DPT0xOff<<16 // data port
// Write command word sub-function complete source code
void LCD_WriteCommand(uint8 command)
{
uint32 com=0; // define temporary storage unit
com=command;
IOODIR=IOODIR | DPT; // set output data
IOOSET=IOOSET | CD; // command attribute
IOOSET=IOOSET | WR:
IOOSET=IOOSET | RD;
IO1CLR=I01CLR | DIR;
//Data transmission direction setting
IOOSET=(IOOSET&(~DPT))|(com<<16);
//Data write entry line
IOOCLR=(IOOCLR&(-DPT)|(((-com)&(0xOff)<<16);
IOOCLR=IOOCLR | CE; //Select LCD
IOOCLR=IOOCLR | WR; //Write valid
IOOSET=IOOSET | WR; //Write completed, write low
IOOSET=IOOSET | CE;
}[page]

//Complete source code of read data sub-function
uint8 LCD_ReadData 0
{
uint8 data;
IO0DIR=IOODIR&(~DPT); //Input data
I01CLR=I01CLR | CD; //Data attribute
IO0SET=IO0SET | WR;
IO0SET=IO0SET | RD;
IO1SET=IO1SET | DIR;
//Data transmission direction setting
IO0CLR=IO0CLR | CE;
IO0CLR=IO0CLR | RD; //Read valid
data=(IO0PIN&DPT)>>16;
//Read data from pin status register
IOOSET=IOOSET | RD; //Read invalid
IO0SET=IO0SET | CE;
return (data); //The return value is the read data
}
As for the writing of read status and write data sub-functions, you can refer to this sub-function to complete it during design.


2.2 Driver layer implementation
Next, we need to use the instructions of T6963C to complete the setting of the driver layer display function. The definitions of some basic instructions are listed in Table 2. In fact, the writing of driver layer sub-functions can be achieved by calling write command, write data, and read status sub-functions.

The source code of the LCD initialization setting function is as follows:
void LCD_Initialize(void)
{
LCD_WriteTCommand3(LCD_TXT_STP, 0x00, 0x00); //Text mode RAM starting address
LCD_WriteTCommand3(LCD_TXT_WID, 30, 0x00); //Set the width of the text mode, the width is N/6 or N/8, N is the number of width dots, such as 240
LCD_WriteTCommand3(LCD_GRH_STP, 0x00, 0x00); //Graphics mode RAM starting address
LCD_WriteTCommand3(LCD_GRH_WID, 30, 0x00); //Set the width of the graphics mode, the width is N/6 or N/8, N is the number of width dots, such as 240
LCD_WriteTCommand 1(LCD_MOD_OR); //Set the display mode to "or"
LCD_WriteTCommandl(LCD_DIS_SW |0x08); //Set pure graphic display mode
}
2.3 Chinese character reading and writing program design
After initializing the LCD, you can set the display area, display mode and display status. Next, the font data of the characters to be displayed should be written into the display buffer to realize the display function. For the text mode, you can first write the font data into the display buffer and establish CGRAM, then determine the character code by the data storage location, and then display the character by writing the corresponding code; for the graphic display mode, you need to write the font data byte by byte into the graphic display buffer to realize the display function. The two have their own characteristics, among which the text mode has a fast display speed. The built-in CGROM contains 128 ASCII characters, which can be called directly, but CGRAM must be established first, and the capacity is limited, and only 2K bytes of data can be managed, which is more suitable for occasions where not many characters are displayed; while the graphic mode has a relatively slow display speed, but there is no need to establish CGRAM. Users only need to write the font data in bytes into the graphic display area, which is suitable for occasions where more content needs to be displayed. In general engineering applications, the display of Chinese characters is a relatively important content, so this article mainly introduces the program design of Chinese character display. [page]

By the LCD initialization program, this system uses the graphic mode as the display mode. The Chinese font is generally 16x16 dot matrix, occupying 32 bytes, and can also use 32x32 dot matrix fonts. Western characters are 16x8. The sub-function program written in this way is as follows:


The horizontal coordinate x on this LCD screen ranges from 0 to 29, and the vertical coordinate y ranges from 0 to 127. The font data is provided by the font creation software. The order of writing the font data should correspond to the structural position of the character it represents. When reading and writing display data, please note that the address pointer will automatically increase by one each time it is read and written. When modifying its value, you must first end the current read and write operation, and then modify the address, so that it will be effective. The writing of other sub-functions is the same as the Chinese character display sub-function. Characters of different fonts only have different font data volumes. Continuous writing can be achieved by calling a separate write function multiple times, or the corresponding byte data of all characters can be written in each line. As for the realization of the reverse function, you can first read the data byte of the corresponding character, invert it, and then rewrite it.


3 Conclusion
This paper realizes the interface design with the LCD display module with built-in T6963C through the GPIO of the ARM7 microprocessor chip LPC2134, and realizes its basic display function in software, thus meeting the requirements of engineering design. This paper systematically explains the design process of the LCD display program, and gives the source code for reference for the difficulties in the design. The program has good portability and can be applied to LPC213x series chips, other ARM7 chips and different models of LCD display modules with built-in T6963C.

Keywords:T6963C Reference address:Interface Design between LCD and ARM7 Based on T6963C

Previous article:Embedded data acquisition and remote transmission control system based on LabVIEW and ARM
Next article:Design and implementation of pulse monitor system based on ARM

Recommended ReadingLatest update time:2024-11-16 21:27

Application of ARM7 Embedded System in Vehicle Dispatch
1. Overall design of vehicle dispatching system: The whole system consists of four parts: (1) communication master station; (2) vehicle-mounted slave station; (3) communication link; and (4) system monitoring part. The following is a brief introduction to the functions of each part. (1) Communication maste
[Microcontroller]
Application of ARM7 Embedded System in Vehicle Dispatch
LCD1602 display stopwatch program based on single chip microcomputer
#include reg52.h     //Header file containing microcontroller registers #include stdlib.h   //Contains the definition file of the random function rand() #include intrins.h   //Header file containing _nop_() function definition sbit RS=P2^2;     //Register selection bit, define RS bit as P2.0 pin sbit RW=P2^1
[Microcontroller]
DS18B20.h LCD1602.h header file download temperature and LCD debugging ok can be called directly
DS18B20.h header file content preview: /*DS18B20 driver*/ //Author: Zhan Lei                                                                                                                                    //Function: Drive the DS18B20 single bus thermometer chip and read the current temperature of the thermometer.
[Microcontroller]
atmega8l direct drive pen segment lcd driver
#include "include.h" uchar lcdtab ={{{0x07,0x01,0x03},{0x04,0x00,0x02},{0x06,0x03,0x01}, {0x06,0x02,0x03},{0x05,0x02,0x02},{0x03,0x02,0x03},{0x03,0x03,0x03},{0x06,0x00,0x02}, {0x07,0x03,0x03} ,{0x07,0x02,0x03}}, {{0x18,0x14,0x0c},{0x10,0x10,0x00},{0x18,0x08,0x0c}, {0x18,0x18,0x08}, {0x10,0x1c,0x00},{0x08,0x1c,0x08},{
[Microcontroller]
STN-LCD color screen module design
STN-LCD color screen module design How to achieve high performance design of LCD flat panel display driver circuit is an important challenge facing handheld device design engineers. This article analyzes the classification and performance characteristics of LCD display panels, introduces the key compone
[Analog Electronics]
STN-LCD color screen module design
LCD1602 display program
/************Port definition, can be modified******************/ sbit ledrs=P2^3; //Read and write control word     sbit leden=P2^5; //Enable control word sbit ledrw=P2^4; void write_com(uchar com) {   ledrw=0;  ledrs=0;  P0 =com;  delayl(1);  leden=1;  delayl(1);  leden=0; } void write_data(uchar date)
[Microcontroller]
Samsung gradually withdraws from the LCD market, and the two panel giants may play a key role in the supply chain
Samsung Group recently announced the list of the top 100 supply chains in 2020. A total of 6 Taiwanese manufacturers made the list, the same as last year. Among them, the two panel giants AUO and Innolux supply Samsung LCD panels. As Samsung Display (SDC) has gradually withdrawn from the LCD market in recent years and
[Mobile phone portable]
LED/LCD display principle
The LED decoder uses standard digital level output to make the seven-segment light-emitting diodes of the LED display work in the on or off state respectively, so that the LLD displays the corresponding numbers. The LCD display uses the dynamic scattering effect of liquid crystal to display numbers. When there is n
[Analog Electronics]
LED/LCD display principle
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号