ESP32S3 and St7701s

Hello, I've been having issues getting my frist hello world code to run.
I am using the ESP32-S3-Mini-1 dev kit
with this display:

with the arduino GFX library :

my hello world code (modified from the examples included in the library)

#include <SPI.h>
#include <Arduino_GFX_Library.h>
#include <Adafruit_GFX.h>
#define GFX_BL 45 // default backlight pin, you may replace DF_GFX_BL to actual backlight pin

#if defined(DISPLAY_DEV_KIT)
Arduino_GFX *gfx = create_default_Arduino_GFX();
#else /* !defined(DISPLAY_DEV_KIT) */

/* More data bus class: https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class */
Arduino_ESP32RGBPanel *bus = new Arduino_ESP32RGBPanel(
  40 /* CS */, 48 /* SCK */, 47 /* SDA */,
  18 /* DE */, 17 /* VSYNC */, 42 /* HSYNC */, 21 /* PCLK */,
  4 /* R0 */, 3 /* R1 */, 2 /* R2 */, 1 /* R3 */, 0 /* R4 */,
  10 /* G0 */, 9 /* G1 */, 8 /* G2 */, 7 /* G3 */, 6 /* G4 */, 5 /* G5 */,
  41 /* B0 */, 14 /* B1 */, 13 /* B2 */, 12 /* B3 */, 11 /* B4 */
);

/* More display class: https://github.com/moononournation/Arduino_GFX/wiki/Display-Class */
Arduino_ST7701_RGBPanel *gfx = new Arduino_ST7701_RGBPanel(
  bus, GFX_NOT_DEFINED, 480 /* width */, 480 /* height */);
#endif /* !defined(DISPLAY_DEV_KIT) */
/*******************************************************************************
 * End of Arduino_GFX setting
 ******************************************************************************/

void setup(void)
{
    gfx->begin();
    gfx->fillScreen(BLACK);

#ifdef GFX_BL
    pinMode(GFX_BL, OUTPUT);
    digitalWrite(GFX_BL, HIGH);
#endif


    gfx->setCursor(100, 100);
    gfx->setTextColor(RED);
    gfx->println("Hello World!");

    delay(5000); // 5 seconds
}

void loop()
{
    gfx->setCursor(random(gfx->width()), random(gfx->height()));
    gfx->setTextColor(random(0xffff), random(0xffff));
    gfx->setTextSize(random(6) /* x scale */, random(6) /* y scale */, random(2) /* pixel_margin */);
    gfx->println("Hello World!");

    delay(1000); // 1 second
}

the Init code the manufacture sent me

#define SET_LSDA_LOW		    HAL_GPIO_WritePin(GPIOC,GPIO_PIN_0,GPIO_PIN_RESET)  
#define SET_LSDA_HIGH		    HAL_GPIO_WritePin(GPIOC,GPIO_PIN_0,GPIO_PIN_SET)
#define SET_LSCK_LOW		    HAL_GPIO_WritePin(GPIOC,GPIO_PIN_1,GPIO_PIN_RESET)   
#define SET_LSCK_HIGH		    HAL_GPIO_WritePin(GPIOC,GPIO_PIN_1,GPIO_PIN_SET)
#define SET_LSCE_LOW        HAL_GPIO_WritePin(GPIOC,GPIO_PIN_2,GPIO_PIN_RESET)
#define SET_LSCE_HIGH       HAL_GPIO_WritePin(GPIOC,GPIO_PIN_2,GPIO_PIN_SET)



void _bus->sendCommand(unsigned char)
{
	u8 i;
	SET_LSCE_LOW;
	delay(20);
	SET_LSDA_HIGH;	
	delay(100);	
	SET_LSCK_LOW;
	delay(100);
	SET_LSCK_HIGH;		
	for(i=0;i<8;i++)
	{ 
		delay(100);	
		SET_LSCK_LOW;
		if(DATA&0X80)
			SET_LSDA_HIGH;
		else
			SET_LSDA_LOW;
		DATA=DATA<<1;
		delay(100);
		SET_LSCK_HIGH;	
	}
	delay(50);
	SET_LSCK_LOW;
	delay(50);	
	SET_LSCE_HIGH;
}

