Go Down

Topic: flash memory and C (Read 482 times) previous topic - next topic

mattgilbertnet

Sorry, this is probably a silly question, but if I search for info on writing into arduino's flash memory, I get links (like the one in the playground: http://www.arduino.cc/playground/Code/EEPROM-Flash ) that go to an outside site (http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_rom_array ). This site has examples in C, and my problem is that I don't understand what the relationship is between this code and the arduino code that I'm familiar with. How do I make use of the sample code? Given that I don't really know C, is there any hope for me?

bigengineer

#1
Jun 28, 2007, 09:00 pm Last Edit: Jun 28, 2007, 09:00 pm by bigengineer Reason: 1
Since 0008 there is an eeprom library.  Documentation is in the reference:
http://www.arduino.cc/en/Reference/EEPROM

mattgilbertnet

Thanks, that looks great, but I'll be needing around 2 or 3K of space for data, so EEPROM won't cut it.

bigengineer

#3
Jun 28, 2007, 09:12 pm Last Edit: Jun 28, 2007, 09:12 pm by bigengineer Reason: 1
I am using a 4Mbit dataflash chip, AT45DB041B,  from atmel. I should write some decent code and a tutorial about it. But at the moment all time is lost wrestling the arduino BT.  :-/

It works with SPI.

mattgilbertnet

i'm looking forward to that tutorial. in the meantime, are there any other resources about how to use that chip?

mellis

Basically, all the Arduino code you're familiar with is C.  You should be able to use the commands documented at the outside site (the avr-libc manual).  You might need an #include statement at the top of your sketch - in this case:

#include <avr/pgmspace.h>

Go Up