Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Thread Closed: Thread will re-open when original poster replies

???
06/20/09 10:54
Read: times


 
#166280 - Plz help me any one..
Am interfacing lcd to 80s52..but am not getting anything on the lcd plz find out and help me....

My code is
[==========================================================================================================]

# include <reg51.h>

# include <stdio.h>

sfr ldata = 0x90;
sbit rs = P2^0;
sbit rw = P2^1;
sbit en = P2^2;


/* function proto-types */
void cmd ( unsigned char value );
void sending_data ( unsigned int value );
void delay ( unsigned char time );

unsigned char buffer [] = { 'Y', 'A', 'T', 'H', 'I' };
unsigned char i;

void main ( ) {

while ( 1 ) {
cmd ( 0x38 ); // intialization of lcd : 2 lines n 5 x 7 matrix
delay ( 100 );

cmd ( 0x0e ); // Display ON, Cursor Blinking
delay ( 100 );
cmd ( 0x01 ); // Clear Display Screen
delay ( 100 );
cmd ( 0x06 ); // Increment cursor ( Shift C to right )
delay ( 100 );
cmd ( 0x86 ); // Cursor at line 1, pos 6 , 0x80 - line1, 0xc0 - line2
delay ( 100 );
for ( i = 0; i < 5; i++ ) {
sending_data ( buffer [i] );
delay ( 100 );
}
}

}

void cmd ( unsigned char value ) {


//ready ( );
ldata = value;
rs = 0;
rw = 0;
en = 1;
delay ( 1 );
en = 0;
return;
}

void sending_data ( unsigned int value ) {

// ready ( );
ldata = value;
rs = 1;
rw = 0;
en = 1;
delay ( 1 );
en = 0;
return;
}

void delay ( unsigned char time ) {
unsigned char x, y;

for ( x = 0; x <= time; x++ )
for ( y = 0; y < 1200; y++ );
return;
}

/* void ready ( void ) {

busy = 1;
rs = 0;
rw = 1;
while ( busy == 1 ) {
en = 0;
delay ( 1 );
en = 1;
}
return;
}*/



List of 17 messages in thread
TopicAuthorDate
Plz help me any one..            01/01/70 00:00      
   Start describing your hw and what you have tested            01/01/70 00:00      
      Thank you..            01/01/70 00:00      
   Re-Initialize Inside Loop            01/01/70 00:00      
      LCD problem            01/01/70 00:00      
   How to debug            01/01/70 00:00      
      LCD problem            01/01/70 00:00      
    A few tips            01/01/70 00:00      
      Thank you..            01/01/70 00:00      
   At least one error            01/01/70 00:00      
      Thank you..            01/01/70 00:00      
   At least one error            01/01/70 00:00      
   Amazing...            01/01/70 00:00      
      Unfortunately not Amazing            01/01/70 00:00      
         Thank you            01/01/70 00:00      
   DISPLAYING MESG IN LCD, INTERFACE 2 89s52            01/01/70 00:00      
   No replies            01/01/70 00:00      

Back to Subject List