ESP32 MONITOR ILI9486 RPI SPI TOUCH - DISPLAY RIMANE BIANCO

Salve sono bolzar

innanzi tutto ciao a tutti e spero di aver azzeccato la sezione corretta.

inizio con la mia problematica:
SCHEDE

  1. esp32
  2. display ili9486 modulo rpi

PROBLEMA
Il monitor non non va mentre il touch funziona perfettamente .
dopo aver collegato il monitor con modalita SPI elenco dei pin esp 32

#define LCD_CS 5
#define LCD_DC 2
#define LCD_RST 15 // 255 = unused, connect to 3.3V

#define TCH_CS 4
#define TCH_IRQ 34

#define SPI_MOSI 23
#define SPI_SCLK 18
#define SPI_MISO 19

#define TFT_BACKLIGHT_PIN 255

allego foto esp32 e display

il dipslay si accende ma rimane bianco ed l massimo diventa grigio

penso che sia un problema di configurazione ma non riesco a capire dove

Ho veramente cercato dappertutto prima di scrivere qui

ho usato le libreire :
utft ****************************************************************************

#include <UTFT.h>
#include <SPI.h> // not necessary if Arduino IDE version >=1.6.6



#if defined ARDUINO_ESP32_DEV

    #define LCD_CS    5
    #define LCD_DC    2
    #define LCD_RST   22 // 255 = unused, connect to 3.3V
    
    #define TCH_CS    4
    #define TCH_IRQ   34

    #define SPI_MOSI  23
    #define SPI_SCLK  18
    #define SPI_MISO  19
    
    #define TFT_BACKLIGHT_PIN   255 /* -via transistor- */
    #define BOARD "ARDUINO_ESP32_DEV"
#elif
    #define BOARD "NO DEVICE"


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

// Modify the line below to match your display and wiring:
UTFT myGLCD ( CTE35IPS, SPI_MOSI,SPI_SCLK,  LCD_CS, LCD_RST, LCD_DC );
//UTFT(byte model, int RS sda, int WR scl , int CS, int RST, rs int SER=0);

void setup (  ) {
    Serial.begin(115200);
    Serial.println("avvio");
    Serial.println(BOARD);
    // Just get some random numbers
    randomSeed ( analogRead ( 0 ) );

    // Setup the LCD
    myGLCD.InitLCD (  );
    myGLCD.setFont ( SmallFont );
   
    myGLCD.setColor ( 255, 0, 0 );
    myGLCD.fillRect ( 0, 0, 319, 13 );
    delay(5000);
    Serial.println("fine avvio");
}

void loop (  ) {
    int buf[318];
    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, 319, 13 );
    myGLCD.setColor ( 64, 64, 64 );
    myGLCD.fillRect ( 0, 226, 319, 239 );
    myGLCD.setColor ( 255, 255, 255 );
    myGLCD.setBackColor ( 255, 0, 0 );
    myGLCD.print ( String("* Universal Color TFT Display Library *"), CENTER, 1 );
    myGLCD.setBackColor ( 64, 64, 64 );
    myGLCD.setColor ( 255, 255, 0 );
    myGLCD.print ( String("<http://www.RinkyDinkElectronics.com/>"), CENTER, 227 );

    myGLCD.setColor ( 0, 0, 255 );
    myGLCD.drawRect ( 0, 14, 319, 225 );

    // Draw crosshairs
    myGLCD.setColor ( 0, 0, 255 );
    myGLCD.setBackColor ( 0, 0, 0 );
    myGLCD.drawLine ( 159, 15, 159, 224 );
    myGLCD.drawLine ( 1, 119, 318, 119 );
}

Buongiorno,
prima di tutto ti segnalo che, nella sezione in lingua Inglese, si può scrivere SOLO in Inglese ... quindi, per favore, la prossima volta presta più attenzione in quale sezione metti i tuoi post ...

... poi, essendo il tuo primo post nella sezione Italiana del forum, nel rispetto del regolamento di detta sezione (… punto 13, primo capoverso), ti chiedo cortesemente di presentarti IN QUESTO THREAD (spiegando bene quali conoscenze hai di elettronica e di programmazione ... possibilmente evitando di scrivere solo una riga di saluto) e di leggere con molta attenzione tutto il su citato REGOLAMENTO ...

... infine, in conformità al suddetto regolamento, punto 7, devi editare il tuo post qui sopra (quindi NON scrivendo un nuovo post, ma utilizzando il bottone More -> Modify che si trova in basso a destra del tuo post) e racchiudere il codice all'interno dei tag CODE (... sono quelli che in edit inserisce il bottone con icona fatta così: </>, tutto a sinistra).

In pratica, tutto il tuo codice dovrà trovarsi racchiuso tra due tag: [code] _il _tuo_ codice_ [/code] così da non venire interpretato e non dare adito alla formazione di caratteri indesiderati o cattiva formattazione del testo. Grazie.

