LCD
LCD
* Alphanumeric LCD
* Developed by
#include <lpc17xx.h>
#include "LCD.h"
#include "libs.h"
clear_ports();
delay_lcd(3200);
temp2 = (0x30<<2);
wr_cn();
delay_lcd(30000);
temp2 = (0x30<<2);
wr_cn();
delay_lcd(30000);
temp2 = (0x30<<2);
wr_cn();
delay_lcd(30000);
temp2 = (0x20<<2);
wr_cn();
delay_lcd(30000);
temp1 = 0x28;
lcd_com();
delay_lcd(30000);
temp1 = 0x0c;
lcd_com();
delay_lcd(800);
temp1 = 0x06;
lcd_com();
delay_lcd(800);
temp1 = 0x01;
lcd_com();
delay_lcd(10000);
temp1 = 0x80;
lcd_com();
delay_lcd(800);
return;
}
void lcd_com(void)
{
temp2 = temp1 & 0xf0; //move data (26-8+1) times : 26 -
HN place, 4 - Bits
temp2 = temp2 << 2; //data lines from 23 to 26
wr_cn();
temp2 = temp1 & 0x0f; //26-4+1
temp2 = temp2 << 6;
wr_cn();
delay_lcd(1000);
return;
}
void clr_disp(void)
{
temp1 = 0x01;
lcd_com();
delay_lcd(10000);
return;
}
void clear_ports(void)
{
/* Clearing the lines at power on */
LPC_GPIO2->FIOCLR = DT_CTRL; //Clearing data lines
LPC_GPIO2->FIOCLR = RS_CTRL; //Clearing RS line
LPC_GPIO2->FIOCLR = EN_CTRL; //Clearing Enable line
return;
}
while(buf1[i]!='\0')
{
temp1 = buf1[i];
lcd_data();
i++;
if(i==16)
{
temp1 = 0xc0;
lcd_com();
}
}
return;
}
lcd_init();
}
}
void display_string1()
{
k = 0;
while(add_result[k] != 0x00)
{
}
}