writing .BMPs from SD to internal memory

128x128 pixel 1.5" full colour OLED display with MicroSD card slot. [Product page]
Post Reply
nickwest
Posts: 10
Joined: Sun Oct 28, 2012 10:20 pm

writing .BMPs from SD to internal memory

Post by nickwest » Sun Oct 22, 2017 10:56 am

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...

Thanks

Nick

nickwest
Posts: 10
Joined: Sun Oct 28, 2012 10:20 pm

Re: writing .BMPs from SD to internal memory

Post by nickwest » Thu Oct 26, 2017 12:59 pm

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!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest