Posts Tagged ‘reverse engineering IC protected heximal’
ATmega644A: What the A Revision Actually Changes
Part numbers that differ by one letter usually differ by more than one letter internally. An A suffix on a megaAVR marks a die revision: same pinout, same instruction set, same memory sizes, different silicon and a different errata list. For anyone examining a device, the interesting question is not what stayed the same but which of the differences can be observed from outside.
The answer is a short list, and every item on it is measurable without opening anything.
The signature byte is the observable difference
Tools identify a part by reading three signature bytes through the programming interface. The first two identify vendor and family and do not change across revisions. The third identifies the model, and it is where a revision can diverge.
When it does diverge, the consequence is procedural rather than technical. A programmer with a fixed device table refuses to talk to a part it does not recognise, and reports an error that sounds like a hardware fault. The part is fine; the table is stale.
The way around it is to stop using the tool’s identification step as a gate. Issue the signature read command directly, print the three bytes, and select the programming algorithm by family rather than by the tool’s model match. Every megaAVR in a given flash-size class uses the same algorithm, so the family-level selection is correct even when the model match fails.
Errata are where the revisions actually differ
Silicon revisions exist to fix things. A published errata sheet lists behaviours that deviate from the datasheet, and the list shrinks with each revision. Three categories recur across the megaAVR line:
- Analogue deviations. Brown-out thresholds that trip slightly outside the specified window, or an internal reference that drifts with temperature more than specified.
- Timing deviations. A peripheral that needs an extra cycle in a corner case, or a start-up delay that is longer than documented.
- Interface deviations. A programming command that behaves differently when issued at the edge of the specified clock range.
The third category is the one that lands on the bench. A revision that changed how the part responds to a fast programming clock will fail on a programmer tuned for the earlier die, and pass on a slower one. That is a testable hypothesis and worth testing before assuming a part is damaged.
What does not change, and why that is the useful part
The lock bit mechanism, the fuse map, and the page organisation of the flash are stable across revisions. That stability is what makes a family-level method work: the sequence signature, fuses, lock byte, then memory does not need to be rewritten for each revision.
| Item | Changes with revision | Same across revisions |
|---|---|---|
| Device signature, third byte | sometimes | — |
| Instruction set | — | yes |
| Lock bit state machine | — | yes |
| Fuse map | — | yes |
| Page size and buffer | — | yes |
| Errata behaviour | yes | — |
The practical reading of that table is: the procedure is portable, the timing and thresholds are not. Plan the method once; calibrate the electrical parameters per die.
Revision and the identity question
Devices get redesigned without a part number change far more often than with one. A revision suffix is a gift, because it tells you the vendor changed something and documented it. The absence of a suffix does not tell you the opposite.
When a customer supplies units that behave differently from each other, the first check is the signature byte, then the date code. Two units with the same signature and different date codes are the same design at different points in the production lifetime; two units with different signature bytes are different dies and may legitimately behave differently.
That distinction changes the answer to a common question — “is this a counterfeit?” A different revision is not a counterfeit. A different signature on a part sold as a specific revision is.
Reading a device whose revision you cannot confirm
The order of operations is unchanged: signature, fuses, lock byte, then memory. What changes is the interpretation of anomalies.
If a read fails at a fast clock and succeeds at a slow one, suspect revision-specific timing before suspecting damage. If a brown-out test trips earlier than the datasheet suggests, suspect the errata list before suspecting the supply. If an erase completes but the lock byte does not read back as expected, suspect the command sequence before suspecting the die.
Each of those is a hypothesis that costs one retest to falsify, and retesting is cheaper than the alternatives.
Related notes
- ATmega644 and page-level behaviour — the flash mechanics both revisions share.
- ATmega644PA and RSTDISBL — the fuse-level difference that removes ISP entry.
- ATmega32PA and the picoPower die — another revision family with its own electrical shifts.
FAQ
Is an A revision a different chip? It is a different die implementing the same specification, with corrections. Pinout, instruction set and memory map are unchanged.
Do I need a different socket? No. The package and pinout are the same, so the same adapter fits.
Can a revision change the lock bit behaviour? The state machine is stable across the family. What can differ is timing at the edges of the specified range.
Does a different signature byte mean the part is fake? Not by itself. It means the die is not the one the tool expected. Check the errata and the date code before drawing a conclusion about authenticity.
Conclusion
The A suffix is a documented die change, and its observable footprint is narrow: a signature byte that may differ, an errata list that shrinks, and analogue or timing behaviour that shifts slightly. The recovery procedure does not change with it. The electrical calibration does, which is why measuring beats assuming on every revision.
R7FA2L1AB3CFM: The Sixty-Four-Pin Version Stops at the Number of Channels
Going from a hundred pins to eighty costs general-purpose I/O and some convenience. Going from eighty to sixty-four costs channels — and channels are different, because a design can absorb losing a spare port pin and cannot absorb losing the eighth sensor input it was built around.
That is what makes the sixty-four-pin body the interesting member of this group. It is the point at which the capacitive touch interface and the converter stop being described by the silicon and start being described by the package.
The same peripheral with fewer electrodes
The touch sensing unit is the second generation of Renesas’ capacitive block: self-capacitance and mutual-capacitance modes, automatic judgement, multi-frequency scanning to dodge noise, and the ability to run in a low-power state and wake the core.
None of that changes with the package. What changes is how many electrodes can be connected, because each electrode occupies a pin, and the pins that reach the touch multiplexer are a subset of the package’s pins.
The same is true of the converter. Nineteen channels exist in the design; how many of them are bonded out depends on how many pins the package has, and the higher-numbered channels are the ones that go first.
| resource | LQFP80 | LQFP64 | effect on a design |
|---|---|---|---|
| touch electrodes | more | fewer | key count, or a different sensing layout |
| converter channels | more | fewer | sensor count, or external multiplexing |
| serial flow control | often present | usually absent | software flow control |
| general-purpose I/O | more | fewer | serial peripherals instead of parallel |
The scan table is a data structure in flash
A touch design is not written as nineteen separate handlers. It is written as a table: which channels are enabled, what threshold applies to each, what baseline each channel settled on, and in what order the scan proceeds. That table lives in flash, is read at start-up, and is updated in RAM as the baselines drift.
For a reader this is the most informative structure in the whole image, because it states the design’s physical layout in numbers. The number of entries says how many electrodes the product has. The threshold column says how sensitive the design needed to be, which correlates with overlay thickness and electrode size. The baseline column says what the raw counts look like on a real board, which is the single most useful figure for anyone rebuilding the product.
A table with twelve entries read out of a firmware that was written for a hundred-pin board tells you either that only twelve electrodes were used, or that the build was retargeted. The distinction is usually visible from whether the unused entries are absent or present-and-disabled.
The converter sequence as a second fingerprint
The converter is configured with a channel sequence, and the sequence order is a design decision, not an accident. A design that reads a strain gauge, then a temperature sensor, then a battery voltage, will have those three channels in that order, because the sequence determines the settle time between conversions.
Reading the sequence gives the same information the touch table gives: how many analogue inputs the product actually uses, and in what priority. Combined with the touch table it produces a complete inventory of the product’s sensing surface, which for many customers is more valuable than the code.
| what the image states | where it lives | what it tells a customer |
|---|---|---|
| enabled touch channels | channel occupancy register image | number of keys or sliders |
| per-channel thresholds | constant table | sensitivity and overlay assumptions |
| baseline values | initialised table | raw counts on a real board |
| converter sequence | sequence registers set at start-up | which physical quantities are measured |
| averaging counts | loop bounds | resolution versus sample rate |
What happens when a larger build is restored smaller
Restoring a hundred-pin image onto a sixty-four-pin part produces a specific failure signature, and it is worth recognising because it looks like a firmware bug rather than a package mismatch.
Start-up completes. The touch scan runs and returns values. The converter runs and returns values. But the channels above the package’s limit return either the last value latched or a constant, because the input is not connected to anything. The firmware has no way to know: from its point of view the conversion completed successfully.
The result is a device that appears to work and reports a fixed reading for the inputs that do not exist. On a touch panel this shows up as a key that is always pressed or always released; on a sensor input it shows up as a channel stuck at full scale or at zero.
Reading order for this package
- Vector table: confirm base address, byte order, and that the image is complete.
- Clock configuration: establish the operating frequency, because every timing constant depends on it.
- Port configuration: collect the set of port bits and function selects written at start-up, which states the package the build expected.
- Touch table: count entries and read thresholds and baselines.
- Converter sequence: count channels and note the order.
- Everything else.
Steps three to five answer the package question from three independent directions, and they take less time than reading the main loop.
What the deliverable contains
The return set is the code flash image at 256 KB, the data flash separately, the configuration words, the identification words as read, a disassembly with the vector table resolved, and the extracted tables: touch channels with thresholds and baselines, and the converter sequence.
Those extracted tables are usually the part of the report a customer reads first, because they describe the product rather than the program.
The step down from eighty pins, and what it costs in general-purpose I/O rather than channels, is in R7FA2L1AB3CFN program recovery. The hundred-pin member and its field-by-field decoding are in R7FA2L1AB3CFP software extraction. A full treatment of the touch unit itself is at R7FA2L1A93CFM firmware recovery.
FAQ
Does the silicon have fewer touch channels on this package? The block is the same. What changes is how many of its inputs are bonded to pins.
Why does an unbonded converter channel not report an error? The conversion completes on whatever the input network presents. With no pin, that is not a signal, and the result is a constant rather than a fault.
Can a sixty-four-pin design be identified without the code? Sometimes, from the board. From the image it is straightforward, because the channel tables state it.
Conclusion
Sixty-four pins is where this group stops being a slightly smaller hundred-pin part and starts being a different product. The touch and converter front ends are limited by the package, and the firmware records those limits in tables that are easy to find and easy to read. Locating them answers the package question, the sensor-count question and, often, the customer’s actual question about what the device measured.