PostHeaderIcon ATmega128PV: Drift During a Long Read

Short reads hide problems. A two-kilobyte dump completes before anything has time to change, so the supply is the supply, the part is cold, and the contact resistance is whatever it was at the start.

A large array changes that. The read takes minutes, and over minutes three variables move: temperature, supply, and mechanical contact. Each of them shifts the margin, and the effect is a file that begins correct and ends wrong.

What drifts and how much

Variable Timescale Effect on a read
Die temperature minutes Oscillator frequency, sense amplifier thresholds
Supply rail seconds to minutes Programming margin, erase reliability
Contact resistance unpredictable Intermittent page failures
Programmer clock stability continuous Sampling margin

The first row is the one that is usually ignored. A part that has been powered for a while is warmer than one that has just been inserted, and the internal oscillator’s frequency moves with temperature. Because the serial interface is synchronous against the target’s clock, a shift in frequency shifts the sampling point.

Why the failure is silent

The interface does not report a marginal sample. It reports success and returns a byte. The byte is whatever the sense amplifier resolved, which on a marginal access may be wrong.

So the failure appears as content, not as an error. On a large array, that content is far from where the analyst is looking: the first pages are read carefully, the middle is skimmed, and the error sits somewhere in the eighth kilobyte.

Three checks that cover the session

Per-page double read. Compare each page against itself immediately. This catches instability at the moment it happens, rather than later when the cause is gone.

End-point re-read. Read the first page again at the end and compare with the first pass. If it still matches, the setup was stable across the whole session. If it does not, the entire file is suspect, including the parts that looked fine.

Page map. Record the number of non-erased words per page. A page that suddenly reads as all FF in the middle of populated code is either erased or misread, and the map makes it visible.

The second check is the cheapest and the most informative, because it converts an unbounded worry into a binary answer.

The picoPower and low-voltage combination

PV combines two things that both narrow margin: the picoPower die with its revised oscillator, and the extended low-voltage range.

At the design rail neither is a problem. At the bottom of the range, the oscillator is less accurate and the sense amplifiers have less to work with, and a long read gives both more time to drift out of specification.

The practical conclusion is unglamorous: power these parts at their design rail, not at the bottom of their range, and accept the seconds of extra settling that a stable supply requires.

Reading procedure

  1. Supply at the design rail, measured at the socket, with local decoupling.
  2. Signature, fuses, lock byte.
  3. One page read twice; require equality before proceeding.
  4. Full read in passes with per-page verification and a page map.
  5. First page re-read at the end.

Steps 3 and 5 bracket the session. Between them, step 4’s page map is the record of what happened, and it is the artefact worth keeping alongside the image.

Related notes

FAQ

Does temperature really matter for a flash read? It shifts the oscillator and the sense amplifier behaviour, which is enough to change a marginal sample.

How long is a 128 KB read? Minutes at a conservative clock, which is exactly why drift becomes relevant.

Can a bad file be detected after the fact? Only by the checksums and page maps recorded during the read. Without them, a plausible file cannot be distinguished from a correct one.

Is a faster read worth the risk? Only if the page-level verification is kept. Speed without verification is how partial images get delivered.

Conclusion

Long reads fail differently from short ones: not by erroring, but by drifting. Bracketing the session with a repeated first page, verifying each page as it arrives, and keeping a page map converts an invisible risk into a recorded measurement — which on a large array is the only evidence that the file is what it claims to be.

Comments are closed.