Initialization Programming Skills of LCD Display Control Circuit KS0713

Publisher:快乐时刻Latest update time:2012-06-01 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Dot matrix LCD graphic display modules with built-in controllers are currently a very popular type of product, and are widely used in digital instruments, portable instruments, bus IC card system terminals, as well as intelligent home appliances and embedded application systems. The core of this type of display module is its internal dedicated controller. KS0713 is such a display controller, which is often used to control the display of prompt menus, waveforms, or various parameter changes in monitoring and measurement. The KS0713 control chip has the characteristics of small size, can be directly controlled by a microprocessor, high flexibility, and comes with the power drive required for LCD.

Basic steps in developing LCD modules

1. Complete the interface between the MCU and the LCD module according to the requirements of the development system. The common interfaces are bus mode and I/O mode. It is necessary to pay attention to the requirements of the LCD module for negative voltage. If the negative voltage value does not meet the requirements, it will cause abnormal display of the LCD screen or reduce the display contrast.

2. Figure 1. Schematic diagram of the correspondence between the ADC inversion column address and the display column address. According to the timing diagram of the controller and the command table of the register, write a program to send a byte, such as 0xFF, to the specified address of the video memory. As long as a solid line segment is displayed on the LCD, if it can be started normally and data is displayed, it means that the initialization of the LCD module has been completed.

3. Carefully study the arrangement of the video memory/data transmission mode, whether it is vertical or horizontal, the bit order within the byte, whether it is high on the left and low on the right, or low on the left and high on the right, the correspondence between 1, 0 and black and white dots, the arrangement order of the video memory address, whether it is automatically incremented or needs to be set separately, etc. After clarifying these issues, the design engineer can display text or graphics on the dot matrix LCD module according to the design requirements.

Initialization of control chip KS0713

The basic steps of KS0713 initialization are similar to those of other similar control chips. It is worth noting that the ADC and SHL registers inside KS0713 define the order in which data is displayed row by row and column by column. The order of their relationship is shown in Table 1.

The initialization C program code using the KS0713 control chip is as follows:


void Init_LCD(void) //define initialization function


{


P6OUT &=~RESET; //Reset position zero


Delay(500);


P6OUT |= RESET; //Reset bit


Delay(5);


P6OUT &=~CS; //Chip select position zero


Send_Command(0xE2); //Reset command


Send_Command(0xA1); //ADC command (ADC=1) data transmission SEG132~SEG1,


LCD screen displays SEG1~SEG132


Send_Command(0xC0); //SHL command (SHL=0) transmission, display COM1~COM64


Send_Command(0xA3); //Set LCD duty cycle to 1/9


Send_Command(0x2F); //Set power control [page]


Send_Command(0x26); //Adjust register selection


Send_Command(0x81); //Set reference voltage mode


Send_Command(0x1C); //Set reference voltage register


Send_Command(0x40); //Set the display line (COM1)


Send_Command(0xAF); //Wait for display to start


}

Display the starting position of the data Figure 2. Schematic diagram of KS0713 font extraction.

Since the address space of KS0713 is 65×132, there is a problem with the starting address when controlling LCD because only 64×128 address space is used. KS0713 internally stipulates that 65 rows constitute 9 pages, of which the first 8 pages are composed of 8 columns (DB0~DB7), and the 9th page is a single row (only DB0), so after the data is transmitted in parallel, it always starts from DB0 (the first row is displayed). However, the column address is different, and the different ways of corresponding internal addresses will lead to different starting data column addresses. If the 0th column address of LCD corresponds to the 0th column address of KS0713, the corresponding starting column address is 0x00; if the 0th column address of LCD corresponds to the 1st column address of KS0713, the corresponding starting column address is 0x01; ... and so on. Therefore, special attention should be paid to this problem when using LCD display with KS0713 as the controller.

Extraction and transmission of font dot matrix data

The row-by-row and column-by-column display order of KS0713 can be set during initialization according to different user requirements. The way the KS0713 control chip sends data to the LCD is different from the usual horizontal data transmission method. Instead, it adopts a vertical data transmission method. The display order corresponding to the previous initialization example is: for an LCD with 64 rows and 128 columns, first send the data from row 0 to row 7 of the 1st column, the data from row 0 to row 7 of the 2nd column, ... until the data from row 0 to row 7 of the 128th column; then send the data from row 8 to row 15 of the 1st column, the data from row 8 to row 15 of the 2nd column, ...; finally the data from row 56 to row 63 of the 128th column. The ADC selection instruction can reverse the correspondence between the column address and the display column address, as shown in Figure 1. At this time, the required data format is: first send the data from row 7 to row 0 of the 1st column, the data from row 7 to row 0 of the 2nd column, ... until the data from row 63 to row 56 of the 128th column.

Therefore, KS0713 has different requirements for font extraction: In order to display the figure of Figure 2a on the LCD, Figure 2a must be transposed horizontally to the left and right to obtain Figure 2b, and then Figure 2b must be transposed vertically to obtain Figure 2c. Finally, the font data extracted by Figure 2c is transmitted to obtain the display of Figure 2a.

Use the font data extraction tool to extract the font data in the figure, and swap it up and down according to the above requirements. The C code displayed by the output is as follows:

{ unsigned char seg_0[ ]={ 0x00,0x04,0x04,0x06,0x04,0x08,0x88,0x50,


0x20,0x50,0x88,0x04,0x04,0x02,0x02,0x02,}; // The upper part of the word "文" Table 1. Relationship between ADC, SHL and row and column display order.


unsigned char seg_1[ ]={ 0x00,0x10,0x10,0x10,0x10,0x1E,0x11,0x10,


0x70,0x90,0x11,0x1E,0x10,0x10,0x10,0x10,}; // The lower half of the word "文"


Send_Command(0xB0); //Start at line 0


Send_Command(0x04); // Start at column 0


for(i=0;i<16;i++)


{ Send_Data(seg_0[i]); }


Send_Command(0xB1); //Start of line 1


Send_Command(0x04); // Start at column 0


for(i=0;i<16;i++)


{ Send_Data(seg_1[i]); }


}


After executing the above code, the system displays the characters shown in the figure in the upper left corner of the LCD screen. In the actual development process, developers can use the "Font 3 Enhanced Edition" font extraction software to extract relevant character data.

Reference address:Initialization Programming Skills of LCD Display Control Circuit KS0713

Previous article:Car audio voice control system based on UniSpeech-SDA80D51
Next article:The pitfalls of crossing data types

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
Guess you like

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号