This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

lcd interface

has anyone interfaced a powertip lcd to 167/ST10?
If yes, Pls let me know the ports used and the initialisation sequence
regards
rajesh

Parents Reply Children
  • How about i post a copy of my C program here?Is that allow??
    I really need help with this..i'm not really good with this LCD interface..

    
    #include<reg51.h>
    
    sbit RS = P2^0;
    sbit RW = P2^1;
    sbit E  = P2^2;
    
    
    void long_delay(unsigned int y)
    {
    	unsigned int x;
    
    	for (x=0;x<y;x++);
    }
    
    void delay(unsigned char y)
    {
    	unsigned char x;
    
    	for (x=0;x<y;x++);
    }
    
    void strobe()
    {
    	E = 1;
    	delay(150);
    	E = 0;
    	delay(150);
    }
    
    void LCD_init()
    {
    	unsigned char x;
    
    	for (x=0;x<3;x++)
    	{
    		P0=0x30;
    		RS=0;
    		RW=0;
    		strobe();
    		delay(150);
    	}
    
    	P0=0x38;
    	strobe();
    
    	P0=0x0c;
    	strobe();
    
    	P0=0x01;
    	strobe();
    
    	P0=0x02;
    	strobe();
    }
    
    void LCD_print(unsigned char x)
    {
    	P0=x;
    	RS=1;
    	RW=0;
    	strobe();
    }
    
    void main()
    {
    
    	LCD_init();
    
    	RI=0;
    	E=0;
    	for(;;)
    		{
    			while (RI==0);
    			RI=0;
    			LCD_print("Hello!!");
    		}
    }
    

    Thanks!!

  • you have no ideas of the length of delay() since it is written in C.

    Erik