Page 3 of 5
Re: Wrong delay when use "delay ms" ESP32
Posted: Fri Mar 05, 2021 9:43 am
by jgu1
Absolutely Ben, faster. Now I will try to test spi with ESP32. Can´t get it fast enough
Now I see in the configuration for the ILI9341 SPI component it is not possible to select "Use pin reference" like in the serial ILI component or am I not looking the rigth place?
Br. Jorgen
Re: Wrong delay when use "delay ms" ESP32
Posted: Fri Mar 05, 2021 10:04 am
by BenR
Hi Jorgen,
For the SPI remap pins, sorry no this is currently not possible.
However it should be fairly simple to work out. PortA is GPIO pins 0-31 so PortA 19 would be GPIO 19. PortB is GPIO pins 32-63 so PortB 2 would be GPIO 34.
Hope this makes sense.
Re: Wrong delay when use "delay ms" ESP32
Posted: Fri Mar 05, 2021 10:56 am
by jgu1
OK Thank´s Ben!
Now I perform a test with Ili9341 SPI. It is extreeeeem slow?
Jorgen
Re: Wrong delay when use "delay ms" ESP32
Posted: Fri Mar 05, 2021 2:18 pm
by BenR
Hi Jorgen,
The Prescale property sets how fast the SPI is output. It's currently at 400KHz in your program but can go a lot faster. I suggest trying it at 10MHz and see how you get on.
Re: Wrong delay when use "delay ms" ESP32
Posted: Fri Mar 05, 2021 2:38 pm
by jgu1
Already done Ben. I try to step up to 30 Mhz max. over this the display stop working, But still not so fast as the as the serial.
If I measure with a scope on the MISO pin I don´t see any signal, and even if I remove the pin it still work, but slow compared with serial.
Jorgen
Re: Wrong delay when use "delay ms" ESP32
Posted: Fri Mar 05, 2021 4:46 pm
by BenR
Hi Jorgen,
Let me do some more testing and I'll see if I can find another bottleneck for you. The SPI is currently being run byte by byte but the ESP chip can work with SPI in transaction mode where you queue up a load of bytes and then let it go. This might be the way to let it run faster. 30MHz is a lot faster then the software version will go by say a factor of at least 10 so there must be a bottleneck somewhere.
I'll have a play and let you know.
If I measure with a scope on the MISO pin I don´t see any signal
For the GLCD MISO isn't used it's just the MOSI and the SCK.
Re: Wrong delay when use "delay ms" ESP32
Posted: Sun Mar 07, 2021 7:01 pm
by jgu1
Thank you Ben. Look forward to see
Jorgen.
Re: Wrong delay when use "delay ms" ESP32
Posted: Mon Mar 08, 2021 9:45 pm
by BenR
It's pretty much as I had imagined, the SPI is faster but the overhead is killing it.
The top trace shows the software driven display and the bottom trace shows the SPI version @ 10MHz.

- Logic.jpg (47.24 KiB) Viewed 8782 times
I'll keep chipping away at it.

Re: Wrong delay when use "delay ms" ESP32
Posted: Mon Mar 08, 2021 10:19 pm
by BenR
I've pushed a new version of the SPI display component which should be a lot faster.
I have a program that just clears each display version,
Using the new SPI display component the clear is now a lot faster, 630ms for the serial component vs 75ms for the SPI version @ 25MHz.

- Logic2.jpg (43.72 KiB) Viewed 8777 times
It will be interesting to see how it gets on with a test that's drawing data to the display. I've optimised where I can so hopefully it is still as fast if not faster.
Re: Wrong delay when use "delay ms" ESP32
Posted: Tue Mar 09, 2021 6:24 pm
by jgu1
Hi Ben!
Thank you
Run an update, but sorry now it doesn´t work at all
I try to set the prescaler from 100 khZ and up to 25 mHz, bu it is not working at all. I try to go back to previus version 10 it work again. But slow.
Do you have an ILI9341 Spi display for test?
Br jorgen