Page 1 of 1

writing .BMPs from SD to internal memory

Posted: Sun Oct 22, 2017 10:56 am
by nickwest
Hi all,

I'm trying to speed up the screen updates when writing BMPs (aren't we all!).

I'm using a Sparkfun SAMD21 mini. It's an ARM M0 core, which I think is roughly the same as an Arduino Zero. The main benefit in this situation is that it has 256kB of program memory, so it should be able to hold the images I need with room to spare.

What I was hoping to do was pre-fetch the images from the SD card at startup, so they can be written to the screen faster than having to fetch them from the SD card on the fly. I'd prefer tp use the SD card to store the images so that if I decide to change the images later I can just dump them on the memory card instead of running the Python script to manually store them in an Arduino header file.

Does that make sense? Has anyone tried this? Is there some other clever hack to display images from an SD card? Despite the fact that this processor is loads more powerful than a regular Arduino, it seems to take the same amount of time to display images from an SD card. This leads me to believe that the card itself is the bottleneck...



Re: writing .BMPs from SD to internal memory

Posted: Thu Oct 26, 2017 12:59 pm
by nickwest
Replying to my own post - another option would be to take advantage of the SAMD21's extra RAM and read each image from the SD card into RAM, then dumping the whole thing onto the screen. I think the current driver does it line by line, which might explain why it's a bit slow.

And kudos to the Freetronics team for writing the driver in the first place. The Arduino IDE comes up with a warning when I #include the library, but so far is has worked fine!