我用的是MSP430FG4619,连接的LCD是NHD‐C12832A1Z‐NSW‐BBW‐3V3
用SPI,我查了有3pin和4pin模式, 我的这个连接用了SCL, STE, SIMO,SOMI没有连,不知道是3pin还是4pin
初始化还是有困难,请大家帮帮忙
以下是LCD datasheet上提供的sample code
void data_out(unsigned char i) //Data Output Serial Interface
{
unsigned int n;
CS = 0;
A0 = 1;
for(n=0; n<8; n++){
i <<=1;
SCL = 0;
P1 = i;
delay(2);
SCL = 1;
}
CS = 1;
}
void comm_out(unsigned char j) //Command Output Serial Interface
{
unsigned int n;
CS = 0;
A0 = 0;
for(n=0; n<8; n++){
j <<=1;
SCL = 0;
P1 = j;
delay(2);
SCL = 1;
}
CS = 1;
}
/****************************************************
* Initialization For controller *
*****************************************************/
void init_LCD()
{
comm_out(0xA0);
comm_out(0xAE);
comm_out(0xC0);
comm_out(0xA2);
comm_out(0x2F);
comm_out(0x26);
comm_out(0x81);
comm_out(0x2F);
}
/*****************************************************/
此帖出自
小平头技术问答
一周热门 更多>