Sie sind auf Seite 1von 7

Fuses and Lock Bits

The ATMega128 has several special memory areas


-Si lock !its "hich determine program memory #eatures$
-Three #use !ytes "hich determine various hard"are #eatures
-Three !ytes #or device signature
-Four !ytes #or %& oscillator cali!ration 'shared "ith device signature(
The si lock !its are !roken do"n into)
-#our BLB lock !its
-t"o lock !its #or overall programming protection
The lock !its select "here the SPM and ELPM are allo"ed to operate and
i# the !ootloader is allo" to over"rite itsel#$
Lock !its are logic *ero "hen programmed+ one "hen not programmed
Fuses and Lock Bits
The Fuse !ytes are the
-,tended Fuse Byte
-Lo" Fuse Byte
--igh Fuse Byte
,tended Fuse Byte determines
-M1./& 'mega 128 predesessor( compati!ility
-i# "atchdog Timer is al"ays on
Fuses and Lock Bits
The Fuse !ytes are the
-,tended Fuse Byte
-Lo" Fuse Byte
--igh Fuse Byte
,tended Fuse Byte determines
-M1./& 'mega 128 predesessor( compati!ility
-i# "atchdog Timer is al"ays on
-igh Fuse Byte determines
-availa!ility o# 0&1+ 2TA3+ S45 do"nloading
-i# oscillator options are availa!le
-i# ,,4%0M is preserved during chip erase
-!oot !lock si*e
-i# reset vector is application or !ootloader address *ero
Fuse !its are logic *ero "hen programmed+ logic one "hen not programmed
Fuse !its are inaccessi!le !y application or !ootloader programs
Fuse !its not e##ected !y chip erase or at all i# lock !it 'LB1( is set
Fuses and Lock Bits
-igh Fuse Byte determines
-availa!ility o# 0&1+ 2TA3+ S45 do"nloading
-i# oscillator options are availa!le
-i# ,,4%0M is preserved during chip erase
-!oot !lock si*e
-i# reset vector is application or !ootloader address *ero
Fuses and Lock Bits
Lo" Fuse Byte determines
-!ro"nout detector trigger level
-startup time
-clock sources
Fuse !its are logic *ero "hen programmed+ logic one "hen not programmed
Fuse !its are inaccessi!le !y application or !ootloader programs
Fuse !its not e##ected !y chip erase or at all i# lock !it 'LB1( is set
Fuses and Lock Bits
Fuse !ytes can !e read6"ritten "ith avrdude interactively in terminal mode
avrdude -p m128 -u -c usbasp -t //unsafe option chosen (see manual) //unsafe option chosen (see manual)
avrdude: AVR device initialized and read to accept instructions
avrdude: !evice si"nature # $%1e&'$2
avrdude: current erase-re(rite ccle count is )2 (if bein" trac*ed)
avrdude+ d efuse
+++ d efuse //dump entended fuse //dump entended fuse
$$$$ fd
avrdude+ d hfuse //dump hi"h fuse //dump hi"h fuse
+++ d hfuse
$$$$ &&
avrdude+ d lfuse //dump lo( fuse //dump lo( fuse
+++ d lfuse
$$$$ e1
avrdude+ ( efuse $ $%ff //(rite e%tended fuse //(rite e%tended fuse
+++ ( efuse $ $%ff
avrdude+ ( hfuse $ $%8& //(ire hi"h fuse //(ire hi"h fuse
+++ ( hfuse $ $%8&
avrdude+ ( lfuse $ $%2f //(rite lo( fuse //(rite lo( fuse
+++ ( lfuse $ $%2f
Fuses and Lock Bits
Fuse !ytes 'and memory( can !e read6"ritten "ith avrdude #rom the command line$
For eample+ "hen programming a Mega78 to run at 8Mh*+ the lo" #use needs
to !e changed to $%,2$ 5t can !e done like this)
sudo avrdude -c usbasp -p m-8 -. lfuse:(:$%,2:m -v
/-./ indicates a memor operation0
/(/ indicates a (rite
/lfuse/ the location to perform the operation on
/$%e2/ the he% value bein" (ritten
/m/ ta*e the immediate value specified on command line
/-v/ verbose mode
Multiple operations can !e done simultaneously too)
avrdude -p m128 -u -. flash:(:dia"1he% 2
+ -. eeprom:(:eeprom1he% 2
+ -. efuse:(:$%ff:m 2
+ -. hfuse:(:$%8&:m 2
+ -. lfuse:(:$%2e:m
8eri#ying #rom command line that #lash memory is same as the #ile code.hex:
avrdude -p m128 -c 3pro"rammer4tpe+ -. flash:v:code1he% 2
See the avrdude manual #or more details)
http://(((1non"nu1or"/avrdude/user-manual/avrdude1html

Das könnte Ihnen auch gefallen