Hai jee,
Try this one,
#include <msp430x14x.h>
#include<stdio.h>
#define CR 0x0D
#define LF 0x0A
#define MAXSIZE 100
#define FIRSTLINE 0x93
#define SECONDLINE 0xCF
#define THIRDLINE 0x94
#define FOURTHLINE 0xD4
void LcdWriteChar(unsigned char dval) ;
void LcdWriteCmd(unsigned char cmd);
void LcdInit(void);
void LcdClear(void);
void delay(unsigned long int count);
void LcdWritedata(unsigned char LCDdata, unsigned int LCDcount) ;
void TimerFunc(unsigned int TIMERCOUNT);
unsigned int I,J,M,check1;
unsigned long int k;
unsigned int TIMERINTERVALCOUNT;
unsigned char dval;
unsigned char data1="CONGRATULATIONS ";//20
unsigned char data2=“SUCCESS…”;//7
void main()
{
WDTCTL = WDTPW + WDTHOLD; // Stop Watch Dog Timer
BCSCTL1 &= ~XT2OFF; // XT2on-8MHz
do
{
IFG1 &= ~OFIFG; // Clear OSCFault flag
for (I = 0xFF; I > 0; I–); // Time for flag to set
}
while ((IFG1 & OFIFG)); // OSCFault flag still set?
BCSCTL2 |= SELM_2 + SELS; // MCLK = SMCLK = XT2 (safe)-8MHz
CCR0 = 0x7FFF;
TACTL = TASSEL_1 + TACLR +MC_2; // SMCLK, contmode
P4SEL = 0x00; // Select P4 port as I/O
P4DIR = 0xFF; // Set P4 port to Output direction
P5SEL = 0x00; // Select P5 port as I/O
P5DIR = 0xFF; // Set P5 port to Output direction
P6SEL = 0x00; // Select P6 port as I/O
P6DIR = 0xFF; // Set P6 port to Output direction
for(;
{
LcdInit(); //initialize LCD
LcdClear(); //Clear LCD
LcdWriteCmd(FIRSTLINE);
LcdWritedata(data1,18);
// for(;
// {
// LcdInit();
LcdWriteCmd(SECONDLINE);
LcdWritedata(data2,12);
/* // for(;
//{
P6OUT=0x08; //for d3
k =500000;
do (k–);
while (k != 0);
P6OUT=0x04;//d2 on
k = 500000;
do (k–);
while (k != 0);
P6OUT=0x02;//d1 on
k = 500000;
do (k–);
while (k != 0);
}*/
}
}
void LcdWriteChar(unsigned char dval)
{
P5OUT = 0x06; // LCD_RW = 0; //LCD_RS = 1; //LCD_E = 1;
P4OUT = dval;
P5OUT = 0x02; // LCD_E = 0;
delay(180000);
} // LcdWriteChar
void LcdWriteCmd(unsigned char cmd)
{
P5OUT = 0x04; // LCD_RW = 0; // LCD_RS = 0; // LCD_E = 1;
P4OUT = cmd;
P5OUT = 0x00; //LCD_E = 0;
delay(180000) ; // Delay
} // LcdWriteCmd
void LcdInit()
{
P5OUT = 0x00; // LCD_RW = 0; // LCD_RS = 0; // LCD_E = 0;
LcdWriteCmd(0x3C); // LCD Function Set
LcdWriteCmd(0x3C); // LCD Function Set
LcdWriteCmd(0x3C); // LCD Function Set
LcdWriteCmd(0x0C); // display off, cursor off, no blini
LcdWriteCmd(0x01); // Clear Display
LcdWriteCmd(0x0F); // display on, cursor on,cursor blini on
LcdWriteCmd(0x07);
LcdWriteCmd(0x3F); // Entry mode- Cursor Direction
} // LcdInit
void LcdClear()
{
LcdWriteCmd(0x01); //(LCD_CLEAR);
}
void LcdWritedata(unsigned char LCDdata, unsigned int LCDcount)
{
for(check1=0;check1 < LCDcount;check1++)
LcdWriteChar(LCDdata[check1]) ; // Write data to LCD
} // LcdClear
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
CCR0 += 0x7FFF; //for 1sec // 0x1F40 for 1ms// // Add Offset to CCR0
TIMERINTERVALCOUNT–;
if(TIMERINTERVALCOUNT==0)
CCTL0 &= ~CCIE;
}
void delay(unsigned long int count)
{
do (count–);
while (count != 0);
} // Time delay