theboot900
Active member
I am using a Teensey 4.1 and a 7 inch 800 x 480 SSD1963 display with a 16 bit parallel bus.
I have always wanted to get full screen refreshes happening with a buffer on a display with proper syncing and the theory is the Teensey 4.1 could be fast enough. No more of this only drawing changes, and undrawing text etc.
I've written a driver to connect to the display (Thanks to MCUFriend for some of the connection macros - RIP David Prentice) Ive set the refresh rate at 60hz by increasing the vertical non blanking period. (13 milliseconds for display period - 3.6 milliseconds for vertical blanking period.
I've connected a wire to the Tearing Effect pin on the SSD1963 and had to change the SDD1963 data recieve direction to match the display vertical sync direction.
Unfortunately the Teensey doesnt have enough memory for a 16 bit 384000 pixel buffer with the display in 16 bit mode. After trying to split the buffer between Ram1 and Ram2 i was having problems using inline functions in Ram2. I couldnt declare an array using DMAMEM in a header file. Then was having trouble getting a pointer to DMAMEM from my DisplayDriver.cpp class to my Display.h file
I also realised using memset only changes every byte in an array. It's no good for 2 byte data types. I use this to clear the buffer after every frame. So ive currently changed to a U_int8 bit 384000 byte array in MEM1. Then i use a 256 colour look up table for each pixel. So technically i have 65k colours available, just stuck in a 256 colour pallet
So we run as follows:
-Clear the buffer (Using memset) //200 microseconds
-Program update and draw to the buffer //Drawing random text, rectangles and circles to the buffer is under a few milliseconds
-Wait for vertical blank signal
-Send the buffer to the display //3.2 milliseconds with no pixel colour changes. 4 to 5 milliseconds with average pixel colour changes
I've wrote and heavily optomised my drawing code to the buffer for text and graphics primitives. Where possible i use memset for fast set vertical lines. I think ive also got sending the buffer to the display as tight as possible. The SSD1963 has an autoincrement feature. Data is strobed until the data pins need a change due to the pixel colour change.
The only downside is this way im stuck with a 256 colour pallete. This will make adding colour gradients difficult.
Would an 8mb PSRam chip be fast enough to use as a full 16bit buffer? Can i use Memcopy on the PSRam chip on QSPI without the data having to come back through the qspi bus. If so i could have the buffer on the PSram chip, as well as a cleared backing array that simply copies into the buffer array after every frame.
I have always wanted to get full screen refreshes happening with a buffer on a display with proper syncing and the theory is the Teensey 4.1 could be fast enough. No more of this only drawing changes, and undrawing text etc.
I've written a driver to connect to the display (Thanks to MCUFriend for some of the connection macros - RIP David Prentice) Ive set the refresh rate at 60hz by increasing the vertical non blanking period. (13 milliseconds for display period - 3.6 milliseconds for vertical blanking period.
I've connected a wire to the Tearing Effect pin on the SSD1963 and had to change the SDD1963 data recieve direction to match the display vertical sync direction.
Unfortunately the Teensey doesnt have enough memory for a 16 bit 384000 pixel buffer with the display in 16 bit mode. After trying to split the buffer between Ram1 and Ram2 i was having problems using inline functions in Ram2. I couldnt declare an array using DMAMEM in a header file. Then was having trouble getting a pointer to DMAMEM from my DisplayDriver.cpp class to my Display.h file
I also realised using memset only changes every byte in an array. It's no good for 2 byte data types. I use this to clear the buffer after every frame. So ive currently changed to a U_int8 bit 384000 byte array in MEM1. Then i use a 256 colour look up table for each pixel. So technically i have 65k colours available, just stuck in a 256 colour pallet
So we run as follows:
-Clear the buffer (Using memset) //200 microseconds
-Program update and draw to the buffer //Drawing random text, rectangles and circles to the buffer is under a few milliseconds
-Wait for vertical blank signal
-Send the buffer to the display //3.2 milliseconds with no pixel colour changes. 4 to 5 milliseconds with average pixel colour changes
I've wrote and heavily optomised my drawing code to the buffer for text and graphics primitives. Where possible i use memset for fast set vertical lines. I think ive also got sending the buffer to the display as tight as possible. The SSD1963 has an autoincrement feature. Data is strobed until the data pins need a change due to the pixel colour change.
The only downside is this way im stuck with a 256 colour pallete. This will make adding colour gradients difficult.
Would an 8mb PSRam chip be fast enough to use as a full 16bit buffer? Can i use Memcopy on the PSRam chip on QSPI without the data having to come back through the qspi bus. If so i could have the buffer on the PSram chip, as well as a cleared backing array that simply copies into the buffer array after every frame.
Last edited: