SPIFlash memory library for Arduino/Moteino

I posted the SPIFlash library I was talking about in previous posts. I have not found a convenient library for that purpose hence this library written by myself.

Get it at my Github repository: http://github.com/LowPowerLab/SPIFlash
Also added a basic usage example under the library.

The All-About-Moteino page describes how you can add a flash chip to your Moteino or even to your Arduino. To access this chip you will need a library such as this one to conveniently read or write bytes to the chip. I would recommend getting used to the chip itself by doing some reading in the datasheet of the chip you are using – there are some particularities as to how these chips work. The library attemps to abstract most of these things so you don’t have to worry about them. At the very least please read the comments in the code for now. Soon I will hopefully add more info and tutorials. Stay tuned for the complete solution code for wireless/in-field programming of Arduino/Moteino using this library. I am working to get all that code organized and posted on this blog.

3 thoughts on “SPIFlash memory library for Arduino/Moteino

  1. Before I read your post I had no clue about SPI Flash memory. So any type in 8-SOIC package will work? i.e. I can use 16 or 32 Megabytes of Flash onboard? That’s pretty amazing, I’ve been wasting my time with SD card sockets and SD to microSD adapters all this time, when I only need about 10 Mb to store WAV files for my Xronos Clock 🙂 Looks like 16Mb flash is about $2, which is pretty awesome!
    But you completely blew my mind with post about wireless programming, I didn’t think it was possible. Going back to the drawing board now 🙂

  2. I own a couple Moteino RFM69HW w/Flash. I now have a Sketch which is giving the: “Warning: Large amount of SRAM memory used. Consider using PROGMEM or F(“text”) macro to reduce ram usage”

    The reported memory usage is:
    “Binary sketch size: 26,480 bytes (of a 32,256 byte maximum)
    Estimated used SRAM memory: 1,715 bytes (of a 2048 byte maximum)”

    Question:
    Is there a way to address the Flash to load larger sketches? Note: I am a cut-n-paste programmer – thus – A cluelessly learning newb.

    • 26k for a compiled sketch is very large, not surprising that chews up the RAM. The libraries only use a few hundred bytes of RAM at most, so you may want to fine tune the rest of your code. The libs could be improved in terms of RAM to save an additional hundred bytes or maybe more, by using PROGMEM. The flash chip is there for additional general purpose storage, but not for actual code space. For sketches all you got is 31k.

Comments are closed.