How can I read the fuse bits from within my sketch?
asked Jun 4, 2016 at 13:29
1 Answer 1
You can use the boot_lock_fuse_bits_get function from <avr/boot.h>.
#include <avr/boot.h>;
void setup()
{
Serial.begin(57600);
cli();
uint8_t lowBits = boot_lock_fuse_bits_get(GET_LOW_FUSE_BITS);
uint8_t highBits = boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS);
uint8_t extendedBits = boot_lock_fuse_bits_get(GET_EXTENDED_FUSE_BITS);
uint8_t lockBits = boot_lock_fuse_bits_get(GET_LOCK_BITS);
sei();
Serial.print("Low: 0x");
Serial.println(lowBits, HEX);
Serial.print("High: 0x");
Serial.println(highBits, HEX);
Serial.print("Ext: 0x");
Serial.println(extendedBits, HEX);
Serial.print("Lock: 0x");
Serial.println(lockBits, HEX);
}
void loop()
{
}
answered Jun 4, 2016 at 13:29