void _bus->sendData(unsigned char)
{
	u8 i;
	SET_LSCE_LOW;
	delay(20);
	SET_LSDA_LOW;
	delay(100);	
	SET_LSCK_LOW;
	delay(100);
	SET_LSCK_HIGH;	
	for(i=0;i<8;i++)
	{ 
		delay(100);	
		SET_LSCK_LOW;
		if(DATA&0X80)
			SET_LSDA_HIGH;
		else
			SET_LSDA_LOW;
		DATA=DATA<<1;
		delay(100);
		SET_LSCK_HIGH;	
	}
	delay(50);
	SET_LSCK_LOW;
  delay(50);	
	SET_LSCE_HIGH;  
}

void _bus->sendData_Int(void);
{
  GPIO_InitTypeDef GPIO_InitStruct = {0};
	__HAL_RCC_GPIOC_CLK_ENABLE();
	GPIO_InitStruct.Pin=GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3;
	GPIO_InitStruct.Mode=GPIO_MODE_OUTPUT_PP;
	GPIO_InitStruct.Pull=GPIO_PULLUP;
	GPIO_InitStruct.Speed=GPIO_SPEED_FREQ_VERY_HIGH;
	HAL_GPIO_Init(GPIOC,&GPIO_InitStruct);
	HAL_GPIO_WritePin(GPIOC,GPIO_PIN_0,GPIO_PIN_SET);  
	HAL_GPIO_WritePin(GPIOC,GPIO_PIN_1,GPIO_PIN_RESET);
	HAL_GPIO_WritePin(GPIOC,GPIO_PIN_2,GPIO_PIN_SET);
	delay(200);
	HAL_GPIO_WritePin(GPIOC,GPIO_PIN_3,GPIO_PIN_SET);
	delay(10);
	HAL_GPIO_WritePin(GPIOC,GPIO_PIN_3,GPIO_PIN_RESET);
	delay(200);
	HAL_GPIO_WritePin(GPIOC,GPIO_PIN_3,GPIO_PIN_SET);
	delay(200);
  _bus->sendCommand(0xFF);
  _bus->sendData(0x77);
  _bus->sendData(0x01);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x10);

  _bus->sendCommand(0xC0);
  _bus->sendData(0x3B);
  _bus->sendData(0x00);

  _bus->sendCommand(0xC1);
  _bus->sendData(0x0B);
  _bus->sendData(0x02);

  _bus->sendCommand(0xC2);
  _bus->sendData(0x07);
  _bus->sendData(0x02);

  _bus->sendCommand(0xCC);
  _bus->sendData(0x10);

  _bus->sendCommand(0xCD);
  _bus->sendData(0x08);

  _bus->sendCommand(0xB0);
  _bus->sendData(0x00);
  _bus->sendData(0x11);
  _bus->sendData(0x16);
  _bus->sendData(0x0E);
  _bus->sendData(0x11);
  _bus->sendData(0x06);
  _bus->sendData(0x05);
  _bus->sendData(0x09);
  _bus->sendData(0x08);
  _bus->sendData(0x21);
  _bus->sendData(0x06);
  _bus->sendData(0x13);
  _bus->sendData(0x10);
  _bus->sendData(0x29);
  _bus->sendData(0x31);
  _bus->sendData(0x18);

  _bus->sendCommand(0xB1);
  _bus->sendData(0x00);
  _bus->sendData(0x11);
  _bus->sendData(0x16);
  _bus->sendData(0x0E);
  _bus->sendData(0x11);
  _bus->sendData(0x07);
  _bus->sendData(0x05);
  _bus->sendData(0x09);
  _bus->sendData(0x09);
  _bus->sendData(0x21);
  _bus->sendData(0x05);
  _bus->sendData(0x13);
  _bus->sendData(0x11);
  _bus->sendData(0x2A);
  _bus->sendData(0x31);
  _bus->sendData(0x18);

  _bus->sendCommand(0xFF);
  _bus->sendData(0x77);
  _bus->sendData(0x01);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x11);

  _bus->sendCommand(0xB0);
  _bus->sendData(0x6D);

  _bus->sendCommand(0xB1);
  _bus->sendData(0x37);

  _bus->sendCommand(0xB2);
  _bus->sendData(0x81);

  _bus->sendCommand(0xB3);
  _bus->sendData(0x80);

  _bus->sendCommand(0xB5);
  _bus->sendData(0x43);

  _bus->sendCommand(0xB7);
  _bus->sendData(0x85);

  _bus->sendCommand(0xB8);
  _bus->sendData(0x20);

  _bus->sendCommand(0xC1);
  _bus->sendData(0x78);

  _bus->sendCommand(0xC2);
  _bus->sendData(0x78);

  _bus->sendCommand(0xC3);
  _bus->sendData(0x8C);

  _bus->sendCommand(0xD0);
  _bus->sendData(0x88);

  _bus->sendCommand(0xE0);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x02);

  _bus->sendCommand(0xE1);
  _bus->sendData(0x03);
  _bus->sendData(0xA0);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x04);

  _bus->sendCommand(0xA0);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x20);
  _bus->sendData(0x20);

  _bus->sendCommand(0xE2);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);

  _bus->sendCommand(0xE3);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x11);
  _bus->sendData(0x00);

  _bus->sendCommand(0xE4);
  _bus->sendData(0x22);
  _bus->sendData(0x00);

  _bus->sendCommand(0xE5);
  _bus->sendData(0x05);
  _bus->sendData(0xEC);
  _bus->sendData(0xA0);
  _bus->sendData(0xA0);
  _bus->sendData(0x07);
  _bus->sendData(0xEE);
  _bus->sendData(0xA0);
  _bus->sendData(0xA0);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);

  _bus->sendCommand(0xE6);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x11);
  _bus->sendData(0x00);

  _bus->sendCommand(0xE7);
  _bus->sendData(0x22);
  _bus->sendData(0x00);

  _bus->sendCommand(0xE8);
  _bus->sendData(0x06);
  _bus->sendData(0xED);
  _bus->sendData(0xA0);
  _bus->sendData(0xA0);
  _bus->sendData(0x08);
  _bus->sendData(0xEF);
  _bus->sendData(0xA0);
  _bus->sendData(0xA0);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);

  _bus->sendCommand(0xEB);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x40);
  _bus->sendData(0x40);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);

  _bus->sendCommand(0xED);
  _bus->sendData(0xFF);
  _bus->sendData(0xFF);
  _bus->sendData(0xFF);
  _bus->sendData(0xBA);
  _bus->sendData(0x0A);
  _bus->sendData(0xBF);
  _bus->sendData(0x45);
  _bus->sendData(0xFF);
  _bus->sendData(0xFF);
  _bus->sendData(0x54);
  _bus->sendData(0xFB);
  _bus->sendData(0xA0);
  _bus->sendData(0xAB);
  _bus->sendData(0xFF);
  _bus->sendData(0xFF);

  _bus->sendCommand(0xEF);
  _bus->sendData(0x10);
  _bus->sendData(0x0D);
  _bus->sendData(0x04);
  _bus->sendData(0x08);
  _bus->sendData(0x3F);
  _bus->sendData(0x1F);

  _bus->sendCommand(0xFF);
  _bus->sendData(0x77);
  _bus->sendData(0x01);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x13);

  _bus->sendCommand(0xEF);
  _bus->sendData(0x08);

  _bus->sendCommand(0xFF);
  _bus->sendData(0x77);
  _bus->sendData(0x01);
  _bus->sendData(0x00);
  _bus->sendData(0x00);
  _bus->sendData(0x00);

  _bus->sendCommand(0x36);
  _bus->sendData(0x00);

  _bus->sendCommand(0x3A);
  _bus->sendData(0x66);
