• 已解决 73482 个问题
  • 已帮助 5993 位优秀工程师

51单片机驱动2.4寸TFT屏,该怎么接线程序?

6d38f182c018e11e 2018-06-29 浏览量:3363
屏.png屏的PIN脚定义如上图,使用的是ST7789V  IC  ,屏代码如下
/-----------------------------------2.4HSD+ST7789V reset sequence------------------------------------//
LCD_RESET=1;
Delay(1); //Delay 1ms
LCD_RESET=0;
Delayms(10); //Delay 10ms
LCD_RESET=1;
Delay(120); //Delay 120ms
//--------------------------------------2.4HSD+ST7789V-------------------------------------------------------------//
WriteComm(0x11);
Delay(120); //Delay 120ms
//------------------------------display and color format setting--------------------------------//
WriteComm(0x36);
WriteData(0x00);
WriteComm(0x3a);
WriteData(0x05);
//--------------------------------ST7789V frame rate setting----------------------------------//
WriteComm(0xb2);
WriteData(0x0c);
WriteData(0x0c);
WriteData(0x00);
WriteData(0x33);
WriteData(0x33);
WriteComm(0xb7);
WriteData(0x35);
//---------------------------------ST7789V Power setting--------------------------------------//
WriteComm(0xbb);
WriteData(0x35);
WriteComm(0xc0);
WriteData(0x2c);
WriteComm(0xc2);
WriteData(0x01);
WriteComm(0xc3);
WriteData(0x0b);
WriteComm(0xc4);
WriteData(0x20);
WriteComm(0xc6);
WriteData(0x0f);
WriteComm(0xd0);
WriteData(0xa4);
WriteData(0xa1);
//--------------------------------ST7789V gamma setting---------------------------------------//
WriteComm(0xe0);
WriteData(0xd0);
WriteData(0x00);
WriteData(0x02);
WriteData(0x07);
WriteData(0x0b);
WriteData(0x1a);
WriteData(0x31);
WriteData(0x54);
WriteData(0x40);
WriteData(0x29);
WriteData(0x12);
WriteData(0x12);
WriteData(0x12);
WriteData(0x17);
WriteComm(0xe1);
WriteData(0xd0);
WriteData(0x00);
WriteData(0x02);
WriteData(0x07);
WriteData(0x05);
WriteData(0x25);
WriteData(0x2d);
WriteData(0x44);
WriteData(0x45);
WriteData(0x1c);
WriteData(0x18);
WriteData(0x16);
WriteData(0x1c);
WriteData(0x1d);
WriteComm(0x29);

}
请问大神,该怎么接线,程序反面怎么写?
0 0 收起

我来回答

上传资料:
选择文件 文件大小不超过15M(格式支持:doc、ppt、xls、pdf、zip、rar、txt)
最佳答案
  • 51驱动TFT屏主要有三种通信方式,SPI 8线并口和16线并口,都是通过数据总线与控制TFT屏的主控ILI93XX或者RA8875通信。​

    • 发布于 2018-06-29
    • 举报
    • 评论 0
    • 0
    • 0

其他答案 数量:7
  • 51单片机你要用并口操作吗?屏幕的接口是定义好的,还是你可以修改?建议用SPI接口
    • 发布于2018-06-29
    • 举报
    • 评论 2
    • 0
    • 0
6d38f182c018e11e 回复了 skawu :已经定义好的,修改不了 回复
6d38f182c018e11e 回复了 skawu :已经定义好的,修改不了 回复

  • 并口操作的话,占用IO口资源较多,只能按照相关定义去配置IO口
    • 发布于2018-06-29
    • 举报
    • 评论 0
    • 0
    • 0

  • 这种是用并口操作的屏幕,通过向IO寄存器中写入数据即可实现操作
    • 发布于2018-06-30
    • 举报
    • 评论 0
    • 0
    • 0

  • 这个屏是并口的,你要使用一级IO口,接并口的数据线。

    其他的控制引脚,可以接GPIO引脚。

    按液晶的时序进行控制

    • 发布于2018-07-02
    • 举报
    • 评论 0
    • 0
    • 0

  • 这个是并口控制屏幕,你直接用的IO接到数据线,然后控制引脚的时序发送数据
    • 发布于2018-07-03
    • 举报
    • 评论 0
    • 0
    • 0

  • 这个屏幕是并口屏。使用51的IO控制并行数据传输就可以了
    • 发布于2018-07-11
    • 举报
    • 评论 0
    • 0
    • 0

  • 并口连接 可以直接发送数据到端口就可以了 
    • 发布于2018-07-14
    • 举报
    • 评论 0
    • 0
    • 0

相关问题

问题达人换一批

51单片机驱动2.4寸TFT屏,该怎么接线程序?