Tuesday, 20 March 2018

LCD-LPC2294

#include<LPC22xx.h>
#define lcd 0x03fc0000
#define rs 0x00010000
#define rw 0x00000000
#define e 0x00020000

void delay()
{
 int i,j;
 for(i=0;i<100;i++)
 for(j=0;j<1000;j++);
}
void lcd_cmd(unsigned char value)
{ IOCLR0=rs;
 IOSET0=value<<18;
 IOCLR0=~value<<18;
 IOSET0=e;
 delay();
 IOCLR0=e;
}
void lcd_data(unsigned char data)
{
 IOSET0=rs;
 IOSET0=data<<18;
 IOCLR0=~data<<18;
 IOSET0=e;
 delay();
 IOCLR0=e;
}
void int_lcd()
 { IODIR0=0x03ff0000;// define as output pin p0-16 to p0-25
  lcd_cmd(0x38);
 lcd_cmd(0x0e);
 lcd_cmd(0x06);
 lcd_cmd(0x01);
 lcd_cmd(0x80);
}
main()
{  int_lcd();
 lcd_data('v');
 lcd_data('i');
 lcd_data('v');
 lcd_data('e');
 lcd_data('k'); 
}

No comments:

Post a Comment

PIC Course with IIT Bombay

 Embedded Lab Course with PIC18F4550 by IIT Bombay 2017-18 Overview: Below course was conducted as an outreach initiative of Wadhwani Elect...