Please forgive my english, I'm Italian and I'm still learning.
I'm using the Adafruit_SSD1306 library with Adafruit_GFX. I'd like to save some program memory, so is it possible to read a Bitmap image stored in EEPROM memory? I'd just need to write the information into the EEPROM one time, and then just read (even byte by byte) whenever I need it. Would I need to buffer the byte data someway?. As I really doubt the Adafruit_GFX library will let me do this, are there any modifications I can make to said library in order to read from EEPROM?
Any kind of help is widely appreciated, thanks! =D
That is certainly possible but in for example the Uno, EEPROM is not large (1K bytes) and does not help much.
The bitmap normally goes in program memory (as required by the GFX library), not in RAM.
That's right. Thanks for the help. I just found a solution online that requires buffering to the RAM, and uses a modified drawRamBitmap(); link: c++ - Adafruit gfx library drawBitmap without PROGMEM - Stack Overflow
But I don't have enough RAM!
So the last thing I thought about was deleting the bootloader and uploading from another board as ISP. It works but the compiler still thinks the space is being occupied by the bootloader. I see this is a common problem, I found the solution, but unfortunately I can't locate the 'hardware' directory that holds the file I have to modify (seems like the location is changing from a version to another). If you know anything about the location of this folder, it would really help!
[NEVERMIND! Apparently it was in a completely different location from what I've read online, I found it thanks to the compiler output]
Removing the bootloader will not give you more RAM. It will give you more flash / program memory.
I'm perfectly aware of that.
I wanted to save space in flash (program) memory, so I tried finding a way to store some bitmap data in the EEPROM. Only then I thought that I would have had to load the image to RAM first, as I didn't want to read the EEPROM each time a frame had to be displayed (it's really slow), and that I didn't have enough RAM.
So the initial intent wasn't to free up RAM memory, but FLASH! Thanks for answering tho, appreciate that you took your time to respond
I have no idea about bitmaps. Would it not possible to read one row from PROGMEM to RAM, send to display, read next row and send to display and so on.
It will not speed up the process but will save RAM.
It would work, but things would be even slower. I already solved the program memory issue by just removing the bootloader tho, I now have the space I need ;D
Also, I assume the RAM is needed to hold the bitmap data for a faster access, so using your method I don't see why the data couldn't just be read from the EEPROM, skipping the copying to RAM. It just needs a little bit of tweaking of the drawBitmap() function.
But again, this is solved. If you come up with a genius idea that could save some more flash memory (without slowing everything down each frame) it will be widely appreciated! Thanks for the answers
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.