TLDR: Dump Stock Raduino's EEPROM using avrdude program. Once this EEPROM is dumped (and checked), we can always restore it back safely.
EEPROM size -> ATmega328 (Arduino Uno, Nano, Mini) -> 1024 bytes
Dump the EEPROM:
$ avrdude -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -U eeprom:r:eeprom_dump_dhiru_v3.5-1.txt
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading eeprom memory:
Reading | ################################################## | 100% 1.86s
avrdude: writing output file "eeprom_dump_dhiru_v3.5-1.txt"
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude done. Thank you.
Sanity-check the size:
$ ls -la eeprom_dump_dhiru_v3.5-1.txt
-rw-rw-r-- 1 dhiru dhiru 1024 Aug 4 15:29 eeprom_dump_dhiru_v3.5-1.txt
Parse the EEPROM:
$ xxd eeprom_dump_dhiru_v3.5-1.txt
00000000: fb5c 0200 ffff ffff 1c0e b700 ffff ffff .\..............
00000010: 6056 6c00 70e9 d700 ffff ffff 9600 ffff `Vl.p...........
00000020: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000030: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000040: 13fb 5c02 00ff ffff ff1c 0eb7 00ff ffff ..\.............
00000050: ffb0 196d 0070 e9d7 00ff ffff ff96 00ff ...m.p..........
...
$ ipython
Python 3.8.2 (default, Apr 10 2020, 12:38:04)
In [2]: int("0x00025cfb", 16) <- first 4 EEPROM byte in LE format => MASTER_CAL
Out[2]: 154875
In [3]: int("0x00b70e1c", 16) <- BFO setting (USB_CAL)!
Out[3]: 11996700
These values match the ones read by uBITX_Manager_V1.11
(which works for
custom non-factory firmwares only?).
[NEW] uBitx EEPROM parser:
$ python parser.py eeprom_dump_dhiru_v3.5-1.txt
Master Calibration (MASTER_CAL): 154875
USB Calibration (USB_CAL): 11996700 'BFO'
$ python parser.py eeprom_dump_dhiru_v3.5-larc-2021.txt
Master Calibration (MASTER_CAL): 121625
USB Calibration (USB_CAL): 11995800 'BFO'
python parser.py eeprom_dump_dhiru_v6-2022.txt
Master Calibration (MASTER_CAL): 180700
USB Calibration (USB_CAL): 11056300 'BFO'
[NEW] Windows Tips:
- [NEW] Extract (to a writable folder) and use the included
avrdude.zip
. Just click on the includeddump.bat
.
[OLD] Windows Tips:
-
Install Arduino IDE
-
Find
avrdude.conf
andavrdude.exe
on your computer. Copyavrdude.conf
next toavrdude.exe
. -
You may need to add
-F
flag to theavrdude
command. Also, you may need to copyavrdude.exe
and its dependencies to a new writable folder. -
Get latest Python from https://www.python.org/downloads/windows/.
-
Yes, Windows gets in the way, more often than not.