There are 3 bytes of permanent storage in the chip called 'fuse low byte', 'fuse high byte' and 'fuse extended byte'. These bytes are called fuses and can be reprogrammed as many times as you want and determines the behaviour of the chip. To do that, their value is not erased when the chip is powered off or reprogrammed.
Each microchip has its own definition for the values that must have the fuses. In this tutorial, we are going to work with the fuses of the Atmel Attiny44A.
Name | Description | Default Value | Byte | Bit range | Datasheet page |
---|---|---|---|---|---|
CKDIV8 | The prescaler feature can be used to change the power consumption when not high performance is required. This feature can be used with any clock source. The prescaler divides the clock frecuency by a defined factor that can be configured using the CLKPS(3...0) register (Datasheet - Table 6-11), being its default value "0011" (divistion factor of 8). | 0 | LOW | (7) | 30 |
CKOUT | This fuse allows us to use the chip clock as a clock source to drive other circuits. Once this bit is programmed, the PIN B2 will output the clock. | 1 | LOW | (6) | 30 |
SUT | This fuses determine the Start-up Times for the external clock selection. This time must be long enough to ensure that the MCU is kept in reset mode while the clock is changing (is not stable). Its default value defines the longest Start-up time. | 10 | LOW | (5,4) | 26 |
CKSEL | The AMTEL Attiny44A can use several clock sources. By default, the clock used is the internal 8MHz oscillator. The available configurations can be found in the datasheet, in table 6-1. | 0010 | LOW | (3...0) | 25 |
RSTDISBL | When programmed (0), the PB3, instead of being used as a reset pin, it can be used as an I/O pin. | 1 | HIGH | (7) | 3 |
DWEN | This fuse allows the activation of the 'debug' mode. Once it is programmed, the RESET port is configured as a bidirectional I/O pin with pull-up enabled. | 1 | HIGH | (6) | 150 |
SPIEN | Fuse that enables serial program and data downloading. Once unprogrammed this fuse, in order to reset its value, you will need a 12V programmer. | 0 | HIGH | (5) | 159 |
WDTON | A watchdog timer is a mechanism to prevent closed loops and errors in the microchip. It consists on a decreasing counter. If it reaches 0, it generates a timeout signal that triggers an action to restore the system. To avoid this, the program must restart the timer before it times out. | 1 | HIGH | bit range | 41 |
EESAVE | If programmed (0) the EEPROM memory will be preserved through chip erase. | 1 | HIGH | (4) | 159 |
BODLEVEL | This fuse controles the Brown-out detector. A Broun-out detector is a circuit that monitors the supply voltage while operating. It compares the supplied voltage to a fixed one. If the supplied voltage decreases blow a fixed one (VBOT-), the Brown-out reset is enabled until the voltage raises above a VBOT+. Then a timer starts; if it times out, the reset is disabled. By default, the Brown-out detector is disabled. In table 20-6 of the Datasheet all the modes are specified. | 111 | HIGH | (2...0) | 159 & 176 |
SELDPRGEN | This fuse, if programmed, allows to the device the ability to upload a program to the MCU by itself. | 1 | EXTENDED | (0) | 152 |
As seen, there is just one bit in the Extended byte of the fuses whose value will change the microchip behaviour. The bytes 7...1 should be set with a value of 1.
High Level configuration | |
---|---|
Clock Output Enable [PB2] | |
Divide clock by 8 | |
Clock | |
External Reset disable | |
DebugWire Enable | |
Enable Serial Program and Data Downloading | |
Watchdog Timer always on | |
EEPROM memory is preserved through the Chip Erase | |
Brown-out Detector trigger level | |
Self-Programming Enable |
Low Level configuration | |||
---|---|---|---|
Bit | Low | High | Extended |
7 | |||
6 | |||
5 | |||
4 | |||
3 | |||
2 | |||
1 | |||
0 |
Fuse values | |
---|---|
Low: | 0x |
High: | 0x |
Extended: | 0x |
~$ avrdude -p t44 -P usb -c usbtiny -U lfuse:w:0x:m -U hfuse:w:0x:m -U efuse:w:0x:m