Posts Tagged ‘break microcontroller encrypted binary’
ATtiny24: High-Voltage Entry and What It Can Actually Reach
A fourteen-pin AVR has few pins to spare, and the programming interface needs four of them. When a designer needs one back, the fuse that frees the reset pin is the obvious candidate — and the consequence is a part that no serial programmer can enter.
The escape hatch is high-voltage programming: twelve volts on the reset pin puts the part into a mode where the fuse settings are irrelevant, because the very state that disables serial entry is what the high-voltage mode overrides.
What the mode does and does not do
It does three things:
- Restores the fuse byte, which is the documented way to undo a disabled serial interface.
- Reads the signature and the fuse bytes.
- Performs chip erase.
It does not read protected flash. This is the point that surprises people, and it is worth being blunt about: high-voltage programming on AVR is not a protection bypass. It is an alternate entry path. The lock bits are enforced by the same logic in both modes, and there is no mode in which the part hands over protected contents.
So the high-voltage adapter is a tool for recovering access, not for recovering data. Those are different objectives and they have different prospects.
Why the distinction matters commercially
If a device is locked in mode 2, no interface reads it. If a device is merely unreachable because a fuse disabled the serial port, the high-voltage path restores access and then everything proceeds normally — including, if the lock bits turn out to be clear, a full read.
That means the first question on an unresponsive part is not “is it locked” but “which of the two problems do I have”. They present identically at the programmer: no device detected. They have completely different answers.
| Condition | Serial entry | High-voltage entry | Flash readable |
|---|---|---|---|
| Unlocked, fuses normal | works | works | yes |
| Unlocked, reset pin disabled | fails | works | yes |
| Locked mode 2, fuses normal | works, read refused | works, read refused | no |
| Locked mode 2, reset disabled | fails | works, read refused | no |
The fourth row is the genuinely closed case, and it is the one a careful designer would choose. The second row is the easy case that looks hard.
Pins are the constraint
On a fourteen-pin part the programming pins are shared with port pins that also carry the ADC and the timer outputs. A product that uses all of them has already made decisions about which function wins.
Two consequences follow. First, the high-voltage adapter needs access to specific pins and a product’s board layout may make that physically awkward — headers may not expose them, and the pins may be loaded by circuitry that interferes with the twelve-volt pulse. Second, the twelve-volt pulse has to reach the reset pin without damaging anything else on that net, which in a product with a reset supervisor means knowing what else is connected.
That is a board-level examination, not a datasheet reading, and it is why a device that is trivial on a breadboard can be awkward in a potting-filled enclosure.
The sequence that wastes least
- Power at the design rail, measure at the socket.
- Try serial entry. If it works, read signature, fuses, lock byte before anything else.
- If serial fails, measure the reset pin while the programmer asserts it. A pin that does not follow means a fuse reassigned it, not that the die is dead.
- Move to high-voltage entry only after step 3.
- In high-voltage mode, read signature and fuses first. Only then decide about memory.
Step 3 is the one that saves the most time, because it distinguishes a configuration problem from a hardware failure with one probe.
Reading after access is restored
Once in, the small parts behave like every other AVR: page-based flash, byte-based EEPROM, lock bits gating the read commands. The array is small, so a full read is fast and there is no excuse for not reading it twice and comparing.
Two things are worth recording even when the read succeeds: the fuse byte, because it explains the access problem and predicts whether the same device will be reachable again next time, and the signature, because on a fourteen-pin family the members differ only in memory size and a mislabelled part is not unusual.
Related notes
- ATtiny24V and the debug-wire fuse — a second way to lose the reset pin.
- ATtiny84 and complete hex images — the same family with the largest array.
- ATmega644PA and RSTDISBL — the fuse behind all of this, explained.
FAQ
Does high-voltage mode bypass the lock bits? No. It bypasses a disabled interface, not code protection.
Can it restore a part whose serial port was disabled? Yes. That is its documented purpose.
Does twelve volts damage the part? Applied to the reset pin in the specified mode, no. Applied elsewhere, yes.
Is a locked, reset-disabled part recoverable? Not by either programming interface. That configuration is closed by design.
Conclusion
High-voltage programming is an entry path, not a key. It restores access that a fuse removed, it reads the fuse byte that explains the situation, and it performs the erase that clears the lock — while destroying the contents. Understanding that narrow scope prevents the most common misallocation of effort on a small AVR.