Discussion in "Project Doubts" started by    pratikshinde    Jul 19, 2012.
Thu Jul 26 2012, 06:46 AM
#21
is there any warning in the code?
Thu Jul 26 2012, 07:27 AM
#22
@majoka,@Ajay

Which keil are you using?

no error messages are generated, few warnings are there, but those of functions defined but not used/called.


[ Edited Thu Jul 26 2012, 07:27 AM ]
Thu Jul 26 2012, 08:55 AM
#23
Fri Jul 27 2012, 11:56 AM
#24
Hello mjoka,

I have used Keil from link you have given,

and now the code is working fine,

here is screen shot,

thank you very much for your support,
mjoka and Curiou_Som

http://www.4shared.com/photo/ecVTKC1W/2012-07-27_16-53-33_273.html?refurl=d1url


[ Edited Fri Jul 27 2012, 11:57 AM ]
Fri Jul 27 2012, 04:40 PM
#25
@pratik

welcome pratik. happy to help you.

I never thought that difference in the version of a same compiler can cause a problem like that.
Thanks for the lesson Ajay ,Majoka.
Sat Jul 28 2012, 12:47 AM
#26
@ pratikshinde
glad to happy that u has done it

@ Curiou_Som
i was doubt that pratikshinde was using a trial version or evolution version
evolution version can compile a program with in a 2kbytes
the code was small than 2 kb but i think it was not a registered version that was creating problem
otherwise there is no difference between its versions
Wed Mar 13 2013, 06:52 PM
#27
hello majoka and Ajay i am having problem interfacing 16x2 LCD with 89c55 controller i have used P0.4 to P0.7 as data and P2.0 and P2.1 as RS and EN respectively. I have connected 10K pull-up resistor with P0.but still i am not able to run on Hardware. Proteus run the code successfully. please tell me where I am Wrong?

#include <regx55.h>

//*******************
//Pin description
/*
P2.4 to P2.7 is data bus
P1.0 is RS
P1.1 is E
*/
//********************

// Defines Pins
sbit RS = P2^0;
sbit E  = P2^1;

//Function declarations
void cct_init(void);
void delay(int);
void lcdinit(void);
void writecmd(int);
void writedata(char);
void writeString(unsigned char *);
void ReturnHome(void);

void cct_init(void)
{
P0 = 0x00;   //not used 
//P1 = 0x00;   //not used 
P2 = 0x00;   //used as data port
//P3 = 0x00;   //used for generating E and RS
}

void delay(int a)
{
   int i;
   for(i=0;i<a;i++);   //null statement
}

void writedata(char t)
{
   RS = 1;             // This is data

   P0 &= 0x0F;		   // Make P2.4 to P2.7 zero
   P0 |= (t&0xF0);     // Write Upper nibble of data

   E  = 1;             // =>
 E = 1
   delay(150);
   E  = 0;             // =>
 E = 0
   delay(150);

   P0 &= 0x0F;		   // Make P2.4 to P2.7 zero
   P0 |= ((t<<4)&0xF0);// Write Lower nibble of data

   E  = 1;             // =>
 E = 1
   delay(150);
   E  = 0;             // =>
 E = 0
   delay(150);
}


void writecmd(int z)
{
   RS = 0;             // This is command

   P0 &= 0x0F;		   // Make P2.4 to P2.7 zero
   P0 |= (z&0xF0);     // Write Upper nibble of data

   E  = 1;             // =>
 E = 1
   delay(150);
   E  = 0;             // =>
 E = 0
   delay(150);

   P0 &= 0x0F;		   // Make P2.4 to P2.7 zero
   P0 |= ((z<<4)&0xF0);// Write Lower nibble of data

   E  = 1;             // =>
 E = 1
   delay(150);
   E  = 0;             // =>
 E = 0
   delay(150);
}
void writeString(unsigned char *s)
{
	while(*s)
	writedata(*s++);

}
void lcdinit(void)
{
  ///////////// Reset process from datasheet /////////
     delay(15000);

	 P0 &= 0x0F;		   // Make P2.4 to P2.7 zero
	 P0 |= (0x30&0xF0);    // Write 0x3
	
	 E  = 1;               // =>
 E = 1
	 delay(150);
	 E  = 0;               // =>
 E = 0
	 delay(150);

     delay(4500);

	 P0 &= 0x0F;		   // Make P2.4 to P2.7 zero
	 P0 |= (0x30&0xF0);    // Write 0x3
	
	 E  = 1;               // =>
 E = 1
	 delay(150);
	 E  = 0;               // =>
 E = 0
	 delay(150);

     delay(300);

	 P0 &= 0x0F;		   // Make P2.4 to P2.7 zero
	 P0 |= (0x30&0xF0);    // Write 0x3
	
	 E  = 1;               // =>
 E = 1
	 delay(150);
	 E  = 0;               // =>
 E = 0
	 delay(150);

     delay(650);

	 P0 &= 0x0F;		   // Make P2.4 to P2.7 zero
	 P0 |= (0x20&0xF0);    // Write 0x2
	
	 E  = 1;               // =>
 E = 1
	 delay(150);
	 E  = 0;               // =>
 E = 0
	 delay(150);

	 delay(650);

  /////////////////////////////////////////////////////
   writecmd(0x28);    //function set
   writecmd(0x0c);    //display on,cursor off,blink off
   writecmd(0x01);    //clear display
   writecmd(0x06);    //entry mode, set increment
}

