Suggestions for using external flash SPI

@rickkas7, @peekay123 do you know if this flash chip works with the flashee-eeprom library?

What library did you use?

Not sure about flashee-eeprom; I never tried it.

I wrote my own library for it. Iā€™ll release my source once I finish a few more things.

2 Likes

@rickkas7 Thanks so much for the picture and wiring diagram! Perfect!

@wesner0019 Check out the code that @Suprazz posted above. It has the library for the flash chip + a library for pulling files from the internet onto the flash chip to fill it up remotely over the web. So if you flash new firmware to the Photon, you can then call a function to wipe the flash chip and then download new files to it over the web.

I have no had a chance to try it yet but will soon enough.

@peekay123 Did your flash chips arrive? Mine did but havenā€™t had a chance to work with them yet. Let me know how it goes, no rush, I have a trillion other things to do also.

@RWB, everything arrived. Iā€™ll be testing the SPIFFS code tonight if I can. One thing that will need to be considered is the file format for the graphics. Ideally, they would be an exact binary version of the what is to be displayed (correct order, etc.) so it can just be streamed from the file to the display. However, Iā€™m not familiar enough with all the moving pieces yet to know if this possible or not.

1 Like

look for the BMP format. This is a uncompressed format easy to read for application like this. This is what Iā€™m using.

@Suprazz, it would be more efficient to not use a common image format in this case. @RWB already converts these to a byte array for direct display. This reduces ā€œreprocessingā€ in the Photon/Electron. @RWB, what are your thoughts here?

@peekay123 I have no idea how the image processing works in the background, so I leave it to you to tell me what is best. Obviously, we donā€™t want to rewrite what is already working with the Sharp Memory LCD.

My main goal was to be able to update the flash chip over the web remotely so I can update my products remotely since I plan on doing a lot of work with the LCD display & animations over time.

Think about it and let me know what the best options are.

Also, what are your thoughts on the image download portion of the code?

@RWB, since this is for the 2.7" monochrome version of the display, all pics will be black and white. A full screen image will take 12KB (also display buffer size). So you could store 80 or so full screen images on the flash. For animation, the faster they can stream off the flash, the faster the animation. As such, a streaming-ready data format may be best. However, that being said, it may be simplest to work with BMP format, as @Suprazz pointed out, and pay the small performance cost. Animations will be slower but I donā€™t believe speed is an issue for you.

@peekay123 If itā€™s not a problem I plan on upgrading to a larger 4 or 16 Mb chip from the same company since the extra cost is so small. This way I should never run out of flash and Iā€™ll have memory to spare for future ideas that will come up.

I have no idea what the image refresh times are between using the BMP format vs the way we are currently doing it but as long as its 1 second or under it shouldnā€™t matter much.

@RWB, as long as you get 30Hz or so, that is more than enough. If the image is only a partial screen size, we could create an animation buffer in RAM and play it back to the screen. It all depends what you need. Presently, the display library does not exploit SPI DMA and uses a single buffer. R&D is in called for here :wink:

@peekay123 90% of the images will not be full-screen size but smaller individual images and icons.

The way the current library works is perfect.

1 Like

look here for a code sample of how to load a bitmap from sd. itā€™s easy and good for your application. And it will be fast because itā€™s only 2 colors. In my case Iā€™m using 160x128 16 bits of color per pixelā€¦

1 Like

@Suprazz, thanks! I was working on that code already :wink: Now, if only I can find a monochrome BMP file online to test with. I want to avoid using an SD card since that means 3 SPI devices. I guess I could write an app that load several BMPs onto the flash from SD and then do another app to read the files and display them. Pain in my tush if you ask me. :smirk:

1 Like

simply load the files from the flash instead of the sdā€¦ with spiffs itā€™s easy to do a file open and read the same was as itā€™s done with the sd libraryā€¦

You can create monocrome bmp files with paint.

@Suprazz, I have to load the images onto the flash from a web page. I canā€™t find any bmp on the web to grab and I have nothing setup to serve one. So, the alternate is to load the files on SD and go from SD to flash. Am I missing something?

yes you're right. or you could use the FTPino server with spiffs like I do but right now there is an issue and I'm not able to transfer files completely. I'm trying to figure this out but I have no idea of what else I can try..

@peekay123 So you just need me to find or create a Bitmap image and host it online?

I have websites so I can provide a link to a BMP image just let me know exactly what you need and Iā€™ll try to help out real quick. Like do you need a full-size image for the 2.7-inch display 400 x 240 pixels? Or do you just need any size BMP file under that size?

@Suprazz, Iā€™m using a different ftp client library that has given me zero problems. Iā€™ll use it to pull a file from a local server.

2 Likes

@RWB, the websites need to be HTTP and not HTTPS. You could hold full screen and smaller monochrome BMP images. If you are hosting an FTP that is just as good.

FYI, Iā€™ll be doing some sanity check on the BMP file so only monochrome images that donā€™t exceed 400x240 are accepted and flashed.

@peekay123 Iā€™ll give this a try after you have it all up and working.

Iā€™ll give ya some :moneybag: for your time also :smiley: