1 month, 3 weeks ago.

2.8 inch TFT Touch Shield v2.0(Seeed) not working! Please answer me.

Hi! there~

I'm going to connect the nucleo-f401re board with the LCD specified in the title. It used a jumper wire to connect the LCD to the board. Below is the code I used, but when I debugged it on the board, the LCD only had a white screen, but the contents of the code did not appear. I tried other examples, but only the same white screen appeared. Does anyone know how to solve this problem? Thank you for your reply in advance.

If you need any other information, let me know.

https://os.mbed.com/users/pathae/code/Seeed_TFT_Touch_Shield2/

When debugging to the source on the top page, only a white screen appears.

When posting code please use

<<code>>
your code
<</code>>

#include "mbed.h"
#include "SeeedStudioTFTv2.h"
#include "Arial12x12.h"
#include "Arial24x23.h"
#include "Arial28x28.h"
#include "font_big.h"
#define PIN_XP A3
#define PIN_XM A1
#define PIN_YP A2
#define PIN_YM A0
#define PIN_MOSI D11
#define PIN_MISO D12
#define PIN_SCLK D13
#define PIN_CS_TFT D5
#define PIN_DC_TFT D6
#define PIN_BL_TFT D7
#define PIN_CS_SD D4

SeeedStudioTFTv2 TFT(PIN_XP, PIN_XM, PIN_YP, PIN_YM, PIN_MOSI, PIN_MISO, PIN_SCLK, PIN_CS_TFT, PIN_DC_TFT, PIN_BL_TFT, PIN_CS_SD);

int main() {
  //Configure the display driver
  TFT.background(Black);
  TFT.foreground(White);
  TFT.cls();

  //Print a welcome message
 TFT.set_font((unsigned char*) Arial12x12);
 TFT.locate(0,0);
 TFT.printf("Hello Mbed");

  // Wait for 5 seconds
 wait(5.0);

// Draw some graphics
 TFT.cls();
 TFT.set_font((unsigned char*) Arial24x23);
 TFT.locate(100,100);
 TFT.printf("Graphic");

 TFT.line(0,0,100,0,Green);
 TFT.line(0,0,0,200,Green);
 TFT.line(0,0,100,200,Green);

 TFT.rect(100,50,150,100,Red); TFT.fillrect(180,25,220,70,Blue);

 TFT.circle(80,150,33,White);
 TFT.fillcircle(160,190,20,Yellow);

 double s;
 for (int i = 0; i < 320; i++) {
   s = 20 * sin((long double)i / 10);
  TFT.pixel(i, 100 + (int)s, Red); 
 }

//Wait for 5 seconds
 wait(5.0);

// Multiple fonts 
TFT.foreground(White);
 TFT.background(Blue);
 TFT.cls();
 TFT.set_font((unsigned char*) Arial24x23);
 TFT.locate(0,0);
 TFT.printf("Different Fonts:");
 TFT.set_font((unsigned char*) Neu42x35);
 TFT.locate(0,30);
 TFT.printf("Hello Mbed 1");
 TFT.set_font((unsigned char*) Arial24x23);
 TFT.locate(20,80); TFT.printf("Hello Mbed 2");
 TFT.set_font((unsigned char*) Arial12x12);
 TFT.locate(35,120);
 TFT.printf("Hello Mbed 3"); 
}
posted by Andy A 01 Aug 2019
Comment on this question

1 Answer

3 weeks, 3 days ago.

Hi Myeee,

The LCD is white means it is powered, but the first line in main loop will set the background to black. There are some troubleshootings I think you can keep debugging. 1. Re-confirm the pins are connected correctly. 2. Use LA to monitor the SPI and TFT_CS signal and check if it's correct. 3. Check if those code lines in main loop are really executed.

Thanks, Desmond


You need to log in to post a question