gLCD module problem

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear guys

I am experiencing a problem of running my mini lcd module at the moment as I am not sure if it is a hardware or software problem. I would be very grateful if you kindly help me to iron this problem asap.

I have attached a datasheet and my codes here:


#include 


// Function Prototypes
void Display(int Status);
void Display_Start_Line(int Row);
void Static_Drive(int Drive);
void Column_Address(int Address);
void Page(int Number);
void DutyCycle(int Switch);
void ADC_Select(int Output);
void End();

void Write_Display(int Line);


void Delay();

void Delay()
{
	int i;

	for(i=0; i<100; i++);
}

void Display(int Status)
{
	static int DATA;

	DATA=0xAE | Status;
	PORTB=DATA;
	PORTE=0x00; 	// A0 	- 0 Bit
					// R/W 	- 1 Bit
					// E2 	- 2 Bit (Slave)
					// E1	- 3 Bit (Master)
	PORTE=0x04;
	Delay();
	PORTE=0x00;
	PORTB=0x00;

}

void Display_Start_Line(int Row)
{
	static int DATA;

	DATA=0xCE | Row;
	PORTB=DATA;
	PORTE=0x00; 	// A0 	- 0 Bit
					// R/W 	- 1 Bit
					// E2 	- 2 Bit (Slave)
					// E1	- 3 Bit (Master)
	PORTE=0x04;
	Delay();
	PORTE=0x00;
	PORTB=0x00;

}



void Static_Drive(int Drive)
{
	static int DATA;

	DATA=0xAE | Drive;
	PORTB=DATA;
	PORTE=0x00; 	// A0 	- 0 Bit
					// R/W 	- 1 Bit
					// E2 	- 2 Bit (Slave)
					// E1	- 3 Bit (Master)
	PORTE=0x04;
	Delay();
	PORTE=0x00;
	PORTB=0x00;
}

void Column_Address(int Address)
{
	static int DATA;

	DATA= Address;
	PORTB=DATA;
	PORTE=0x00; 	// A0 	- 0 Bit
					// R/W 	- 1 Bit
					// E2 	- 2 Bit (Slave)
					// E1	- 3 Bit (Master)
	PORTE=0x04;
	Delay();
	PORTE=0x00;
	PORTB=0x00;
}


void Page(int Number)
{
	static int DATA;

	DATA=0xB8 | Number;
	PORTB=DATA;
	PORTE=0x00; 	// A0 	- 0 Bit
					// R/W 	- 1 Bit
					// E2 	- 2 Bit (Slave)
					// E1	- 3 Bit (Master)
	PORTE=0x04;
	Delay();
	PORTE=0x00;
	PORTB=0x00;
}

void DutyCycle(int Switch)
{
	static int DATA;

	DATA=0xA8 | Switch;
	PORTB=DATA;
	PORTE=0x00; 	// A0 	- 0 Bit
					// R/W 	- 1 Bit
					// E2 	- 2 Bit (Slave)
					// E1	- 3 Bit (Master)
	PORTE=0x04;
	Delay();
	PORTE=0x00;
	PORTB=0x00;
}

void ADC_Select(int Output)
{
	static int DATA;

	DATA=0xA0 | Output;
	PORTB=DATA;
	PORTE=0x00; 	// A0 	- 0 Bit
					// R/W 	- 1 Bit
					// E2 	- 2 Bit (Slave)
					// E1	- 3 Bit (Master)
	PORTE=0x04;
	Delay();
	PORTE=0x00;
	PORTB=0x00;
}

void End()
{
	PORTB=0xEE;
	PORTE=0x00; 	// A0 	- 0 Bit
					// R/W 	- 1 Bit
					// E2 	- 2 Bit (Slave)
					// E1	- 3 Bit (Master)
	PORTE=0x04;
	Delay();
	PORTE=0x00;
	PORTB=0x00;
}

void Write_Display(int Line)
{
	static int DATA;

	DATA=Line;
	PORTB=DATA;
	PORTE=0x01; 	// A0 	- 0 Bit
					// R/W 	- 1 Bit
					// E2 	- 2 Bit (Slave)
					// E1	- 3 Bit (Master)
	PORTE=0x05;
	Delay();
	PORTE=0x00;
	PORTB=0x00;

}

