
Originally Posted by
MichaelMeissner
You might want to look at the optimized ILI9341 library for inspiration. As long as you use the hardware CS pins for both CS and DC, the code will use DMA to transfer data as fast as possible.
...
So I now use the Teensy 3.5. I've found I need to set the SPI bus speed to 11Mhz or slower to allow the Adafruit OLED display to work and 18Mhz for the waveshare and newhaven displays. With a SPI bus speed set, I can run the Teensy 3.5 at full speed (120Mh), or even over-clocked. The TFT displays can run fine with a 24Mhz SPI clock speed and the 3.5 running at full 120Mhz.
I use the SPIsettings with SPI transactions to set the SPI bus speed.
hmm thankyou.
At the moment I try to write from an array with 240*320*3 Bytes x-D ...with SPI.transfer(rgb, 0, sizeof(rgb)); ... but it doesn't works as expected. :-((
I think the spi-function cannot handle such big arrays?? Can you confirm that?
My setting, 96MHz (overclocked),
SPISettings settingsA(30000000, MSBFIRST, SPI_MODE0);
Maximum clock I can measure now in real is aprox 20MHz....
Code:
void color(uint8_t r, uint8_t g, uint8_t b) //red, green, blue Byte value
{
writecommand(0x2A); //x pixel-position
writedata(0x00); //start-position
writedata(0x00); //start-position
writecommand(0x2B); //y pixel-positon
writedata(0x00); //start-position
writedata(0x00); //start-position
writecommand(0x2C); //Write to RAM
uint8_t rgb[230399];
long int x;
for(x=0; x<76800; x++)
{
rgb[x*3+0]=r;
rgb[x*3+1]=g;
rgb[x*3+2]=b;
}
digitalWrite(CS0, 0);
digitalWrite(DC, 1); //Command = 0, Data = 1
SPI.transfer(rgb, 0, sizeof(rgb));
digitalWrite(CS0, 1);
}