summaryrefslogtreecommitdiffstats
path: root/firmware/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/Makefile')
-rw-r--r--firmware/Makefile11
1 files changed, 7 insertions, 4 deletions
diff --git a/firmware/Makefile b/firmware/Makefile
index 0e38760..403786a 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -17,13 +17,16 @@
F_CPU = 16500000
DEVICE = attiny85
-# BOOTLOADER_ADDRESS is 1800 for 8k devices, 3800 for 16k and 7800 for 32k.
-# Can be on the start of any flash page for ATtiny85, but must be set low enough so there is space for the full boot loader
-# BOOTLOADER_ADDRESS is in units of 4 bytes seems like
-BOOTLOADER_ADDRESS = 1740
FUSEOPT = $(FUSEOPT_t85)
LOCKOPT = -U lock:w:0x2f:m
+# hexadecimal address for bootloader section to begin. To calculate the best value:
+# - make clean; make main.hex; ### output will list data: 2124 (or something like that)
+# - for the size of your device (8kb = 1024 * 8 = 8192) subtract above value 2124... = 6068
+# - How many pages in is that? 6068 / 64 (tiny85 page size in bytes) = 94.8125
+# - round that down to 94 - our new bootloader address is 94 * 64 = 6016, in hex = 1780
+BOOTLOADER_ADDRESS = 1780
+
PROGRAMMER = -c USBasp
# PROGRAMMER contains AVRDUDE options to address your programmer