how use external flash memory? - Page 1
Forum section: electronics / beginners

author: RoadRunner
author_rank: Frequent Contributor
timestamp: July 22, 2013, 06:36:13 am
content: hi guys,i was just thinking how to use a flash memory chip as external storage of a microcontroller or a FPGA ? i mean for example i wanted to store icon images , font data, some text for a lcd controller or any other resources like web pages for an embedded server.the confusion is do i need to parse this data via some software that will generate some hex type file of which will programmed into the flash chip? i am really confused. is there any standard way to do this thing?and what sort technique you use to program a parallel flash chip?

author: leb120
author_rank: Contributor
timestamp: July 22, 2013, 09:04:50 am
content: Have you considered using an SD card?You can run them in SPI mode which means most microcontrollers have built in hardware to interface and only uses 3 pins.http://en.wikipedia.org/wiki/Secure_Digital#Technical_detailshttp://www.circlemud.org/jelson/sdcard/SDCardStandardv1.9.pdfhttp://www.dtt8.com/images/micro-sd%20specification.pdfhttps://www.sparkfun.com/datasheets/Prototyping/microSD_Spec.pdfThe hardest part of working with SD cards is the implementing something that can deal with the FAT file-system.I have done this for just reading files, but used a lot of program memory (it could probably be implemented better than what I did).The other option which I have had great success with is writing raw data at known addresses on the SD card, bypassing file-systems all together; just hard-code the address in your program or you could implement a lookup table at that start of the card just to add a little flexibility. The problem is, it isn't really possible for an end user to do anything with the SD card; windows will just ask if you want to format it.I would highly recommend HxD (http://mh-nexus.de/en/hxd/) it allows you to open the raw physical drive and then copy and past raw data into any location you want, very powerfull. You will probably want to convert the data (icons, fonts, text, sounds...) into a format easiest to read using a simple custom program on the PC, no reason to implement common formats if you don't need to.I have dumped raw video and audio onto and SD card and had a microcontroller simply dump the data from the card to an LCD screen and a PWM to produce video and audio, nothing to amazing, but it looked cool.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: July 22, 2013, 10:39:44 am
content: Depends on your other requirements. Normal way would be to have the microcontroller program it via whatever interface (e.g. UART) is available in your system. Other options might be pre-programming before it goes on teh board, or in-circuit programming via SPI with an external programmer.

author: RoadRunner
author_rank: Frequent Contributor
timestamp: July 22, 2013, 12:44:37 pm
content: the sd card seems be a quite good option it adds a much large size of memory at cost of a bit additional firmware.with an fpga we can run it very fast but with microcontroller the interface would be much slower and we can't even use DMA.