Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Graphical LCD module datasheet (150 POINTS)

Status
Not open for further replies.

Maverickmax

Advanced Member level 1
Advanced Member level 1
Joined
Dec 6, 2004
Messages
404
Helped
8
Reputation
16
Reaction score
3
Trophy points
1,298
Activity points
3,689
lcd module datasheet

Hi

I am not sure that I have written code in correct ways because I am slightly confused with E1 and E2. I believe they are used to transmit enable signal for master and slave respectively. Bascially I would to print a line on the top and left corner of the lcd. Please correct me if I have made a mistake in my code

Thank you in advance

MM

P.S If you help me to solve this matter, I will reward you whopping 150 points

Code:
// 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=0x5E | 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);



	while(1)
	{


		return 1;
	}

}
 

glcd e1 e2 rw a0

Have anyone used SED1520 before?

MM
 

sed1520 need negative voltage

Yes i have, it is a very easy controller to use.

I can send you some old init codes ect. Maybe usefull.?
 

lcd module datasheet

That would be wonderful if you provide me some codes.

I need to ask you regarding E1 and E2. I am slightly confused with command that was given in a datasheet.

For example,

If i want to write display data, I just simply 0xff for D0 to D7, and set R/W to logic zero or put it to 0V and finally set AO to 1. What about E1 and E2?


Regards

mm

Added after 5 hours 7 minutes:

Should I execute A0, RW and D0-D7 in sequence?

Please correct me if Im mistaken

Regards

MM
 

atmega128 lcd datasheet

Dear guys

I am somewhat disappointed with lack of response from you guys. I only assume you are not famaliar with SED1520?

MM
 

lcd driver atmega128 lcd bias modify write

E1 E2 is to acess the left section of lcd or right section
actialy lcd has two sed1520 each one control a part of lcd so if you go to access the left section of lcd E1=0 , E2=1 . right section E1=1 , E2=0
SO E1,E2 IS the enable line for the two sed1520

there is two model try this two method and show who will work will (write data to display)

1-you set data(d0-d7)
2-set A0, E1,E2
3- set R/W
at rising edge of R/W the data will be written

OR

1-you set data(d0-d7)
2-set A0 R/W
3- set E1,E2
at rising edge of E1 OR E2 the data will be written

PS:
note that the STEP 3 the selected signal must be un activated before you set it because the action is taken only at the edge

ok
 

sending text to graphical lcd +sed1520

I have re-tried to work with the same LCD with my ATMEGA128 but I could not get a black dots on my screen....

Here is my updated codes

Code:
#include <avr/io.h>
#include "STRING.H"
#include <stdio.h>
#include <avr/iom128.h>
#include <compat/deprecated.h>

#define F_OSC 16000000		           /* oscillator-frequency in Hz */
#define UART_BAUD_RATE 2400
#define UART_BAUD_CALC(UART_BAUD_RATE,F_OSC) ((F_OSC)/((UART_BAUD_RATE)*16l)-1)


#define    LCD_A0 PB0
#define    LCD_E1 PB1
#define    LCD_E2 PB2
#define    LCD_RW PB3
#define    DATA   PORTE
#define    LCD_EL PB4

void Delay();
void LCD_On(void);
void LCD_Off(void);
void LCD_Power_Up(void);
void LCD_Power_Down(void);
void LCD_Reset(void);
void LCD_Write_Command(char Command);
void LCD_Write_Data(char LCD_Data);


// --------------------  Delay Loop -----------------------

