Skip to content

Commit 6577e7a

Browse files
authored
Added comments about esp_lcd_panel_io_spi_config_t.pclk_hz (#20)
* Example code: comment that DISPLAY_REFRESH_HZ may need to be lowered. * Fix spelling in comment. * README info about screen artifacts and pclk_hz * README.md formatting for screen artifact section
1 parent ed4dd77 commit 6577e7a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,19 @@ At this time testing is limited to ESP32 and ESP32-S3, other ESP32 variants shou
6464
This driver converts the color data from 16-bit to 18-bit as part of the `draw_bitmap` callback.
6565
Therefore it is required to set `CONFIG_LV_COLOR_DEPTH_16=y` in your sdkconfig. In the future other
6666
color depths may be supported.
67+
68+
## Screen artifacts
69+
70+
Some developers have noted artifacts on the screen when using in their projects. This seems to be related to
71+
having a number of SPI devices connected to same bus or due to wire length. If this happens, try changing
72+
the pclk_hz in the esp_lcd_panel_io_spi_config_t configuration to a lower value. You can try starting with
73+
a small number, like 4mhz. If the artifacts disappear, try increasing this number until they appear again
74+
to find a good value:
75+
```
76+
const esp_lcd_panel_io_spi_config_t io_config =
77+
{
78+
...
79+
.pclk_hz = 4 * 1000 * 1000,
80+
...
81+
}
82+
```

examples/lvgl/main/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ static const int DISPLAY_HORIZONTAL_PIXELS = 320;
3131
static const int DISPLAY_VERTICAL_PIXELS = 480;
3232
static const int DISPLAY_COMMAND_BITS = 8;
3333
static const int DISPLAY_PARAMETER_BITS = 8;
34+
// Some developers have needed to reduce this value to avoid screen artifacts. It seems related to the # of SPI devices connected and/or wire lengths.
35+
// If you see artifacts, try a low value, like 4 * 1000 * 1000, then increase until artifacts disappear.
3436
static const unsigned int DISPLAY_REFRESH_HZ = 40000000;
3537
static const int DISPLAY_SPI_QUEUE_LEN = 10;
3638
static const int SPI_MAX_TRANSFER_SIZE = 32768;
@@ -347,4 +349,4 @@ void app_main()
347349
vTaskDelay(pdMS_TO_TICKS(10));
348350
lv_timer_handler();
349351
}
350-
}
352+
}

0 commit comments

Comments
 (0)