EPPROM

Thanks for the reply , But I want to clear something up

I don't wanna save data from Arduino, or from any sensor that is connected to Arduino. I have a cal file that I needed to be save on the EEPROM or on the flash memory.

BTW does anyone know what is the ": SKetch -> ADD file " button do ?

thanks

what is the ": SKetch → ADD file " button do ?

Surprisingly enough it adds a file to the current program by prompting you which file to add, then creating a new tab in the IDE which gives access to editing the file.

Try it and see

I have a cal file that I needed to be save on the EEPROM or on the flash memory.

And that has what to do with saving data to the desktop? The Arduino doesn't come in a desk, so it doesn't have a desktop, drawers, or a desk chair.

Interesting , so If i used the add file button to add a text file to my sketch, then uploaded it to my arduino Micro Board,Does that means I will be uploading the txt file as well ?????

If the above true , then this is a great news, then I can dump the flash memory into a file in my desktop, through the usb/serial. Is that feasible ?

If i used the add file button to add a text file to my sketch, then uploaded it to my arduino Micro Board,Does that means I will be uploading the txt file as well

No. The IDE will compile the contents of the extra file or files into the project, not just simply upload it to the Arduino in some way.

Yes, but is ther away to read the flash memory using serial port

Yes, but is ther away to read the flash memory using serial port

No. You can use the serial port to send the Arduino a request, like <"Hey, there, Mr. Arduino, could you please tell me what's stored in EEPROM?>".

Then, when the Arduino got such a request (or, just maybe something simpler), it could generate a suitable response.

Okay But the EPPROM is only 1kb , My Cal file is around 10 Ks, that is why i am hoping to access the flash memory file. How about if i createa header file and defined the variables in the header file . can I read those variable using C++ ? after compiling .

can I read those variable using C++ ?

Can you get the contents of a variable that you have defined? It would be a useless exercise creating variables if you couldn't access the contents, wouldn't it? Write-only variables...

Yes that is a good question!! Hummm I actually don't know

bemin:
Yes that is a good question!! Hummm I actually don’t know

It was a trick question. The answer is “well, duh, of course”.

Hahah, DUhhh*** On the top of your head, Can you five an example on how possible we can do that

Can I save a zip file in the EEPPROM tho ??

bemin: Can I save a zip file in the EEPPROM tho ??

A ZIP file is a series of bytes. The EEPROM holds a series of bytes.

So, subject to space being available you could, indeed, save a ZIP file to the EEPROM by reading it a byte at a time from the PC and saving them. Once there, what would you do with it ?

Well If I successfully were able to save it there then I will call it from C++ to be transferred or open on a Desktop but I am not sure how to do that tho ? how to read it fro the PC? Since the EEPROM have only few function

Functions

read() write() update() get() put() EEPROM[]

AND

"EEPROM Read: Read the EEPROM and send its values to the computer. EEPROM Write: Stores values from an analog input to the EEPROM."

How can I read from the computer to the EEPROM ????

how to read it fro the PC?

I have a book. The book has 1024 pages. There is one letter per page. How do YOU think you could determine what is on page 937 of MY book?

PaulS: I have a book. The book has 1024 pages. There is one letter per page. How do YOU think you could determine what is on page 937 of MY book?

Only If I know the exact address for the line on your book

bemin: Only If I know the exact address for the line on your book

It's MY book. I'm not going to give you direct access to it.

THAT is the point. The Arduino does NOT make the EEPROM directly accessible to anything.

If you want to know what is on page 937 of my book, you have to ask me for the data on page 937. If you (the PC) want to know what is in EEPROM address 937, you (some application on the PC) have to ask the Arduino for that data.

How can I read from the computer to the EEPROM

The Arduino program requests data from the PC over the Serial connection. The PC sends it one byte at a time and the Arduino reads over the Serial connection and puts it into sequential locations in the EEPROM starting at an address that you decide. By definition you know that address.

The PC can request the file to be sent to it by sending a message over the Serial connection to the Arduino. The Arduino responds by reading the EEPROM from the start address byte by byte and sending each of them over the Serial interface to the PC.

Note that you need specially written programs on both the PC and the Arduino to do this.

I am not clear why you would want to do this. What problem are you trying to solve ?

bemin: Yes, but is ther away to read the flash memory using serial port

avrdude, the program used to upload programs to AVR chips, also has the ability to read the flash memory (and EEPROM, fuses, and lock bits if the programmer supports it) and save it to a file on your computer. It can also load a file on your computer into flash, EEPROM, fuses, or lock bits. That's how sketches get uploaded normally.

The catch is that avrdude uses the programming mode of the microcontroller, which requires resetting the processor and interrupting normal operation while the programming actions are happening. This might or might not be a problem for you.

Just like PROGMEM, the avr-gcc compiler has an EEMEM attribute that lets you define variables that reside in EEPROM memory. This lets you define default values for an EEPROM table that you can flash in without having to write a special sketch or initialization function to write those values in yourself. Unfortunately, there's no way to upload EEPROM information with the normal Arduino bootloader. Optiboot (the bootloader Arduino uses) has that functionality disabled, and there's no way to even use those commands in the normal Arduino workflow. You would need to either use avrdude from the command line to upload the eeprom file, or create custom boards.txt and platforms.txt files that allow you to select the eeprom memory to upload to with an external programmer. I've done this myself, so I know it's possible.