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

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
Mon Aug 05 2019, 04:33 PM
Ismail balghmi
Hello. Please I won't download
ExperimenterUK
Wed Jul 24 2019, 12:47 AM
@BUSTER123 Please post in the forum
Tue Jul 23 2019, 06:13 PM
BUSTER123
hello! newbie here. i am kind of a guy who hates using ready - made existing libraries, so this helped a lot as i was trying to control and write to a character lcd display. however, i can't figure out how to set the cursor position. for example, i want to set it to the 5th column in the first row, so position 5. so according to the table, i am sending 10000101 on the 8 data lines of the lcd (register select pulled low). the cursor does not move there however. and i cant move the cursor left or right too. is it something wrong that i am doing? thank you.
ExperimenterUK
Thu Jul 11 2019, 07:55 PM
@ramos https://www.theengineeringprojects.com/2017/09/l298-motor-driver-library-proteus.html
ExperimenterUK
Thu Jul 11 2019, 07:44 PM
@praveen123. Can you give a link to the project ?

Downloads

Comments

auwal
Tue Nov 19 2019, 03:13 PM
ANKITPATEL
Mon Nov 18 2019, 11:00 AM
Casmir
Wed Nov 13 2019, 06:25 AM
DeepakBGattani
Mon Nov 11 2019, 01:31 PM
Jeanbusatta
Sun Nov 10 2019, 04:42 AM
mdayaz
Sat Nov 09 2019, 03:41 PM
baoyen123
Fri Nov 08 2019, 10:06 AM
xiwang
Fri Nov 08 2019, 07:28 AM

Online

Guests: 31, Members: 0 ...

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

Members: 38105
Newest member: auwal
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Nov 19 2019, 10:44 PM
The 8051 has too little memory to do anything us...
ilylily07 Avatar
Posted By ilylily07
Mon Nov 18 2019, 09:54 AM
0v7670 camera interfacing with stc 8051.using asse...
Jeanbusatta Avatar
Posted By Jeanbusatta
Sun Nov 10 2019, 04:43 AM
ty, really needed it
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Oct 22 2019, 05:18 AM
wimac Avatar
Posted By wimac
Mon Oct 21 2019, 09:18 AM
I’ve been following this thread and looking at the...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 03:09 PM
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 03:02 PM
sir, when i on display ,sometime 3rd display is no...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 02:53 PM
sir, when i on display ,sometime 3rd display is no...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Oct 20 2019, 12:21 AM
Your code seems okay on my simulationTry my code o...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sat Oct 19 2019, 07:13 PM
please find video attachment. 3rd & 4th displa...