delay(50);	

  _bus->sendCommand(0x11);
delay(50);
  _bus->sendCommand(0x29);
}

I have double and triple checked my wiring while avoiding using UART pins.
I cant seem to get my display to do anything. When the backlight is connected to 3v3 it lights up but not if using pin 45 like stated in the code.

I have checked the board with other example sketches and have used two displays and still nothing.

I am not sure if i need to modify the library with my init code from the manufacture. im not sure if my rgb timing is off, or if theres something else im missing.
plz halp.
thanks in advance!

1 Like

I am not familiar with ESP32 Devkit.
But the HAL_GPIO_WritePin() calls look like STM32.

You should be able to bit-bang SPI on any GPIO pins on any 3V Arduino.

David.

so in that case I would modify my display .cpp file to include the the code to bit bang the correct pins in line with manf init code?

Thanks for your response david

It looks as if the Arduino_ESP32RGBPanel constructor takes VSYNC, RGB signals.
i.e. more GPIO than any self-respecting ESP32 can afford.

But the create_default_Arduino_GFX() probably uses some default pins.

You will just have to study the GitHub project.

Note that East Rising / BuyDisplay examples are normally for 3V 8051 or 3V STM32. (and generally a bit trivial)

I have never used that controller or display.
Perhaps Bodmer or Jean-Marc have tried it.

