-->
Page 1 of 1

Increasing SPI speed

PostPosted: Tue Jul 19, 2016 3:13 am
by Ignat Georgiev
Hello,

I am writing a little program directly on the NodeMCU but I am experiencing a little bit of "stuttering".

My setup:
NodeMCU v1.0
ILI9341 3.2" TFT screen datasheet: https://store.comet.bg/download-file.php?id=5356
UTFT + UTFT_DLB for esp8266

I am not exactly sure if the UTFT library allows me to use the HSPI pins directly, but I am using them none the less. Displaying small text (~20) is absolutely fine but the problem comes with larger text (40+). Changing the text doesn't look very pleasant. It's also worth noting that the "stutter" is not noticeable on camera.

My question is how do I find out what frequency the SPI is working at the moment and is it possible to increase that speed and see if it helps.

Using this renders the screen unusable but the esp itself continues working.
Code: Select all   SPI.begin();
   SPI.setFrequency(40000000);




I am also open to other libraries for this display. So far I have tried Adafruit GFX, ucglib, PDQ GFX.

Re: Increasing SPI speed

PostPosted: Thu Jul 21, 2016 8:48 am
by mrburnette
Ignat Georgiev wrote:I am writing a little program directly on the NodeMCU but I am experiencing a little bit of "stuttering".
<...>


You have a combination of small issues that are causing your large-font problem. The ILI934x display is a bitmap display, so there are no internal font rendering. The graphic library you are using will have a set of fonts that define the dot-matrix and fonts are then mapped to an (x, y) position and the fonts are 'drawn' by algorithms.

The drawing of the fonts looks great for smaller fonts because the algorithm completes quickly; however, the larger the font the longer the algorithm takes to paint the character on the screen.

Additionally, the ESP8266 runs the Arduino sketch in a pseudo-thread while the RF and ESP8266-centric stuff works in another pseudo-thread. So, your arduino library is sharing time with the ESP8266 radio. This of course further complicates your graphic display.

To further complicate things: http://www.esp8266.com/wiki/lib/exe/fetch.php?media=0a-esp8266_datasheet_en_v4.3.pdf
Note:
• SPI mode can be implemented via software programming. The clock frequency can reach up to
a maximum value of 80MHz.
• Function of Slave SDIO/SPI interface can be implemented via hardware, and linked list DMA
(Direct Memory Access) is supported, software overheads are smaller. However, there is no
linked list DMA on general SPI and HSPI, and the software overheads are larger, therefore, the
data transmitting speed will be restrained by software processing speed.


I did a quick search for "ILI9341 + DMA" against site:esp8266.com and did not get a hit, therefore I do not think anyone has made the inexpensive SPI LCDs work via DMA up to this point. I do use DMA with the 32-bit STM32F103, the ILI9341, and a modified Adafruit library - so there is no display concern whatsoever.

Ray