Olimex MSP430-4619LCD board screen problem

Discussions on how to get your MSP JTAG programmer up and running.

Moderator: phalanx

Post Reply
Jee
Posts: 2
Joined: Fri Feb 13, 2009 10:59 am

Olimex MSP430-4619LCD board screen problem

Post by Jee » Fri Feb 13, 2009 11:10 am

Hi. I've just got MSP430-4619LCD evaluation board which was pre-programmed with the demo software which worked fine.
When I tried to upload the demo code for this board from the web site the screen did't work. The backlight is on, but no picture at all. I traced the program in step by step mode - the joystick works, so the program is uploaded. There is something with the screen initialization maybe.

Could anybody help me how to make the screen work properly or maybe you have a simple code just for the screen itself?
I would greatly appreciate any help.
Thanks.

Jee
Posts: 2
Joined: Fri Feb 13, 2009 10:59 am

Post by Jee » Fri Feb 13, 2009 2:21 pm

Ok, the answer is "RTFM" as usual.
It was necessary to comment the display definition in LCD.h

//#define GE12

Everything works fine now.

But if anybody has some simple code examples for this display I would greatly appreciate if you share those.

naz
Posts: 108
Joined: Thu Feb 12, 2009 11:31 pm

LCD code

Post by naz » Fri Feb 13, 2009 11:26 pm

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

Post Reply