发帖
3 0 0

【安信可小安派BW21-CBV-Kit】ili9341 TFT显示

sujingliang
论坛元老

20

主题

16

回帖

5935

积分

论坛元老

积分
5935
小安派·BW21-CBV-KIt 126 3 2025-3-7 20:22:57
本帖最后由 sujingliang 于 2025-3-7 20:26 编辑

连线图

6.png
在 "文件"->"示例"->"AmebaSPI"->"LCD_Screen_ILI9341_TFT"中打开示例。
7.png


  1. #define TFT_RESET 5
  2. #define TFT_DC    4
  3. #define TFT_CS    SPI_SS
  4. #define TFT_LED   11
复制代码
TFT背光使用11引脚
SPI用SPI0,对应引脚
SPI_MOSI   13
SPI_MISO   14
SPI_SCLK    15
SPI_SS       12

  1. #define SPI_MOSI                                AMB_D13 // SPI_0_MOSI   AMB_D13
  2. #define SPI_MISO                                AMB_D14 // SPI_0_MISO   AMB_D14
  3. #define SPI_SCLK                                AMB_D15 // SPI_0_SCL    AMB_D15
  4. #define SPI_SS                                  AMB_D12 // SPI_0_CS0    AMB_D12
复制代码

  1. /* Digital pin mapping refer to g_APinDescription */
  2. #define AMB_D0                                  0  // PF_5
  3. #define AMB_D1                                  1  // PF_6
  4. #define AMB_D2                                  2  // PF_7
  5. #define AMB_D3                                  3  // PF_8
  6. #define AMB_D4                                  4  // PF_11
  7. #define AMB_D5                                  5  // PF_12
  8. #define AMB_D6                                  6  // PF_13
  9. #define AMB_D7                                  7  // PF_14
  10. #define AMB_D8                                  8  // PF_15
  11. #define AMB_D9                                  9  // PF_2
  12. #define AMB_D10                                 10 // PF_1
  13. #define AMB_D11                                 11 // PF_0
  14. #define AMB_D12                                 12 // PE_4
  15. #define AMB_D13                                 13 // PE_3
  16. #define AMB_D14                                 14 // PE_2
  17. #define AMB_D15                                 15 // PE_1
  18. #define AMB_D16                                 16 // PD_18
  19. #define AMB_D17                                 17 // PD_17
  20. #define AMB_D18                                 18 // PD_16
  21. #define AMB_D19                                 19 // PD_15
  22. #define AMB_D20                                 20 // PD_14
  23. #define AMB_D21                                 21 // PA_2
  24. #define AMB_D22                                 22 // PA_3

  25. #define AMB_D23                                 23 // PF_9
  26. #define AMB_D24                                 24 // PE_6
  27. #define AMB_D25                                 25 // PF_4
  28. #define AMB_D26                                 26 // PF_3
  29. #define AMB_D27                                 27 // PA_1
  30. #define AMB_D28                                 28 // PA_0
  31. #define AMB_D29                                 29 // PF_10
复制代码

void setup()中增加:
  1. pinMode(TFT_LED,OUTPUT);
  2.   digitalWrite(TFT_LED,HIGH);
复制代码
unsigned long testText()中增加

  1. tft.setForeground(ILI9341_GREEN);
  2.     tft.setFontSize(4);
  3.     tft.println("Hello BW21-CBV-Kit");
复制代码
运行效果
3.jpg

tutieshi_640x362_4s.gif



──── 0人觉得很赞 ────

使用道具 举报

2025-3-7 20:41:43
屏幕的例子还是有点少,应该多搞几种屏幕的例程,比如ST7789
2025-3-10 08:43:34
棒~
2025-3-25 16:09:04
HaydenHu 发表于 2025-3-7 20:41
屏幕的例子还是有点少,应该多搞几种屏幕的例程,比如ST7789

不是不想搞,是其他的得自己写驱动,官方就写了这一个芯片的
您需要登录后才可以回帖 立即登录
高级模式
返回
统计信息
  • 会员数: 28580 个
  • 话题数: 40691 篇