David.

Thats what ive been doing. the bodmer libray said they are not going to be working 4wire spi. I think im best off using this library and I chose the esp32s3 because thats the mcu the library said to use.
the display including touch controls comes out to 30 pins. my esp32s3 has 33 gpio (cutting it close lol) Im currently tying to for the library and get it working with the st7701s but Im not super expirienced with displays.. where would you start for getting this display working on this mcu?

I am just horrified by the sheer number of GPIO.
My experience is with 4-wire SPI, 3-wire SPI, 8080-8, 8080-16. Fine for graphics, static images, simple animations. Full motion video is another matter.

My advice is. Follow the GitHub project to the letter. i.e. same wiring, same code, ...

David.

yeah, its not going to be full motion video, mostly static photos with a few moving numbers and objects. Unfortunitly I have followed the tutorials and nothing has worked yet. im trying to get anything to display so im sure its some silly little issue . I messaged the maintainer but no pointers on things to try yet. Thats why I reached out here. Thanks for you awnsers and advice. I very much appreciate it.

Update-
it seems to be some issue with memory allocation with the esp chip its self ( probably something I did)

ESP-ROM:esp32s3-20210327
14:09:44.676 -> Build:Mar 27 2021
14:09:44.676 -> rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
14:09:44.676 -> SPIWP:0xee
14:09:44.676 -> mode:DIO, clock div:1
14:09:44.676 -> load:0x3fcd0108,len:0x43c
14:09:44.676 -> load:0x403b6000,len:0xbd0
14:09:44.676 -> load:0x403ba000,len:0x29c8
14:09:44.676 -> SHA-256 comparison failed:
14:09:44.714 -> Calculated: 27beaa143e4753b6cdeed5b388d3ebbf4c921ce01156fd10673139a323a25557
14:09:44.714 -> Expected: 6eb14ec480aff4f05e39378c41406102ac163573741e63b6cfd73509ef44e3bd
14:09:44.714 -> Attempting to boot anyway...
14:09:44.714 -> entry 0x403b61d8

Ive tried a few different partition setups but nothing has worked yet. any esp wizards know how i can fix the sha-256 comparison issue?

With these setting I get a different error :

upload mode: uart0/hardwarecdc
cpu freq : 80mhz
flash mode : qio 80mhz
flash size : 8MB (64mb)
partition scheme : 8M (3MB APP/ 1.5MB FAT)
PSRAM : QSPI PSRAM
arduino runs on : core 1
Events run on : core 1


