Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Help:not able to go specific locaion on lcd

Status
Not open for further replies.

adi2293

Newbie level 2
Joined
Dec 16, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,294
I use atmega32 (16mhz), avr studio 6, and an avr usb programmer
My LCD is 16X2 JDH162A

I successfully made a code for writing to an LCD...but when I tried making for writing to a specific location,
all I was able to do was move the cursor to a specific location, but not able to write on that location..

the program compiled successfully, but I could not burn the program on the microcontroller..
it produced some sort of error :http://obrazki.elektroda.pl/4505256400_1355675700.png


Code:
void gotoxy(unsigned int x,unsigned int y)
{
   unsigned char t=0;
	if(y==0)
	  t=0;
	  else 
	    t=64;  
		
		t=t+x-1;
    
	Send_A_Command(t);

}


CAn someone help me out??
I have also uploaded the .c fileView attachment lcd_phd.rar
 
Last edited:

rohitkhanna

Banned
Joined
May 1, 2012
Messages
341
Helped
76
Reputation
150
Reaction score
75
Trophy points
1,308
Location
New Delhi, India
Activity points
0
LCD controllers have different codes for 'command' and for 'data'.

It looks like you are only sending commands ( Send_A_Command() ). Where are you sending any data ?!?
Please check & report..

all the best !
 

adi2293

Newbie level 2
Joined
Dec 16, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,294
LCD controllers have different codes for 'command' and for 'data'.

It looks like you are only sending commands ( Send_A_Command() ). Where are you sending any data ?!?
Please check & report..

all the best !


That was the code for gotoxy()

Here is my main routine:


Code:
int main(void)
{
	DataDir_MrLCDsControl |= 1<<LightSwitch | 1<<ReadWrite | 1<<BiPolarMood;
	
           _delay_ms(15);

	Send_A_Command(0x01); //Clear Screen 0x01 = 00000001
	//delay
	
	Send_A_Command(0x38);    //set up interface length
       //delay
	
	Send_A_Command(0b00001111);   //turn on the lcd. enble cursor, enable blinking 
	
	
  
		 gotoxy(5,2);
	

          Send_A_String("Hi!!");
	
	while(1)
	{
			
	}


}

PS: most of the code has taken from another code by Patrick Hood Daniels, on you tube
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top