From 9bed754a7dd583232bef447215d662519d9ebc76 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Wed, 30 Dec 2020 03:26:13 +0100 Subject: [PATCH] Made changes for ATmega328P --- Makefile | 4 ++-- main.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2646923..cc62c9a 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,10 @@ TARGET = twiboot SOURCE = $(wildcard *.c) # select MCU -MCU = attiny85 +MCU = atmega328p AVRDUDE_PROG := -c avr910 -b 115200 -P /dev/ttyUSB0 -#AVRDUDE_PROG := -c dragon_isp -P usb +AVRDUDE_PROG := -c usbasp -P usb # --------------------------------------------------------------------------- diff --git a/main.c b/main.c index 1ec8249..4e4024c 100644 --- a/main.c +++ b/main.c @@ -21,12 +21,12 @@ #include #include -#define VERSION_STRING "TWIBOOT v3.1" +#define VERSION_STRING "TWIBOOT v3.1 (M)" #define EEPROM_SUPPORT 1 #define LED_SUPPORT 1 #ifndef USE_CLOCKSTRETCH -#define USE_CLOCKSTRETCH 0 +#define USE_CLOCKSTRETCH 1 #endif #ifndef VIRTUAL_BOOT_SECTION @@ -37,8 +37,8 @@ #define TWI_ADDRESS 0x29 #endif -#define F_CPU 8000000ULL -#define TIMER_DIVISOR 1024 +#define F_CPU 16000000ULL +#define TIMER_DIVISOR 2048 #define TIMER_IRQFREQ_MS 25 #define TIMEOUT_MS 1000 @@ -741,7 +741,7 @@ static void TIMER0_OVF_vect(void) TCNT0 = 0xFF - TIMER_MSEC2TICKS(TIMER_IRQFREQ_MS); /* blink LED while running */ - LED_GN_TOGGLE(); + /* LED_GN_TOGGLE(); */ /* count down for app-boot */ if (boot_timeout > 1)