Interface method and application of S3C44B0X and LM057QC1T01

Publisher:RainbowPromiseLatest update time:2012-10-22 Source: 21ic Keywords:S3C44B0X  LCD  Controller  LM057QC1T01 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:S3C44B0X  LCD  Controller  LM057QC1T01 Reference address:Interface method and application of S3C44B0X and LM057QC1T01

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

Panel prices continue to rise, Samsung Display is rumored to postpone the closure of LCD production lines
On December 25, according to Korean media reports, SDC plans to extend the suspension of LCD panel production until the end of next year at the longest. The company has recently informed the LCD production line staff at the Asan Industrial Park of this news. In recent years, with the continuous release of high-generat
[Mobile phone portable]
Interface circuit for reading LCD display data into single chip microcomputer
This article takes a fully automatic blood pressure monitor as an example to introduce the interface circuit for reading LCD display into a single-chip microcomputer. The blood pressure monitor display is a 6 1/2-digit segment LCD display, 3 digits for systolic pressure and 3 digits for diastolic pressure. The 1/2 digi
[Microcontroller]
Interface circuit for reading LCD display data into single chip microcomputer
Transplantation of μCOS-Ⅱ on ARM Series MCU S3C44B0x
Introduction At present, embedded systems have been more and more widely used in various fields such as industrial control, household appliances, mobile communications, PDAs, etc. As users have higher and higher requirements for the performance of embedded products, program design has become more and more co
[Microcontroller]
Transplantation of μCOS-Ⅱ on ARM Series MCU S3C44B0x
Decoding the new domestic LCD screen: supports 15-144Hz refresh rate adjustment, comparable to OLED
      Today, blogger @数码闲聊站 revealed a new LCD screen created by CSOT. This screen can achieve adaptive adjustment of refresh rate of 15-144Hz, comparable to OLED.   At present, OLED screens have achieved adaptive refresh rate. Models such as Xiaomi 12 Pro and realme GT2 Pro use LTPO 2.0 screens.   Based on the second
[Mobile phone portable]
New Redmi 10C exposed: LCD screen + 5000mAh large battery
      On March 22, according to GSMArena, Xiaomi launched the Redmi 10C in Malaysia.   In terms of core configuration, the Redmi 10C uses a 6.71-inch LCD full screen with a resolution of HD+, a 5-megapixel front camera, a 50-megapixel main camera and a 2-megapixel depth-of-field secondary camera at the back, and is eq
[Mobile phone portable]
STM8L LCD interface detailed explanation and driver
Some STM8L models integrate segment LCD drivers, which can drive 4*28=112 LCD segments. Segment LCD screens are low-power display devices. The power consumption varies according to the size of the screen and the number of display segments. Usually, the power consumption is around 10ua. In life, digital electronic mete
[Microcontroller]
STM8L LCD interface detailed explanation and driver
LCD Driver(II)
In the previous section, we mainly configured the fb_info structure. The configuration of the fb_info structure is mainly divided into the following steps: static int lcd_init(void) { /* 1. Allocate a fb_info */ s3c_lcd = framebuffer_alloc(0, NULL); /* 2. Settings*/ /* 2.1 Set fixed paramet
[Microcontroller]
LCD Driver(II)
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号