Saturday, July 26, 2014

AVR Tutorial - Fuses

Fuses are bits which you can programm to change some settings of your microcontroller, like frequency, start up time etc.

It's better to always check datasheet before changing them, they can differ from MC to MC.

Atmel uses this notation: 0 = ON, 1 = OFF, that's the way the write their datasheets, also different programms for loading .hex in MC use different notation.


Before changing fuses always read what fuse bits are already set and check SPIEN bit, it should always be ON, without him you wouldn't be able to programm MC, and with him you can check what notation your programm use.

Bits

bits group CKSEL — determines source and frequency of oscilattor (clocking options). AVR can work with internal RC oscilattor (max 8 MHz), external resonators, oscilattors and signal generators.

CKOPT — bit, which can change amplitude of oscillations, if you programm it the Oscillator output will oscillate from 0 to VCC, it's better if your MC works in noisy environment, otherwise it will have smaller swing, but it will reduce power consumption considerably.

RESERVED —  Atmel reserved this bits, do not change them.

OCDEN — allows reading .hex from AVR, (On Chip Debug ENable), it is used so that no one could copy programm from your MC to another.

JTAGEN — allows using JTAG debugger, you can see what's happening inside of MC, when it is on AVR consumes more power and you can't use JTAG pins for average IN/OUT.

SELFPRGEN — allows selfprogramming

DWEN — allows DebugWire - it's a debug interface with one wire.

EESAVE — allows saving data to EEPROM after reprogramming.

SPIEN — allows internal programming interface with SPI, without it programm MC with ordinary methods will be impossible.

WDTON — enables Watch Dog timer, which starts when AVR gets power and you can't turn it off, if bit is not set, you can controll it with programmatically, this timer overloads MC if it's not reloaded from time to time, helps to check if microcontroller is freezed.

BODLEVEL - bits which reloads MC if voltage drops below the number that is written in this bits.

BODEN — enables BODLEVEL.

RSTDISBL — Disables RESET pin and you can use it like average IN/OUT pin, but now you can't programm it normally.

CKDIV8 — decreases oscilattor frequency by 8 times, if you have 8 MHz ceramic oscillator your MC will work on 1 MHz.

CKOUT — allows to output clock to one of your pins.

SUT1 и SUT0 — determines AVR delay before starting after connectig it to voltage source, from 4 till 65 ms.

PLLCK — allows use of internal frequency synthesizer for the MC core clock.

BOOTRST — chooses from whic memory address AVR will start working, if it's set it will start executing commands from BOOT LOADER.

BOOTSZ — two bits, which determines memory size for boot loader.

Thanks to this sites:
easyelectronics.ru
cxem.net
avrfuse.narod.ru

No comments :

Post a Comment