Subversion Repositories group.electronics

Rev

Rev 85 | Rev 87 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 85 Rev 86
Line 6... Line 6...
6
# Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH
6
# Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH
7
# License: GPLv2.
7
# License: GPLv2.
8
# This Revision: $Id$
8
# This Revision: $Id$
9
 
9
 
10
DEVICE=atmega168
10
DEVICE=atmega168
-
 
11
F_CPU=20000000
-
 
12
HID_SIZE=44
-
 
13
 
11
AVRDUDE = avrdude -c avrispmkii -P usb -p $(DEVICE)
14
AVRDUDE = avrdude -c avrispmkii -P usb -p $(DEVICE)
12
# The two lines above are for "avrdude" and the STK500 programmer connected
15
# The two lines above are for "avrdude" and the STK500 programmer connected
13
# to an USB to serial converter to a Mac running Mac OS X.
16
# to an USB to serial converter to a Mac running Mac OS X.
14
# Choose your favorite programmer and interface.
17
# Choose your favorite programmer and interface.
15
 
18
 
16
COMPILE = avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=$(DEVICE) -DF_CPU=12000000 -DDEBUG_LEVEL=0
19
COMPILE = avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) -DHID_SIZE=$(HID_SIZE) -DDEBUG_LEVEL=0
17
# NEVER compile the final product with debugging! Any debug output will
20
# NEVER compile the final product with debugging! Any debug output will
18
# distort timing so that the specs can't be met.
21
# distort timing so that the specs can't be met.
19
 
22
 
20
#OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o
23
#OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o
21
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o  main.o
24
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o  main.o
Line 38... Line 41...
38
 
41
 
39
flash:	all
42
flash:	all
40
	$(AVRDUDE) -U flash:w:main.hex:i
43
	$(AVRDUDE) -U flash:w:main.hex:i
41
 
44
 
42
 
45
 
43
# Fuse high byte:
-
 
44
# 0xdd = 1 1 0 1   1 1 0 1
-
 
45
#        ^ ^ ^ ^   ^ \-+-/ 
-
 
46
#        | | | |   |   +------ BODLEVEL 2..0 (brownout trigger level -> 2.7V)
-
 
47
#        | | | |   +---------- EESAVE (preserve EEPROM on Chip Erase -> not preserved)
-
 
48
#        | | | +-------------- WDTON (watchdog timer always on -> disable)
-
 
49
#        | | +---------------- SPIEN (enable serial programming -> enabled)
-
 
50
#        | +------------------ DWEN (debug wire enable)
-
 
51
#        +-------------------- RSTDISBL (disable external reset -> enabled)
-
 
52
#
-
 
53
# Fuse low byte:
-
 
54
# 0xe1 = 1 1 1 0   0 0 0 1
-
 
55
#        ^ ^ \+/   \--+--/
-
 
56
#        | |  |       +------- CKSEL 3..0 (clock selection -> HF PLL)
-
 
57
#        | |  +--------------- SUT 1..0 (BOD enabled, fast rising power)
-
 
58
#        | +------------------ CKOUT (clock output on CKOUT pin -> disabled)
-
 
59
#        +-------------------- CKDIV8 (divide clock by 8 -> don't divide)
-
 
60
fuse:
46
fuse:
61
	$(AVRDUDE) -U hfuse:w:0xdd:m -U lfuse:w:0xe1:m
47
	$(AVRDUDE) -U hfuse:w:0xdf:m -U lfuse:w:0xff:m
62
 
48
 
63
fusedef:
49
fusedef:
64
	$(AVRDUDE) -U hfuse:w:0xdf:m -Ulfuse:w:0x64:m
50
	$(AVRDUDE) -U hfuse:w:0xdf:m -U lfuse:w:0x62:m
65
 
51
 
66
readcal:
52
readcal:
67
	$(AVRDUDE) -U calibration:r:/dev/stdout:i | head -1
53
	$(AVRDUDE) -U calibration:r:/dev/stdout:i | head -1
68
 
54
 
69
 
55