White screen of death

Hello everyone!!

I have some problem with dislay lcd tft connected with arduino. The display work fine for a like 2-3 minute and after this the screen become completly white. The touch behind this works and the program still works too, only the screen become white. Infact if you try to watch the screen on side you will see the drawed things in in transparency.

The display is a chinese display with an unreadble name but it mount this controller:

SSD 1963ql9 au352af

Can someone help me??

PLEASE avoid answers like change display or something because they don't contribute to forum and it is not a solution because already know this thing too

Thanks :grin:

Ok i'm continuing the test on my display an i found an interesting thing:

if i make run the lcdInit() command (using UTFT.h of Electronics - Henning Karlsen) the display recover from the WSOD (white screen of death lol). Then i've noticed in my sketch there is some drawing in a very fast cycle so this is what i'm thinking about:

I think that if i print to much on the screen some how the controller save in his memory the object till he go overflow. So if i refresh to zero the screen with the lcdInit() the internal memory clear itself and he restart to work fine.

I'm very interesting to discuss with someone about that infact i've seen tha this controller is very diffused and maybe someone can stumble like me.

Bye guys!!

Without your code to examine, I daresay we will never know!

we would need to know the code you are working with and how you connected the screen to the arduino.
this can happen when there is a bad connection to the arduino (bad wire) or when the arduino restarts itself.
you can recreate this situation if you disconnect and reconnect the screen while the code is running.

Hey then the sketch is damn long, like 15 tabs with around 300 line in average, so i will make for you a summary of the point:

int f0t1()     //controlla ed eventualmente esegue il passaggio di stato tra 0 e 1
{
  if (digitalRead(pinInterface[fotocellula]) == HIGH)
  { countdown++;
    refreshScreen--;
    pieces_per_hour = int(3600000 /  ( millis()-t));    //calcolo del pezzi ora istantaneo (non sarà quello reale della sessione in quanto è soggetto a perturbaizioni ma rappresenta la prospettiva che si avrà)
    t = millis();
    if (pieces_per_hour > 0)
  {
    myGLCD.setColor(0, 0, 0);
    myGLCD.fillRoundRect(30, 130, 260, 150);
    myGLCD.setColor(255, 255, 255);
    myGLCD.printNumI(pieces_per_hour, 100, 130);
  }
    if ((unsigned long)(millis() - cooldown) > (unsigned long)(timer * 60000) && en_timer) timeToStop=true;
    return 1;
  }
  return 0;
}

int f1t2() //controlla ed eventualmente esegue il passaggio di stato tra 1 e 2
{
  if (var_time == 0)
  {
    var_time = millis();
  }
  else
  {
    if ((unsigned long)(millis() - var_time) > USCITA)
    { var_time = 0;
      return 2;
    }
  }
  return 1;
}


int f2t3() //controlla ed eventualmente esegue il passaggio di stato tra 2 e 3
{
  if (digitalRead(pinInterface[camma_palette]) == LOW)
  {
    return 3;
  }
  return 2;
}


int f3t4()  //controlla ed eventualmente esegue il passaggio di stato tra 3 e 4
{
  if (digitalRead(pinInterface[camma_palette]) == HIGH)
  {
    return 4;
  }
  return 3;
}

int f4t0()  //controlla ed eventualmente esegue il passaggio di stato tra 4 e 5
{
  if (var_time == 0)
  {
    var_time = millis();
  }
  else
  {
    if ((unsigned long)(millis() - var_time) > RITARDO_AGO)
    { var_time = 0;
      return 0;
    }
  }
  return 4;
}






















