求助关于MSP430FG4619与LCD显示问题

2019-03-24 14:44发布

我用的是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);
}
/*****************************************************/ 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
8条回答
wstt
2019-03-25 00:00
原帖由 chenc_44 于 2012-3-22 06:38 发表 void spi_IO( unsigned char data[], int bytes ) { int n=0; // Set Chip Select low, so LCD panel knows we are talking to it. CS_L; while(n < bytes) { UCA0TXBU ...
放到TXBUF中会自动发送,但是有没有发送完需要检查发送BUSY位,BUSY结束后就发送完了

一周热门 更多>

相关问题

    相关文章