void Delay(void)
{
	int i;

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

// --------------------  void LCD_On() -----------------------

void LCD_On(void)
{
	LCD_Write_Command(0xAF);
	LCD_Write_Command(0xA4);	// Static Driving Off
}

// --------------------  void LCD_Off() -----------------------

void LCD_Off(void)
{
	cbi(PORTB,LCD_EL);
	Delay();
	LCD_Write_Command(0xAE);	// Static Driving Off
}

// --------------------  void LCD_Power_Up() -----------------------

void LCD_Power_Up(void)
{
	//LCD_POWER=0;
	cbi(PORTB,LCD_EL);
	LCD_Write_Command(0xAE);		// Display Off
	Delay();
	LCD_Write_Command(0xC0);		// Start Line Com 0 
	LCD_Write_Command(0xA4);		// Static Driving Off
	LCD_Write_Command(0x00);		// Column=0 (0-59)
	LCD_Write_Command(0xB8);		// Page=0 (0-3)
	LCD_Write_Command(0xA9);		// 1/32 Duty
	LCD_Write_Command(0xA9);		// adc=CW (Forward)
	LCD_Write_Command(0xEE);		// end read-modify-write code
	LCD_Write_Command(0xAF);		// Display ON
}

// --------------------  void LCD_Power_Down() -----------------------

void LCD_Power_Down(void)
{
	LCD_Write_Command(0xAE);		// Display Off
	LCD_Write_Command(0xA5);		// Static Driving On
	
	Delay();
	cbi(PORTB,LCD_E1);
	Delay();
	cbi(PORTB,LCD_E2);
	Delay();
	cbi(PORTB,LCD_RW);
	Delay();
	cbi(PORTB,LCD_A0);
	Delay();
//	LCD_POWER=1;
}

// --------------------  void LCD_Reset() -----------------------
void LCD_Reset(void)
{
	LCD_Write_Command(0xE2);		// Display Off
}

// --------------------  void LCD_Write_Command(char) -----------------------
//
void LCD_Write_Command(char Command)
{
	cbi(PORTB,LCD_E1);
	Delay();
	cbi(PORTB,LCD_E2);
	Delay();
	cbi(PORTB,LCD_RW);
	Delay();
	cbi(PORTB,LCD_A0);
	Delay();
	sbi(PORTB,LCD_E1);
	Delay();
	sbi(PORTB,LCD_E2);
	Delay();
	PORTE=Command;
	Delay();
	cbi(PORTB,LCD_E1);
	Delay();
	cbi(PORTB,LCD_E2);
	Delay();
}

// --------------------  void LCD_Write_Data(char) -----------------------
//
void LCD_Write_Data(char LCD_Data)
{
//	if(xaxis==60){LCD_Write_Command(0x00)};
	cbi(PORTB,LCD_E1);
	Delay();
	cbi(PORTB,LCD_E2);
	Delay();
	cbi(PORTB,LCD_RW);
	Delay();
	sbi(PORTB,LCD_A0);
	Delay();

//	if(xaxis<60){sbi(PORTB,LCD_E1);}
//	else if(xaxis>59){sbi(PORTB,LCD_E2);}
	PORTE=LCD_Data;
	Delay();

	sbi(PORTB,LCD_E1);
	Delay();
	sbi(PORTB,LCD_E2);
	Delay();
	PORTE=LCD_Data;
	Delay();
	cbi(PORTB,LCD_E1);
	Delay();
	cbi(PORTB,LCD_E2);
	Delay();
}



int main (void)
{

	//unsigned char counter;

	DDRB = 0xFF;
    DDRE = 0xFF;

	PORTB = 0x00;
	PORTE = 0x00;

	LCD_Power_Up();
	LCD_Write_Data(0xFF);
	LCD_Write_Data(0xFF);
	LCD_Write_Data(0xFF);
	
	do
	{

		
	}while(1);

}

Please let me know if you spot any mistake

Regards

MM
 

At the moment it is connected to 0V

MM
 

Well, then that is probably your problem.

The LCD voltage, also known as LCD bias voltage, will determine the contrast of
the display, i.e. how dark or bright its pixels are.
The datasheet says (absolute maximum ratings):
Supply Voltage for LCD : VDD-VLCD : min 0 : max 10.0 V

So if you have a VDD of 5V, VLCD should be from +5V to -5V.
Unfortunately the recommended LCD operating voltage is missing from table 6.1
in the datasheet but if you have a variable voltage at hand you can connect that
to VLCD and see what happens.
My guess is that you need a negative voltage for the contrast - that has always
been the case with the displays I have encountered.
 

Hmmm.....

I don't have a dual power supply at this stage....

Btw I measured the unconnected VLCD and it is 5V . I don't really understand why. Please advise me


MM
 

Try a 9V battery. Hook the positive terminal to VDD and the negative to VLCD.
That should give you about -4V at VLCD.

At least you should see a difference in the display.
 

    Maverickmax

    Points: 2
    Helpful Answer Positive Rating
XNOX_Rambo said:
Try a 9V battery. Hook the positive terminal to VDD and the negative to VLCD.
That should give you about -4V at VLCD.

At least you should see a difference in the display.

Finally I can see some of black dots. Im going to interface it with my uC

mm
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top