Made changes for ATmega328P
This commit is contained in:
parent
baf5a895b5
commit
9bed754a7d
4
Makefile
4
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
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
|
10
main.c
10
main.c
|
@ -21,12 +21,12 @@
|
|||
#include <avr/boot.h>
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#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)
|
||||
|
|
Reference in New Issue
Block a user