Hi All,
I have used the EEPROM Examples, and I they work as expected.
What i want some instruction on is how to read the EEPROM without writing over what is in the flash.
When I used to program using Microchip PICs, there were tools which allowed one to read the EEPROM without reprograming the flash. If any one knows how to do this, I am interested.
You can do that in various ways. If you have an ICSP programmer you can use avrdude to download the EEPROM contents.
Example:
avrdude -c usbtiny -p m328p -U eeprom:r:myfile.hex:i
That's assuming a USBtiny programmer and a Atmega328P processor. That would read the EEPROM and write to "myfile.hex".
Hi Nick,
Thanks for the reply! I am using the UNO, with an Atmege 328 chip.
I have been using the default setting of AVRISP mkII for the programmer.
I just tried running:
$ avrdude -c avrispmkII -p m328p -U eeprom:r:myfile.hex:i
avrdude: ser_open(): can't set attributes for device "/dev/ttyS0": Inappropriate ioctl for device
which I think is beacuse the arduino is on /dev/ttyAMC0
I havent read all of the avrdude man pages yet, can some one tell me how to specify a device "/dev/ttyAMC0"
explicitly?
ok, i rad the man page,
and saw the -P port specification.
I tried this , but got errors:
$ avrdude -P /dev/ttyACM0 -c avrispmkII -p m328p -U eeprom:r:myfile.hex:i
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
OK Cool, I think I got it. (?)
$ avrdude -P /dev/ttyACM0 -c arduino -p m328p -U eeprom:r:myfile.hex:i
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: reading eeprom memory:
Reading | ################################################## | 100% 2.10s
avrdude: writing output file "myfile.hex"
avrdude: safemode: Fuses OK
avrdude done. Thank you.
I am confussesed by the output of "myfile.hex"
Perhaps I am still using the wrong programmer?
Are these sets the same somehow?
"myfile.hex":
:200000000C9435000C945D000C945D000C945D000C945D000C945D000C945D000C945D0020
:200020000C945D000C945D000C945D000C945D000C945D000C945D000C945D000C945D00D8
:200040000C94B2000C945D000C949E010C94E5010C945D000C945D000C945D000C945D0098
:200060000C945D000C945D00240311241FBECFEFD8E0DEBFCDBF11E0A0E0B1E0E8E2FAE008
:2000800002C005900D92A231B107D9F711E0A2E1B1E001C01D92A13CB107E1F710E0CAE68D
:2000A000D0E004C02297FE010E940E05C836D107C9F70E947A030C9412050C940000609162
:2000C00012017091130185E191E00E94AB008093140160911201709113018FE191E04AE088
:2000E00050E00E94B4048FE191E060E071E00E94C7048FE191E06091140140E150E00E94BD
:2001000062048FE191E00E94B3038091120190911301019690931301809312018050924051
:2001200021F4109213011092120164EF71E080E090E00E94350108958FE191E040E855E216
:2001400060E070E00E9415028FE191E00E9422038823D1F30895F999FECF72BD61BDF89A64
:2001600080B508951F920F920FB60F9211242F933F938F939F93AF93BF9380911A019091F7
:200180001B01A0911C01B0911D0130911E010196A11DB11D232F2D5F2D3720F02D57019626
:2001A000A11DB11D20931E0180931A0190931B01A0931C01B0931D01809116019091170162
:2001C000A0911801B09119010196A11DB11D8093160190931701A0931801B0931901BF91F9
:2001E000AF919F918F913F912F910F900FBE0F901F901895789484B5826084BD84B58160F6
:2002000084BD85B5826085BD85B5816085BDEEE6F0E0808181608083E1E8F0E0108280812D
:2002200082608083808181608083E0E8F0E0808181608083E1EBF0E0808184608083E0EB28
:20024000F0E0808181608083EAE7F0E0808184608083808182608083808181608083808194
:20026000806880831092C1000895EF92FF920F931F93CF93DF937B018C013FB7F8948091BD
:20028000160190911701A0911801B091190126B5A89B05C02F3F19F00196A11DB11D3FBFEE
:2002A000BA2FA92F982F8827820F911DA11DB11D52E0880F991FAA1FBB1F5A95D1F7EC0174
:2002C00030C00E94CA043FB7F8948091160190911701A0911801B091190126B5A89B05C053
:2002E0002F3F19F00196A11DB11D3FBFBA2FA92F982F8827820F911DA11DB11D32E0880FBB
:20030000991FAA1FBB1F3A95D1F78C1B9D0B885E9340B8F20894E108F10801091109C8517E
:20032000DC4FE114F1040105110559F6DF91CF911F910F91FF90EF90089508951F920F9283
:200340000FB60F9211242F933F934F938F939F93EF93FF938091C00082FD19C04091C60064
:2003600080913D01282F30E02F5F3F4F2F73307080913E0190E02817390759F0E0913D0132
:20038000F0E0E15EFE4F42A320933D0102C08091C600FF91EF919F918F914F913F912F91C2
:2003A0000F900FBE0F901F90189580913D0120913E0190E0805C9F4F821B91098F73907024
:2003C000892B11F00E949D0108951F920F920FB60F9211242F938F939F93EF93FF93909153
:2003E0003F0180914001981731F48091C1008F7D8093C10010C0E0914001F0E0EF57FE4F00
which when run via the EEPROM READ program reads:
0 65
1 65
2 6C
3 63
4 6F
5 6D
6 65
7 20
8 74
9 6F
10 20
11 63
12 6F
13 73
14 74
15 63
16 6F
17 3B
18 20
19 49
20 20
21 6C
22 6F
23 76
24 65
25 20
26 79
27 6F
28 75
29 2E
Which reads
eelcome to costco; I love you.
in hex--> ascii
looks like I had a typo.
Maybe I should just Zero write this and try again.
Ah, so it works?
Do you actually have some sort of AVR chip programmer? The Uno bootloader cannot read EEPROM. (it will probably do SOMETHING if you tell it to try, but not the right thing.)
Hi Westfw,
I was under the impression that the UNO was a chip programmer... is that not correct?
in any event, I am getting something out, but Its not what i am expecting.
can I not use the UNO to Read the EEPROM in this way? can I make the aruido into an ICSP?
I was under the impression that the UNO was a chip programmer
under normal circumstances, the UNO uses a "bootloader", which is not quite the same thing as a chip programmer.
An Uno CAN be a chip programmer (using ArduinoISP), but you then need TWO unos. One to be the chip programmer, and one to be ... the chip.