Realization of LCD driving circuit based on handheld terminal

Publisher:EuphoricMelodyLatest update time:2011-09-03 Source: chinaaetKeywords:Driver Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Most of the portable handheld terminal products now, such as mobile phones, navigation systems, etc., have a small LCD display, which makes the design of LCD drive circuit an important part of handheld terminal design.

The design of LCD driver circuit is an important part of handheld terminal products. This paper designs and implements the LCD driver circuit of handheld terminal based on S3C2440A. Taking the handheld terminal used in special industries as an example, the design and implementation method of LCD driver circuit is described.

Hardware circuit design

Hardware circuit structure

The handheld terminal CPU in this design adopts Samsung's ARM920T core processor S3C2440A, and its LCD controller supports STN LCD and TFT LCD. The actual LCD used is LTS350Q1-PE1_PI, which is a TFT LCD.

The circuit block diagram is shown in Figure 1.

The driving circuit mainly consists of three parts: the first part is LCD driving, which uses the MAX1779 chip; the second part is LED backlight driving, which uses the MP1521 chip; the third part is VCOM signal driving, which uses the LM8261 chip. Here we mainly describe the implementation of LCD driving and backlight circuits.

LCD drive circuit

Since LCD integrates digital circuits and analog circuits, it needs to provide digital voltage DVDD and analog voltage AVDD externally. In addition, in order to complete data scanning, TFT needs to be turned on/off in turn. When TFT is turned on, data is loaded to the display electrode through the source driver, and the voltage difference between the display electrode and the common electrode acts on the liquid crystal to realize display. Therefore, it is necessary to control the TFT's turn-on voltage VGH, turn-off voltage VGL, and voltage VCOM applied to the common electrode.

The MAX1779 chip can generate the analog voltage AVDD, gate turn-on voltage VGH and gate turn-off voltage VGL required by the LCD. The chip integrates three DC-DC converters, including two charge pumps and a boost converter, which can provide efficient regulated voltage for small TFT LCD screens. The LCD driver circuit is shown in Figure 2.

Here, one charge pump generates a positive voltage as the TFT's turn-on voltage VGH; the other charge pump generates a negative voltage as the TFT's turn-off voltage VGL. In addition, the chip can also generate a -5V voltage output, which is used to assist LM8261 in generating the VCOM signal.

LED backlight drive circuit

As a passive display device, LCD cannot emit light by itself and must be provided by a backlight module. White light LEDs are widely used as LCD backlight sources for embedded handheld devices due to their low complexity, low cost and small size. The backlight drive circuit in this article is shown in Figure 3.

The driver chip uses MP1521, which has three independent current feedback loops and can drive three parallel LEDs at the same time. Now short-circuit the three feedback loops FB1, FB2, and FB3 to provide a larger drive current for driving six white series LED backlights.

MP1521 supports two ways to control LED brightness, one is to connect BRT to a voltage in the range of 0.26V~1.2V, and the other is to control LED brightness through PWM signal. When designing, connect it to the PWM port and use PWM to control LCD backlight brightness.

S3C2440A has 5 16-bit timers, of which timers 0, 1, 2, and 3 have PWM functions. Connect the BRT to the TOUT0/GPB0 pin of the CPU that can output PWM signals, and use the PWM signal generated by timer 0 to control the LCD brightness. The LED brightness can be adjusted by changing the duty cycle of the PWM signal, and the PWM duty cycle can be changed by setting the value of the CPU internal register.

In order to save power consumption, the enable (EN) terminal of the circuit is connected to the LCD_PWREN pin of the CPU. When the level is high, the backlight circuit works; when the level is low, the backlight circuit does not work. At the same time, the EN terminal can be directly connected to the 3.3V power supply through a resistor for debugging.

LCD_BCK+ and LCD_BCK- are connected to the positive and negative ends of the series LEDs respectively. Software Design

The kernel version used by the embedded Linux of the handheld terminal is kernel-2.4.18. In order for the LCD to display normally, it is also necessary to develop the LCD driver under the Linux system.

Character device drivers

Character devices are the simplest devices in the Linux system and can be accessed like files. When a character device is initialized, its driver registers with the Linux kernel and adds a device_struct data structure entry to the chrdevs vector table. The major device identifier of this device is used as an index into this vector table. The major device identifier of a device is fixed. The device_struct data structure in the chrdevs vector table includes a pointer to the name of the registered device driver and a pointer to a set of file operations. This set of file operations itself is located in the character device driver of this device and handles some specific tasks.

Frame buffer devices under Linux