Guglielmo

P.S.: Ti ricordo che, purtroppo, fino a quando non sarà fatta la presentazione nell’apposito thread e sistemato il codice come da regolamento, nessuno ti potrà rispondere, quindi ti consiglio di fare il tutto al più presto. :wink:

Aggiungo questo post perche il primo era troppo lungo quindi questo e il proseguo de primo post

in questo inoltre ho inserito una sezione che interroga il dipslay ed ho risposte !!!!!

ma display rimane bianco gtigio
Waveshare_ILI9486-master2 ********************************************************

#include "Arduino.h"

#include <GFXcanvas16T.h>
#include <ILI9486_SPI.h>
#include <test_canvas.h>

#include <SPI.h>



#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF


#if defined ARDUINO_ESP32_DEV


    #define LCD_CS    22
    #define LCD_DC    21
    #define LCD_RST   4 // 255 = unused, connect to 3.3V
    
    #define TCH_CS    5
    #define TCH_IRQ   34

    #define SPI_MOSI  23
    #define SPI_SCLK  18
    #define SPI_MISO  19
    
    #define TFT_BACKLIGHT_PIN   255 /* -via transistor- */
    #define BOARD "ARDUINO_ESP32_DEV"
    
    ILI9486_SPI tft(/*CS=10 oppure ss default pin cs*/LCD_CS , /*DC=*/ LCD_DC, /*RST=*/ LCD_RST);
    

#elif

    #define BOARD "NO DEVICE"
#endif

#define LED_BUILTIN 2 



void init_pin(){
  /*pinMode(LCD_RST,OUTPUT);
  digitalWrite(LCD_RST,HIGH);
  pinMode(LCD_CS,OUTPUT);
  digitalWrite(LCD_CS,HIGH);
  pinMode(TCH_CS,OUTPUT);
  digitalWrite(TCH_CS,HIGH);
  */
  pinMode (LED_BUILTIN, OUTPUT);
}


void led_blink(int LED = 2, int time_blink =1000){
    digitalWrite(LED, HIGH);
    delay(time_blink);
    digitalWrite(LED, LOW);
    delay(time_blink);
}
void diag_reg(const __FlashStringHelper *name, uint8_t reg, uint8_t n)
{
    uint8_t x = reg;
    Serial.print(name);
    Serial.print(" (0x");
    Serial.print(x < 0x10 ? "0" : "");
    Serial.print(x, HEX);
    Serial.print("):");
    SPI.transfer(reg);
    for (int i = 0; i < n; i++) {
        uint8_t x = SPI.transfer( i);
        Serial.print(x < 0x10 ? " 0" : " ");
        Serial.print(x, HEX);
    }
    Serial.println("");
}

void diag_show(void)
{
    diag_reg(F("ILI9488_RDDID                     "), 0x04, 5);
    diag_reg(F("ILI9488_RDIMGFMT                  "), 0x0A, 1);
    diag_reg(F("ILI9488_RDMADCTL                  "), 0x0B, 1);
    diag_reg(F("ILI9488_RDPIXFMT                  "), 0x0C, 1);
    diag_reg(F("ILI9488_RDSELFDIAG                "), 0x0F, 1);
    diag_reg(F("ILI9488_DFUNCTR                   "), 0xb6, 5);
    diag_reg(F("ILI9488_PWCTR1                    "), 0xC0, 3);
    diag_reg(F("ILI9488_VMCTR1                    "), 0xC5, 3);
    diag_reg(F("ILI9488_VMCTR2                    "), 0xC7, 2);
    diag_reg(F("NVM Status                        "), 0xD2, 3);
    diag_reg(F("ID4                               "), 0xD3, 4);
    diag_reg(F("ILI9488_RDID1                     "), 0xDA, 2);
    diag_reg(F("ILI9488_RDID2                     "), 0xDB, 2);
    diag_reg(F("ILI9488_RDID3                     "), 0xDC, 2);
    diag_reg(F("PGAMCTRL(Positive Gamma Control)  "), 0xE0, 16);
    diag_reg(F("NGAMCTRL(Negative Gamma Correction)"), 0xE1, 16);
    diag_reg(F("INTERFACE                         "), 0xf6, 4);
    diag_reg(F("Read Display Brightness Value     "), 0x52, 2);
    diag_reg(F("Read Display Pixel Format         "), 0x0C, 2);
    diag_reg(F("Read display identification info  "), 0x04, 4);
    diag_reg(F("Read display identification info  "), 0xD3, 4);
    diag_reg(F("Read Number of the Errors on DSI  "), 0x05, 4);
    diag_reg(F("Read Display Self-Diagnostic Result  "), 0x0F, 4);
}


