3.6.2 Configuring Fuses Using AVR® LibC
To configure the fuses using Atmel Studio, the fuse.h
header file must
be included, as presented below.
#include <avr/fuse.h> /* Required header file */
The following example shows how to disable the Watchdog Timer using the Watchdog Configuration (WDTCFG) fuse register, disable the CRC and set the Reset Pin Configuration to GPIO mode using the System Configuration 0 (SYSCFG0) register, and configure the start-up time to 8 ms using the System Configuration 1 (SYSCFG1) register.
FUSES = {
/* Disable Watchdog Timer */
.WDTCFG = PERIOD_OFF_gc,
/* Disable CRC and set the Reset Pin Configuration to GPIO mode */
.SYSCFG0 = CRCSRC_NOCRC_gc | RSTPINCFG_GPIO_gc,
/* Start-up Time select: 8 ms */
.SYSCFG1 = SUT_8MS_gc
};
CAUTION: If not initialized by
the user, the fuses will be initialized with default values (‘
0
’) when
using AVR LibC. If there are fuses not initialized which must be different from
‘0
’, the device may not work as expected.