void main()
{	
	cct_init();                                     //Make all ports zero
   	lcdinit();                                      //Initilize LCD
	
	writeString("Hello World");
} 	  

please help me out


[ Edited Wed Mar 13 2013, 07:14 PM ]
Thu Mar 14 2013, 06:16 PM
#28
Please guys I need help i have tried every thing but not working.............
Thu Mar 14 2013, 06:22 PM
#29
please check your delay function, does that provide sufficient delay?
Fri Mar 15 2013, 05:26 PM
#30


but still i am not able to run on Hardware. Proteus run the code successfully. please tell me where I am Wrong?

taher


The obvious conclusion is that you have a hardware fault !
recheck all connections.

Have you tried adjusting the contrast ?

Post a diagram of your circuit.

Get Social

Information

Powered by e107 Forum System

Conversation

Wed Jan 22 2020, 06:16 PM
MINU CHAUDHARY
I m getting errors while simulation process during interfacing socket output and lcd... Can i get the report of ur project which is same as us.
Tue Jan 14 2020, 07:08 AM
shubham kharade
when i am trying to simulate the program in Proteus 8 professional, I am getting some errors as cannot find module file dhtxx.md can u help me
Tue Dec 17 2019, 01:44 PM
Devangi
hello..i am programming industrial timer using 8051 with 24lc64 eeprom. i have query in storing the 3 diff value in eeprom with enter button. can anyone share c code ?
Tue Dec 17 2019, 10:30 AM
Andrius
Hello. Can anyone share the code in Bascon and scheme in Proteus?
Thu Nov 21 2019, 12:30 PM
raj2555
how to interface 8051 microcontroller with NRF24L01+ module
ExperimenterUK
Sat Oct 12 2019, 10:23 PM
Log in.. then post your code in the 8051 forum
Sat Oct 12 2019, 10:18 AM
Bhadra Sajikumar
i am doing a countdown timer with 8051 for my project, unfortunately our professor had to take a leave of absence before he could teach us most of it.. can someone explain the .asm code of it for me?
Mon Sep 23 2019, 07:37 AM
Nathaniel
I am doing a project for my schools wireless security system with cameras,sensors and spot lights using 8051 micro controller, could you help me out with the design and its source code.
Wed Sep 18 2019, 08:48 PM
Caryn Kover
Thank you for your time,
ExperimenterUK
Mon Aug 05 2019, 07:09 PM
@Ismail ..post in forum, give details

Downloads

Comments

wounder
Sat Jan 25 2020, 12:09 PM
brucewilliams20
Thu Jan 23 2020, 11:47 AM
Nippy56
Sun Jan 19 2020, 02:13 AM
usb5962
Sat Jan 11 2020, 10:42 AM
elt
Tue Jan 07 2020, 06:53 PM
mg3914697
Tue Jan 07 2020, 12:42 PM
afds43
Sun Dec 29 2019, 05:54 AM
Rupeshpatil
Fri Dec 27 2019, 06:14 PM

Online

Guests: 52, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38118
Newest member: wounder
Forum Activity
wounder Avatar
Posted By wounder
Sat Jan 25 2020, 12:14 PM
I have a 8051 micro controller ,it has timer0,1,2,...
brucewilliams20 Avatar
Posted By brucewilliams20
Sat Jan 25 2020, 08:25 AM
Also, does anyone knows a platform where I can liv...
brucewilliams20 Avatar
Posted By brucewilliams20
Sat Jan 25 2020, 08:17 AM
Hi Mirza,That match and the politics, both are fin...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Jan 17 2020, 10:24 PM
We will need the circuit diagram.A Proteus simulat...
Billz Avatar
Posted By Billz
Sat Jan 11 2020, 05:43 PM
hi everyone please attached files are my c code fo...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jan 07 2020, 08:18 PM
Not a stupid question.Setting up "Eclipse" can be...
elt Avatar
Posted By elt
Tue Jan 07 2020, 07:06 PM
So i have just began learning programming micros a...
Billz Avatar
Posted By Billz
Mon Jan 06 2020, 09:22 PM
I think it would be better if you guys try to come...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Jan 06 2020, 12:22 AM
Can you post a circuit diagram and any code you ha...
Billz Avatar
Posted By Billz
Sun Jan 05 2020, 08:17 PM
Need help regarding C code (specifically for PIC 1...