Author Topic: how use external flash memory?  (Read 2540 times)

0 Members and 1 Guest are viewing this topic.

Offline RoadRunnerTopic starter

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: de
how use external flash memory?
« on: July 22, 2013, 06:36:13 am »
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?   
 

Offline leb120

  • Contributor
  • Posts: 10
  • Country: us
Re: how use external flash memory?
« Reply #1 on: July 22, 2013, 09:04:50 am »
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_details

http://www.circlemud.org/jelson/sdcard/SDCardStandardv1.9.pdf
http://www.dtt8.com/images/micro-sd%20specification.pdf
https://www.sparkfun.com/datasheets/Prototyping/microSD_Spec.pdf

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

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13747
  • Country: gb
    • Mike's Electric Stuff
Re: how use external flash memory?
« Reply #2 on: July 22, 2013, 10:39:44 am »
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.

 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline RoadRunnerTopic starter

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: de
Re: how use external flash memory?
« Reply #3 on: July 22, 2013, 12:44:37 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf