Specifications

delay2 (40);
control(0x02); // 4 bit
control(0x08); // 2 lines
delay2 (40);
control(0x00); //display on, cursor off, blink off
control(0x06);
delay2 (40);
control(0x00); //clear display
control(0x0C);
delay2 (40);
control(0x00);
control(0x01); //entry = increment + shift
NutDelay(2);
control(0x08);
control(0x00);
delay2 (40);
}
/*
* goto the x y position on the LCD
* 0,0 represents top left
*/
void gotoxy(unsigned char x, unsigned char y)
{
x = x * 0x04;
NutDelay(5);
control(0x08 + x);
control(y);
NutDelay(5);
}
/* Control for the enable line */
void LCD_E(char state){
if (state)
PORTE |= 0x80;
else
PORTE &= 0x7F;
}
/* Control for the register select line */
void LCD_RS(char state){
if (state)
PORTE |= 0x10;
else
PORTE &= 0xEF;
}
/*
* PUTCH
* writes character "data" to the LCD
*/
void putch(char data)
{
unsigned char count;
91