#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');
}
Tuesday, 20 March 2018
LCD-LPC2294
Subscribe to:
Post Comments (Atom)
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...
-
The APB divider determines the relationship between the processor clock (CCLK) and the clock used by peripheral devices (PCLK). The APB di...
-
The pin connect block allows selected pins of the microcontroller to have more than one function. Configuration registers control the mult...
-
Interrupt controller The Vectored Interrupt Controller (VIC) accepts all of the interrupt request inputs and categorizes them as Fast Inte...
No comments:
Post a Comment