Skip to content

FreeRTOS ili9341 driver with close integration to LwIP for fast network image rendering

Notifications You must be signed in to change notification settings

8bitmcu/esp8266_ili9341

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro

This project uses the esp-open-sdk SDK, with a custom lcd driver and custom server to draw images as fast as possible to an ILI9431 tft display.

I wanted to optimize FastBMP even further. Starting off with the Blinky example & awesome Makefile, I created this project in order to avoid the Arduino libraries overhead.

The proccess and what I've learned

The lack of official documentation on the esp8266 chip is quite unfortunate. Because of that, I used a logic analyzer from the start. Replicating the initialization routine and getting the LCD to fill one color took me roughly one night. While the initilization commands / data values were copy/pasted from Adafruits library (no shame, the lcd datasheet doesn't really cover in depth the init wizardery), the rest of the code was developped independently while looking at the output from the Saleae Logic software.

My WeMos D1 Mini also gave me issues with esptool.py, but thankfully using a different baud rate seemed to solve the issue for me.

alt text

Adafruits original startup routine, as captured by Saleae Logic. Surprisingly, a lot of time spent in-between SPI transactions!

alt text

Somewhat optimized routine, ommitting the CS signal as shown optional by the datasheet. Also showing 24-bit SPI transactions.

alt text

Since SDA/SLC are handled by the SPI library (CS too, turns out!), we only need to make sure DC is LOW during commands, and HIGH during data transfers. Optionally CS can be kept LOW during larger transfers.

TL;DR: Optimizations

  • Very low overhead: uses RTOS and HSPI driver, everything else is custom.
  • Display initilization routine rewritten to be faster, more compact.
  • Uses all 16 SPI registers for 64-bytes transactions when needed.
  • Faster SPI communication with the display.
  • Custom image format (RGB565 really) means no data conversion.

What else could be improved

  • Look into DMA possibilities. doable in UART
  • Falling / Rising edge triggers, SPI Mode (single/double/quad?)
  • Assembly, although I'm not interested
  • Switching to software SPI that runs at optimal frequency.

References & Documentation

About

FreeRTOS ili9341 driver with close integration to LwIP for fast network image rendering

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published