Professional Documents
Culture Documents
void LCD_DISPLAY (char* msg) //Function to print the characters sent one by one
{
uint8_t i=0;
while(msg[i]!=0)
{
IO0PIN = ( (IO0PIN & 0xFFE1FFFF) | ((msg[i] & 0xF0)<<13) );
//Sends Upper nibble
IO0SET = 0x00012000; //RS HIGH & ENABLE HIGH to print data
IO0CLR = 0x00010000; //RW LOW Write mode
delay_ms(2);
IO0CLR = 0x00002000; // EN = 0, RS and RW unchanged(i.e. RS = 1, RW = 0)
delay_ms(5);
IO0PIN = ( (IO0PIN & 0xFFE1FFFF) | ((msg[i] & 0x0F)<<17) );
//Sends Lower nibble
IO0SET = 0x00012000; //RS & EN HIGH
IO0CLR = 0x00010000;
delay_ms(2);
IO0CLR = 0x00002000;
delay_ms(5);
i++;
}
}
int main(void)
{
LCD_INITILIZE(); //Function call INITILIZE
LCD_DISPLAY("SGU Kolhapur");
//Function call DISPLAY with String arguments (put your message here)
LCD_SEND(0xC0); //Function call SEND with Hex command as argument
delay_ms(100); //Function call delay with delay time as argument
LCD_DISPLAY("Electronics Dept");
//Function call DISPLAY with our message (Puts your message here)
LCD_SEND(0xCC); //Function call SEND with Hex command as argument
return 0;
}