how can i save an image on avr program memory ?

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

need to save an image on avr program memory or eeprom so that later i can add that image to html code as

how can i do it ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First question is the size of the image. Will it fit into code space? You might get a thumbnail into eeprom, but not much more.

There are a number of utilities that convert a file into C arrays. If you look at how lwip and uip save their webpages, then the images are saved the same way. In the ti stellaris driverlib, there is the source and executable for such a utility. There are plenty of others.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Often the best place to store an image is in flash.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I usually save .bmp files in a resial flash from ATMEL AT45DB081D-SU

Of course you can save it in the AVR EEPROM or even flash memory, but like Kartman says it depends on the image file size.

regards,

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

There are a number of utilities that convert a file into C arrays.

I like xxd that comes with the vim editor. On Linux it's almost certainly there already and on Windows you can download the .zip for VIM and just take xxd.exe from it. Use the -i parameter.