9 years, 9 months ago.

SPI LCD Display improving refresh rate - K64F

Dear All,

I am writing my first question on the forum, I am quite new to frescale and mbed so please bare with me.

I have a Freedom K64F board with an SPI0 connected to an LCD - ILI9341, I am currently running the SPI CLK at 12.5Mhz, I am currently using the Unigraphics Library to run the screen.

The problem is when I try to write 320x240px image it take about 250ms which is about 4FPS (not good at all)...

So I dug a bit deeper and noticed that the image is sent in lines and each line is 16bit pixels, however between each pixel there is a big delay (2.1us) approximately 60% of the transmission time is wasted idling .

The data array is read by a while loop and sent via SPI,

include the mbed library with this snippet

void SPI16::wr_grambuf(unsigned short* data, unsigned int lenght)
{
    while(lenght)
    {
        _spi.write(*data);
        data++;
        lenght--;
    }
}

My question is how to best optimise this to get rid of the delay between transitions? I am not sure how to use the SPIBurst.h example that I found here: https://developer.mbed.org/users/Sissors/code/BurstSPI/

I dont really know how to adapt it to work with my setup? To my understanding this example will be making use of the 4 level FIFO, that would get rid of the delays between chunks?

/media/uploads/PencilDH/screen_shot_2016-07-28_at_17.46.47.png

Be the first to answer this question.