This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
LCD驱动是HT1621B,在CCS5.5中编译有问题,电脑为WIN7专业版;用的是MSP430G2553launchpad底板加上口袋实验平台的LCD128段显示屏,问题处在
Description Resource Path Location Type
#20 identifier "P5OUT" is undefined main.c /shuP160 line 19 C/C++ Problem
Description Resource Path Location Type
#20 identifier "P6DIR" is undefined main.c /shuP160 line 97 C/C++ Problem
#include"MSP430G2553.h"
#include <msp430.h>
#define unchar unsigned char
#define uint unsigned int
#define comm 0
#define dat 1
unchar tab1[]={"我"};
void delay(long unsigned int time)
{
while(time--);
}
void wr_lcd(unsigned char dat_comm,unsigned char data)
{
unsigned char j=0x00 ;
unsigned char i= 0x00;
P5OUT|=0x10;
P5OUT&=~0x08;
P5OUT|=0X20;
for(i=0;i<5;i++)
{
P5OUT|=0x08;
delay (10);
P5OUT&=~0x08;
}
P5OUT&=~0x20;
P5OUT|=0x08;
P5OUT&=~0x08;
if (dat_comm ==0x01)
P5OUT|=0x20;
else
P5OUT&=~0x20;
P5OUT|=0x08;
P5OUT&=~0x08;
P5OUT&=~0x20;
P5OUT|=0x08;
P5OUT&=~0x08;
for (j=0 ;j<2;j++)
{
for (i =0;i<4;i++)
{
if (data &0x80)
{
P5OUT|=0x20;
}
else
P5OUT&=~0x20;
P5OUT|=0x08;
P5OUT&=~0x08;
data=data<1;
}
P5OUT&=~0x20;
for (i=0 ;i <4;i++)
{
P5OUT|=0x08;
P5OUT&=~0x08;
}
}
}
void init_lcd(void)
{
P2OUT|=0X40;
P2OUT&=~0X01;
delay(10);
wr_lcd(comm,0X30);
wr_lcd(comm,0X01);
delay(10);
wr_lcd(comm,0X06);
wr_lcd(comm,0X0c);
}
void clrram(void)
{
wr_lcd(comm,0X30);
wr_lcd(comm,0X01);
delay(180);
}
Initial_Dis()
{
wr_lcd(comm,0X30);
}
write_Zi_to_12864(unsigned char *chn)
{
wr_lcd(comm,0X80);
wr_lcd(dat,chn[00]);
wr_lcd(dat,chn[01]);
}
int main(void)
{
WDTCTL=WDTPW+WDTHOLD;
P2DIR=0xff;
P6DIR=0xff;
init_lcd();
while(1)
{
Write_Zi_to_12864(tab1);
while(1);
}
}