Microcontrollers ProjectsProgrammers

Restoring the Fuse-bits configuration of ATtiny13, ATtiny25/45/85 (HVSP)

Restoring the Fuse-bits configuration of ATtiny13, ATtiny25/45/85 (HVSP)

Sometimes, when developing devices on 8- and 14-pin AVR microcontrollers, it is necessary to use the Reset pin as an input/output line. This can be done by setting the appropriate Fuse-bit configuration. But after these actions, access to the microcontroller for in-circuit programming is lost, because we disable the Reset line.

Restoring the Fuse-bits configuration of ATtiny13, ATtiny25/45/85 (HVSP)

We will consider a device that will reset the Fuse-bits configuration of the Atmel ATtiny13, ATtiny25/45/85 microcontrollers to factory settings and, thus, will make it possible to program the microcontroller in-circuit (serial interface). When restoring the configuration of the target microcontroller, the device operates via the high-voltage serial programming (HVSP) interface. It should be noted that the device is not suitable for microcontrollers with 20 or more pins; in such cases, the high-voltage parallel programming (HVPP) interface is used for them. The design is very simple to manufacture and does not contain expensive components. The basis is the ATtiny2313 microcontroller. In addition, you will need a seven-segment 4-digit LED indicator, which will display the values ​​​​of the set Fuse-bits. The main characteristics of the device: reading the signature of the target microcontroller, Fuse-bit values ​​​​- high/low byte; resetting the Fuse-bits settings on the target device to factory settings; support for working with microcontrollers – ATtiny13, ATtiny25/45/85; the ability to work with ATtiny24/44/84 microcontrollers (an adapter will need to be made); a stand-alone device, displaying the value of Fuse-bits on a seven-segment indicator. For assembly we will need: Atmel AVR ATtiny2313 microcontroller; 4-digit seven-segment indicator with a common cathode (MR-3461SRB was used); two resistors with a nominal value of 4.7 kOhm; NPN transistor 2N2222 or equivalent; integrated voltage regulator 78L05; a small breadboard; a voltage source +12 V. Schematic diagram

Restoring the Fuse-bits configuration of ATtiny13, ATtiny25/45/85 (HVSP)

Click to enlarge Note: The NPN transistor is connected incorrectly in the diagram. The collector pin should be connected to the Reset pin of the target microcontroller, and the emitter should be connected to the ground wire. To minimize the number of components, the indicator is connected directly to the microcontroller. No transistors or current-limiting resistors are used. This method uses 12 I/O lines of the microcontroller (4 digits + 7 segments + decimal point).

Restoring the Fuse-bits configuration of ATtiny13, ATtiny25/45/85 (HVSP)

Click to enlarge For the high-voltage serial programming mode, we need 6 signal lines from the ATtiny2313 microcontroller. We will need to supply +5 V to power the target microcontroller, +12 V to the Reset pin of the target microcontroller, the SCI (serial clock input) signal, the SII (serial instruction input) signal, the SDI (serial data input) signal, and the SDO (serial data out) signal. For this, we will use the remaining free I/O lines of the ATtiny2313. Some of the I/O lines will be used both in the HVSP interface and to control the indicator. The button is used to confirm the configuration restore and to switch between the displayed read values ​​of the Fuse bits, and is also connected to the microcontroller port, which is used to control the indicator. After power is applied, the signature of the target microcontroller is read via the HVSP interface, which determines the name of the target microcontroller. Then the Fuse bits (lower, higher, and extended) are read. The Fuse-bit values ​​can be read by the user by pressing the button, the values ​​are displayed in hexadecimal format. Pressing and holding the button for about 1 second switches the device to the Fuse-bit factory settings programming mode. After programming, the reading of the values ​​is repeated, and the user can verify the correctness of the settings. An external +12 V voltage source is required for power supply. The installed +5 V voltage regulator is used to power the target and control microcontroller. The author used an A23 battery with a voltage of 12 V to power the circuit. The 2N2222 transistor is used to supply the +12 V programming voltage to the Reset input of the target microcontroller. The device was assembled on a circuit board, the design view is shown in the figures below.

Restoring the Fuse-bits configuration of ATtiny13, ATtiny25/45/85 (HVSP) Restoring the Fuse-bits configuration of ATtiny13, ATtiny25/45/85 (HVSP)

Usage: Install the target microcontroller into the slot; Apply +12V power to the circuit; The display will show the target microcontroller name after identifying it by signature bytes; Press the button to change the display content (controller name, high byte, low byte, extended byte); Press and hold the button for about 1 second to reset the fuse bits to factory settings.

Restoring the Fuse-bits configuration of ATtiny13, ATtiny25/45/85 (HVSP)

Download full project

Back to top button