Page 1 of 1
How to set fuse bits for Tiny2313 when implementing USB ?
Posted: Wed Dec 19, 2007 8:23 am
by chisteven
I try to implement USB with AVR-CDC using ATtiny2313
I referenced the datasheet but can't get the right setting for fuse bits,
(or it doesn't need to program the fuse bit ? )
can anyone tell me which fuse bits should be programmed (set to 0) ?
( use 12MHZ crystal oscillator )
please give me a hand, thanks a lot~~
Posted: Sat Dec 22, 2007 9:23 am
by Guest
Christeven,
this MAKEFILE snipplet is from Osamu Tamura's own tiny2313 example. It worked fine for me (version 2007-10-03).
To use it you need to run "make fuse_tiny2313" before or after flashing the actual code,
Code: Select all
# Fuse low byte:
# 0xef = 1 1 1 0 1 1 1 1
# ^ ^ \+/ \--+--/
# | | | +------- CKSEL 3..0 (clock selection -> crystal @ 12 MHz)
# | | +--------------- SUT 1..0 (BOD enabled, fast rising power)
# | +------------------ CKOUT (clock output on CKOUT pin -> disabled)
# +-------------------- CKDIV8 (divide clock by 8 -> don't divide)
#
# Fuse high byte:
# 0xdb = 1 1 0 1 1 0 1 1
# ^ ^ ^ ^ \-+-/ ^
# | | | | | +---- RSTDISBL (disable external reset -> enabled)
# | | | | +-------- BODLEVEL 2..0 (brownout trigger level -> 2.7V)
# | | | +-------------- WDTON (watchdog timer always on -> disable)
# | | +---------------- SPIEN (enable serial programming -> enabled)
# | +------------------ EESAVE (preserve EEPROM on Chip Erase -> not preserved)
# +-------------------- DWEN (debug wire enable)
fuse_tiny2313: # only needed for attiny2313
$(AVRDUDE) -U hfuse:w:0xdb:m -U lfuse:w:0xef:m
Cheers
Gert
Posted: Sun Dec 23, 2007 8:38 am
by chisteven
Thank you~~
I'll try it later and tell you if it works fine or not !
DWEN
Posted: Tue Dec 30, 2008 3:26 am
by magwas
Be warned that this snippet enables DebugWire, which means you cannot program the processot without a MKII (and STK500?) anymore.
If you program is with SPI, do not ever alter the DWEN bit, or you have to find a friend with a MKII to set the fuse back.
Posted: Sun Jan 04, 2009 7:06 pm
by christian
Setting DWEN to 1 disables it, setting it to 0 enables it. This is "fuse" logic: a logic 0 means that the fuse is "blown", 1 is the default state.