Go Down

Topic: EPPROM  (Read 721 times) previous topic - next topic

bemin

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

UKHeliBob

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 ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

bemin

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 ????

PaulS

Quote
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?
The art of getting good answers lies in asking good questions.

bemin

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

PaulS

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.
The art of getting good answers lies in asking good questions.

UKHeliBob

Quote
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 ?

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Jiggy-Ninja

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.
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

Go Up