ESP-ROM:esp32s3-20210327
12:02:03.616 -> Build:Mar 27 2021
12:02:03.616 -> rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
12:02:03.616 -> SPIWP:0xee
12:02:03.616 -> mode:DIO, clock div:1
12:02:03.616 -> load:0x3fcd0108,len:0x43c
12:02:03.616 -> load:0x403b6000,len:0xbd0
12:02:03.616 -> load:0x403ba000,len:0x29c8
12:02:03.616 -> SHA-256 comparison failed:
12:02:03.616 -> Calculated: 0bb45b01207a4a9e9fca8880ddfc0f79112bfa4d004bd1e6b2eaa75c5323b19d
12:02:03.616 -> Expected: 6eb14ec480aff4f05e39378c41406102ac163573741e63b6cfd73509ef44e3bd
12:02:03.616 -> Attempting to boot anyway...
12:02:03.616 -> entry 0x403b61d8
12:02:03.711 -> E (293) psram: PSRAM ID read error: 0x00ffffff
12:02:03.899 -> E (487) lcd_panel.rgb: esp_lcd_new_rgb_panel(138): no mem for frame buffer
12:02:03.899 -> ESP_ERROR_CHECK failed: esp_err_t 0x101 (ESP_ERR_NO_MEM) at 0x403795a4
12:02:03.899 -> file: "C:\Users\S Beyer\Documents\Arduino\libraries\Arduino_GFX-master\src\databus\Arduino_ESP32RGBPanel.cpp" line 185
12:02:03.899 -> func: uint16_t* Arduino_ESP32RGBPanel::getFrameBuffer(int16_t, int16_t)
12:02:03.899 -> expression: esp_lcd_new_rgb_panel(_panel_config, &_panel_handle)
12:02:03.899 -> 
12:02:03.899 -> abort() was called at PC 0x403795a7 on core 1
12:02:03.946 -> 
12:02:03.946 -> 
12:02:03.946 -> Backtrace:0x403769b2:0x3fce2da00x403795b1:0x3fce2dc0 0x4037ec91:0x3fce2de0 0x403795a7:0x3fce2e60 0x420021ce:0x3fce2e80 0x4200284f:0x3fce2eb0 0x420012c4:0x3fce2ed0 0x420034ae:0x3fce2ef0 


I GOT IT WORKING!!
Had to changed a few things in the display and data bus class.
board-
esp32-s3-c1 (wroom n8r8)
display -
480x480 round ips tft lcd with cpt (driver IC - st7701s)

//CHANGES to library
Arduino_ST7701_RGBPanel.h
lines 11&12

#define ST7701_TFTWIDTH 480
 #define ST7701_TFTHEIGHT 480

Arduino_ST7701_RGBPanel.cpp
lines 14-299

void Arduino_ST7701_RGBPanel::begin(int32_t speed)
{
_bus->begin(speed);

#if 1 
_bus->sendCommand(0xFF);
_bus->sendData(0x77);
_bus->sendData(0x01);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x10);

_bus->sendCommand(0xC0);
_bus->sendData(0x3B);
_bus->sendData(0x00);

_bus->sendCommand(0xC1);
_bus->sendData(0x0B); //VBP
_bus->sendData(0x02);

_bus->sendCommand(0xC2);
_bus->sendData(0x00);
_bus->sendData(0x02);

_bus->sendCommand(0xCC);
_bus->sendData(0x10);

_bus->sendCommand(0xCD);
_bus->sendData(0x08);

_bus->sendCommand ( 0xB0); //Positive Voltage Gamma Control
_bus->sendData ( 0x02);
_bus->sendData ( 0x13);
_bus->sendData ( 0x1B);
_bus->sendData ( 0x0D);
_bus->sendData ( 0x10);
_bus->sendData ( 0x05);
_bus->sendData ( 0x08);
_bus->sendData ( 0x07);
_bus->sendData ( 0x07);
_bus->sendData ( 0x24);
_bus->sendData ( 0x04);
_bus->sendData ( 0x11);
_bus->sendData ( 0x0E);
_bus->sendData ( 0x2C);
_bus->sendData ( 0x33);
_bus->sendData ( 0x1D);

_bus->sendCommand ( 0xB1); //Negative Voltage Gamma Control
_bus->sendData ( 0x05);
_bus->sendData ( 0x13);
_bus->sendData ( 0x1B);
_bus->sendData ( 0x0D);
_bus->sendData ( 0x11);
_bus->sendData ( 0x05);
_bus->sendData ( 0x08);
_bus->sendData ( 0x07);
_bus->sendData ( 0x07);
_bus->sendData ( 0x24);
_bus->sendData ( 0x04);
_bus->sendData ( 0x11);
_bus->sendData ( 0x0E);
_bus->sendData ( 0x2C);
_bus->sendData ( 0x33);
_bus->sendData ( 0x1D);

