1,581
edits
(Created page with "Files modified in USBaspBootLoader, probably not yet correct (and should be in github anyway) <nowiki> # Name: Makefile # Project: USBaspLoader # Author: Christian Starkjohann...") |
No edit summary |
||
| Line 3: | Line 3: | ||
<nowiki> | <nowiki> | ||
</nowiki> | |||
# Name: Makefile | # Name: Makefile | ||
# Project: USBaspLoader | # Project: USBaspLoader | ||
| Line 20: | Line 22: | ||
F_CPU = 16000000 | F_CPU = 16000000 | ||
DEVICE = atmega328p | |||
DEVICE = | |||
# BOOTLOADER_ADDRESS is 1800 for 8k devices, 3800 for 16k and 7800 for 32k. | # BOOTLOADER_ADDRESS is 1800 for 8k devices, 3800 for 16k and 7800 for 32k. | ||
BOOTLOADER_ADDRESS = 7800 | BOOTLOADER_ADDRESS = 7800 | ||
| Line 27: | Line 28: | ||
LOCKOPT = -U lock:w:0x2f:m | LOCKOPT = -U lock:w:0x2f:m | ||
PROGRAMMER = -c buspirate -P /dev/ttyUSB1 | # PROGRAMMER = -c buspirate -P /dev/ttyUSB1 -e | ||
PROGRAMMER = -c buspirate -P /dev/ttyUSB1 | |||
# PROGRAMMER contains AVRDUDE options to address your programmer | # PROGRAMMER contains AVRDUDE options to address your programmer | ||
| Line 111: | Line 113: | ||
# Options: | # Options: | ||
DEFINES = #-DDEBUG_LEVEL=2 | DEFINES = -DUSE_AUTOCONFIG=1 #-DDEBUG_LEVEL=2 | ||
# Remove the -fno-* options when you use gcc 3, it does not understand them | # Remove the -fno-* options when you use gcc 3, it does not understand them | ||
CFLAGS = -Wall -Os -fno-move-loop-invariants -fno-tree-scev-cprop -fno-inline-small-functions -I. -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) $(DEFINES) | CFLAGS = -Wall -Os -fno-move-loop-invariants -fno-tree-scev-cprop -fno-inline-small-functions -I. -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) $(DEFINES) | ||
| Line 186: | Line 188: | ||
$(MAKE) main.hex F_CPU=$${clock}000000 DEVICE=atmega$$device BOOTLOADER_ADDRESS=$$addr DEFINES=-DUSE_AUTOCONFIG=1 | $(MAKE) main.hex F_CPU=$${clock}000000 DEVICE=atmega$$device BOOTLOADER_ADDRESS=$$addr DEFINES=-DUSE_AUTOCONFIG=1 | ||
mv main.hex $@ | mv main.hex $@ | ||
| Line 292: | Line 292: | ||
* ISP command. Otherwise pages are erased on demand before they are written. | * ISP command. Otherwise pages are erased on demand before they are written. | ||
*/ | */ | ||
#define SIGNATURE_BYTES 0x1e, 0x93, 0x07, 0 /* ATMega8 */ | |||
/* This macro defines the signature bytes returned by the emulated USBasp to | /* This macro defines the signature bytes returned by the emulated USBasp to | ||
* the programmer software. They should match the actual device at least in | * the programmer software. They should match the actual device at least in | ||
| Line 352: | Line 352: | ||
#endif /* __bootloader_h_included__ */ | #endif /* __bootloader_h_included__ */ | ||
</nowiki> | </nowiki> | ||
| Line 358: | Line 357: | ||
<nowiki> | <nowiki> | ||
/* Name: usbconfig.h | /* Name: usbconfig.h | ||
* Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers | * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers | ||
| Line 669: | Line 669: | ||
* interrupt than INT0, you may have to define some of these. | * interrupt than INT0, you may have to define some of these. | ||
*/ | */ | ||
#define USB_INTR_CFG EICRA | |||
#define USB_INTR_CFG_SET ((1 << ISC10) | (1 << ISC11)) | |||
#define USB_INTR_CFG_CLR 0 | |||
#define USB_INTR_ENABLE EIMSK | |||
#define USB_INTR_ENABLE_BIT INT1 | |||
#define USB_INTR_PENDING EIFR | |||
#define USB_INTR_PENDING_BIT INTF1 | |||
#define USB_INTR_VECTOR INT1_vect | |||
#endif /* __usbconfig_h_included__ */ | #endif /* __usbconfig_h_included__ */ | ||
</nowiki> | </nowiki> | ||