added a make target for 4.8Mhz without the CLKDIV8 bit flag on.

This commit is contained in:
jakeg00dwin 2024-01-03 17:23:47 -08:00
parent fc610a2f44
commit 2d85b5138c
1 changed files with 8 additions and 3 deletions

View File

@ -8,8 +8,9 @@
CC = avr-gcc CC = avr-gcc
#Default cpu frequency is 9.8Mhz, 4.8 gives us less power consumption #Default cpu frequency is 9.8Mhz, 4.8 gives us less power consumption
#F_CPU = 4800000UL #F_CPU = 1000000UL
F_CPU = 9800000UL F_CPU = 4800000UL
#F_CPU = 9800000UL
MCU = attiny13a MCU = attiny13a
# Flags # Flags
@ -45,11 +46,15 @@ $(TARGET).elf: $(OBJ)
%.o: %.c %.o: %.c
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
size: $(TARGET).o size: $(TARGET).o
avr-size --mcu=$(MCU) -t ./$(TARGET).o avr-size --mcu=$(MCU) -t ./$(TARGET).o
# Default for the attiny13a is going to be 9.6Mhz
flash_defualt_fuses: flash_defualt_fuses:
$(AVRDUDE) $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PORT) $(AVRDUDE_MCU) $(BUADRATE) -U lfuse:w:0x6A:m -U hfuse:w:0xFF:m -U lock:w:0xFF:m $(AVRDUDE) $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PORT) $(AVRDUDE_MCU) $(BUADRATE) -U lfuse:w:0x6A:m -U hfuse:w:0xFF:m -U lock:w:0xFF:m
# This is for 4.8Mhz
flash_slow_fuse: flash_slow_fuse:
$(AVRDUDE) $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PORT) $(AVRDUDE_MCU) $(BUADRATE) -U lfuse:w:0x69:m -U hfuse:w:0xFF:m -U lock:w:0xFF:m $(AVRDUDE) $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PORT) $(AVRDUDE_MCU) $(BUADRATE) -U lfuse:w:0x69:m -U hfuse:w:0xFF:m -U lock:w:0xFF:m
flash_slow_nodiv8:
$(AVRDUDE) $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PORT) $(AVRDUDE_MCU) $(BUADRATE) -U lfuse:w:0x79:m -U hfuse:w:0xFF:m -U lock:w:0xFF:m
flash: $(TARGET).hex flash: $(TARGET).hex
$(AVRDUDE) $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PORT) $(AVRDUDE_MCU) $(BUADRATE) -U flash:w:$(TARGET).hex:i $(AVRDUDE) $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PORT) $(AVRDUDE_MCU) $(BUADRATE) -U flash:w:$(TARGET).hex:i