Made changes for ATmega328P

This commit is contained in:
Dreaded_X 2020-12-30 03:26:13 +01:00
parent baf5a895b5
commit 9bed754a7d
2 changed files with 7 additions and 7 deletions

View File

@ -8,10 +8,10 @@ TARGET = twiboot
SOURCE = $(wildcard *.c) SOURCE = $(wildcard *.c)
# select MCU # select MCU
MCU = attiny85 MCU = atmega328p
AVRDUDE_PROG := -c avr910 -b 115200 -P /dev/ttyUSB0 AVRDUDE_PROG := -c avr910 -b 115200 -P /dev/ttyUSB0
#AVRDUDE_PROG := -c dragon_isp -P usb AVRDUDE_PROG := -c usbasp -P usb
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

10
main.c
View File

@ -21,12 +21,12 @@
#include <avr/boot.h> #include <avr/boot.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#define VERSION_STRING "TWIBOOT v3.1" #define VERSION_STRING "TWIBOOT v3.1 (M)"
#define EEPROM_SUPPORT 1 #define EEPROM_SUPPORT 1
#define LED_SUPPORT 1 #define LED_SUPPORT 1
#ifndef USE_CLOCKSTRETCH #ifndef USE_CLOCKSTRETCH
#define USE_CLOCKSTRETCH 0 #define USE_CLOCKSTRETCH 1
#endif #endif
#ifndef VIRTUAL_BOOT_SECTION #ifndef VIRTUAL_BOOT_SECTION
@ -37,8 +37,8 @@
#define TWI_ADDRESS 0x29 #define TWI_ADDRESS 0x29
#endif #endif
#define F_CPU 8000000ULL #define F_CPU 16000000ULL
#define TIMER_DIVISOR 1024 #define TIMER_DIVISOR 2048
#define TIMER_IRQFREQ_MS 25 #define TIMER_IRQFREQ_MS 25
#define TIMEOUT_MS 1000 #define TIMEOUT_MS 1000
@ -741,7 +741,7 @@ static void TIMER0_OVF_vect(void)
TCNT0 = 0xFF - TIMER_MSEC2TICKS(TIMER_IRQFREQ_MS); TCNT0 = 0xFF - TIMER_MSEC2TICKS(TIMER_IRQFREQ_MS);
/* blink LED while running */ /* blink LED while running */
LED_GN_TOGGLE(); /* LED_GN_TOGGLE(); */
/* count down for app-boot */ /* count down for app-boot */
if (boot_timeout > 1) if (boot_timeout > 1)