ILI9341 -> SPI is very slow
Posted: Fri Mar 22, 2019 1:50 pm
Hi guys,
I guess I need your help with the SPI interface.
I downloaded a current master branch of the esp-idf and included the LCD component from the ESP IoT Solution which included/wrapped the Adafruit GFX Library (esp-iot-solution/components/spi_devices/lcd/) to drawing text string to my ILI9341 LCD Display.
This was a very straight forwarded way and my code build successfully.
BUT: Writing to the display seems very very slow at this moment. Currently I don't know why. If I writing a string to the display, I can see building up the text character by character on the display. This is a wrong behaviour.
I uses the following code to initilialize the LCD and getting a lcd_obj object to access the display:
The SPI device should run with 40MHz and should use the HW SPI of the ESP32 device.
Please did you have any idea what is my mistake?
Thank you very much,
Stefan
I guess I need your help with the SPI interface.
I downloaded a current master branch of the esp-idf and included the LCD component from the ESP IoT Solution which included/wrapped the Adafruit GFX Library (esp-iot-solution/components/spi_devices/lcd/) to drawing text string to my ILI9341 LCD Display.
This was a very straight forwarded way and my code build successfully.
BUT: Writing to the display seems very very slow at this moment. Currently I don't know why. If I writing a string to the display, I can see building up the text character by character on the display. This is a wrong behaviour.
I uses the following code to initilialize the LCD and getting a lcd_obj object to access the display:
Code: Select all
void initialise_lcd(void)
{
/*Initialize LCD*/
lcd_conf_t lcd_pins = {
.lcd_model = LCD_MOD_ILI9341,
.pin_num_miso = GPIO_NUM_12, // leave unconnected
.pin_num_mosi = GPIO_NUM_13,
.pin_num_clk = GPIO_NUM_14,
.pin_num_cs = GPIO_NUM_15,
.pin_num_dc = GPIO_NUM_26, // better 35
.pin_num_rst = GPIO_NUM_25, // better 34
.pin_num_bckl = GPIO_NUM_17, // leave unconnected
.clk_freq = 40 * 1000 * 1000,
.rst_active_level = 0,
.bckl_active_level = 0,
.spi_host = HSPI_HOST,
.init_spi_bus = true,
};
if (lcd_obj == NULL) {
lcd_obj = new CEspLcd(&lcd_pins);
}
// write test
lcd_obj->setRotation(2);
lcd_obj->fillScreen(COLOR_ESP_BKGD);
lcd_obj->setTextSize(1);
lcd_obj->setTextColor(COLOR_GREEN, COLOR_ESP_BKGD);
lcd_obj->setFont(&FreeSans9pt7b);
lcd_obj->drawString("HELLO WORLD", 3, 40);
}
Please did you have any idea what is my mistake?
Thank you very much,
Stefan