Tag Archives: fuses

Arduino: View fuse settings from sketch

avr/boot.h contains utilities to get fuse settings. The sketch below prints out the low, high & extended fuses. This link will help make sense of the fuse settings.

#include <avr/boot.h>

void setup()
{

// backup status register including interrupts
uint8_t sreg = SREG;
// disable interrupts
cli();

// get fuse bits
uint8_t low_fuse_bits = boot_lock_fuse_bits_get(GET_LOW_FUSE_BITS);
uint8_t high_fuse_bits = boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS);
uint8_t extended_fuse_bits = boot_lock_fuse_bits_get(GET_EXTENDED_FUSE_BITS);

// restore status register including interrupts
SREG = sreg;

Serial.begin(9600);
Serial.println("Ready...\n");

Serial.print("Low fuses: 0x");
Serial.println(low_fuse_bits,HEX);
Serial.print("High fuses: 0x");
Serial.println(high_fuse_bits,HEX);
Serial.print("Extended fuses: 0x");
Serial.println(extended_fuse_bits,HEX);
}

void loop()
{
}