introduction
S3C44B0X is a cost-effective microprocessor for embedded systems. It uses the ARM7TDMI core and operates at 66MHz. In order to save project development cycle and cost, S3C44B0X integrates a large number of peripheral devices such as ADC and LCD controller. Among them, the LCD controller supports monochrome, 4-level, 16-level grayscale, and 256-color display on the LCD, and has strong versatility. Sharp LM057QC1T01 is a 256-color TSTN translucent liquid crystal display module with a pixel format of 320×3×240. This article discusses the connection between S3C44B0X and Sharp LCD interface. On this basis, the specific principles and methods of color graphics display and English and Chinese character display are discussed.
LCD Controller
The function of S3C44B0X LCD controller is to transfer the data in the buffer to the external LCD driver and generate the necessary LCD control signals. The LCD controller can be programmed to support LCDs with different horizontal and vertical dot counts (640×480, 320×240, 160×160, etc.), different data line widths, different interface timings and refresh rates, and supports 4-bit double scan, 4-bit single scan, 8-bit single scan modes, and supports horizontal/vertical scrolling to support larger screen displays (such as 1280×1280).
LCD display module LM057QC1T01
LM057QC1T01 is a graphic dot matrix 256-color STN liquid crystal module produced by Sharp. Its resolution is 320×240. It is widely used in embedded systems because of its simple interface, stable operation and easy operation.
Connection of S3C44B0X and LM057QC1T01
Since both S3C44B0X and LM057QC1T01 LCD modules are highly versatile, their connection is relatively easy to achieve. However, since the LCD module needs the deflection voltage required for LCD display, it is necessary to add a circuit that can realize the voltage deflection function between the controller and the LCD interface to achieve the output of the 27V deflection voltage required for LCD display. The specific pin connections are shown in Table 1.
The LCD controller has 20 pins. Among them, for the Sharp LM057QC1T01 LCD module, pins 13 to 17 have no use significance and are left floating in the actual connection. The connections between other pins and LCD are shown in Table 1. In the LCD display module, the 27V deflection voltage required for LCD display connected to pin 6 is provided by an external circuit. The power required by the external circuit can be provided by the LCD controller or by other circuits. However, the high voltage required for LCD module display can only be achieved by an external circuit.
Graphic and character display
In S3C44B0X, since the CPU does not support file management, the image to be displayed must be included in the program. For example, if you want to display a 320×240 image on the LCD, in actual operation, you should first use a conversion tool to convert the image into a C-format array file, that is, convert the color of each pixel into a byte, and then save the entire file in a 240×320 array format. For example:
char BMP[240][320]= {0x00,0x00,0x01, 蓕;
Then include the file in the project and use the following loop statement to display:
for(i=0;i<240;i++)
for(j=0;j<320;j++)
{
LCD_Buffer_Color[i][j]= BMP[i][j];
}
Display English letters and characters
In actual applications, an array is usually used to save letter and character dot matrix. Take 16×8 dot matrix as an example, use 16×8 dot matrix to represent a character, for example, to display the character '1', the pixel where it needs to be displayed is represented by *, otherwise it is blank, so that a character '1' is displayed. Express this dot matrix in hexadecimal form, the dot matrix corresponding to character 1 is:
0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x1,
0x18,0x18,0x18,0x7e,0x00,0x00,0x00,0x00,
When sending the character to the LCD buffer for display, since one byte is used to represent one pixel in the buffer, and one bit in the font library represents one pixel, that is, one byte in the font library corresponds to eight bytes in the buffer, so the font library must be adjusted before sending it to the buffer. The specific method is to shift the bit right to the lowest bit of the byte before displaying a pixel, then mask the other seven bits except this pixel, then multiply the color to be displayed by this pixel, and finally send the adjusted data to the corresponding buffer. For example: Assuming that the character '1' dot matrix exists in the one-dimensional array font library Zfk[], the starting address is 20, and the program to display the character '1' with a color value of 42 to the 8th row and 10th column is:
for (i=0;i<16;i++)
for(j=0;j<8;j++)
LCD_Buffer_Color [10*16+i][(*8+j)]= (Zfk[20+i]>>(7-j))&0x01))*42;
Display Chinese characters
There are usually two ways to display Chinese characters in a system with relatively large capacity. 1. Burn the Chinese character library into the memory, and use the burned address plus the offset address of the font library to determine the location of the specific Chinese character. 2. Convert the Chinese character library into an array, and read the character library in the program in the form of array. These two methods have their own advantages and disadvantages. Here we discuss the second method to realize Chinese character display.
In the Chinese character library, in order to facilitate the search for the dot matrix of the required Chinese character, each Chinese character corresponds to a double-byte internal code. The dot matrix start byte can be calculated through the internal code of the Chinese character. Taking the 16×16 Songti horizontal dot matrix as an example, the formula for calculating the starting byte address of the dot matrix is:
address = ((internal code high byte-160)*94+
(internal code low byte-160))*32
For example: the internal code corresponding to the Chinese character "衬" is C7B6H, then its address in the Chinese character library is:
lONg int adress=
((C7-0xa1)*94+(B6-0xa1))*32
=1C120
Assume that the converted Chinese character library is stored in a one-dimensional array Hzk, then the corresponding values of Hzk[1C120] to Hzk[1C120+32] are the hexadecimal dot matrix corresponding to the Chinese character "衬". Since one row of data in the dot matrix is represented by two bytes during LCD display, necessary adjustments need to be made when determining the position of the row of data to be displayed in the dot matrix. For example, when displaying the bottom Y row of pixel data on the LCD, the data in the Chinese character dot matrix should be the offset address in the Chinese character library array, that is, the data corresponding to 2*Y and 2*Y+1. Therefore, when determining the offset address, multiply by 2 before the row. In the process of displaying a line, the offset address corresponding to the first eight pixels is 2*Y, and the offset address corresponding to the last eight pixels is 2*Y+1. Therefore, when calculating the offset address, the data representing the pixel column should be divided by 8, that is, Y*2+X/8. In the specific implementation process, for convenience, the Chinese character dot matrix to be displayed is first read out from the font library. The implementation program is:
char hzbuff[16];
for (i=0;i<16;i++)
{
hzbuff[i]= Hzk[address+i] ;
}
After reading out the font library, it is also necessary to deal with the problem that one bit in the font library represents one pixel and one byte in the LCD buffer represents one pixel on the LCD. The processing method is basically the same as that of displaying English letters.
For example: The program to display the Chinese character "衬" with color C in the Y row and X column of the LCD module is:
for (i=0;i<16;i++)
for(j=0;j<16;j++)
{
LCD_Buffer_Color [y*16+i][x*16+j]= (( hzbuff[i*2+j/8]>>(7-j%8))&0x01)*C;
}
About line breaks: When the display dot matrix is 16×16 Chinese characters and the LCD module is 320×240 in size, 20 Chinese characters are displayed in each line, with a total of 15 lines, and each screen can display 300 Chinese characters or characters. In the implementation of the program, the numbers 0~15×20 are used to represent the position of each Chinese character, for example, 0 represents the first position at the beginning, 15 represents the first position of the second line, and so on. Assuming that the current display position is Position, when a line break is required in the display, the following program can be used to recalculate the display position:
Position=(position/20+1)*20;
Conclusion
This paper mainly discusses the use of the built-in LCD controller of the ARM7 processor S3C44B0X, briefly introduces the Sharp LM057QC1T01 graphic dot matrix LCD display module, and gives a detailed hardware connection method with the built-in LCD controller of the S3C44B0X, and builds an embedded work platform based on the two. Based on this platform, this paper discusses in detail the display principles and methods of graphics, English and Chinese characters, and gives a specific implementation program.
These display methods and programs only need a small amount of modification when connecting S3C44B0X with other types of LCD modules. They are simple to use, stable in operation, and easy to transplant and modify.
Previous article:Development and application of embedded video network server
Next article:Design of networked electric energy meter based on ARM microcontroller
Recommended ReadingLatest update time:2024-11-16 22:58
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
- Ended | Live broadcast [Cloud-based secure authentication | Microchip embedded security solutions]
- ST60 millimeter wave water medium data transmission test report
- Schematic diagram of a simple TWS charging box consisting of a common LTH7 charging chip + lithium battery boost and protection
- Please tell me, how to make a dual power automatic switching circuit?
- Decimal to hexadecimal C language function
- MSP432E401Y SimpleLink Ethernet Microcontroller
- [AB32VG1 Development Board Review] Getting to Know the Development Board
- Simple driver for 64Mb PSRAM
- How to tell how many layers a PCB has
- [MM32 eMiniBoard Review] + Display driver for color OLED screen