The Linux operating system provides a frame buffer for display devices such as LCDs. The frame buffer is an interface provided by Linux for display devices. It is a device that abstracts the video memory. The essence of writing a driver for an LCD is to write a driver for the frame buffer.

Since the implementation of the frame buffer driver has been described in detail in many papers, it will not be repeated here. This article focuses on the implementation of the backlight device driver.

LCD backlight device driver

LCD backlight device can be regarded as character device, and can be implemented according to the writing method of character device driver. Various LCD control functions are implemented in the driver. The driver mainly includes lcdctrl.c and lcdctrl_smdk2440.c. Among them, lcdctrl.c shields the specific hardware, and it calls the related functions of lcdctrl_smdk2440.c through the hook function to complete various specific operations. In order to vividly illustrate the relationship between the two files, here we take the LCD brightness adjustment process as an example to illustrate the function calling process, as shown in Figure 4.

The lcdctrl_ioctl function in lcdctrl.c needs to implement different functions according to different parameters of the upper-level application. These LCD control functions include brightness adjustment, contrast adjustment, LCD off, LCD on, etc.

The implementation of the two files is described below.

lcdctrl.c file

1. Define the file_operation structure

static struct file_operations lcdctrl_fops = {

ioctl: lcdctrl_ioctl,

open: lcdctrl_open,

release: lcdctrl_close };

Various control functions of the LCD are implemented in the lcdctrl_ioctl function. lcdctrl_open and lcdctrl_close do not implement specific functions and directly return a value of 0.

2. lcdctrl_ioctl function

The lcdctrl_ioctl function needs to implement different functions according to different parameters of the upper-layer application. Here we mainly explain the implementation of the brightness adjustment function. Part of the code is as follows:

static int lcdctrl_ioctl(struct inode * inode, struct file *filp, unsigned int cmd , unsigned long arg)

{……

switch(cmd)

{ ……

case

_LCDCTRL_IOCTL_BRIGHTNESS:

if ((arg >=0) && (arg <= 100))

ret = lcdctrl_set_brightness(arg);

break; //Adjust LCD backlight brightness

……

break;}

return right;}

When the command parameter passed by the application is LCDCTRL_IOCTL_BRIGHTNESS, lcdctrl_ioctl calls lcdctrl_set_ brightness to implement the brightness adjustment function.

3. lcdctrl_set_brightness function

lcdctrl_set_brightness specifically implements the brightness adjustment function. The main code is as follows:

int lcdctrl_set_brightness(int b)

{

brightness = b;

return lcd_device->set_brightness(b);

}

It can be seen that this function calls the lcd_ device->set_brightness function, and lcd_device has been pointed to a function related to specific hardware during initialization.

4. Initialization function

The initialization function mainly completes the setting of initial information and registration of equipment.

lcdctrl.c_smdk2440 file

1. lcdctrl_device structure

The lcdctrl_device structure defines the function pointers for specific LCD operations, including LCD initialization function, LCD on and off function, brightness, contrast setting function, etc. The essence of the LCD off function is to set the LCD backlight brightness to 0.

static struct lcdctrl_device smdk2440_dev = {

heat: smdk2440_lcdctrl_heat,

enable: smdk2440_lcdctrl_enable,

disable: smdk2440_lcdctrl_disable,

set_intensity: smdk2440_lcdctrl_set_intensity,

set_brightness: smdk2440_lcdctrl_set_brightness,

set_contrast: smdk2440_lcdctrl_set_contrast};

2. smdk2440_lcdctrl_set_brightnes function

Only the implementation of the brightness setting function is described here.

static int smdk2440_lcdctrl_set_brightness( int b)

{ ……

TCNTB0 = 100;

TCMPB0 = b*100/100;

//Set the value of TCMPB0 register

TCON = (TCON & ~(0xf)) | ( TCON_0_AUTO | TCON_0_MAN | COUNT_0_OFF);

TCON = (TCON & ~(0xf)) | 0;

TCON=(TCON & ~(0xf)) | (TCON_0_AUTO | COUNT_0_ON);}

Most of the statements in the function are to write values ​​to registers related to the timer. Among them, b is the bright value passed down by the upper function. From the program, we can see that adjusting the brightness is essentially to write the value related to bright through the TCMPB0 register to control the PWM duty cycle to achieve the brightness adjustment function.

3. lcdctrl_device_get_ops function

It is used by the upper layer to obtain the hook function of the specific device. The code is as follows:

struct lcdctrl_device *lcdctrl_device_get_ops(void)

{return &smdk2440_dev;}

