Hello,
This is my inspiration (https://www.youtube.com/watch?v=...)
I am reading the data sheet regarding getting DMA working and trying to wrap my head around what I need to do and I have some generic questions.
I have an LCD screen that is currently using SPI to read some BMP data from a flash memory - however I am unsatisfied with the speed at which this is accomplished. I can visibly see the image load from bottom to top - I would like for it to load faster than the human eye can perceive so as to give the illusion of an image popping up immediately. The MCU isn't really doing much work but it seems that sending and receiving the data is a bit on the slow side between the flash memory and the LCD:
for (int row = (int)header.imageHeight-1; row >= 0; row--) { for (int k=0; k<(bytesPerRow/2); k++){ //get next row from flash pixelBuffer[k] = read16Bit(currAddress, rx, rx); } for(uint16_t col = 0; col<header.imageWidth; col++){ /*convert each color from RBG565 to BGR565*/ uint16_t color = pixelBuffer[col]; uint16_t tmp = (color & 0x001F) << 11; tmp |= (color & 0xF800) >> 11; color &= 0xFFE0 & 0x07FF; color |= tmp; TFT_SetPixel(Xoffset+col,Yoffset+row,color); //draw pixel }
The first loop goes through every row of the image, the first nested loops gets a row of pixel data and the second nested loop manipulated the color scheme and sends the color information for each pixel to the LCD. Both the flash memory and the LCD and connected to their own respective SPI.
The MCU is, as mentioned, an ATSAML21E18B. The LCD screen is an ILI9341 and the flash is SST26VF016B.
Does anyone else have a gut feeling of how I could get this done as fast as possible so that the images load quickly?