[SOLVED] ISSUE! 5in TFT SSD1963 Random vertical/horizontal lines with DUE

I can't find anything on that subject on the forum so i'm asking for help.

Is there anyone having a similar issue and found a solution?

My 5in tft screen looks like that when I upload some demo code (3 different versions)
Chipset is ssd1963 and i'm using an arduino DUE, without additional shield (screen is connected directly to the arduino via integrated shield

I used the code's reqmt to match the pins on the arduino with custom pins at digital 38 thru 41.

Thanks :slight_smile:

What code are you referring to when you say "I used the code's reqmt"? Please paste it (the code) into a reply using "code" tags so that we may see what you're doing (or trying to do). See the sticky note at the top of the forum posts for "how to use this forum" for help on posting.

Also, we need a schematic of how the lcd is connected to the Due.

Also worth mentioning to use additional power supply, don't just rely on USB power. I Have the 5" CPLD version and it needs additional power.

Regards,

Graham

Ops, I failed to notice the 'integrated shield' comment....... That sounds ominous.... avr_fred is correct, we need to know more, such as post a link to where you got the display from.

G

Edit: The 40 way ribbon cable in the shot, would make me think no integrated shield.......... or some other hocus pocus between due and display.

Bought the display off eBay. the guy told me it was a Sainsmart display.

ghlawrence2000:
Also worth mentioning to use additional power supply, don't just rely on USB power. I Have the 5" CPLD version and it needs additional power.

I did tried with a USB Hub power supply(50W).. did the same thing

Some relevant comments in the code such as pinout:

// UTFT_Demo_800x480 (C)2013 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program is a demo of how to use most of the functions
// of the library with a supported display modules.
//
// This demo was made for modules with a screen resolution 
// of 800x480 pixels.
//
// This program requires the UTFT library.
//

#include <UTFT.h>

// Declare which fonts we will be using
extern uint8_t SmallFont[];

UTFT myGLCD(ITDB50,38,39,40,41);   // Remember to change the model parameter to suit your display module!
  /*
  Tried TFT01_50 & CTE50 as well which are in the list of supported controllers
  Actual pin setup is
  DB0 THRU DB7 TO D37 THRU D30
  DB8 TO DB15 TO D22 THRU D29
  RS TO D38
  WR TO D39
  RD TO 3.3V
  CS TO D40
  RSET TO D41
  LED_A TO 5V
  VCC TO 5V
  GRND TO GRND  
  */
void setup()
{
  randomSeed(analogRead(0));
  
// Setup the LCD
  myGLCD.InitLCD();
  myGLCD.setFont(SmallFont);
}

void loop()
{
  int buf[798];
  int x, x2;
  int y, y2;
  int r;

// Clear the screen and draw the frame
  myGLCD.clrScr();

  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRect(0, 0, 799, 13);
  myGLCD.setColor(64, 64, 64);
  myGLCD.fillRect(0, 466, 799, 479);
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.print("* Universal Color TFT Display Library *", CENTER, 1);
  myGLCD.setBackColor(64, 64, 64);
  myGLCD.setColor(255,255,0);
  myGLCD.print("<http://electronics.henningkarlsen.com>", CENTER, 467);

  myGLCD.setColor(0, 0, 255);
  myGLCD.drawRect(0, 14, 799, 465);

// Draw crosshairs
  myGLCD.setColor(0, 0, 255);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.drawLine(399, 15, 399, 464);
  myGLCD.drawLine(1, 239, 798, 239);
  for (int i=9; i<790; i+=10)
    myGLCD.drawLine(i, 237, i, 242);
  for (int i=19; i<470; i+=10)
    myGLCD.drawLine(397, i, 402, i);

// Draw sin-, cos- and tan-lines  
  myGLCD.setColor(0,255,255);
  myGLCD.print("Sin", 5, 15);
  for (int i=1; i<798; i++)
  {
    myGLCD.drawPixel(i,239+(sin(((i*1.13)*3.14)/180)*200));
  }
  
  myGLCD.setColor(255,0,0);
  myGLCD.print("Cos", 5, 27);
  for (int i=1; i<798; i++)
  {
    myGLCD.drawPixel(i,239+(cos(((i*1.13)*3.14)/180)*200));
  }

  myGLCD.setColor(255,255,0);
  myGLCD.print("Tan", 5, 39);
  for (int i=1; i<798; i++)
  {
    myGLCD.drawPixel(i,239+(tan(((i*0.9)*3.14)/180)));
  }

  delay(2000);

  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,798,464);
  myGLCD.setColor(0, 0, 255);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.drawLine(399, 15, 399, 464);
  myGLCD.drawLine(1, 239, 798, 239);

