Archive for the ‘Reverse Engineer Microcontroller’ Category
Read PLD Binary Into Sum-of-Products: The Actual Conversion
A fuse array is a set of connection bits. An equation is a statement about logic. The transformation between them looks mechanical and is mostly mechanical, but it contains three decision points where a choice has to be made, and each choice affects whether the result is useful.
The three are: how product terms are grouped into outputs, whether a macrocell’s feedback is taken from the register or the pin, and how far to simplify. The first two are determined by the device architecture and can be answered definitively. The third is a judgement, and getting it wrong produces equations that are correct and unreadable, or readable and subtly wrong.
Grouping: from bits to product terms
The AND array is organised so that each output’s OR gate receives a fixed number of product terms, in a fixed order. Reading the array therefore produces, for each output, a list of terms; each term is a set of input connections.
| Array region | Maps to |
|---|---|
| A block of fuses feeding one OR input | One product term |
| The set of terms feeding one OR gate | One output equation |
| Fuses outside any product term row | Unused, or belonging to another function |
| The polarity fuse for a macrocell | Whether the final sum is inverted |
The third row matters because arrays are rarely fully used. Unused product terms are typically programmed to a contradiction — a term that can never be true, such as a variable ANDed with its complement — so that they contribute nothing to the OR. Recognising that pattern prevents a reconstruction from containing dozens of impossible terms.
| Pattern in a product term | Meaning |
|---|---|
| A signal and its complement both present | Contradiction; term is disabled |
| No signals connected at all | Term is always true; suspect a misread |
| All signals in the row present | Term is a constant product |
| Exactly one signal from each input group | Well-formed term |
Feedback: the decision that changes everything
A macrocell can feed its output back into the array from two places, and on some devices the choice is a configuration bit. This single bit determines whether the device implements combinational logic or a state machine.
| Feedback source | Behaviour | Typical use |
|---|---|---|
| From the output pin | Combinational; the term sees the current output | Glue logic |
| From the register | Sequential; the term sees the stored state | State machines, counters |
| From the pin, with the register unused | Purely combinational | Simple decoding |
| Neither, output only | The cell drives a pin and feeds nothing | Output expansion |
The second row is what turns a list of equations into a state machine. Once the feedback is known to come from the register, the equations become next-state functions, and the register bits become the state vector. Getting this wrong produces an equation set that describes a device with feedback loops but no memory, which is a device that would oscillate.
Simplification: how far to go
The fuse array contains whatever the original tool produced after its own minimisation. Simplifying further is possible and not always desirable.
| Level | Result | Risk |
|---|---|---|
| No simplification | Exact terms as programmed | Unreadable, but faithful |
| Algebraic factoring | Fewer literals, same terms | None; preserves structure |
| Full minimisation | Fewest terms possible | Loses intentional redundancy |
| Minimisation plus don’t-care exploitation | Smallest form | Changes behaviour in unused states |
The third and fourth rows are where correctness can be lost. A term that appears redundant may have been placed to eliminate a static hazard, and removing it produces equations that are logically equivalent in steady state and produce glitches in transition. On a device driving a clock or an asynchronous input, a glitch is a functional difference.
The fourth row is more dangerous still: minimisation that exploits don’t-care conditions produces a function that agrees with the original only for the input combinations the designer cared about. That is usually fine and occasionally catastrophic, and the difference cannot be determined from the array alone.
The readable output
What a customer receives should be equations in a form that can be read, checked and re-implemented.
“ o1 = (!a & b & c) # (a & !c) # (b & fb1) o2 = (a & b) # (!a & !b & fb2) fb1 = o1 fb2 = o1 & !o2 “
Two conventions make such a set usable. The first is naming feedback nets explicitly rather than inlining them, because inlining obscures the state structure. The second is preserving the original term order where possible, because a designer reading a reconstruction uses structure as a memory aid.
| Convention | Benefit |
|---|---|
| Feedback nets named | State structure visible |
| Terms in original order | Matches the designer’s mental model |
| Inversions marked at the term, not the output | Matches how the array is programmed |
| Disabled terms omitted with a note | Avoids clutter without hiding anything |
Verification
The equation set can be checked without any knowledge of the original design, by compiling it back and comparing.
| Test | Proves |
|---|---|
| Recompile to the same device and compare fuse arrays | Exact equivalence |
| Simulate all input combinations and compare | Functional equivalence |
| Compare against measured board behaviour | The reconstruction matches reality |
The second test is exhaustive and cheap on a device with twenty inputs, which covers most of this class. A million combinations evaluated in simulation settles the question completely.
Where the surrounding steps are
The array readout itself is covered in reading PLD binary source code, which also fixes the terminology. The container format is in reading the JED format. Where the device implements a controller rather than glue, the equation set becomes a state machine, and attacking CPLD source code covers that next step.
Services at this boundary
Work covers fuse array decoding, product term grouping, feedback resolution with explicit configuration bit evidence, simplification at a stated level, and exhaustive equivalence checking. It does not cover recovering the original text, and it does not cover guaranteeing that a simplified form preserves behaviour in states the original never reached.
The three decisions should be recorded in the deliverable, because each one is a place where a different analyst could reasonably have chosen differently.
Read PLD Code in an MCU System: You Are Recovering a Memory Map
A microcontroller board with a small programmable logic device on it invites an assumption: the PLD must be doing something interesting, since otherwise why is it there. In practice the answer is usually that it is doing something boring and essential. It is decoding addresses, gating chip selects, and inserting wait states for slow peripherals.
That makes reading it unexpectedly valuable, because the decode logic is a complete specification of how the microcontroller sees the rest of the board. Address ranges, chip select polarities, bus width, and the mapping between physical devices and memory regions are all in those few dozen product terms.
What a decoder actually looks like
A decoder takes address lines and produces select signals. In a PLD, that means product terms that match address ranges and outputs that drive the select pins.
| Product term pattern | Function |
|---|---|
| A set of address lines ANDed with fixed polarities | An address range match |
| Several such terms ORed together | A non-contiguous range |
| The match ANDed with a read or write strobe | Direction-qualified select |
| The match ANDed with a qualifier from another device | Arbitration or banking |
| Register output feeding back | A latched or delayed select |
The fifth row is the interesting one, because a latched select implies a timing requirement. Something in the system needed a select to stay asserted longer than the address remained valid, or needed it asserted earlier, and the PLD provides that.
Recovering the map from the terms
The conversion is direct once the pin assignment is known. Each input pin corresponds to a signal, and the pin assignment is a property of the device and the board, not of the design.
| Step | Output |
|---|---|
| Map pins to signals | Which pin is A15, which is CS, which is RD |
| Read each output’s terms | Range expressions |
| Resolve don’t-cares | Ranges with unmapped bits become blocks |
| Order by address | A memory map |
| Cross-check with the MCU firmware | Confirmation |
The third step is where a decoder differs from general logic. An address decoder deliberately ignores some address lines, and those ignored lines define the block size. A term that matches A15 through A12 and ignores A11 through A0 defines a four-kilobyte window mirrored throughout a larger range — which is either intentional aliasing or a bug that the firmware never noticed.
Why the map is worth having
A memory map is the interface between hardware and firmware, and on undocumented boards it exists nowhere. Recovering it answers questions that otherwise require probing every device on the bus.
| Question | Answer comes from |
|---|---|
| What address does this peripheral appear at | Decode term for its chip select |
| How large is the window | Which address lines the term ignores |
| Is the window mirrored | Whether upper lines are also decoded |
| What polarity does the select have | Whether the term is inverted |
| Are there gaps | Ranges with no term matching |
The fourth row matters when a bus analyser capture has to be interpreted: a capture showing activity at an address is meaningless if the select is active low and the analyst assumed active high.
Where the PLD is not a decoder
Sometimes the assumption is wrong, and the device really is doing something else. Three patterns are worth distinguishing before spending effort on decode reconstruction.
| Observation | Likely function |
|---|---|
| Most terms reference address lines | Decoder |
| Terms reference clock and data, with registers | Serial interface or shift register |
| Terms reference a small number of signals, deeply registered | State machine |
| Terms combine timer outputs and enables | Pulse generation |
| Terms include many feedback paths between cells | Counter or sequencer |
The third row is the one that changes the deliverable from a map to a transition table, which is covered in attacking CPLD source code.
The timing constants in the firmware
One of the more satisfying cross-checks is to compare the decode logic against the firmware’s assumptions. A firmware that inserts three wait states before accessing a peripheral is asserting that the peripheral needs three cycles, and that assertion is testable against the board.
| Firmware constant | Hardware counterpart |
|---|---|
| Wait state count | Bus cycle timing and PLD delay |
| Bus width setting | Data line connections and decode |
| Address of a peripheral | Decode term |
| Access order at init | Reset and enable sequencing |
| Polling loop length | Ready signal timing |
A discrepancy between a firmware constant and the hardware is a real finding. It usually means the firmware was written for a different board revision, and it explains intermittent failures that appear only on some units.
Reading the device
The read itself follows the same path as any other programmable logic device, and on these parts it is usually simple because the devices are small and their arrays are easy to access. The array content and its conversion into equations are covered in reading PLD binary into equations, and the container in reading the JED format.
Whichever order the two devices are read in, the bus topology decides what is possible, and that constraint is set out in extracting PLD and MCU code.
| Device state | Route |
|---|---|
| Unprotected | Session read |
| Read inhibited | Physical readout |
| Removed from the board | Read in a programmer |
| Failed | Behavioural reconstruction from the bus |
The fourth row is the fallback and it is genuinely workable for a decoder: a bus capture during normal operation reveals which addresses produce which selects, and that is the memory map observed rather than inferred.
Services at this boundary
Work covers pin and signal mapping, decode term extraction, memory map reconstruction including aliasing and gaps, cross-checking against firmware constants, and behavioural confirmation from bus captures. It does not cover producing a program listing, because a decoder has no program, and it does not cover recovering the schematic that the decoder originally came from.
The reframing worth offering a customer is that reading this device is not about recovering code; it is about recovering the contract between the processor and the board.
Extract PLD EEPROM: Charge Pumps, Vpp and Bit Drift
An EEPROM-based programmable logic device is a memory before it is logic. Its configuration is charge trapped on floating gates, and everything about how it can be read, copied or lost follows from the physics of that charge.
This is a more useful starting point than the logical view, because the failure modes of these devices are physical: a part that has been in service for twenty years has cells whose threshold has drifted, and a part that was programmed at the edge of the specification has cells whose margin was always thin.
The cell and its two thresholds
An EEPROM cell is a transistor with a floating gate. Charge on that gate shifts the threshold voltage, and the sense circuit decides the stored bit by comparing the cell’s conduction against a reference.
| State | Threshold relative to reference | Read as |
|---|---|---|
| Programmed, well within margin | Well above | 1 |
| Erased, well within margin | Well below | 0 |
| Programmed, drifted low | Marginally above | 1, but marginal |
| Erased, drifted high | Marginally below | 0, but marginal |
| Indeterminate | At the reference | Unstable; may read differently on successive reads |
The fifth row is the one that causes unreproducible readouts, and it is more common on old parts than on new ones. A device with a few indeterminate cells produces a configuration that is almost right, which is the worst kind of result.
Writing: the charge pump and Vpp
Writing a cell requires a voltage high enough to move charge across the oxide, far above the device’s supply. Older devices required this voltage externally on a dedicated pin; later ones generate it internally with a charge pump.
| Generation | Programming voltage | Consequence |
|---|---|---|
| Early EEPROM PLD | External Vpp, often 12 to 21 volts | Requires a specialised programmer |
| Later EEPROM PLD | Internally generated from 5 volts | Standard programmer, slower writes |
| In-system programmable | Generated on chip, commanded by a serial protocol | Programmable on the board |
| Flash-based | Internally generated, block erase | Different architecture entirely |
The first row is where a modern universal programmer fails: it may support the device’s read protocol and not its programming voltage, or the reverse. This asymmetry is worth checking before assuming a device is unreadable.
Reading: no high voltage required
A read is a low-voltage operation. The sense amplifier compares the cell’s conduction against a reference at the normal supply, and the array is addressed like any memory.
| Operation | Voltage | Effect on stored charge |
|---|---|---|
| Read | Nominal supply | None, ideally |
| Program | Elevated, generated or external | Adds charge |
| Erase | Elevated, opposite polarity | Removes charge |
| Read at elevated temperature | Nominal | Slow loss over time |
The fourth row is a real long-term effect: reading at high temperature does not damage a cell in one pass, but the cumulative effect over decades of operation contributes to drift.
Drift and how it presents
Charge leaks. The mechanisms are slow and temperature-dependent, and the result is a gradual shift of threshold toward the middle of the range.
| Age and history | Typical condition |
|---|---|
| New, never programmed | All cells at the erased floor |
| Programmed once, stored cool | Margin largely intact |
| Programmed, twenty years at moderate temperature | Margin reduced, some cells marginal |
| Reprogrammed many times | Margin reduced by cycling damage |
| Stored hot or powered continuously | Margin substantially reduced |
The consequence for extraction is that a single read is not sufficient on an old device. Reading the array several times and comparing identifies the marginal cells, and those cells can then be decided by a more careful method rather than by a coin flip.
Extraction approaches
The method depends on the device’s state and the equipment available.
| Approach | Requires | Reliability |
|---|---|---|
| Read in a programmer | Device removed or a suitable clip | High, if the device is supported |
| Read in system through the programming port | A device with an ISP interface | High |
| Read by probing the array | Decapsulation and a positioned probe | High but destructive |
| Read by observing the device’s behaviour | A working board | Indirect; recovers function, not bits |
The fourth row is the fallback that is often forgotten. A PAL or GAL in a working system can be characterised exhaustively by driving its inputs and recording its outputs, and for a device with twenty inputs that is a million vectors — slow but complete, and it yields a truth table that can be turned into equations.
Why the same device reads differently
Repeatability is the diagnostic that separates a good extraction from a lucky one.
| Symptom | Cause |
|---|---|
| Same cells differ between reads | Marginal cells at the threshold |
| Whole blocks differ | Addressing error, or a bad contact |
| One pin’s worth of cells differs | A single address or data line not making contact |
| Reads agree but behaviour is wrong | The read is correct and the device is not what it seems |
The third row is the one that a socket or clip problem produces, and it is recognisable because the errors have structure: the same bit position in many words.
What the extracted array becomes
The array is the input to the interpretation work described in reading PLD binary into equations, and the container is covered in reading the JED format. Where the device is a decoder on a processor board, the array is worth more than the logic, and reading PLD code in an MCU system explains why.
Services at this boundary
Work covers device identification and voltage requirement checking, readout with repeatability testing, marginal cell identification, behavioural characterisation where the array is unreachable, and delivery of the array with a confidence statement per region. It does not cover recovering cells that have drifted to the threshold, because there is no longer any information there.
The practical statement is that an EEPROM array is a physical measurement, and like any measurement it needs a stated uncertainty.
Extract PLD Source Code: Acceptance Is Recompilation, Not Identity
Every reconstruction project needs a definition of done, and in programmable logic that definition cannot be identity. The original source file is gone, and even if a copy existed there would be no way to prove the reconstruction matches it rather than merely producing the same configuration.
This is not a counsel of despair. It is a clarification that makes acceptance possible, because it replaces an unattainable test with two attainable ones. The first is recompilation: compile the reconstruction and compare the resulting configuration against the device. The second is simulation: evaluate both against every input combination. Either can be made rigorous, and the choice between them depends on what the customer needs to do next.
Three candidate acceptance tests
| Test | What it establishes | Practical limit |
|---|---|---|
| Byte identity with the original source | Nothing attainable | The original is unavailable |
| Identity of the reconstructed configuration | Exact structural match | Depends on tool version and settings |
| Functional equivalence over all inputs | Complete behavioural match | Input count must be enumerable |
| Behavioural match on a test set | Match for realistic use | Coverage is a judgement |
The second row is stronger than it looks and is often achievable, because the same equations fitted to the same device by the same tool tend to produce the same mapping. It is also brittle, since a tool version change can alter the mapping without changing behaviour.
The third row is the rigorous one, and on these devices it is genuinely available: a twenty-input device has just over a million input combinations, and exhaustive simulation of both the original array and the reconstructed equations settles the question completely.
Why equivalence is provable here and not on a microcontroller
The difference is state. A microcontroller has memory whose contents evolve, so equivalence requires reasoning about all reachable states. A combinational PLD has no state at all, and equivalence is a truth table comparison.
| Device class | Equivalence question | Feasibility |
|---|---|---|
| Combinational PLD | Same output for every input vector | Trivial |
| Registered PLD | Same output sequence for every input sequence | Tractable with formal tools |
| Small CPLD | Same state machine behaviour | Tractable; state space is small |
| Microcontroller | Same behaviour for all programs and data | Not feasible in general |
The second row is where most real devices sit, and the practical approach is to enumerate the reachable state space, which for a device with eight state bits and a handful of inputs is thousands of combinations rather than millions.
The reconstruction itself
What is produced is an equation set per output, with feedback nets named and configuration choices documented.
| Component | Why it is in the deliverable |
|---|---|
| Per-output equations | The logic |
| Feedback net declarations | Whether behaviour is sequential |
| Polarity information | Whether outputs are inverted |
| Registered or combinational flag per cell | The cell’s mode |
| Simplification level used | Affects the form, not the function |
| Equivalence evidence | Proof that the test passes |
The fourth row is easy to omit and essential to include, because a reader who does not know whether a macrocell is registered will misinterpret every equation that references it.
When the tool refuses to reproduce the array
A reconstruction can be functionally correct and fail the identity test, and the reasons are worth knowing so the failure is not misread as an error.
| Cause | Evidence |
|---|---|
| Different tool version | Same equations, different fitting |
| Different optimisation setting | Different product term allocation |
| Different device revision | Different internal mapping |
| Don’t-care exploitation | Fewer terms than the original |
| Manual placement in the original | The tool cannot reproduce a hand-placed fit |
The fifth row is the interesting one. Some designs were fitted by hand, with specific signals assigned to specific macrocells to meet timing. A tool re-fitting the same equations will choose differently, and the result is functionally identical and structurally different.
What a customer usually wants
The acceptance test should match the purpose, and the purposes fall into a few categories.
| Purpose | Adequate test |
|---|---|
| Manufacture replacements | Configuration identity, or equivalence |
| Modify the design | Equivalence plus readable equations |
| Document the product | Equivalence plus behavioural notes |
| Prove infringement or origin | Structural similarity, which is a different analysis |
The fourth row is not a technical acceptance test at all and should not be sold as one. Establishing that two designs are related requires comparing structure, placement and style, and it produces an opinion rather than a proof.
Delivering the evidence
The deliverable should include the test, not just its result.
| Item | Form |
|---|---|
| Equation set | Text, human readable |
| Recompiled configuration | In the device’s container |
| Comparison result | Identical, or a diff |
| Simulation log | Vectors, expected, actual |
| Known differences | Explicitly listed |
The fifth item is what makes a deliverable trustworthy. A reconstruction that claims perfect equivalence invites suspicion; one that lists the three places where the fit differs and explains why is credible.
Where this connects
The equation recovery that this acceptance test validates is described in reading PLD binary into equations, and the array that everything starts from is in reading PLD binary source code. Where the device contains a state machine, the equivalence argument has to cover sequences rather than vectors, and attacking CPLD source code covers the transition table that makes that possible.
Equivalence is also the tool used when several devices have to be told apart, since two arrays that are equivalent are the same build and two that are not are different builds by definition. Extracting PLD firmware applies that idea to the problem of identifying which revision a device holds.
Services at this boundary
Work covers equation reconstruction, configuration re-fitting, exhaustive or formal equivalence checking, documented diffs where identity is not achieved, and behavioural notes. It does not cover producing the original source file, and it does not cover claiming identity when only equivalence was demonstrated.
The sentence worth putting in every report is the one that names the test: equivalent over all input vectors, or equivalent over the reachable state space, or matching on a specified set.
Extract PLD Firmware: There Is No Version Number in a Fuse Map
Every other kind of firmware carries some mark of its identity. A microcontroller hex file has a checksum, a compiler version string in a comment, sometimes a firmware revision constant in a table. An FPGA bitstream has a header with a device and a date in the tool’s metadata. A PLD fuse map has none of this. It is a set of bits, and the bits do not know when they were created.
This becomes a practical problem the moment more than one build exists. A production run spans years, a design was revised twice, and the question is which devices on the shelf hold which revision. The fuse map cannot answer that directly. It can only be fingerprinted.
What the array does contain
| Content | Metadata? | Useful for identification |
|---|---|---|
| Logic configuration | No | Only by comparison |
| Macrocell modes | No | Structural signature |
| Signature row, if used | Sometimes | Directly, if the designer filled it |
| Unused term patterns | No | Tool version fingerprint |
| Pin assignment | No | Board revision fingerprint |
The signature row is the only intended channel, and it is empty on most devices. Its absence is the reason fingerprinting exists.
Unused terms as a tool fingerprint
This is the most underused identification technique in this field. Tools differ in how they disable unused product terms, and the difference is visible in the array.
| Tool behaviour | Pattern in unused terms |
|---|---|
| Term set to a contradiction | Signal ANDed with its complement |
| Term left with no connections | All fuses erased |
| Term connected to a constant | A fixed input combination |
| Terms grouped per output | Distinct blocks of disabled terms |
Two devices produced by different tool versions frequently differ in the second row, and two devices from the same version agree. That gives a coarse but real classification: builds from era A versus builds from era B.
Structural signatures
Beyond unused terms, the structure of the logic itself is a signature, and it is more discriminating than the tool pattern.
| Structural feature | Stability across builds |
|---|---|
| Number of product terms used per output | Changes when logic changes |
| Which macrocells are used at all | Stable unless the design grows |
| Register usage pattern | Stable for a given architecture |
| Feedback topology | Stable unless the state machine changes |
| Pin assignment | Stable unless the board changed |
The fifth row deserves emphasis: pin assignment is chosen by the board, not by the tool, so it is one of the most stable features and one of the most useful for distinguishing board revisions.
Building a fingerprint that can be compared
A fingerprint is a vector of features, each of which is stable within a class and different between classes.
| Feature | Computation | Discriminating power |
|---|---|---|
| Fuse count set | Count of programmed locations | Low; many designs land nearby |
| Per-output term counts | Vector of term usage | Medium |
| Macrocell mode bitmap | Which cells are registered | Medium |
| Pin usage bitmap | Which pins are driven | High for board revisions |
| Signature row bytes | Direct read | Definitive when present |
| Hash of the full array | Cryptographic digest | Definitive when comparing two files |
The last row is worth having even though it identifies nothing on its own: a hash answers the question “are these two devices identical” instantly, and that question comes up constantly during a production audit.
The workflow for a shelf of devices
| Step | Purpose |
|---|---|
| Read every device | Arrays in hand |
| Group by hash | Exact duplicates identified |
| Group by structural signature | Near-duplicates and revisions |
| Extract signature rows | Any intentional labels |
| Compare groups against known builds | Assignment |
| Report with confidence per group | Honest output |
The sixth step matters. Some devices will not be assignable, and a report that says so is more useful than one that forces every device into a category.
When the ambiguity cannot be resolved
Sometimes two builds differ in a way that does not show up in the array — a change to a constant that was optimised away, or a change that only affects timing through placement. In that case identification has to come from outside.
| Additional evidence | Source |
|---|---|
| Date code on the package | Marking |
| Board revision the device sits on | Silkscreen |
| Behavioural difference under test | Bench measurement |
| Production records | Customer’s own archive |
| Firmware revision in a companion MCU | Its image |
The fifth row is often decisive on mixed boards: the microcontroller’s image carries a version string, and the PLD revision is correlated with it.
What the extraction actually produces
The deliverable for this kind of work is not just arrays. It is arrays plus a comparison structure.
| Item | Purpose |
|---|---|
| Each device’s array | The raw evidence |
| Hash per device | Grouping |
| Feature vector per device | Classification |
| Group assignment with confidence | The answer |
| Unassigned devices with reasons | Honest gaps |
Where the surrounding work is covered
Reading the arrays is in reading PLD binary source code and extracting PLD EEPROM for the physical side. Establishing whether two arrays are equivalent is in extracting PLD source code, and the container that carries the arrays is in reading the JED format.
Services at this boundary
Work covers array readout across a batch, hashing and grouping, structural feature extraction, signature row interpretation, correlation with companion devices, and a per-device assignment with confidence. It does not cover inventing a version number that the device does not carry, and it does not cover distinguishing builds that are identical in the array.
The reframing is that identity in this field is constructed rather than read, and a constructed identity is only as good as the features behind it — which is why the feature list should be in the report.
Extract PLD and MCU Code: The Bus Decides the Order
On a board with a microcontroller, a PLD, and one or more memory devices, the physical order of the components is not the logical order of their relationships. The PLD frequently sits between the microcontroller and everything else, latching addresses, decoding chip selects, and gating the bus. That position makes it both a key to the board and an obstacle to reading it.
The practical consequence is that extraction has an order, and the order is determined by the bus topology rather than by preference. Reading the wrong device first is not merely inefficient; on some boards it is impossible.
The three common topologies
| Topology | PLD’s role | Consequence for extraction |
|---|---|---|
| PLD decodes only | Passive; chip selects from address lines | Any device can be read independently |
| PLD latches and decodes | Holds the low address byte | Reads require the latch to be driven correctly |
| PLD arbitrates | Grants the bus to one master at a time | Reads require a grant, or a halt |
| PLD holds the boot image select | Chooses which memory is mapped at boot | Which device is visible depends on boot state |
The second row is the most common on older designs, where a multiplexed address and data bus needs an external latch. The PLD is the latch, and the address it holds determines what the memory sees. A read that drives the bus without driving the latch reads whatever address happened to be latched, which is usually the last one the system used.
Why a latch changes the method
With a latch in the path, the microcontroller’s address is not the memory’s address. The mapping goes through a register inside the PLD, and the register’s value is part of the system state.
| Signal | Source | Needed for a read |
|---|---|---|
| High address byte | Microcontroller, direct | Driven by the reader |
| Low address byte | Latched inside the PLD | Must be written to the latch first |
| Chip select | Decoded from both bytes | Follows from the address |
| Read strobe | Microcontroller, or PLD | Must be asserted at the right time |
This is why a clip-on programmer sometimes fails on these boards while an in-system read succeeds: the programmer drives addresses directly at the memory, which works if the memory’s address pins are accessible, and fails if the low byte comes from the PLD’s output rather than the bus.
Establishing the topology before reading
The topology can be determined without a schematic, from a few observations.
| Observation | Inference |
|---|---|
| Memory address pins trace to the microcontroller directly | Direct bus, no latch |
| Memory address pins trace to the PLD | Latched or decoded |
| PLD output drives the memory’s chip enable | PLD gates access |
| Two memory devices with mutually exclusive enables | Banked; boot state matters |
| PLD input from the microcontroller’s read strobe | PLD may qualify the strobe |
The second row is the decisive one. Once the low address lines come from the PLD, the PLD has to be understood before the memory can be read reliably.
Order of extraction
| Order | Device | Why |
|---|---|---|
| 1 | PLD | Defines the map and the latch behaviour |
| 2 | Memory | Read using the map, with the latch driven |
| 3 | Microcontroller | Read last, because it is usually the easiest |
| Alternative | Memory first, with the PLD held in a known state | Works if the latch can be forced |
The alternative is worth knowing because it is sometimes much faster: if the PLD can be held in reset, its outputs go to a defined state, and some designs tri-state their latch outputs on reset, which restores direct access to the memory.
When the PLD cannot be read first
A protected PLD blocks the preferred order, and the fallback is behavioural.
| Situation | Approach |
|---|---|
| PLD unprotected | Read it; the map follows |
| PLD protected, board working | Capture the bus; infer the map from observed selects |
| PLD protected, board dead | Read the memory by forcing the latch, or desolder |
| PLD failed | Reconstruct the map from the memory’s contents and the MCU code |
The fourth row is a genuine and satisfying case: a failed decoder can often be reconstructed from the firmware, because the microcontroller’s code contains the addresses it expects. Those addresses define the map that the PLD must have implemented.
The firmware as a specification of the decoder
This is the most useful cross-check available on these boards, and it works in both directions: the firmware tells you what the decoder does, and the decoder tells you what the firmware assumes.
| Firmware evidence | Decoder property |
|---|---|
| Base addresses of peripheral accesses | Decode ranges |
| Access width | Bus width configuration |
| Wait states or delay loops | Timing requirements |
| Initialisation sequence | Enable and reset ordering |
| Aliased accesses | Mirrored decode windows |
The fifth row is subtle and valuable. If the firmware accesses the same peripheral at two different addresses, either the decode mirrors the window or the firmware has a latent bug. Reading the decoder settles which.
Reading the PLD itself
Once the topology is understood, the PLD read follows the usual path. Its array is small, its protocol is documented, and its position on the board usually makes in-system access straightforward if the device is unprotected.
| Device type | Read method | Note |
|---|---|---|
| EEPROM PLD, unprotected | In-system or socket | Charge-based, see the EEPROM page |
| EEPROM PLD, read inhibited | Physical | Array is small and accessible |
| Flash CPLD, unprotected | JTAG or ISP | Container is a fuse map |
| Flash CPLD, security bit set | Physical or policy analysis | Depends on architecture |
The first row’s caveat matters: the physical basis of an EEPROM array is treated in extracting PLD EEPROM, and the conversion of the array into logic is in reading PLD binary into equations. Where the PLD’s role is purely decoding, the map reconstruction is the whole deliverable and is covered in reading PLD code in an MCU system.
Services at this boundary
Work covers topology identification, latch behaviour characterisation, extraction ordering, in-system reads with the latch driven, behavioural map inference where the PLD is unreachable, and cross-checking against firmware constants. It does not cover reading a memory device through a latch that cannot be controlled, without either desoldering or forcing the latch through another path.
The practical rule is that on these boards the bus is the specification, and the PLD is usually the part of the bus that nobody wrote down.
Decapsulate W78IE54 secured integrated circuit source code
For a board built around the W78IE54, a decapsulate W78IE54 secured integrated circuit source code request is best handled as an identification report first. Only after the marked part and its memory map are confirmed does an archived build comparison make sense. The industrial version keeps the 16 Kbyte array but adds a 2.4 to 5.5 V supply window.
Closing the loop on decapsulate W78IE54 secured integrated circuit source code
The industrial W78I line keeps the standard 12T 8051 pipeline but widens the operating conditions to 2.4 to 5.5 V and -40 to 85 degrees, which is why these parts turn up in outdoor and factory equipment. Three 16-bit timer/counters, one full-duplex UART, a hardware watchdog and an eight-source two-level interrupt controller are provided. Idle and power-down modes are software selected, and the EMI reduction mode is available for boards that must pass a radiated-emissions test. The difference between a protected and an unprotected sample is a configuration fact that a written report must state plainly.
How the array is organised
Program storage is 8 Kbytes on the IE52 and 16 Kbytes on the IE54, with 256 bytes of scratchpad RAM and the standard 64 Kbyte program and data address spaces. Flash can be read and programmed electronically for verification, and once the code is confirmed the user can set the protection mechanism. A heximal export that flattens configuration and program data into one block is still not a substitute for the owner’s build archive. The 8 / 16 KB Flash EPROM / 256 B RAM / industrial temperature grade specification identifies these two members. For background on a neighbouring Winbond part, see W79E201 flash documentation.
Protection, erase and documentation
| Item | What the data sheet states |
|---|---|
| Core | 12T 8051, DC-20 MHz (IE52) / DC-24 MHz (IE54), 2.4-5.5 V, -40 to 85 C |
| Memory | 8 / 16 KB Flash EPROM / 256 B RAM / industrial temperature grade |
| Program memory | 8 Kbytes (IE52) or 16 Kbytes (IE54) electrically erasable Flash EPROM |
| RAM | 256 bytes on-chip scratchpad RAM |
| Package | DIP40 / PLCC44, with RoHS W78I052A derivatives |
| Programming | programmed by a writer; no loader ROM on this industrial generation |
The code protection mechanism is a single configurable state described in the data sheet, not a cryptographic engine and not a service interface. With the state set, an external read of the application array returns no usable instructions; identification and the reported array size remain available. A wide-temperature board often uses a lower crystal frequency to stay inside the rated timing across the full range. The watchdog, the extra port and the EMI logic are application features and provide no alternate readout path. For a legacy board with no build archive, the achievable result is a documented identification and a comparison against whatever release artefacts the owner can supply. The surrounding microcontroller cross-reference is documented in W78E65 flash documentation.
Clock, UART and port settings
Four 8-bit bidirectional ports plus an extra 4-bit port P4 are available on the 44-pin body, with INT2 and INT3 mapped to that extra port. Three 16-bit timers, one UART, a watchdog and eight interrupt sources cover the control tasks, while Port 0 and Port 2 carry the external bus when external memory is fitted. Protective configuration, locked memory and encrypted binary are three claims that a technical report must separate before any quotation. A comparable recovery note is W77E58 flash documentation.
Body selection and replacement parts
DIP40 and PLCC44 are the published bodies, and the lead-free W78I052A24DL and W78I052A24PL codes identify the RoHS versions. The 44-pin option exposes the extra port, so a firmware image built for it cannot be assumed to behave identically on the 40-pin part. Because the part is qualified for a wide temperature range, rework notes should record the solder profile as well as the marking. Further reading on adjacent 8051 and MCU boards: Attack chip atmega8a binary.
What the written handover contains
In the Winbond catalogue the W78IE52 is described as hardware-equivalent to the W78E52 apart from the wide temperature grade and the wider supply window. The later D-series parts add a loader ROM and a 6T clock option; neither exists on this generation. Because there is no loader ROM, a field update on this generation normally means swapping the programmed device rather than reflashing it in circuit. Recording the exact marking before selecting a programming procedure avoids a costly mistake on a wide-temperature board. A written scope covers the package marking, ordering code, device identification, oscillator, supply rails and temperature grade, then compares the owner’s release archive with what the fitted device reports. On an unlocked part the handover is a labelled program file for the single flash array. The wider Winbond, Nuvoton and general MCU material is linked here: Attack chip attiny2313 firmware.
Owners considering decapsulate W78IE54 secured integrated circuit source code should expect a technical deliverable first: a datasheet-based identification record, a labelled image where the protection state permits one, and a clear written statement where it does not. We explain that a whole chip erase removes the firmware together with the protection, require written authorisation before any destructive step, and never price a service that depends on defeating the security field. That boundary is what keeps a recovered program file usable as evidence years later.
Decapsulate W78IE52 protective integrated circuit code
A technician asked to decapsulate W78IE52 protective integrated circuit code should begin with the package marking and the supply rails. On the W78IE52 several ordering codes share one core, so the suffix is the first thing worth recording. The I in the ordering code marks the -40 to 85 degree industrial grade, not a different instruction set.
Where decapsulate W78IE52 protective integrated circuit code meets the data sheet
The industrial W78I line keeps the standard 12T 8051 pipeline but widens the operating conditions to 2.4 to 5.5 V and -40 to 85 degrees, which is why these parts turn up in outdoor and factory equipment. The RoHS W78I052A ordering codes are easy to confuse with the older leaded parts when a replacement is ordered from a broker. Three 16-bit timer/counters, one full-duplex UART, a hardware watchdog and an eight-source two-level interrupt controller are provided. The industrial temperature window is the whole point of this ordering group. Retrieving configuration data from a secured MCU is a separate task from reconstructing the program that once used it.
Separating program and data memory
Program storage is 8 Kbytes on the IE52 and 16 Kbytes on the IE54, with 256 bytes of scratchpad RAM and the standard 64 Kbyte program and data address spaces. There is no separate loader array, so a captured program file represents a single contiguous region and can be checked against the linker map of the original build. Flash can be read and programmed electronically for verification, and once the code is confirmed the user can set the protection mechanism. A heximal export that flattens configuration and program data into one block is still not a substitute for the owner’s build archive. Related device notes on this site cover the wider 8051 family: W78E354 flash documentation.
Identification on a protected device
| Item | What the data sheet states |
|---|---|
| Core | 12T 8051, DC-20 MHz (IE52) / DC-24 MHz (IE54), 2.4-5.5 V, -40 to 85 C |
| Memory | 8 / 16 KB Flash EPROM / 256 B RAM / industrial temperature grade |
| Program memory | 8 Kbytes (IE52) or 16 Kbytes (IE54) electrically erasable Flash EPROM |
| RAM | 256 bytes on-chip scratchpad RAM |
| Package | DIP40 / PLCC44, with RoHS W78I052A derivatives |
| Programming | programmed by a writer; no loader ROM on this industrial generation |
The code protection mechanism is a single configurable state described in the data sheet, not a cryptographic engine and not a service interface. A whole chip erase clears the state and the application together, so it removes the very firmware an owner wanted to archive. The watchdog, the extra port and the EMI logic are application features and provide no alternate readout path. For a legacy board with no build archive, the achievable result is a documented identification and a comparison against whatever release artefacts the owner can supply. For background on a neighbouring Winbond part, see W77E58 flash documentation.
The timer, watchdog and port blocks
Four 8-bit bidirectional ports plus an extra 4-bit port P4 are available on the 44-pin body, with INT2 and INT3 mapped to that extra port. A wide-temperature board often uses a lower crystal frequency to stay inside the rated timing across the full range. An attack on the security field is explicitly out of scope; what remains is documenting the microprocessor, its flash geometry and its program file. The surrounding microcontroller cross-reference is documented in W78IE54 flash documentation.
Footprints, rails and test points
DIP40 and PLCC44 are the published bodies, and the lead-free W78I052A24DL and W78I052A24PL codes identify the RoHS versions. The 44-pin option exposes the extra port, so a firmware image built for it cannot be assumed to behave identically on the 40-pin part. A 100 nF decoupler near each supply pin and a bulk capacitor on the rail remain the standard board requirement. A comparable recovery note is Arm microcontroller stm32f071v8 source code decryption.
Deliverables for a legitimate owner
In the Winbond catalogue the W78IE52 is described as hardware-equivalent to the W78E52 apart from the wide temperature grade and the wider supply window. That equivalence is useful for a schematic review but misleading for documentation, because the ordering codes and the qualified operating limits differ. The later D-series parts add a loader ROM and a 6T clock option; neither exists on this generation. A written scope covers the package marking, ordering code, device identification, oscillator, supply rails and temperature grade, then compares the owner’s release archive with what the fitted device reports. Because there is no loader ROM, a field update on this generation normally means swapping the programmed device rather than reflashing it in circuit. On a locked part it is an identification and documentation package, because a whole chip erase destroys the application along with the protection state. Further reading on adjacent 8051 and MCU boards: Arm microcontroller stm32f100r6 secured flash breaking.
To discuss decapsulate W78IE52 protective integrated circuit code for a specific board, send the marking, the schematic if available and the reason the original build output is no longer accessible. We return a feasibility note that separates what the silicon exposes from what would require destroying the application, and we only proceed after the owner confirms the scope in writing. Legacy 8051 controllers are our regular work, and the handover is a documented file set rather than an undocumented promise about a locked chip.
Retrieve W78E354 locked monitor firmware
Most retrieve W78E354 locked monitor firmware enquiries can be resolved on paper: read the data sheet, note the configuration and compare the owner’s release archive. The W78E354 is a good example, because its protection behaviour is documented in plain terms. This is a monitor controller ASIC rather than a general-purpose MCU, with sync processing and DDC logic on chip.
Clarifying retrieve W78E354 locked monitor firmware for an 8051 board
These are monitor controller ASICs rather than general-purpose microcontrollers: an embedded 8031 core is combined with sync processing, DDC logic, PWM DACs and a small analogue-to-digital converter on one die. One DDC port supports master and slave I2C operation with two slave addresses and DDC1, DDC2B and DDC2B+ modes, which is why the part appears on display boards. The 32 Kbyte derivative uses a 32-pin DIP body and a 10 MHz ceiling, trading I/O for a smaller footprint. An unlocked microcontroller yields a clean software image; a locked chip yields documentation and a comparison exercise instead.
Loader region and its protection
Program memory is 16 Kbytes of Flash OTP cells on the E354 and 32 Kbytes on the E378, with 512 or 576 bytes of on-chip data RAM respectively, half of which is reached as external data memory through MOVX. There is no loader ROM and no separate EEPROM array, so a captured program file describes one contiguous region. Special function registers control the PWM DACs, the sync processor and the DDC port, and their reset values are part of the firmware’s behaviour. For background on a neighbouring Winbond part, see W78E065 flash documentation.
Protect, erase, or document
| Item | What the data sheet states |
|---|---|
| Core | embedded 8031 core, DC-20 MHz (E354) / 10 MHz (E378), 5 V |
| Memory | 16 / 32 KB Flash / 512 or 576 B RAM / monitor controller ASIC with sync processor |
| Program memory | 16 Kbytes (E354) or 32 Kbytes (E378) Flash program memory |
| RAM | 512 B (E354) or 576 B (E378) on-chip data RAM |
| Package | PLCC68 / DIP48 / DIP40 (E354), DIP32 (E378) |
| Programming | Flash/RAM test mode and functional test mode are entered with the chip held in reset |
The data sheet describes a Flash and RAM test mode entered while the chip is held in reset, plus a functional test mode in which the CPU executes from external program memory. Those modes are production and verification features, not a general readout service, and the device still enforces its code protection state on the internal array. PWM DAC duty values are board specific, which makes the special function register dump as important as the program file. A whole chip erase clears the state and the application together. For an owner holding a signed release archive, comparing that build’s checksum with the board’s observable sync and DDC behaviour is the defensible reconstruction path. The surrounding microcontroller cross-reference is documented in W77E058A flash documentation.
Baud rates, divisors and clock options
The PWM DAC bank drives the analogue controls of a monitor, while the sync processor detects horizontal and vertical polarity, separates composite sync and counts both frequencies. A programmable dummy frequency generator, a clamp pulse output, an 8-bit auto-reload timer for the software time base and a watchdog are also on chip. Because most of the useful behaviour lives in special function registers rather than in the program array alone, documenting a recovered image without the register map is of little value. A source code archive, a compiled binary and a raw heximal each answer a different question about the same microcontroller. A comparable recovery note is W79E201 flash documentation.
Tray versus reel packing codes
The 16 Kbyte member is published in 68-pin PLCC, 48-pin DIP and 40-pin DIP bodies, while the 32 Kbyte derivative uses a 32-pin DIP. Pin functions differ between the 68-pin and 40-pin options, so the schematic and the marked package must agree before any rework is planned. Further reading on adjacent 8051 and MCU boards: Arm microcontroller stm32f101c4 locked firmware recovery.
Written scope and NDA practice
Both parts belong to the display-controller branch of the Winbond 8051 catalogue and share the embedded 8031 core, but they are not pin compatible and do not share a flash size. The sync processor, DDC port and PWM DAC bank are common to the branch; the package and the array size are not. Because the 32-pin body has fewer I/O lines, a firmware image built for the 68-pin part cannot simply be moved to the smaller package. Recording the marked ordering code first is the only reliable way to choose the correct datasheet. Where the array is unprotected, a labelled program file plus the special-function-register map can be returned. All work is scoped under NDA for the owner or an appointed repair partner, and we never price a service that depends on defeating the protection field. The wider Winbond, Nuvoton and general MCU material is linked here: Arm microcontroller stm32f205rg flash code recovery.
Owners considering retrieve W78E354 locked monitor firmware should expect a technical deliverable first: a datasheet-based identification record, a labelled image where the protection state permits one, and a clear written statement where it does not. We explain that a whole chip erase removes the firmware together with the protection, require written authorisation before any destructive step, and never price a service that depends on defeating the security field. That boundary is what keeps a recovered program file usable as evidence years later.
Decode W78E052 protected microcontroller software
Before any tool is attached for decode W78E052 protected microcontroller software, the ordering code of the W78E052 has to be read from the package. Generations in this family look alike on a schematic but do not share a programming procedure. This is the 8 Kbyte D-series part with a 2 Kbyte loader ROM and a selectable 6T / 12T clock.
Preparing a decode W78E052 protected microcontroller software assessment
The D generation is a configurable 6T / 12T 8052 that remains pin compatible with the traditional 12T 8051 while widening the supply window to 2.4 to 5.5 V and the temperature range to -40 to 85 degrees. An internal 22.1184 MHz oscillator with one percent accuracy is available on the standard line, although a crystal is still used where precise UART timing matters. Three 16-bit timer/counters, one UART, up to 36 I/O lines, an extra 4-bit port and a watchdog make up the peripheral baseline. The 6T/12T option is the defining feature of this ordering group. A secured device is still an identifiable device, and that identification is the first page of any honest report.
Flash pages and reported size
Application flash runs from 8 Kbytes on the 052D through 16, 32 and up to 64 Kbytes on the 516D, with a separate LDROM of 2 Kbytes on the two smaller parts and 4 Kbytes on the two larger ones. SRAM is 256 bytes for the 052D and 054D and 512 bytes for the 058D and 516D, the latter including 256 bytes of AUX-RAM selected in software. A usable firmware archive therefore labels application pages, LDROM pages and the configuration byte separately; a single flat binary loses the CBS setting that decides the boot source. The 8 / 16 / 32 / 64 KB Flash + 2 or 4 KB LDROM / 256 or 512 B SRAM table is the ordering reference for the whole line. Further reading on adjacent 8051 and MCU boards: W78E378 flash documentation.
Protection is a configuration fact
| Item | What the data sheet states |
|---|---|
| Core | 6T / 12T 8052, 40 MHz in 12T mode, 20 MHz in 6T mode, 2.4-5.5 V, -40 to 85 C |
| Memory | 8 / 16 / 32 / 64 KB Flash + 2 or 4 KB LDROM / 256 or 512 B SRAM |
| Program memory | in-system programmable Flash APROM plus a separate LDROM loader region |
| RAM | 256 B (052D / 054D) or 512 B (058D / 516D) SRAM |
| Package | PDIP40 / PLCC44 / PQFP44 / LQFP48 |
| Programming | Nuvoton Standard ISP Code can be pre-programmed in LDROM; CBS config selects boot source |
Code protection is a configuration state, and the interface still returns the device identification and the reported memory size when external reads of application flash are disabled. A chip erase clears the protection and the application in one operation, which is why an owner’s signed build archive is the stronger evidence. A 2 Kbyte LDROM on the smaller parts leaves less room for a field updater than the 4 Kbyte region on the larger ones. The ISP loader is a normal firmware feature: it can update the APROM from a serial line, but it cannot be used to read out a protected application array. An identification record plus an archive comparison is the deliverable on a locked sample. The wider Winbond, Nuvoton and general MCU material is linked here: W78E054 flash documentation.
Port, timer and interrupt inventory
One full-duplex UART, three 16-bit timer/counters, a programmable watchdog, a software reset and eight interrupt sources with two priority levels are common to the four capacities. Any reconstructed software documentation should record the UART baud generator, the clock source selection and the boot strap, since all three are board specific. Break, attack and duplicate are keyword verbs, not a description of a technique that suppresses the protection state. Related device notes on this site cover the wider 8051 family: W78E058 flash documentation.
Schematic evidence and board rails
PDIP40, PLCC44, PQFP44 and LQFP48 bodies share the same die within one capacity, and the ordering suffix selects body, temperature grade and packing. The LQFP48 option adds I/O lines that are simply absent on the 40-pin part, so a schematic is not sufficient evidence of which package is fitted. For background on a neighbouring Winbond part, see Attack atmega IC embeded firmware.
Written findings for the owner
These four capacities are pin compatible, so a board laid out for the 64 Kbyte member can be assembled with the 8 Kbyte part and will appear to work until the linker map overruns. Because the 6T option doubles the instruction rate per clock, a firmware timing loop written for 12T mode will run at half its intended delay. Flash size, LDROM size and SRAM size are the only differences that matter to an archive; the CPU and peripherals are shared. That is why the marked ordering code and the reported array size come first in any service note. On an unlocked sample we return separate labelled images for application flash and LDROM plus the configuration byte. The surrounding microcontroller cross-reference is documented in Attack atmega MCU embeded firmware.
If you need to decode W78E052 protected microcontroller software, the practical first step is a written identification report: package marking, ordering code, device identification, clock source and supply rails, followed by a comparison with any build archive you hold. Our engineers document those findings, explain whether a clean read is possible, and state the whole-chip-erase limit before any destructive work is authorised. We work under NDA for legitimate owners and their appointed repair partners, and we do not quote a readout that depends on suppressing a protection state.


