Line 15... |
Line 15... |
15 |
|
15 |
|
16 |
|
16 |
|
17 |
# Define target dependent constants |
17 |
# Define target dependent constants |
18 |
# --------------------------------- |
18 |
# --------------------------------- |
19 |
|
19 |
|
20 |
ifeq ($(TARGET), atmega88) |
- |
|
21 |
HFUSE=0xc9 |
- |
|
22 |
LFUSE=0xef |
- |
|
23 |
endif |
- |
|
24 |
|
- |
|
25 |
ifeq ($(TARGET), atmega8) |
20 |
ifeq ($(TARGET), atmega8) |
26 |
HFUSE=0xc9 |
21 |
HFUSE=0xC9 |
27 |
LFUSE=0xef |
22 |
LFUSE=0x9F |
28 |
endif |
23 |
endif |
29 |
|
24 |
|
30 |
ifeq ($(TARGET), atmega8) |
25 |
ifeq ($(TARGET), atmega88) |
- |
|
26 |
EFUSE=0xF9 |
31 |
HFUSE=0xdd |
27 |
HFUSE=0xDE |
32 |
LFUSE=0xff |
28 |
LFUSE=0xD7 |
33 |
endif |
29 |
endif |
34 |
|
30 |
|
35 |
|
31 |
|
36 |
|
- |
|
37 |
# ISP=bsd PORT=/dev/parport0 |
32 |
# ISP=bsd PORT=/dev/parport0 |
38 |
# ISP=ponyser PORT=/dev/ttyS1 |
33 |
# ISP=ponyser PORT=/dev/ttyS1 |
39 |
# ISP=stk500 PORT=/dev/ttyS1 |
34 |
# ISP=stk500 PORT=/dev/ttyS1 |
40 |
# ISP=usbasp PORT=/dev/usb/ttyUSB0 |
35 |
# ISP=usbasp PORT=/dev/usb/ttyUSB0 |
41 |
# ISP=stk500v2 PORT=/dev/ttyUSB0 |
36 |
# ISP=stk500v2 PORT=/dev/ttyUSB0 |
Line 110... |
Line 105... |
110 |
avrdude -c ${ISP} -p ${TARGET} -P ${PORT} -u -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m |
105 |
avrdude -c ${ISP} -p ${TARGET} -P ${PORT} -u -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m |
111 |
|
106 |
|
112 |
avrdude: |
107 |
avrdude: |
113 |
avrdude -c ${ISP} -p ${TARGET} -P ${PORT} -v |
108 |
avrdude -c ${ISP} -p ${TARGET} -P ${PORT} -v |
114 |
|
109 |
|
- |
|
110 |
# Fuse atmega8 |
- |
|
111 |
# ------------ |
115 |
# Fuse atmega8 high byte HFUSE: |
112 |
# Fuse atmega8 high byte HFUSE: |
- |
|
113 |
# 0xD9 = 1 1 0 1 1 0 0 1 = Factory Default Value |
116 |
# 0xc9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000) |
114 |
# 0xC9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000) |
117 |
# ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0 |
115 |
# ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0 |
118 |
# | | | | | +-------- BOOTSZ1 |
116 |
# | | | | | +-------- BOOTSZ1 |
119 |
# | | | | + --------- EESAVE (don't preserve EEPROM over chip erase) |
117 |
# | | | | + --------- EESAVE (don't preserve EEPROM over chip erase) |
120 |
# | | | +-------------- CKOPT (full output swing) |
118 |
# | | | +-------------- CKOPT (full output swing) |
121 |
# | | +---------------- SPIEN (allow serial programming) |
119 |
# | | +---------------- SPIEN (allow serial programming) |
122 |
# | +------------------ WDTON (WDT not always on) |
120 |
# | +------------------ WDTON (WDT not always on) |
123 |
# +-------------------- RSTDISBL (reset pin is enabled) |
121 |
# +-------------------- RSTDISBL (reset pin is enabled) |
124 |
# Fuse atmega8 low byte LFUSE: |
122 |
# Fuse atmega8 low byte LFUSE: |
- |
|
123 |
# 0xE1 = 1 1 1 0 0 0 0 1 = Factory Default Value |
125 |
# 0x9f = 1 0 0 1 1 1 1 1 |
124 |
# 0x9F = 1 0 0 1 1 1 1 1 |
126 |
# ^ ^ \ / \--+--/ |
125 |
# ^ ^ \ / \--+--/ |
127 |
# | | | +------- CKSEL 3..0 (external >8M crystal) |
126 |
# | | | +------- CKSEL 3..0 (external >8M crystal) |
128 |
# | | +--------------- SUT 1..0 (crystal osc, BOD enabled) |
127 |
# | | +--------------- SUT 1..0 (crystal osc, BOD enabled) |
129 |
# | +------------------ BODEN (BrownOut Detector enabled) |
128 |
# | +------------------ BODEN (BrownOut Detector enabled) |
130 |
# +-------------------- BODLEVEL (2.7V) |
129 |
# +-------------------- BODLEVEL (2.7V) |
131 |
# |
130 |
# |
- |
|
131 |
# Fuse atmega88 |
- |
|
132 |
# ------------- |
132 |
# Fuse atmega48 high byte hfuse: |
133 |
# Fuse atmega88 extended byte: |
- |
|
134 |
# 0xF9 = 1 1 1 1 1 0 0 1 = Factory Default Value (default value is used) |
133 |
# 0xdf = 1 1 0 1 1 1 1 1 factory setting |
135 |
# 0xF9 = 1 1 1 1 1 0 0 1 <-- BOOTRST (select vetor) |
- |
|
136 |
# \+/ |
- |
|
137 |
# +----- BOOTSZ1..0 (Select Boot Size) |
- |
|
138 |
# Fuse high byte: |
- |
|
139 |
# 0xDF 1 1 0 1 1 1 1 1 = Factory Default Value (default value may be used) |
- |
|
140 |
# 0xDE = 1 1 0 1 1 1 1 0 |
134 |
# ^ ^ ^ ^ ^ \-+-/ |
141 |
# ^ ^ ^ ^ ^ \-+-/ |
135 |
# | | | | | +------ BODLEVEL (Brown out disabled) |
142 |
# | | | | | +------ BODLEVEL (1.7-2.0V) |
136 |
# | | | | + --------- EESAVE (don't preserve EEPROM over chip erase) |
143 |
# | | | | +---------- EESAVE (don't preserve EEPROM over chip erase) |
137 |
# | | | +-------------- WDTON (WDT not always on) |
144 |
# | | | +-------------- WDTON (WDT not always on) |
138 |
# | | +---------------- SPIEN (allow serial programming) |
145 |
# | | +---------------- SPIEN (allow serial programming)!!! |
139 |
# | +------------------ DWEN (debug wire is disabled) |
146 |
# | +------------------ DWEN (debug wire not enabled) |
140 |
# +-------------------- RSTDISBL (reset pin is enabled) |
147 |
# +-------------------- RSTDISBL (reset pin is not disabled) |
141 |
# 0xdd = ext.reset, no DW, SPI, no watchdog, no save eeprom, BOD 2.7V |
- |
|
142 |
# Fuse atmega48 low byte lfuse: |
148 |
# Fuse low byte: |
- |
|
149 |
# 0x62 0 1 1 0 0 0 1 0 = Factory Default Value (must be programmed to use xosc) |
143 |
# 0x62 = 0 1 1 0 0 0 1 0 factory setting |
150 |
# 0xD7 = 1 1 0 1 0 1 1 1 |
144 |
# ^ ^ \ / \--+--/ |
151 |
# ^ ^ \ / \--+--/ |
145 |
# | | | +------- CKSEL 3..0 (internal 8Mhz Oszillator) |
152 |
# | | | +------- CKSEL 3..0 (full swing xosc, BOD enabled) |
146 |
# | | +--------------- SUT 1..0 (start-up time) |
153 |
# | | +--------------- SUT 1..0 (startup timer - see CKSEL) |
147 |
# | +------------------ CKOUT (no clock output) |
154 |
# | +------------------ CKOUT (clock output is not enabled) |
148 |
# +-------------------- CKDIV8 (divide clock by 8) |
155 |
# +-------------------- CLKDIV8 (clock divider is not enabled) |
149 |
# 0xdc = divide/1,no clock output,fast raising power,low Pw Oszil. 3..8 Mhz |
- |
|
150 |
# 0xe0 = divide/1,no clock output,fast raising power,external Oszil. |
- |
|
151 |
# 0xff = divide/1,no clock output,slow raising power,low Pw Oszil 8.. Mhz |
- |
|
- |
|
156 |
|
152 |
|
157 |
|
153 |
|
158 |
|
154 |
SERIAL = `echo /dev/tty.USA19QI*` |
159 |
SERIAL = `echo /dev/tty.USA19QI*` |
155 |
UISP = uisp -dprog=$S -dserial=$(SERIAL) -dpart=auto |
160 |
UISP = uisp -dprog=$S -dserial=$(SERIAL) -dpart=auto |
156 |
# The two lines above are for "uisp" and the AVR910 serial programmer connected |
161 |
# The two lines above are for "uisp" and the AVR910 serial programmer connected |