Miscellaneous › Others › LCD Programming
- This topic has 7 replies, 5 voices, and was last updated 10 years, 6 months ago by SHAH DISHANT H..
-
AuthorPosts
-
December 4, 2012 at 5:45 pm #2010VickyParticipant
Can anyone suggest me a complete tutorial for LCD Programming with any microcontroller………………..
January 19, 2013 at 4:42 am #8982nidhin.kParticipant/********************************* MAIN PROGRAM START*************************************/#include<reg51.h>#include”lcd8.h”unsigned char xx,xxx,zz,zzz;void main(){EA=1;TMOD=0x11;ET0=1;ET1=1;TH0=0x3c;TL0=0xaf;TH1=0x3c;TL1=0xaf;Lcd8_Init();Lcd8_Display(0x80,”TIMER 0″,7);Lcd8_Display(0xc0,”TIMER 1″,7);TR0=1;while(1){Lcd8_Decimal3(0x88,xxx);Lcd8_Decimal3(0xc8,zzz);if(xxx>9){TR0=0;TR1=1;xxx=0;}if(zzz>9){TR1=0;TR0=1;zzz=0;}}}void timer0()interrupt 1{xx++;if(xx>19){xxx++;xx=0;}TH0=0x3c;TL0=0xaf;}void timer1()interrupt 3{zz++;if(zz>19){zzz++;zz=0;}TH1=0x3c;TL1=0xaf;}/********************************* MAIN PROGRAM END*************************************//*********************************LCD HEADER FILE START*************************************/#define First_Line 0x80#define Second_Line 0xc0#define Curser_On 0x0f#define Curser_Off 0x0c#define Clear_Display 0x01#define Data_Port P0sbit Lcd_rs = P2^7;sbit Lcd_rw = P2^6;sbit Lcd_en = P2^5;void Lcd8_Init();void Lcd8_Command(unsigned char);void Lcd8_Write(unsigned char,unsigned char);void Lcd8_Display(unsigned char,const unsigned char*,unsigned int);void Lcd8_Decimal2(unsigned char,unsigned char);void Lcd8_Decimal3(unsigned char,unsigned char);void Lcd8_Decimal4(unsigned char,unsigned int);void Delay(unsigned int);void del();void Lcd8_Init(){Lcd8_Command(0x38); //to select function setLcd8_Command(0x06); //entry mode setLcd8_Command(0x0c); //display onLcd8_Command(0x01); //clear display}void Lcd8_Command(unsigned char com){Data_Port=com;Lcd_en=1;Lcd_rs=Lcd_rw=0;Delay(125);Lcd_en=0;Delay(125);}void Lcd8_Write(unsigned char com,unsigned char lr){Lcd8_Command(com);Data_Port=lr; // DataLcd_en=Lcd_rs=1;Lcd_rw=0;Delay(125);Lcd_en=0;Delay(125);}void Lcd8_Display(unsigned char com,const unsigned char *word,unsigned int n){unsigned char Lcd_i;for(Lcd_i=0;Lcd_i<n;Lcd_i++){Lcd8_Write(com+Lcd_i,word[Lcd_i]);}}void Lcd8_Decimal2(unsigned char com,unsigned char val){unsigned int Lcd_hr,Lcd_t,Lcd_o;Lcd_hr=val%100;Lcd_t=Lcd_hr/10;Lcd_o=Lcd_hr%10;Lcd8_Write(com,Lcd_t+0x30);Lcd8_Write(com+1,Lcd_o+0x30);}void Lcd8_Decimal3(unsigned char com,unsigned char val){unsigned int Lcd_h,Lcd_hr,Lcd_t,Lcd_o;Lcd_h=val/100;Lcd_hr=val%100;Lcd_t=Lcd_hr/10;Lcd_o=Lcd_hr%10;Lcd8_Write(com,Lcd_h+0x30);Lcd8_Write(com+1,Lcd_t+0x30);Lcd8_Write(com+2,Lcd_o+0x30);}/*void Lcd8_Decimal4(unsigned char com,unsigned int val){unsigned int Lcd_th,Lcd_thr,Lcd_h,Lcd_hr,Lcd_t,Lcd_o;val = val%10000;Lcd_th=val/1000;Lcd_thr=val%1000;Lcd_h=Lcd_thr/100;Lcd_hr=Lcd_thr%100;Lcd_t=Lcd_hr/10;Lcd_o=Lcd_hr%10;Lcd8_Write(com,Lcd_th+0x30);Lcd8_Write(com+1,Lcd_h+0x30);Lcd8_Write(com+2,Lcd_t+0x30);Lcd8_Write(com+3,Lcd_o+0x30);} */void Delay(unsigned int del){while(del–);}void del(){Delay(65000);Delay(65000);}/*********************************LCD HEADER FILE END*************************************/January 19, 2014 at 5:10 am #10865shivani suraParticipantwhile(1)
{
Lcd8_Decimal3(0x88,xxx);
Lcd8_Decimal3(0xc8,zzz);
if(xxx>9){TR0=0;TR1=1;xxx=0;}
if(zzz>9){TR1=0;TR0=1;zzz=0;}
}
}
void timer0()interrupt 1
{
xx++;
if(xx>19){xxx++;xx=0;}
TH0=0x3c;TL0=0xaf;
}
void timer1()interrupt 3
{
zz++;
if(zz>19){zzz++;zz=0;}
TH1=0x3c;TL1=0xaf;
}Can any
January 19, 2014 at 5:11 am #10866shivani suraParticipantCan any one explain this please
January 19, 2014 at 5:28 am #10867shivani suraParticipantIt is in above lcd
program..
please someone
explain this…January 19, 2014 at 5:51 am #10868AJISH ALFREDParticipantHi all,
From the home page of this site, navigate to EG LABS >> MICROCONTROLLER and find projects done on different microcontrollers in which there is an example of LCD interfacing with each and every microcontroller with maximum details.
January 28, 2014 at 1:07 pm #10901shivani suraParticipantEye blink sensor for
accident Prevention-for this
can anyone provide me the complete
source code pleaseApril 16, 2014 at 3:53 pm #11576SHAH DISHANT H.ParticipantHi,
Go through EG LABS>> MICROCONTROLLER>> ARM7
You will find the perfect solution…!!!
-
AuthorPosts
- You must be logged in to reply to this topic.