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. 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
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 "文"
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.
Previous article:Car audio voice control system based on UniSpeech-SDA80D51
Next article:The pitfalls of crossing data types
- Popular Resources
- Popular amplifiers
- Linux lcd_display_font tutorial
- Research on control algorithm and program design of intelligent tracking car_Technical report of the first \"Freescale\" Cup National College Student Intelligent Car Invitational Competition
- Design of voice/text message wireless transmitter
- v4l2 acquisition and display program
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