// Draw a moving sinewave
  x=1;
  for (int i=1; i<(798*20); i++) 
  {
    x++;
    if (x==799)
      x=1;
    if (i>799)
    {
      if ((x==399)||(buf[x-1]==239))
        myGLCD.setColor(0,0,255);
      else
        myGLCD.setColor(0,0,0);
      myGLCD.drawPixel(x,buf[x-1]);
    }
    myGLCD.setColor(0,255,255);
    y=239+(sin(((i*1.65)*3.14)/180)*(200-(i / 100)));
    myGLCD.drawPixel(x,y);
    buf[x-1]=y;
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,798,464);

// Draw some random filled rectangles
  for (int i=0; i<50; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(746);
    y=16+random(397);
    x2=x+50;
    y2=y+50;
    myGLCD.fillRect(x, y, x2, y2);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,798,464);

// Draw some random filled, rounded rectangles
  for (int i=0; i<50; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(746);
    y=16+random(397);
    x2=x+50;
    y2=y+50;
    myGLCD.fillRoundRect(x, y, x2, y2);
  }
  
  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,798,464);

// Draw some random filled circles
  for (int i=0; i<50; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=27+random(746);
    y=41+random(397);
    myGLCD.fillCircle(x, y, 25);
  }
  
  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,798,464);

// Draw some lines in a pattern
  myGLCD.setColor (255,0,0);
  for (int i=15; i<463; i+=5)
  {
    myGLCD.drawLine(1, i, (i*1.66)-10, 463);
  }
  myGLCD.setColor (255,0,0);
  for (int i=463; i>15; i-=5)
  {
    myGLCD.drawLine(798, i, (i*1.66)+30, 15);
  }
  myGLCD.setColor (0,255,255);
  for (int i=463; i>15; i-=5)
  {
    myGLCD.drawLine(1, i, 770-(i*1.66), 15);
  }
  myGLCD.setColor (0,255,255);
  for (int i=15; i<463; i+=5)
  {
    myGLCD.drawLine(798, i, 810-(i*1.66), 463);
  }
  
  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,798,464);

// Draw some random circles
  for (int i=0; i<250; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=32+random(736);
    y=45+random(386);
    r=random(30);
    myGLCD.drawCircle(x, y, r);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,798,464);

// Draw some random rectangles
  for (int i=0; i<250; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(796);
    y=16+random(447);
    x2=2+random(796);
    y2=16+random(447);
    myGLCD.drawRect(x, y, x2, y2);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,798,464);

// Draw some random rounded rectangles
  for (int i=0; i<250; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(796);
    y=16+random(447);
    x2=2+random(796);
    y2=16+random(447);
    myGLCD.drawRoundRect(x, y, x2, y2);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,798,464);

  for (int i=0; i<250; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(796);
    y=16+random(447);
    x2=2+random(796);
    y2=16+random(447);
    myGLCD.drawLine(x, y, x2, y2);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,798,464);

  for (int i=0; i<10000; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    myGLCD.drawPixel(2+random(796), 16+random(447));
  }

  delay(2000);

  myGLCD.fillScr(0, 0, 255);
  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRoundRect(320, 190, 479, 289);
  
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.print("That's it!", CENTER, 213);
  myGLCD.print("Restarting in a", CENTER, 239);
  myGLCD.print("few seconds...", CENTER, 252);
  
  myGLCD.setColor(0, 255, 0);
  myGLCD.setBackColor(0, 0, 255);
  myGLCD.print("Runtime: (msecs)", CENTER, 450);
  myGLCD.printNumI(millis(), CENTER, 465);
  
  delay (10000);
}

Without a schematic of how you've wired the display to the Due, it is impossible to help you.

avr_fred:
Without a schematic of how you've wired the display to the Due, it is impossible to help you.