_bus->sendCommand(0xFF);
_bus->sendData(0x77);
_bus->sendData(0x01);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x11);

_bus->sendCommand(0xB0);
_bus->sendData(0x5d);//5d

_bus->sendCommand(0xB1); //VCOM amplitude setting
_bus->sendData(0x43); //43

_bus->sendCommand(0xB2); //VGH Voltage setting
_bus->sendData(0x81); //12V

_bus->sendCommand(0xB3);
_bus->sendData(0x80);

_bus->sendCommand(0xB5); //VGL Voltage setting
_bus->sendData(0x43); //-8.3V

_bus->sendCommand(0xB7);
_bus->sendData(0x85);

_bus->sendCommand(0xB8);
_bus->sendData(0x20);

_bus->sendCommand(0xC1);
_bus->sendData(0x78);

_bus->sendCommand(0xC2);
_bus->sendData(0x78);

_bus->sendCommand(0xD0);
_bus->sendData(0x88);

_bus->sendCommand(0xE0);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x02);

_bus->sendCommand(0xE1);
_bus->sendData(0x03);
_bus->sendData(0xA0);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x04);
_bus->sendData(0xA0);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x20);
_bus->sendData(0x20);

_bus->sendCommand(0xE2);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);

_bus->sendCommand(0xE3);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x11);
_bus->sendData(0x00);

_bus->sendCommand(0xE4);
_bus->sendData(0x22);
_bus->sendData(0x00);

_bus->sendCommand(0xE5);
_bus->sendData(0x05);
_bus->sendData(0xEC);
_bus->sendData(0xA0);
_bus->sendData(0xA0);
_bus->sendData(0x07);
_bus->sendData(0xEE);
_bus->sendData(0xA0);
_bus->sendData(0xA0);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);

_bus->sendCommand(0xE6);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x11);
_bus->sendData(0x00);

_bus->sendCommand(0xE7);
_bus->sendData(0x22);
_bus->sendData(0x00);

_bus->sendCommand(0xE8);
_bus->sendData(0x06);
_bus->sendData(0xED);
_bus->sendData(0xA0);
_bus->sendData(0xA0);
_bus->sendData(0x08);
_bus->sendData(0xEF);
_bus->sendData(0xA0);
_bus->sendData(0xA0);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);

_bus->sendCommand(0xEB);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x40);
_bus->sendData(0x40);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);

_bus->sendCommand(0xED);
_bus->sendData(0xFF);
_bus->sendData(0xFF);
_bus->sendData(0xFF);
_bus->sendData(0xBA);
_bus->sendData(0x0A);
_bus->sendData(0xBF);
_bus->sendData(0x45);
_bus->sendData(0xFF);
_bus->sendData(0xFF);
_bus->sendData(0x54);
_bus->sendData(0xFB);
_bus->sendData(0xA0);
_bus->sendData(0xAB);
_bus->sendData(0xFF);
_bus->sendData(0xFF);
_bus->sendData(0xFF);

_bus->sendCommand(0xEF);
_bus->sendData(0x10);
_bus->sendData(0x0D);
_bus->sendData(0x04);
_bus->sendData(0x08);
_bus->sendData(0x3F);
_bus->sendData(0x1F);

_bus->sendCommand(0xFF);
_bus->sendData(0x77);
_bus->sendData(0x01);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x13);

_bus->sendCommand(0xEF);
_bus->sendData(0x08);

_bus->sendCommand(0xFF);
_bus->sendData(0x77);
_bus->sendData(0x01);
_bus->sendData(0x00);
_bus->sendData(0x00);
_bus->sendData(0x00);

#if 0
_bus->_bus->sendCommand (0xFF);
WriteData (0x77);
WriteData (0x01);
WriteData (0x00);
WriteData (0x00);
WriteData (0x12);
_bus->_bus->sendCommand (0xD1);
WriteData (0x81);
WriteData (0x08);
WriteData (0x03);
WriteData (0x20);
WriteData (0x08);
WriteData (0x01);
WriteData (0xA0);
WriteData (0x01);
WriteData (0xE0);
WriteData (0xA0);
WriteData (0x01);
WriteData (0xE0);
WriteData (0x03);
WriteData (0x20);
_bus->_bus->sendCommand (0xD2);
WriteData (0x08);
#endif
/////////////////Bring up the internal test picture///////////////////////////////////

