ATtiny44: The Debug Interface as a Reading Tool
A flash dump answers the question “what instructions are there”. It does not answer “what does the device do with them”, and on a small part with a single timer and a handful of pins, the second question is often the one that matters.
The on-chip debug system answers the second question directly. It connects to the same pin the programmer uses, halts the core on demand, and exposes registers and memory while the firmware runs. When it is available, it is a better instrument than a dump — and its availability is decided by two independent settings that are easy to conflate.
Two settings, one interface
The interface must be enabled by a fuse, and it must not be blocked by the lock bits. Those are separate conditions:
Fuse enabled, lock bits clear. Full debug: halt, single-step, read memory, write memory, set breakpoints. This is the useful configuration and it is also the least common in shipping products.
Fuse enabled, lock bits set. The interface exists but the debug access is removed. What remains is enough to reach the erase command. No inspection.
Fuse disabled. The interface does not exist for practical purposes. The pin behaves as a reset pin, and serial programming is available instead.
| Fuse | Lock byte | What is available |
|---|---|---|
| enabled | clear | halt, step, read, write, breakpoints |
| enabled | set | erase only; inspection removed |
| disabled | any | nothing; use serial programming instead |
The third case is normal and harmless. The second is the one that produces the frustrating experience of connecting a probe and being told the device is protected — which is true, and which is information rather than a fault.
What a halted core reveals
Four categories of observation, each of which fills a gap a dump leaves:
- Register state at a breakpoint. Which peripheral the code was configuring, and with what value. A write to a timer control register two instructions before a pin changes is a causal chain, not a guess.
- Memory contents at run time. The initialised value of a variable, the contents of a buffer after a reception. A dump shows the initial data; the debugger shows what the code computes.
- Call sequence. Which routine runs on which input. This is the state machine, recovered by observation rather than by reading a dispatch table.
- Timing. How long a routine takes, and therefore whether the design has margin.
The fourth is underrated. A device that fails intermittently under load often has a routine running close to its deadline, and the debugger measures it in a way that static analysis cannot.
Where the debugger cannot go
It cannot see anything the lock bits protect, and on a locked device that includes the code itself. It also cannot repair a device whose fuse disabled the interface.
More subtly, it changes the thing it measures. Halting the core stops the timers, and the firmware’s timing behaviour under a debugger is not its timing behaviour in the field. For protocol work that is irrelevant; for a device with a control loop it matters, and the observation has to be interpreted with that in mind.
Reading the image anyway
Even with a debugger available, a dump is worth taking. It is the record of what the device contains, as opposed to what it did during one session, and it can be disassembled offline without the device present.
The order that works: dump first, then debug. The dump gives the map; the debugger gives the behaviour; together they resolve ambiguities that neither resolves alone. A function that never runs in a debug session may be a dead code path or a fault handler that only triggers on an error — the dump tells you it exists, and the debugger tells you it does not run normally.
The array itself
The flash is page-based like every member of the family, the EEPROM is byte-addressed, and the lock bits gate both read commands. Nothing about the debug interface changes the memory rules: it is a different door into the same rooms.
One practical point: this family has no boot section, so there is no SPM self-programming path and no boot lock bits. The whole protection story is the two general lock bits. That simplifies the reasoning considerably — there is no second container to consider.
What to record
Whatever the method, four items belong in the report: the signature, the fuse byte, the lock byte, and the image with a checksum. The first three explain the device’s configuration and therefore why it was or was not accessible; the fourth is the evidence.
Omitting the fuses is the most common reporting failure, and it is the one that makes a later reproduction attempt fail for reasons nobody can reconstruct.
Related notes
- ATtiny24V and the debug fuse — how the interface gets blocked.
- ATtiny44V and the clock fuses — the settings the debugger reads at start-up.
- ATtiny24 and high-voltage entry — the fallback when the interface is gone.
FAQ
Does the debug interface work on a locked part? Only far enough to erase. Inspection is removed by the lock bits.
Can the debugger read the EEPROM? It reads memory through the core’s view, which includes the EEPROM access path, subject to the same lock bit rules.
Does debugging wear the flash? No. Debug access reads memory; it does not reprogram it unless you write.
Why does the device behave differently under a debugger? Because halting stops the timers and removes the real-time constraint the firmware was designed around.
Conclusion
On a small AVR, the debug interface converts a static artefact into an observable system. It is gated by a fuse and by the lock bits, and when both permit, it shows intent that a disassembly only suggests. Dump first and debug second, and record the fuses either way — the behaviour is evidence, but the configuration is the explanation.