int main (void)
{

	//unsigned char counter;

	DDRB = 0xFF;
    DDRE = 0xFF;

	PORTB = 0x00;
	PORTE = 0x00;

	Display(0x01);

	Display_Start_Line(0x00);
	Static_Drive(0x00);
	Column_Address(0x00);
	Page(0x03);
	DutyCycle(0x01);
	ADC_Select(0x00);
	End();


	Write_Display(0xFF);
	Write_Display(0xFF);
	Write_Display(0xFF);
	Write_Display(0xFF);
	Write_Display(0xFF);



	while(1)
	{


		return 1;
	}

}

Please remember this is purely experiment as I need to check that I am able to control the glcd module properly.

If you help me to resolve this matter, I will be happy to dispatch 4 lcd module to you regardless of where.

Regards

MM

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I am experiencing a problem of running my mini lcd module

What problem are you having?

What are your connections? What is a "glcd"? What controller does it use? Is the above proven driver code for the display?

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I looked at this thread right after it was posted.

Whether or not the OP wants to "dispatch 4 lcd module to me regardless of where.", it was the arogance of the "asap" that turned me away.

ASAP should be an "Outlawed" acronym on this forum.

I guess I could have said "Dispatch 4 lcd modules to me - ASAP... And I'll get to your problem, when I get around to it!"

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

microcarl wrote:
I looked at this thread right after it was posted.

Whether or not the OP wants to "dispatch 4 lcd module to me regardless of where.", it was the arogance of the "asap" that turned me away.

ASAP should be an "Outlawed" acronym on this forum.

I guess I could have said "Dispatch 4 lcd modules to me - ASAP... And I'll get to your problem, when I get around to it!"

I am sorry if I have offended you sir. I would be grateful to have your assistance.

MM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:
Quote:

I am experiencing a problem of running my mini lcd module

What problem are you having?

What are your connections? What is a "glcd"? What controller does it use? Is the above proven driver code for the display?

Lee

gLCD stands for graphical LCD module. I believe the controller is SED 1520.

Regards

MM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is it true that I can use avr-gcc/avr-libc to access SED1520-based graphics-LCDs?

If yes, is there anyone here have the experience of using this software?

MM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

maverickmax wrote:
I am sorry if I have offended you sir. I would be grateful to have your assistance.

Its that when "One" uses the term "asap", "One" doesn't take into consideration that all of us here on the forum have a personal lives - wife, children, jobs, etc... This being a weekend, this would especially hold true.

There are those who have come demanding our attention with the idea that, we owe them something because this is an Atmel sanctioned forum.

True, this is an Atmel sanctioned forum but, we rarely hear from Atmel. All of us here are just a bunch of Blokes who worship AVRs, and want to help others learn to love them as much as we do.

And, pretty much, we expect nothing in return for the time effort, and sometimes, frustration, for helping the many.

About the only thing that we ask, up front, is to have done your homework, don't expect us to do your work for you and, when we reach a solution to your particular problem, tell us "Thank You!" by revealing to us what actually solved your problem.

You should be able to figure out the rest from here.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any software can control any hardware. To get this to work, you (or We) have to be pretty good at editing, compiling, burning and running c programs for the particular type of avr and compiler we are using. Starting a new project with a new type of avr that we havent used before and a new c compiler that we havent used before and a new graphics lcd that we havent used before has a very large chance of human error. Even if you are pretty good on gcc and avrs, the sed1520 might be tricky. It helps if you have examples that supposedly work, but I have NEVER seen a project that used the lcd EXACTLY like the sample code. Someone always uses a different avr that doesnt have the same number of ports, or the same number of timers, or they dont use the same xtal, and all the little magic delay subroutines that count to 10000 with a 4mhz clock are all off and the thing doesnt init right. Once you get it to init, its easy to fill the screen with 0xff... at that point you are about 80% done, in my opinion.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I believe the controller is SED 1520

How can you expect to write a graphics LCD driver if you do not >>know<< exactly what controller it is using?

And if a common/popular controller, a search with Google or in the Projects section will probably give you several examples.

[Side question: Why pick a device, and then need software asap, if you don't know if you can find a ready-made driver for it? Or have studied the datasheet and similar devices, and say "I can do that".]

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MM, the code here https://www.avrfreaks.net/index.p... will be able to drive your SED1520 devices. It may do more or less than you want - it outputs text as a series of individual character parts and has no graphics primitives - but you should be able to adapt it without difficulty.

One thing to bear in mind: the SED has eighty column drivers; on most of the 122*32 displays I've come across they've used 0-60 but some use 19-80. Also, watch out for the direction bit which if set the wrong way will make your text come out backwards.

Neil

p.s. where do you get your displays, and for how much? I'm looking...