Forum Replies Created
-
AuthorPosts
-
Osama MohammedParticipant
Thank you all,
Osama MohammedParticipantThanks, now it’s working
Osama MohammedParticipantOsama MohammedParticipant#include <reg51.h>msDelay(unsigned int);cmd(unsigned char); //LCD command code initializationdat(unsigned char ); // LCD data code initializationsbit regs=P2^6; //name the pin register select of the lcdsbit enab=P2^7;sbit rd=P2^5;void LCD_write_string(unsigned char *str) //store address value of the string in pointer *str{unsigned char j = 0;while (str[j] != 0){dat(str[j]); // sending data on LCD byte by bytemsDelay(100);j++;}return;}void main (void){cmd(0x38);msDelay(100);cmd(0x0C);msDelay(100);cmd(0x01);msDelay(100);while(1){LCD_write_string(“osama”);msDelay(2000);cmd(0x01);msDelay(2000);}}cmd(unsigned char value){P1=value;regs=0;rd=0;enab=0;msDelay(500);enab=1;}dat(unsigned char info){P1=info;regs=1;rd=0;enab=0;msDelay(500);enab=1;}msDelay(unsigned int tdelay){unsigned int k,j;for(k=0;k<=tdelay;k++)for(j=0;j<=100;j++);}
This is a code I used to test the LCD , it is not the code that I use in the project that I am working in but just to test the LCD ,but unfortunately this is not workingOsama MohammedParticipantThank you,
I have bought HC-05 bluetooth module , and I will try it soon ….
Osama MohammedParticipantThanks all , the problem is solved !
I found that the problem was from the voltage supply ,although I am using 5v regulator to supply the microcontroller but the microcontroller was unable to function with it, I don’t know why is this but maybe the voltage regulator is of bad quality !!
I tried to supply it with a 5v from 5v of the Arduino UNO board and the 8051 led blinking circuit worked well , this is how I detected where is the problem.
but now I am facing another problem ,the LCD in my circuit is not working !!.
when I tried the LCD code and circuit with ISIS proteus simulation it was working fine ,but when implementing it on my breadboard it doesn’t work ……. !!!!!!!!!!!! this would drive me crazy !!.
Osama MohammedParticipantOkay send me
Thank you
Osama MohammedParticipantPlease I hgave another question
my hex code file is 9 kilo bytes in size
can it be used with 89C52 ?
Osama MohammedParticipantHi,
Thank you all,
the problem is solved
the if statement argument was wrong ,that is all !!
Dishant
thank you for posting this function I will try it
Osama MohammedParticipantHi,
Thank you all,
the problem is solved
the if statement argument was wrong ,that is all !!
SHAH DISHANT H. thank you for posting this function I will try it
Osama MohammedParticipantThanks,
The problem is solved
but now I have another problem,
I don’t know how to display decimal numbers on LCD , for example 244 how if I want to display on LCD ?
Also how to display a number preserved inside a variable ,for instance if k is a variable and k=200; , how to display this value of k ????
Osama MohammedParticipantThank you guys,
Osama MohammedParticipantthanks you guys,
Osama MohammedParticipantno my simulation is working good without the delay function ,when I use the delay function it stops working
anyway I tried to reduce the 1275 to 100 ,and it worked and it has worked well
but know how could I calibrate the function to return 1 second delay when I enter 1000 ms to the function arguement msDelay(1000)
Osama MohammedParticipantThis is the code of a setpper motorI am using ISIS Proteuswhen I run the code with that delay function the execution us stuck in the function !!when I remove this delay function the code is executed normally and continually without stopping !I tried to make many modfiications but nothing works#include <reg51.h>msDelay(unsigned int);#define stepperPort P2void main (void){stepperPort=0x03;msDelay(4000);stepperPort=0x06;msDelay(4000);stepperPort=0x0C;msDelay(4000);stepperPort=0x09;msDelay(4000);}msDelay(unsigned int tdelay){unsigned k,j;for(k=0;k<=tdelay;k++)for(j=0;j<=1275;j++);} -
AuthorPosts