This function is called when lcdctrl.c is initialized to point the device to smdk2440_dev.

At this point, the driver design is completed. In order to better manage the LCD, a human-computer operation interface needs to be provided in the upper-level Qtopia application.

Qtopia Applications

The Qtopia application provides a human-machine interface and calls the underlying driver to complete the LCD control function. Here, the working process of the application is still described using brightness adjustment as an example.

Main completed functions:

1. The application completes the human-machine operation interface and provides a friendly interface for users;

2. Read the brightness value and store it in the variable bright;

3. Open the device file: fd=open("/dev/devname",O_RDONLY);

4. Call the underlying driver and adjust the LCD backlight brightness to the specified value through the underlying driver.

ioctl(fd, _BACKLIGHT_ IOCTL_BRIGHT, bright)。

The ioctl function calls the driver to complete the brightness adjustment.

Conclusion

After testing, the designed LCD can display graphics well, and the terminal power management interface includes the LCD brightness adjustment function. The graphical management interface can conveniently manage the LCD to save energy and extend the working time of the handheld terminal.

Keywords:Driver Reference address:Realization of LCD driving circuit based on handheld terminal

Previous article:Simplified drive circuit for single positive gate drive IGBT
Next article:Mains powered LED driver

Recommended ReadingLatest update time:2024-11-16 19:49

AT89C51 single chip microcomputer drives LCD to display Chinese characters C language
Download the complete project file of this program: http://www.51hei.com/f/8952lkj_c.rar The above picture is the schematic diagram and its simulation effect. /*******************************************************************  AT89C51 MCU drives LCD to display Chinese characters C language ***************
[Microcontroller]
AT89C51 single chip microcomputer drives LCD to display Chinese characters C language
Introduction to H-bridge drive for DC motor speed regulation
H-bridge driver Search Name H-Bridge Introduction The H-bridge is a typical DC motor control circuit. It is named "H-bridge" because its circuit shape resembles the letter H. Four transistors form the four vertical legs of the H, and the motor is the horizontal bar in the H (Note: the f
[Embedded]
Introduction to H-bridge drive for DC motor speed regulation
Analysis of LED drivers with Boost and Buck-Boost topologies
LED light source manufacturers and designers often mention solid-state lighting applications, and the most obvious advantages are like "low-hanging fruit on the tree". For example, garden path lighting or MR16 cup lights often only need a few or even just one LED. For low-voltage applications, the most common volta
[Power Management]
Analysis of LED drivers with Boost and Buck-Boost topologies
LCD1602, LCD1640 LCD 4-bit bus mode programming successful
//Since the IO of 2051 is not enough, we must save the IO port. As a last resort, we modified the program based on a lot of information // and got the following program that can run successfully. This program can be written normally through the test of data image CM1640 LCD module //yusung W-1602A LCD module and Guan
[Microcontroller]
CINNO Research: LCD panel prices continued to fall in Q4, while AMOLED panel prices remained high
On November 19, CINNO Research analyzed the price trend of mobile phone panels in November: "Entering the fourth quarter, the prices of smartphone panels continued to diverge. LCD panels continued to fall due to weak terminal demand. In October, the price of a-Si/LTPS panels continued to fall by US$0.1, and it is expe
[Mobile phone portable]
CINNO Research: LCD panel prices continued to fall in Q4, while AMOLED panel prices remained high
128*64 LCD screen (ST7920) C51 driver
/**************************  Resources used by the file 1. Port: P0.0, P0.1 2. Call delay_ms function ******************************/ #define TIME 1 #define display_TIME 1000 sbit CS=P1^0; //Chip select sbit SCLK=P0^0; //Clock sbit STD=P0^1; //Data //sbit LCD_ON=P0^2; //Backlight switch uchar code AC_TABLE ={ 0x80,0x8
[Microcontroller]
Digital Power and Dimming in LED Lighting Driver ICs
As LED lighting, it needs a power supply that can drive small lighting products such as light bulbs and large lighting products such as street lamps . Moreover, this power supply should be compatible with various dimming methods such as "thyristor dimming" used in existing lighting fixtures, "PWM dimming" ded
[Power Management]
Digital Power and Dimming in LED Lighting Driver ICs
How to optimize the communication protocol between the motor and the drive of the motor drive system
Improvements in the design of industrial motors and their communication with drives and other systems can help engineers succeed with industrial machines and applications. Designing and deploying motor drive systems helps improve automation efficiency and provide information to key parts of the production
[Embedded]
How to optimize the communication protocol between the motor and the drive of the motor drive system
Latest Power Management Articles
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号