PROJECT= blinkled_ele
SOURCES=$(PROJECT).c
MMCU=attiny45
F_CPU = 8000000
CFLAGS=-mmcu=$(MMCU) -Wall -Os -DF_CPU=$(F_CPU)
$(PROJECT).hex: $(PROJECT).out
avr-objcopy -O ihex $(PROJECT).out $(PROJECT).c.hex;\
avr-size --mcu=$(MMCU) --format=avr $(PROJECT).out
$(PROJECT).out: $(SOURCES)
avr-gcc $(CFLAGS) -I./ -o $(PROJECT).out $(SOURCES)
program-usbtiny: $(PROJECT).hex
avrdude -p t45 -P usb -c usbtiny -U flash:w:$(PROJECT).c.hex
program-usbtiny-fuses: $(PROJECT).hex
avrdude -p t45 -P usb -c usbtiny -U lfuse:w: 0x62:m
$ make -f blinkled_ele.make
avr-gcc -mmcu=attiny45 -Wall -Os -DF_CPU=8000000 -I./ -o blinkled_ele.out blinkled_ele.c
avr-objcopy -O ihex blinkled_ele.out blinkled_ele.c.hex;\
avr-size --mcu=attiny45 --format=avr blinkled_ele.out
AVR Memory Usage
----------------
Device: attiny45
Program: 98 bytes (2.4% Full)
(.text + .data + .bootloader)
Data: 0 bytes (0.0% Full)
(.data + .bss + .noinit)
$ make -f blinkled_ele.make program-usbtiny
avr-objcopy -O ihex blinkled_ele.out blinkled_ele.c.hex;\
avr-size --mcu=attiny45 --format=avr blinkled_ele.out
AVR Memory Usage
----------------
Device: attiny45
Program: 98 bytes (2.4% Full)
(.text + .data + .bootloader)
Data: 0 bytes (0.0% Full)
(.data + .bss + .noinit)
avrdude -p t45 -P usb -c usbtiny -U flash:w:blinkled_ele.c.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9206
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "blinkled_ele.c.hex"
avrdude: input file blinkled_ele.c.hex auto detected as Intel Hex
avrdude: writing flash (98 bytes):
Writing | ################################################## | 100% 0.09s
avrdude: 98 bytes of flash written
avrdude: verifying flash memory against blinkled_ele.c.hex:
avrdude: load data flash data from input file blinkled_ele.c.hex:
avrdude: input file blinkled_ele.c.hex auto detected as Intel Hex
avrdude: input file blinkled_ele.c.hex contains 98 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.06s
avrdude: verifying ...
avrdude: 98 bytes of flash verified
avrdude done. Thank you.
$ make -f blinkled_ele.make program-usbtiny-fuses
avr-objcopy -O ihex blinkled_ele.out blinkled_ele.c.hex;\
avr-size --mcu=attiny45 --format=avr blinkled_ele.out
AVR Memory Usage
----------------
Device: attiny45
Program: 98 bytes (2.4% Full)
(.text + .data + .bootloader)
Data: 0 bytes (0.0% Full)
(.data + .bss + .noinit)
avrdude -p t45 -P usb -c usbtiny -U lfuse:w:0x62:m
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9206
avrdude: reading input file "0x62"
avrdude: writing lfuse (1 bytes):
Writing | ################################################## | 100% 0.01s
avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0x62:
avrdude: load data lfuse data from input file 0x62:
avrdude: input file 0x62 contains 1 bytes
avrdude: reading on-chip lfuse data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude done. Thank you.