Help me interface a 320x240 LCD of LG322401 with a microcontroller

Status
Not open for further replies.

emb11

Newbie level 2
Joined
Jul 10, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
hyderabad
Activity points
1,311
iam interfacing monochrome 320x240 lcd of LG322401 with a microcontroller,
ater initialisation no cusor or anything displayed.any one help me to find out my problem&send me a sample program asap.
pls send me a simulator to test my code for graphic lcd.
 

Re: 320x240 lcd

Hello!

Usually a good way to get attention is to start by saying "hello" or something
like this. Another thing is that when asking for something, "please" could be
another useful keyword to get help.
Then, if you are asking for free help, as a rule, never say "asap".

So apparently you need somebody to do you job. What is your budget?

Thanks,

Dora.


 

    emb11

    Points: 2
    Helpful Answer Positive Rating
Re: 320x240 lcd

hi,

Plz check this link it also contains downloadable code

Need to interface 320X240 graphics LCD
 

    emb11

    Points: 2
    Helpful Answer Positive Rating
Re: 320x240 lcd

Hi

1.Upload your schematic & LCD data sheet (or place a link)

2. If you think your hardware is Ok - try writing & reading from a scratch register

3. whether its works the problem may lay in your driver - try to add delays since most LCD hardware are very slow

All the best

Bobi

The microcontroller specialist
 

    emb11

    Points: 2
    Helpful Answer Positive Rating
Re: 320x240 lcd

hi,
iam attaching my code&details.This is a monochrome LCD320X240 interfacing with a simple microcontroller.

......................................................................................
/* display_320240_test_program */


#include<stdio.h>
#include<reg51.h>


void write_comm(unsigned int);
void write_data(unsigned int);
void lcd_initialization(void);
void delay(void);
void delay2();

sbit Rst = P1^6;
sbit Wr = P1^4;
sbit Cs = P1^5;
sbit A0 = P1^1;

unsigned int a=0;

void delay2()
{
unsigned int K;
for (K=0;K<2500;K++)
{
}
}


void main()
{
lcd_initialization();
while(1)
{
write_comm(0x42);
delay2();
write_data(0x48);

}

}


void lcd_initialization(void)
{
Rst=1;
delay();
Rst=0;
delay();
Rst=1;
delay();
/**********system set***********/
write_comm(0x40);
write_data(0x30);
write_data(0x87);
write_data(0x07);
write_data(0x27);
write_data(0x2F);
write_data(0xEF);
write_data(0x28);
write_data(0x00);
/**********scroll***************/
write_comm(0x44);
write_data(0x00); //first layer address
write_data(0x00);
write_data(0xb1); //second layer address
write_data(0x04);
write_data(0x00);
write_data(0x00);
write_data(0x00);
write_data(0x00);
/****************csr form********/
write_comm(0x5d);
write_data(0x04);
write_data(0x86);

///**************cursor direction***/
// write_comm(0x4c); */

/***********hdot scr ************/
write_comm(0x5a);
write_data(0x00);
/************ovlay*************/
write_comm(0x5b);
write_data(0x01);
/***********disp on***************/
write_comm(0x59);
write_data(0x14);
/*********clear 1st layer****/
a=0;
while(a<0x04b0)
{
write_comm(0x46); //set cursor
write_data(a);
write_data(a>>8);
write_comm(0x42);
write_data(0x20);
++a;
}
/************clear 2nd layer***********/
a=0;
while(a<0x2580)
{
write_comm(0x46); //set cursor
write_data(a);
write_data(a>>8);
write_comm(0x42);
write_data(0x00);
++a;
}

}

/*************command for lcd**********/
void write_comm(unsigned int cmd)
{
A0=1; //A0=1 is a command
P3=cmd;
Cs=0;
Wr=0;
delay2();
Wr=1;
Cs=1;
}


/*************data for lcd**********/
void write_data(unsigned int dat)
{
A0=0; //A0=0 is a data
P3=dat;
Cs=0;
Wr=0;
delay2();
Wr=1;
Cs=1;

}


/********************delay************/
void delay(void)
{
unsigned int b=0;
for(b=0;b<500;b++)
{}
}


thank you
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…