EmbeddedRelated.com
Forums

Reg:MSP430F2370-lcd

Started by ssundari February 11, 2008
Hi Friends,

I have connected HITACHI lcd parallel with MSP430F2370.In my code controll signals are working fine
but the data not yet display on LCD.Any one help me to find the error in my code and give me suggestion to
correct the error.

int main( void )
{
//int i=0;
//unsigned char data[] = {"HI GOOD MORNING"};
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
P2DIR |= 0x0E;
P1DIR |= 0xFF;

//P1OUT &= 0x08;
lcdcmd(0x38); // Init LCD
delay(250);
lcdcmd(0x0C); //Display ON , cursor ON
delay(250);
lcdcmd(0x01); //Clear Screen
delay(250);
lcdcmd(0x06); //shift cursor right
delay(250);
display(1,1,'G');
display(2,1,'H');

//i++;
return 0;
}

void lcdcmd(unsigned char cmd )
{

P2OUT &= ~0x02; //P1.1-RS
//P1OUT &= ~0x08; //P1.2-R/W
P2OUT |= 0x04; //P1.1-E
delay(500);
P2OUT &= ~0x04; //P1.1-E
P1OUT = cmd;
return;

}
void lcddata(unsigned char ch)
{

P1OUT = ch;
P2OUT |= 0x02; //P1.0-RS
P2OUT |= 0x04; //P1.1-E
//P1OUT &= ~0x04; //P1.2-R/W
delay(500);
P2OUT |= ~0x04 ; //P1.2-E
return;

}
void display(char l, char c, char ch)
{
if ( l==1)
lcdcmd( 0x80+c);
if ( l==2)
lcdcmd( 0xc0+c);
lcddata(ch);
}

Thanks and Regards,

S.Sundari

Beginning Microcontrollers with the MSP430

----- Original Message -----
From: "ssundari"
To:
Sent: Monday, February 11, 2008 3:58 AM
Subject: [msp430] Reg:MSP430F2370-lcd
> Hi Friends,
> I have connected HITACHI lcd parallel with MSP430F2370.In my code
> controll signals are working fine
> but the data not yet display on LCD.Any one help me to find the error in
> my code and give me suggestion to
> correct the error.

Is that LCD suitable for low-voltage operation?

Leon
Have a look at the initialization sequence. I think you might find you need to add a second lcdcmd(0x38) with about a 5ms delay between the two.

If the LCD is showing no sign of life at all then you may need to look at the contrast voltage input.

Gary.

----- Original Message -----
From: ssundari
To: m...
Sent: Monday, February 11, 2008 4:58 PM
Subject: [msp430] Reg:MSP430F2370-lcd
Hi Friends,
I have connected HITACHI lcd parallel with MSP430F2370.In my code controll signals are working fine
but the data not yet display on LCD.Any one help me to find the error in my code and give me suggestion to
correct the error.
int main( void )
{
//int i=0;
//unsigned char data[] = {"HI GOOD MORNING"};
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
P2DIR |= 0x0E;
P1DIR |= 0xFF;

//P1OUT &= 0x08;
lcdcmd(0x38); // Init LCD
delay(250);
lcdcmd(0x0C); //Display ON , cursor ON
delay(250);
lcdcmd(0x01); //Clear Screen
delay(250);
lcdcmd(0x06); //shift cursor right
delay(250);
display(1,1,'G');
display(2,1,'H');

//i++;
return 0;
}

void lcdcmd(unsigned char cmd )
{

P2OUT &= ~0x02; //P1.1-RS
//P1OUT &= ~0x08; //P1.2-R/W
P2OUT |= 0x04; //P1.1-E
delay(500);
P2OUT &= ~0x04; //P1.1-E
P1OUT = cmd;
return;

}
void lcddata(unsigned char ch)
{

P1OUT = ch;
P2OUT |= 0x02; //P1.0-RS
P2OUT |= 0x04; //P1.1-E
//P1OUT &= ~0x04; //P1.2-R/W
delay(500);
P2OUT |= ~0x04 ; //P1.2-E
return;
}
void display(char l, char c, char ch)
{
if ( l==1)
lcdcmd( 0x80+c);
if ( l==2)
lcdcmd( 0xc0+c);
lcddata(ch);
}
Thanks and Regards,

S.Sundari
Hi,

I have given 5v input separately from RPS to the LCD

________________________________

From: m... on behalf of Leon
Sent: Mon 2/11/2008 9:50 AM
To: m...
Subject: Re: [msp430] Reg:MSP430F2370-lcd

----- Original Message -----
From: "ssundari" >
To: >
Sent: Monday, February 11, 2008 3:58 AM
Subject: [msp430] Reg:MSP430F2370-lcd

> Hi Friends,
> I have connected HITACHI lcd parallel with MSP430F2370.In my code
> controll signals are working fine
> but the data not yet display on LCD.Any one help me to find the error in
> my code and give me suggestion to
> correct the error.

Is that LCD suitable for low-voltage operation?

Leon
Hi,

Thank you,

shall i interface and controll the high voltage device with our low voltage Msp430.

Thanks and Regards,

S.Sundari

________________________________

From: m... on behalf of Gary Anderson
Sent: Mon 2/11/2008 10:20 AM
To: m...
Subject: Re: [msp430] Reg:MSP430F2370-lcd

Have a look at the initialization sequence. I think you might find you need to add a second lcdcmd(0x38) with about a 5ms delay between the two.

If the LCD is showing no sign of life at all then you may need to look at the contrast voltage input.

Gary.

----- Original Message -----
From: ssundari
To: m...
Sent: Monday, February 11, 2008 4:58 PM
Subject: [msp430] Reg:MSP430F2370-lcd

Hi Friends,

I have connected HITACHI lcd parallel with MSP430F2370.In my code controll signals are working fine
but the data not yet display on LCD.Any one help me to find the error in my code and give me suggestion to
correct the error.

int main( void )
{
//int i=0;
//unsigned char data[] = {"HI GOOD MORNING"};
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
P2DIR |= 0x0E;
P1DIR |= 0xFF;

//P1OUT &= 0x08;
lcdcmd(0x38); // Init LCD
delay(250);
lcdcmd(0x0C); //Display ON , cursor ON
delay(250);
lcdcmd(0x01); //Clear Screen
delay(250);
lcdcmd(0x06); //shift cursor right
delay(250);
display(1,1,'G');
display(2,1,'H');

//i++;
return 0;
}

void lcdcmd(unsigned char cmd )
{

P2OUT &= ~0x02; //P1.1-RS
//P1OUT &= ~0x08; //P1.2-R/W
P2OUT |= 0x04; //P1.1-E
delay(500);
P2OUT &= ~0x04; //P1.1-E
P1OUT = cmd;
return;

}
void lcddata(unsigned char ch)
{

P1OUT = ch;
P2OUT |= 0x02; //P1.0-RS
P2OUT |= 0x04; //P1.1-E
//P1OUT &= ~0x04; //P1.2-R/W
delay(500);
P2OUT |= ~0x04 ; //P1.2-E
return;

}
void display(char l, char c, char ch)
{
if ( l==1)
lcdcmd( 0x80+c);
if ( l==2)
lcdcmd( 0xc0+c);
lcddata(ch);
}

Thanks and Regards,

S.Sundari