I have a new AtTiny85 chip on a breadboard, connected to an Arduino Uno serving as ISP.
I'd like to understand the fuses of the AtTiny85 and then set it up to be 16.5MHz internal clock.
I read:
- lfuse 62
- hfuse DF
- efuse FF
Decoding with AVR® Fuse Calculator – The Engbedded Blog
AtTiny85: ckdiv8, spien
Does that mean the chip runs at 8MHz/8 = 1MHz ?
If I set lfuse to 0xE2 (removing ckdiv8) then I should be running 8MHz?
If I want to run at 16.5MHz should I write:
- lfuse F1 (CKSEL 001, SUT 11 i.e. PLL clock, 16CK/14CK + 64ms)
- hfuse DD (BODlevel1 2.8V)
- efuse FE (self program enable)
What fuse properties must I always preserve to not brick it?
- SPI program download (needed to send program)
- Reset enabled (needed to program with ISP?)
- Only internal or PLL clock if I have no cristal.
Thanks!
For those trying to read the fuses, that's how I got it to work:
I had no clue what are the parameters so I used the parameters spewed by AVRdude when I compile successfully, and used the -U lfuse:r:-:i command.
Getting Fuses:
PS C:\Program Files (x86)\Arduino\hardware\tools\avr\bin> ./avrdude.exe -c stk500v1 -p attiny85 -P com4 -U lfuse:r:-:i -v -C ..\etc\avrdude.conf -b 19200
avrdude.exe: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "..\etc\avrdude.conf"
Using Port : com4
Using Programmer : stk500v1
Overriding Baud Rate : 19200
AVR Part : ATtiny85
Chip Erase delay : 400000 us
PAGEL : P00
BS2 : P00
RESET disposition : possible i/o
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 12 4 0 no 512 4 0 4000 4500 0xff 0xff
flash 65 6 32 0 yes 8192 64 128 30000 30000 0xff 0xff
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 2 0 0 0 0 0x00 0x00
Programmer Type : STK500
Description : Atmel STK500 Version 1.x firmware
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ## | 100% 0.06s
avrdude.exe: Device signature = 0x1e930b
avrdude.exe: safemode: lfuse reads as 62
avrdude.exe: safemode: hfuse reads as DF
avrdude.exe: safemode: efuse reads as FF
avrdude.exe: reading lfuse memory:
Reading | ## | 100% 0.02s
avrdude.exe: writing output file "<stdout>"
:01000000629D
:00000001FF
avrdude.exe: safemode: lfuse reads as 62
avrdude.exe: safemode: hfuse reads as DF
avrdude.exe: safemode: efuse reads as FF
avrdude.exe: safemode: Fuses OK (H:FF, E:DF, L:62)
avrdude.exe done. Thank you.
Getting ISP programmer properties from a successfult build:
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -pattiny85 -cstk500v1 -PCOM4 -b19200 -Uflash:w:C:\Users\dant\AppData\Local\Temp\build4666128290593242810.tmp/YAMA_2.0_Tiny85_temp_4th_ju.cpp.hex:i
avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : [b]COM4[/b]
Using Programmer : [b]stk500v1[/b]
Overriding Baud Rate : [b]19200[/b]
AVR Part : [b]ATtiny85[/b]
Chip Erase delay : 400000 us
PAGEL : P00
BS2 : P00
RESET disposition : possible i/o
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 12 4 0 no 512 4 0 4000 4500 0xff 0xff
flash 65 6 32 0 yes 8192 64 128 30000 30000 0xff 0xff
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 2 0 0 0 0 0x00 0x00
Programmer Type : STK500
Description : Atmel STK500 Version 1.x firmware
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ### | 100% 0.06s
avrdude: Device signature = 0x1e930b
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "C:\Users\dant\AppData\Local\Temp\build4666128290593242810.tmp/YAMA_2.0_Tiny85_temp_4th_ju.cpp.hex"
avrdude: writing flash (6212 bytes):
Writing | ################################################## | 100% 10.44s
avrdude: 6212 bytes of flash written
avrdude: verifying flash memory against C:\Users\dant\AppData\Local\Temp\build4666128290593242810.tmp/YAMA_2.0_Tiny85_temp_4th_ju.cpp.hex:
avrdude: load data flash data from input file C:\Users\dant\AppData\Local\Temp\build4666128290593242810.tmp/YAMA_2.0_Tiny85_temp_4th_ju.cpp.hex:
avrdude: input file C:\Users\dant\AppData\Local\Temp\build4666128290593242810.tmp/YAMA_2.0_Tiny85_temp_4th_ju.cpp.hex contains 6212 bytes
avrdude: reading on-chip flash data:
Reading | #### | 100% 6.75s
avrdude: verifying ...
avrdude: 6212 bytes of flash verified
avrdude done. Thank you.