Just playing with the parallel version - and, depressingly - it's quite a bit slower than the SPI version.
The SPI hardware must be very efficient (especially as it's having to write out 50% more data (24 bit cf 16). There may be a way to put the parallel interface into 4 or 8 bit mode?
Something also not right - I only get blue data ( ) Here I do a single cube (with and without modified background) Show orientations and repeatedly clear the display to a random (here read blue) colour. - Note I also got this with the demo program
Still to get the SD working - more playing later....
Martin
Speeding up the ILI9488 SPI display (esp32)
-
- Valued Contributor
- Posts: 1008
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 106 times
- Been thanked: 520 times
-
- Valued Contributor
- Posts: 1008
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 106 times
- Been thanked: 520 times
Re: Speeding up the ILI9488 SPI display (esp32)
It looks as though it might be possible to use i2s to push the data to the display? That would speed things up - if there is a way to get i2s to 'toggle' the write pin.
Martin
Martin
-
- Matrix Staff
- Posts: 1763
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 448 times
- Been thanked: 607 times
Re: Speeding up the ILI9488 SPI display (esp32)
Hi Martin,
Have you got the latest version of the ILI9488 component? I pushed some optimisations into it for the display.
Aha I see you're not using the parrallel component and instead rolling your own code. Well then I send out the 16-bit data like this.
FCL_DAT is my local 16-bit colour variable I'm sending out.
It might be worth you trying the component and see if that's any better for you.
Here's the latest optimised component source. It looks like maybe the Flowcode port write code could do with a bit of improvement as currently it does it the recommended (and very slow) way of bit by bit. I'll see if I can use the method I've used in the component for the port writes.
I've also just pushed an update for the ESP32 definitions and the SD Card component to allow you to see/set the SD Mode I/O pins. Probably won't have worked without this as the S3 needs to be told which pins to use.
Have you got the latest version of the ILI9488 component? I pushed some optimisations into it for the display.
Aha I see you're not using the parrallel component and instead rolling your own code. Well then I send out the 16-bit data like this.
Code: Select all
GPIO.out_w1ts = FCL_DAT; //Write all the 1's
FCL_DAT = ~FCL_DAT;
GPIO.out_w1tc = FCL_DAT; //Write all the 0's
It might be worth you trying the component and see if that's any better for you.
Here's the latest optimised component source. It looks like maybe the Flowcode port write code could do with a bit of improvement as currently it does it the recommended (and very slow) way of bit by bit. I'll see if I can use the method I've used in the component for the port writes.
I've also just pushed an update for the ESP32 definitions and the SD Card component to allow you to see/set the SD Mode I/O pins. Probably won't have worked without this as the S3 needs to be told which pins to use.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 1008
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 106 times
- Been thanked: 520 times
Re: Speeding up the ILI9488 SPI display (esp32)
Thanks Ben,
That does indeed make a dramatic difference.. I'm still just getting the blue channel - so a bit more work needed
Yesterday I had a play with the ili9488 component from espressif at https://github.com/atanisoft/esp_lcd_ili9488 - almost got it to work in FC with just a little C code - this mimics the i80 interface (using DMA to write and the i2s hardware?). The initialisation seemed to work, but my attempts at writing the data to display didn't (nothing on the pins)
However - I think this is probably pretty good for now. Just need to cure the case of the blues
I tried two 'versions' of the display macro - writing the data inline (disabled - disable the following two macros if re-enabled) - and, as currently, using Write_Data16_Bus - it's good to localise this, but Display is the only place it's called from.
Next to try the new SD component --- Still fails with error 13 (tested with 8 and 128GB cards) -
Martin
That does indeed make a dramatic difference.. I'm still just getting the blue channel - so a bit more work needed
Yesterday I had a play with the ili9488 component from espressif at https://github.com/atanisoft/esp_lcd_ili9488 - almost got it to work in FC with just a little C code - this mimics the i80 interface (using DMA to write and the i2s hardware?). The initialisation seemed to work, but my attempts at writing the data to display didn't (nothing on the pins)
However - I think this is probably pretty good for now. Just need to cure the case of the blues
I tried two 'versions' of the display macro - writing the data inline (disabled - disable the following two macros if re-enabled) - and, as currently, using Write_Data16_Bus - it's good to localise this, but Display is the only place it's called from.
Next to try the new SD component --- Still fails with error 13 (tested with 8 and 128GB cards) -
Martin
-
- Matrix Staff
- Posts: 1763
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 448 times
- Been thanked: 607 times
Re: Speeding up the ILI9488 SPI display (esp32)
Hi Martin,
Aha I know what the all blues are about I've had that too. In your initialise you might just need to ensure you have written to the higher byte using a output icon or similar. Otherwise the higher 8-bits are not defined as outputs.
e.g. your LCD_Write_Data8_Bus defines the lower 8-bits as outputs but not the upper 8 bits.
This is how I do it in the component at the top of the initialise function. I can then do the 8-bit command writes in the same high speed optimised way.
Aha I know what the all blues are about I've had that too. In your initialise you might just need to ensure you have written to the higher byte using a output icon or similar. Otherwise the higher 8-bits are not defined as outputs.
e.g. your LCD_Write_Data8_Bus defines the lower 8-bits as outputs but not the upper 8 bits.
This is how I do it in the component at the top of the initialise function. I can then do the 8-bit command writes in the same high speed optimised way.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 1008
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 106 times
- Been thanked: 520 times
Re: Speeding up the ILI9488 SPI display (esp32)
Thanks - yes that fixed it.
I tried : port_high = 0 which didn't work(?), but output of a8..a15 of 0 and suddenly the world is suddenly a more colourful place!
Marti
I tried : port_high = 0 which didn't work(?), but output of a8..a15 of 0 and suddenly the world is suddenly a more colourful place!
Marti
-
- Valued Contributor
- Posts: 1008
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 106 times
- Been thanked: 520 times
Re: Speeding up the ILI9488 SPI display (esp32)
Slightly more neatly with a loop and
The code manages to clear and redraw the display 5 times for one of the ILI9488 refresh cycles. Repeatedly clearing and displaying a new colour manages 5/6 'stripes' on the display - manages to clear and redraw too fast!
For anyone to play:
Now we need a way to check for 'vsync' to draw the next frame
Martin
Code: Select all
gpio_set_direction(FCL_I, GPIO_MODE_OUTPUT);
For anyone to play:
Now we need a way to check for 'vsync' to draw the next frame
Martin
-
- Valued Contributor
- Posts: 1008
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 106 times
- Been thanked: 520 times
Re: Speeding up the ILI9488 SPI display (esp32)
Just tried a 'cube demo' and with the old component - this compiles and draws the cube (albeit (very) slowly).
Then did a library update (of the ILI_9488 component) and can no longer compile:
Martin
Then did a library update (of the ILI_9488 component) and can no longer compile:
amongst the many errors. Full database update didn't fix this unfortunately.C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\ESP\ESP_CAL_IO.h:91:78: note: in definition of macro 'SET_PORT_MASK'
91 | #define SET_PORT_MASK(p,m,v) FC_CAL_Port_Out_DDR (p, m, v)
| ^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\ESP\ESP_CAL_IO.h:91:79: error: left-hand operand of comma expression has no effect [-Werror=unused-value]
91 | #define SET_PORT_MASK(p,m,v) FC_CAL_Port_Out_DDR (p, m, v)
Martin
-
- Matrix Staff
- Posts: 1763
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 448 times
- Been thanked: 607 times
Re: Speeding up the ILI9488 SPI display (esp32)
Hi Martin,
Thanks looks like there's something up with the port writes that I'll look into for you.
This should hopefully work correctly with the speed optimisation and more importantly compile. As for making the cube spin faster could you instead draw the cube in white, frame delay, draw the cube in black, rotate the cube, repeat. Should be significantly faster then clearing the display each time. I imagine you already know this.
Thanks looks like there's something up with the port writes that I'll look into for you.
This should hopefully work correctly with the speed optimisation and more importantly compile. As for making the cube spin faster could you instead draw the cube in white, frame delay, draw the cube in black, rotate the cube, repeat. Should be significantly faster then clearing the display each time. I imagine you already know this.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 1008
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 106 times
- Been thanked: 520 times
Re: Speeding up the ILI9488 SPI display (esp32)
Thanks Ben,
Does indeed compile now (what was I doing wrong?) - good improvement on speed (still a slideshow - keep pushing those improvements :-; )
Have doubts about my fullscreen 'clears' - the 'banding' might be an artefact of something else - though at the moment not sure what - black works AOK though!
Martin
Does indeed compile now (what was I doing wrong?) - good improvement on speed (still a slideshow - keep pushing those improvements :-; )
Have doubts about my fullscreen 'clears' - the 'banding' might be an artefact of something else - though at the moment not sure what - black works AOK though!
Martin