lovyan03 / LovyanGFX

SPI LCD graphics library for ESP32 (ESP-IDF/ArduinoESP32) / ESP8266 (ArduinoESP8266) / SAMD51(Seeed ArduinoSAMD51)
Other
1.13k stars 200 forks source link

On Wemos D32 Pro + TFT3.5inch touch , how to test 「 MovingIcons」 example ? #27

Closed BlynkGO closed 3 years ago

BlynkGO commented 4 years ago

I am using Wemos D32 Pro + TFT3.5inch (ILI9488) . and connect line like the following image

image

When I test by 「 ClockSample」example, it 's fine for me by the following config.

struct LGFX_Config
{
  static constexpr spi_host_device_t spi_host = VSPI_HOST;
  static constexpr int dma_channel = 1;
  static constexpr int spi_sclk = 18;
  static constexpr int spi_mosi = 23;
  static constexpr int spi_miso = 19;
  static constexpr int spi_dlen = 8;
};

static lgfx::LGFX_SPI<LGFX_Config> lcd;

// Panelクラスのインスタンスを作成します。使用するパネルにあった記述をコメントアウトしてください。
//static lgfx::Panel_HX8357B panel;
//static lgfx::Panel_HX8357D panel;
//static lgfx::Panel_ILI9163 panel;
//static lgfx::Panel_ILI9341 panel;
//static lgfx::Panel_ILI9342 panel;
//static lgfx::Panel_ILI9486 panel;
static lgfx::Panel_ILI9488 panel;
//static lgfx::Panel_SSD1351 panel;
//static lgfx::Panel_ST7789 panel;
//static lgfx::Panel_ST7735S panel;

void panel_config(){
  panel.freq_write = 20000000;
  panel.freq_fill  = 27000000;
  panel.freq_read  = 16000000;
  panel.spi_mode = 0;
  panel.spi_mode_read = 0;
  panel.len_dummy_read_pixel = 8;
  panel.spi_read = true;
  panel.spi_3wire = false;
  panel.spi_cs = 14;
  panel.spi_dc = 27;
  panel.gpio_rst = 33;
  panel.gpio_bl  = 32;
  panel.pwm_ch_bl = 7;
  panel.backlight_level = true;
  panel.invert = false;
  panel.rgb_order = false;
  panel.memory_width  = 320;//320;
  panel.memory_height = 480;//240;
  panel.panel_width  = 320;//320;
  panel.panel_height = 480;//240;
  panel.offset_x = 0;
  panel.offset_y = 0;
  panel.rotation = 3;
  panel.offset_rotation = 0;  
}

// ....

void setup(){
  Serial.begin(115200);

#if defined(ARDUINO_M5Stick_C)
  axp.begin();
#endif

  panel_config();
  lcd.setPanel(&panel);
  lcd.init();

  //. ....
}

void loop(){
   //.....
}

However when I use this config for 「 MovingIcons」or 「 MovingCircles」 example , it occurs some strange display like the following clip.

https://streamable.com/4qw95u

How to solve this example ? Thank you very much.

lovyan03 commented 4 years ago

Thank you for reporting this ! I have just modified the examples to work properly with ILI9488 . The fix is now reflected in the "develop" branch. We'll release it in the master branch soon, but if you want to try it out right away, you can get examples from the develop branch.

tobozo commented 4 years ago

@BlynkGO just out of curiosity I've been wondering why is the espressif logo hidden on this image ? Are there any fake/counterfeit LoLinD32Pro models out there ?

BlynkGO commented 4 years ago

@lovyan03 Thank you very much. I will try.

@tobozo . No, there are not any fake models. It's a ESP32 Wrover module.

BlynkGO commented 4 years ago

@lovyan03 I have just tried by "develop" branch. 「 MovingIcons」 example is still occurs the same result.

Furthermore when I tried 「 CollisionCircles」 example with the config, it occurs runtime-error.

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x400d2898  PS      : 0x00060230  A0      : 0x8008a5d0  A1      : 0x3ffb8a10  
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x00000000  
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x00000001  A9      : 0x00000000  
A10     : 0x00000001  A11     : 0xb13f93c4  A12     : 0xb13f93c4  A13     : 0x3ffc407c  
A14     : 0x3ffb89ac  A15     : 0x3ffb89ac  SAR     : 0x00000000  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000000  LBEG    : 0x400d2898  LEND    : 0x400d28a8  LCOUNT  : 0x00000000  

Backtrace: 0x400d2898:0x3ffb8a10 0x4008a5cd:0x3ffb8aa0

Are my config any mistake ?

lovyan03 commented 4 years ago

@BlynkGO I'm sorry. I updated my local branch but didn't update github. I just redid it. I also fixed "CollisionCircles". It's now capped at 320x240, so there's a gap in the screen with ILI9488, but I've made This is a response to the lack of memory.

BlynkGO commented 4 years ago

「CollisionCircles」is fine now for (320x240 area), Can I make sprite by PSRAM for 480x320 ?

And「 MovingIcons」 example's result is still strange..

PHOTO_20200720_131651

BlynkGO commented 4 years ago

PHOTO_20200720_141139

Finally by the lastest 'developer' branch, 「 MovingIcons」 example is fine for 480x320 now . Thank you very much for fast update.

One more thing, I wish to use the same SPI both TFT and Touch interface. Is there any easy way to config Touch-SPI interface can be used the same with TFT's SPI that used by LovyanGFX ?

lovyan03 commented 4 years ago

@BlynkGO Thanks for the report ! The "CollisionCirlces" sample has also been updated. If memory allocation fails, PSRAM is used. If it still fails, it reduce the screen size.

Touch screen support is planned to be implemented. I haven't been able to work on the touch screen function because I'm giving priority to the display function at the moment, but I plan to provide a function similar to TFT_eSPI.

It is possible to use SPI when TFT is not drawing, so if you already have a library that handles the touch screen, you may be able to use it.

BlynkGO commented 4 years ago

https://streamable.com/ro4zdt

The "CollisionCirlces" sample now can display on 480*320 at between 7-15 fps , thanks again.

I wish to replace TFT-eSPI to LovyanGFX for more high-performance with TFT Touch interface. Waiting for the next version.

Akigato Go zaimasu.

lovyan03 commented 4 years ago

@BlynkGO Thank you for your patience. LovyanGFX is now touch screen compatible ! (in the master branch. ) The release will happen in the next few days. Currently available are XPT2046 and STMPE610 (SPI) , and FT5x06 (I2C).