STM32F103C8 & TFT (ili9325)

Working libraries, libraries being ported and related hardware
golpesar132
Posts: 24
Joined: Mon Jul 10, 2017 1:42 pm

Re: STM32F103C8 & TFT (ili9325)

Post by golpesar132 » Mon Jul 24, 2017 11:41 am

stevestrong wrote:
Mon Jul 24, 2017 11:32 am
I am almost sure that I tested the BMP example reading a file from SD card, but I will check it again.
I am ok with that example. but it is very slow. I want to load it faster like birduino example images, but an image like that is too big and I cant have it on the flash memory of microcontroller. how can I do it faster from sd card?

stevestrong
Posts: 1612
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: STM32F103C8 & TFT (ili9325)

Post by stevestrong » Mon Jul 24, 2017 11:56 am

1. faster reading from card
If you are using the SD card only for reading, then you could use the SdFatEX class (search the SDFat lib for that information, and/or the forum) or use at least a 4kB buffer.
viewtopic.php?f=51&t=2034&p=27982&hilit=sdfatex#p27982

2. parallel processing
- You could (theoretically) use an asynchronous DMA access to send the data to LCD while the new data is read form the SD card.
I don't have any DMA example which would send parallel data to a GPIO port, but I am interested to see one working with an LCD.
- Another alternative for this is using FreeRTOS - again, I did not use it so far, so cannot provide any support.
- still another potential could be exploited if the SdFat lib would use yield() for the time is waiting for a process to complete...(which is the case for the SDIO lib for F4, but not for SPI)

3. use another chip with more FLASH memory - where you can fit all needed bitmaps in the FLASH.
Btw, it may happen that the F103C8 chip includes 128kB flash instead of the officially specified 64kB.

david.prentice
Posts: 112
Joined: Wed Nov 16, 2016 8:52 am

Re: STM32F103C8 & TFT (ili9325)

Post by david.prentice » Mon Jul 24, 2017 1:07 pm

If you want the fastest rendering of a BMP from SD card:
1. pre-process the BMP files into RAW data e.g. like UTFT utility.
2. set a rectangular window with the correct dimensions.
3. read the raw pixel data from SD with a DMA version of SD.h library.
4. blit the pixel data to the screen. e.g. with pushColors()
5. if you arrange (3) and (4) to run simultaneously, you will effectively fill the screen as fast as your SPI rate from the SD.

6. as Steve has suggested, if you can use a SDIO interface to the SD, it will be faster than SPI.
7. this needs access to all the SD pins and a CPU with SDIO hardware.

I assume that you have got Steve's library working ok now.
What was the problem?

David.

golpesar132
Posts: 24
Joined: Mon Jul 10, 2017 1:42 pm

Re: STM32F103C8 & TFT (ili9325)

Post by golpesar132 » Mon Jul 24, 2017 1:16 pm

Thank you. I will test these.
david.prentice wrote:
Mon Jul 24, 2017 1:07 pm
1. pre-process the BMP files into RAW data e.g. like UTFT utility.
how can i do this?? and then how can i read it?
david.prentice wrote:
Mon Jul 24, 2017 1:07 pm
I assume that you have got Steve's library working ok now.
What was the problem?
the color565 wasn't in the class in that library. just we should use color565() instead of tft.color565().

Post Reply