_bus->sendCommand(0x11);

delay(120);

_bus->sendCommand(0x29);

_bus->sendCommand(0x36);
_bus->sendData(0x00);

_bus->sendCommand(0x3A);
_bus->sendData(0x60);//0x60 18bit 0x50 16bit
#endif

Arduino_ESP32RGBPanel.cpp
lines 175-180

timings.hsync_back_porch = 18; //CHANGED 
timings.hsync_front_porch = 24;//CHANGED 
timings.hsync_pulse_width = 6;//CHANGED 
timings.vsync_back_porch = 10;//CHANGED 
timings.vsync_front_porch = 16;//CHANGED 
timings.vsync_pulse_width = 4;//CHANGED
1 Like

Thanks CosmicOwl. With your detective work I now have it working and it looks awesome!

good to hear glad you got it working! took me a couple months of screwing with it to finally work. and yes the display is awesome!. have you had any luck getting touch to work with lvgl through gfx?

Hi, I have only the non-touch version but have ordered the cap touch unit. All my other cap touch displays work well with the S3 and lvgl although for some reason they all show a miss calibration of touch coordinates with display coordinates. They align perfectly in the centre of the display but lose ground as you move to the extremes - as though a touch overlay for a 320x240 panel has been used for a 480x320 panel, but not as extremely mismatched. I have to bias +/- 20px at the extremes using the map() function. It’s definitely a physical problem as can be seen looking at the raw touch data.

I think I’m gonna stick with ST7701 RGB and the S3 lcd peripheral from now on as the choice of displays is vast and they all seem very high quality. I even saw a compatible AMoled which I will explore - no need to bodge mipi-dsi with a bridge or discrete logic.

Hey CosmicOwl, I’m trying to do what you did but before I reinvent the wheel would you be kind enough to share the boards you used to interface the display with the ESP32? If you’re feeling extra generous, I’d love to see the hello world code that you have to get it working…

Thanks in advance.

1 Like

Hi CosmicOwl, I do have a very similar setup like your and copy your code for testing. I also made the changes on the libraries as your suggest. However when I copy your code something gets wrong.

error: 'Arduino_ESP32RGBPanel' does not name a type
Arduino_DataBus *bus = new Arduino_ESP32RGBPanel

error: expected type-specifier before 'Arduino_S7701S'
Arduino_GFX *gfx = new Arduino_S7701S(

I'm new on Arduino and coding and are lost. Can you give me some clues what is wrong?

<#include <SPI.h>
#include <Arduino_GFX_Library.h>

Arduino_DataBus bus = new Arduino_ESP32RGBPanel( 30 / CS /, 31 / SCK /, 32 / SDA /, 28 / DE /, 27 / VSYNC /, 26 / HSYNC /, 29 / PCLK /, 25 / R0 /, 24 / R1 /, 23 / R2 /, 22 / R3 /, 21 / R4 /, 20 / G0 /, 19 / G1 /, 18 / G2 /, 17 / G3 /, 16 / G4 /, 15 / G5 /,
14 /
B0 /, 13 / B1 /, 12 / B2 /, 11 / B3 /, 10 / B4 */ );
Arduino_GFX gfx = new Arduino_S7701S(bus, DF_GFX_RST, 480 / width /, 480 / height */);

void setup() {
// put your setup code here, to run once:
gfx->begin();
gfx->fillScreen(BLACK);
gfx->setCursor(10, 10);
gfx->setTextColor(RED);
gfx->println("Hello World!");
}

void loop()
{
gfx->setCursor(random(gfx->width()), random(gfx->height()));
gfx->setTextColor(random(0xffff), random(0xffff));
gfx->setTextSize(random(6) /* x scale /, random(6) / y scale /, random(2) / pixel_margin */);
gfx->println("Hello World!");

delay(1000); // 1 second

}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.