bool controlli_touch()
{
  if((unsigned long)(millis()-refreshScreen)>10000)
  {
  refreshScreen=millis();
  myGLCD.InitLCD();
  myGLCD.setFont(BigFont);
  myGLCD.clrScr();
  myGLCD.setColor(253, 133, 38);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.drawRect(10, 10, 270, 80);
  myGLCD.drawRect(10, 90, 270, 170);
  myGLCD.setColor(255, 255, 255);
  myGLCD.fillRoundRect(10, 180, 157, 262);
  myGLCD.fillRoundRect(167, 180, 320, 262);
  myGLCD.fillRoundRect(350, 212, 460, 262);
  myGLCD.fillRoundRect(350, 112, 460, 162);
  myGLCD.setFont(BigFont);
  en_timer = fm.read(9);                                    //carica i timer e i contatori di arresto automatico
  en_contatore = fm.read(10);
  timer = (int((fm.read(11)) << 8) & 0xff00) | (fm.read(12));
  contatore = (int((fm.read(13)) << 8) & 0xff00) | (fm.read(14));
  if (en_timer)
  { myGLCD.print(dizionario[language + 4], 275, 10); //"timer attivo"
    myGLCD.printNumI(timer, 325, 28);
  }
  if (en_contatore)
  {
    myGLCD.printNumI(contatore, 325, 68);
    myGLCD.print(dizionario[language + 5], 275, 50); //"contatore attivo"
  }
  myGLCD.print(dizionario[language + 6], 12, 12); //"velocità motore"
  myGLCD.print(dizionario[language + 7], 12, 92); //"pezzi/ora"
  myGLCD.setColor(0, 0, 0);
  myGLCD.setBackColor(255, 255, 255);
  myGLCD.print(dizionario[language + 8], 32, 210); //"pausa"
  myGLCD.print(dizionario[language + 9], 195, 210); //"stop"
  myGLCD.setColor(0, 0, 0);
  myGLCD.fillRect(404, 117, 410, 157); //disgno icone +/-
  myGLCD.fillRect(382, 134, 432, 139);
  myGLCD.fillRect(382, 235, 432, 241);
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.printNumI(spd0, 390, 175);
  myGLCD.printNumI(pieces_per_hour, 100, 130);
  //myGLCD.printNumI(spd1, 420, 140);
  myGLCD.print(dizionario[language + 10], 275, 90); //"motore nastro"
  }
  
  
  
  
  
  if (countdown > contatore - 1 && en_contatore)        //controllo di stop dovuto al raggiungimento della quota produttiva 
   {
 //code here
 return true;
  }
  if (button(167, 180, 320, 262, 255, 255, 255) == true)   //controllo del pulsante di arresto
  {
    //code here
    return true;
  }
  if (button(10, 180, 157, 262, 255, 255, 255) == true)   //controllo del pulsante di pausa
  {
   //code here
  }
  if (buttonTastierino(350, 112, 460, 162, 255, 255, 255) == true && spd0 < 10) //aumento velocità del motore nastro
  {
    //code here
  }
  if (buttonTastierino(350, 212, 460, 262, 255, 255, 255) == true && spd0 > 2) //riduzione della velocità del motore nastro
  {
    //code here
  }
  return false;
}




void ciclo_lavoro()
{ int s = 0;
  digitalWrite(pinInterface[en_nastro], LOW);
  while (!controlli_touch())
  {
    analogWrite(pinInterface[motore_nastro], gear[spd0-1]);     //movimento nastro
    switch (s)
    {
      case 0:

        //digitalWrite(pinInterface[solo_farcitura], HIGH); //esegue la farcitura            ||(K)<----||-->[]<
        s = f0t1();
        break;
      case 1:
        digitalWrite(pinInterface[pompa_farcitura], HIGH);     //estrae l'ago dal krapfen e arma la farcitura  ||(K)  
        s = f1t2();
        break;
      case 2:
        //digitalWrite(pinInterface[solo_farcitura], LOW); //arma la farcitura 
        digitalWrite(pinInterface[en_palette], LOW);        
        analogWrite(pinInterface[motore_palette], gear[spd1-1]); //muove le palette
        s = f2t3();
        break;
      case 3:
        digitalWrite(pinInterface[en_palette], LOW);  
        s = f3t4();
        break;
      case 4:
        digitalWrite(pinInterface[en_palette], HIGH);
        delay(ENTRATA);  //RITARDO D'ENTRATA
        analogWrite(pinInterface[motore_palette], 255);
        digitalWrite(pinInterface[pompa_farcitura], LOW);  //spinge l'ago nel prodotto e farcisce        
        s = f4t0();
        break;
    }
  }
}

The point is that when it run the case 2 and 3 for some times the screen become white.
Sorry if some keyword are in italian.

The top 4-5 methods is for checking the state changes (variable “s”).
void ciclo_lavoro() is the fuction that do the things (states machine model)
controlli_touch() draw and control all the things you see in the display

Dunno if this can help you understand but if you have more question, tell me.