void setup() {
  init_pin();
  Serial.begin(115200);
  SPI.begin(SPI_SCLK ,SPI_MISO,SPI_MOSI,LCD_CS);
  
  tft.writeLine(0,0,100,300,RED);
  Serial.print("tft.height ()   ");
  Serial.println(String(tft.height ()));
  Serial.print("tft.width ()   ");
  Serial.println(String(tft.width ()));
  
  diag_show();
  
}

void loop() {
  led_blink(LED_BUILTIN);
  
}

tft_espi (allego file di configurane )****************************************************

#include <TFT_eSPI.h> // Graphics and font library for ILI9341 driver chip
#include <SPI.h>

#define TFT_GREY 0x5AEB // New colour

TFT_eSPI tft = TFT_eSPI();  // Invoke library


void setup(void) {
  Serial.begin(115200);
  Serial.println("Start");
  tft.init();
  
  tft.setRotation(2);
}

void loop() {
  
  // Fill screen with grey so we can see the effect of printing with and without 
  // a background colour defined
  tft.fillScreen(TFT_BLACK);
  Serial.println("tft.fillScreen(TFT_BLACK);");
  // Set "cursor" at top left corner of display (0,0) and select font 2
  // (cursor will move to next line automatically during printing with 'tft.println'
  //  or stay on the line is there is room for the text with tft.print)
  tft.setCursor(0, 0, 2);
  // Set the font colour to be white with a black background, set text size multiplier to 1
  tft.setTextColor(TFT_YELLOW,TFT_BLACK);  
  tft.setTextSize(1);
  // We can now plot text on screen using the "print" class
  tft.println("Hello World!");
  
  // Set the font colour to be yellow with no background, set to font 7
  tft.setTextColor(TFT_YELLOW); tft.setTextFont(7);
  tft.println(1234.56);
  
  // Set the font colour to be red with black background, set to font 4
  tft.setTextColor(TFT_RED,TFT_BLACK);    tft.setTextFont(4);
  //tft.println(3735928559L, HEX); // Should print DEADBEEF

  // Set the font colour to be green with black background, set to font 4
  tft.setTextColor(TFT_GREEN,TFT_BLACK);
  tft.setTextFont(4);
  tft.println("Groop");
  tft.println("I implore thee,");

  // Change to font 2
  tft.setTextFont(2);
  tft.println("my foonting turlingdromes.");
  tft.println("And hooptiously drangle me");
  tft.println("with crinkly bindlewurdles,");
  // This next line is deliberately made too long for the display width to test
  // automatic text wrapping onto the next line
  tft.println("Or I will rend thee in the gobberwarts with my blurglecruncheon, see if I don't!");
  
  // Test some print formatting functions
  float fnumber = 123.45;
   // Set the font colour to be blue with no background, set to font 4
  tft.setTextColor(TFT_BLUE);    tft.setTextFont(4);
  tft.print("Float = "); tft.println(fnumber);           // Print floating point number
  tft.print("Binary = "); tft.println((int)fnumber, BIN); // Print as integer value in binary
  tft.print("Hexadecimal = "); tft.println((int)fnumber, HEX); // Print as integer number in Hexadecimal
  delay(10000);
}

ili9386***************************************************************************

<XPT2046_Touchscreen.h> **********************************************************
+cod
ILI9341Test_002

allego codice

#include <XPT2046_Touchscreen.h>
#include <SPI.h>


#if defined ARDUINO_ESP32_DEV

    #define LCD_CS    15
    #define LCD_DC    2
    #define LCD_RST   4 // 255 = unused, connect to 3.3V
    
    #define TCH_CS    22
    #define TCH_IRQ   34

    #define SPI_MOSI  23
    #define SPI_SCLK  18
    #define SPI_MISO  19
    
    #define TFT_BACKLIGHT_PIN   255 /* -via transistor- */
    #define BOARD "ARDUINO_ESP32_DEV"
#elif
    #define BOARD "NO DEVICE"
#endif

XPT2046_Touchscreen ts(TCH_CS, TCH_IRQ);

void setup() {
  pinMode(LCD_RST,OUTPUT);
  digitalWrite(LCD_RST,HIGH);
  
  pinMode(TCH_CS,OUTPUT);
  pinMode(LCD_CS,OUTPUT);

  
  Serial.begin(115200);
  ts.begin();
  while (!Serial && (millis() <= 1000));
  Serial.print(BOARD);
  SPI.begin(SPI_SCLK,SPI_MISO,SPI_MOSI);
}

void loop() {
  TS_Point p = ts.getPoint();
  
  if (ts.touched()) {
    Serial.print("Pressure = ");
    Serial.println(p.z);
    Serial.print(", x = ");
    Serial.println(p.x);
    Serial.print(", y = ");
    Serial.println(p.y);
  }
}