Thanks Fred,
You probably didn't notice but I wrote it as a comment in my code.

Here's for you

buzzben:
/*
Tried TFT01_50 & CTE50 as well which are in the list of supported controllers
Actual pin setup is
DB0 THRU DB7 TO D37 THRU D30
DB8 TO DB15 TO D22 THRU D29
RS TO D38
WR TO D39
RD TO 3.3V
CS TO D40
RSET TO D41
LED_A TO 5V
VCC TO 5V
GRND TO GRND
*/

I hate to break it to you, but you might have damaged something.........

buzzben:
/*
Tried TFT01_50 & CTE50 as well which are in the list of supported controllers
Actual pin setup is
DB0 THRU DB7 TO D37 THRU D30
DB8 TO DB15 TO D22 THRU D29
RS TO D38
WR TO D39
RD TO 3.3V
CS TO D40
RSET TO D41
LED_A TO 5V <-------------------- !!!!
VCC TO 5V <-------------------- !!!!
GRND TO GRND
*/

NO!!! NO!!!! NO!!!!! and just for emphasis NO!!!!!!!

Having spent approx £40 on the display, approx £20-40 on the DUE, why the h*ll didn't you spend £10 on the shield?

Right, so lets do this the way it SHOULD have been done and hope you didn't already fry something.

CTE TFT/SD shield for arduino DUE
coldtears electronics
http://www.coldtears.com/electronics

This shield is created for arduino DUE, which fit two types of LCD:

  1. 40pin version LCD which is commonly used in previous version of TFT Mega shield for Arduino MEGA 2560
  2. 32pin version LCD which is commonly used in STM32 development board.

To use with UTFT library:

1.uncomment "#define CTE_DUE_SHIELD 1" in the HW_ARM_defines.h in the \hardware\arm folder of the UTFT library

2.Change the pinout to : UTFT myGLCD(CTE50,25,26,27,28);


Shipping default jumper configuration:

The TFT/SD Shield for arduino DUE is shipped with the following jumper config, if you use TFT modules in our store, you do not need to reconfig the jumpers.

LCD Vcc - 3.3V (JP2 shorted) <==========!!!!!!!!!!
LCD backlight (LEDA+) - 3.3V (JP4 shorted) <==========!!!!!!!!!!


More interesting products are avaliable in
Coldtears electronics Ebay store and
http://www.coldtears.com/electronics
coldtearselectronics@gmail.com

I have removed all references to SD/Flash/Touch since you are wiring this manually, this should be enough to prove your display does/does not work. Notice the instructions and pin allocations for CTE wiring!!!! (CTE50,25,26,27,28) !! AND uncomment "#define CTE_DUE_SHIELD 1" in the HW_ARM_defines.h in the \hardware\arm folder of the UTFT library.

If you have damaged your display by using 5v it will have been a very expensive exercise!! Good luck.

Regards,

Graham

Graham, Thanks a lot for your reply!

At first I tried everything connected to the 3.3V but the screen seems very dim. I saw some post here saying it was ok to plug it to the 5V (can't recall which post tho..) so this is what I did.. didn't changes anything to me.. but, fortunately it didn't damage the TFT or any of it's components.. I guess i'm lucky on this one!! :smiley:

My problem was in the HW_ARM_define.h
The example I had came with CTE_DUE_SHIELD 1 configuration already uncommented. Therefore, the connection reqmts in the main PDF file were waived and the connection I made were incorrect.

I did exactly how you posted In the JPG but I still experienced some random behavior on the screen.. 1/3rd of the screen updated but didn't clean out and pictorially, the forms were incomplete..

This happened because (As the picture shown) there isn't supposed to be a 10K ohms resistor on the RD connection..
Once I removed that resistor, everything works like a charm!!!

Thanks again for your support!

buzzben:
This happened because (As the picture shown) there isn't supposed to be a 10K ohms resistor on the RD connection..
Once I removed that resistor, everything works like a charm!!!

Curious, I have an actual CTE shield, not the Sainsmart rip off of a CTE shield, and my shield has the 10k resistor, and my display works as it should. But so long as it is working for you now, that's all that matters, glad your display is not damaged :grin:

Regards,

Graham