Archive for the ‘Recover Chip’ Category

PostHeaderIcon Copy IC PIC16F884 Code: Drawing the Line Between Code and Everything Else

A scope statement is the cheapest part of an engineering job and the one most often left implicit. When the request says copy the code, four different regions could be meant, and the difference between them is the difference between a replacement that works and one that starts and misbehaves.

This part makes the question concrete because it carries all four regions at once. Program memory, a data EEPROM of a couple of hundred bytes, a configuration block, and a manufacturer identity area. Each has its own protection bit, its own access method, and its own claim on the phrase that was used.

The four regions and who owns each

Region Owner at design time Protection What happens if it is left out of the copy
Program memory the firmware engineer code protection bit nothing runs
Data EEPROM the production line and the field data protection bit, often unset runs, with wrong calibration and identity
Configuration block the firmware engineer, once its own bits may not start at all, or starts in the wrong clock mode
Identity area the manufacturer read-only, not erasable nothing, but the silicon revision becomes unknown

The asymmetry is what makes the discussion worth having. Leaving out program memory is a job that visibly failed. Leaving out data EEPROM is a job that appears to have succeeded and fails weeks later in the field, which is a considerably worse outcome for everyone involved.

What the program array actually contains

Reading the program array of a mid-range device is straightforward: a linear sequence of instruction words covering the implemented address space, with the reset vector at address zero, the interrupt vector a few words above it, and the bulk of the code following.

Two structural features are worth naming because they affect how the image is read rather than what it holds. The first is paging. The instruction set addresses program memory in pages, and a call or goto that crosses a page boundary needs a bit set in the program counter’s high byte beforehand. This leaves a visible signature in the disassembly — pairs of instructions where a page-select precedes a call — and it is a reliable way to confirm that a disassembled listing is aligned correctly rather than shifted by one word.

The second is the literal pool. Values too large for an instruction’s operand field are stored as words in the code stream and loaded through a table-read, and those words look like nonsense instructions to a disassembler. Finding them and marking them as data rather than code is part of producing a listing a human can read.

Where the data array earns its place

The data EEPROM on this device is byte-writable, retains across power cycles, and is addressed separately from the program array. That independence is what makes it the natural home for anything that changes after the firmware is fixed — a sensor trim measured on the fixture, a serial number, a run-hour counter, the position of a mechanical part at last shutdown.

It is also why the data array and the program array have to be treated as a pair in a copy. The program reads the data at startup, and the read has a defined behaviour when the data is blank. That behaviour is usually a fallback rather than a refusal: the firmware loads a default gain, a default offset, a default identity, and carries on. The product works, and every measurement it produces is wrong by a small percentage that nobody notices until a customer compares two units.

There is also a startup flag convention worth knowing. Many products keep a magic value in the first bytes of the data array and treat anything else as a virgin device, running a first-time initialisation path that overwrites the array. Copy a program onto a device with a blank data array and the first power-up may quietly replace the calibration you were trying to preserve.

Configuration is not a setting, it is a decision about the silicon

The configuration block decides things that happen before the first instruction: which oscillator the core runs from, whether that oscillator is divided, when the brown-out reset trips, whether the watchdog is armed, whether the programming pin remains available as an input, and whether the arrays are protected.

It is worth reading it before anything else on a device of unknown history, because it answers two operational questions at once. It says how the board is meant to start, and it says whether the arrays you are about to read are protected. On this family the configuration block sits at a defined address near the top of the map and the identity word sits just below it.

The trap on the write side is that copying configuration verbatim copies the protection bits. A device programmed with the original’s configuration is immediately as locked as the original was, which is fine if the copy is finished and a problem if it is not. The working order is: read everything, verify, program program and data, verify again, program configuration last.

Identity and revision

The manufacturer identity area is small and read-only. It carries a device identifier and a revision code, and it cannot be written, so it cannot be copied. What it can do is explain a behaviour.

Errata attach to revision. A product designed around a workaround for a specific silicon bug will behave differently on a later revision where the workaround is unnecessary or where the bug was fixed differently. Recording the identifier and revision in the delivery costs one read and answers the question that arrives six months later, when two supposedly identical units behave differently and nobody can say why.

Deciding the scope with the customer

Four questions settle it in a short conversation, and they are worth asking in this order.

  1. Is the goal to reproduce the product, to repair one unit, or to understand the algorithm? A repair needs the data array and often not the code; understanding needs the code and often not the data.
  2. Does the product have per-unit calibration? If the answer is unknown, assume yes and read the data array anyway.
  3. Are there field-updated settings? If so, the data array is part of the deliverable by definition.
  4. Will the copy be programmed onto a fresh device, or into a simulation? A simulation needs the disassembly with literal pools marked; a fresh device needs the raw images.

The answers usually move the scope outward rather than inward. Almost every job described as copy the code ends up delivering three regions and a note about the fourth.

What to hand over

A complete delivery for this class of work is a small set of files with an unambiguous description of each.

  • the program image with start and end addresses
  • the data EEPROM image, blank regions marked as blank rather than omitted
  • the configuration block, decoded into named fields
  • the identity and revision words
  • a disassembly with data regions marked
  • a statement of which regions were protected and therefore inferred

The last line is the one that keeps a delivery honest. An inferred region should be labelled as inferred, never silently filled with a plausible pattern.

For the equivalent scope decision on a part without a data array at all, PIC12C671 image copying shows how the job simplifies. For a device where the data array is the whole point, PIC16F88 data recovery is the closer comparison. Where a vendor puts the factory calibration into a separate information segment instead of the last program word, the region split becomes a fourth and fifth region and the scope question grows — MSP430F4361 flash recovery covers that layout. And for the larger sibling where the program array is several times this size and paging becomes a structural feature rather than an occasional detail, PIC16F877 heximal recovery covers the reading strategy.

PostHeaderIcon Copy Microcontroller PIC18F4515 Code

Like previous PIC18 devices, Copy Microcontroller PIC18F4515 Code includes a feature that allows the device clock source to be switched from the main oscillator to an alternate low-frequency clock source. PIC18F2X1X/4X1X devices offer two alternate clock sources.

When an alternate clock source is enabled, the various power managed operating modes are available. Essentially, there are three clock sources for these devices:

· Primary oscillators

· Secondary oscillators

· Internal oscillator block

The primary oscillators include the External Crystal and Resonator modes, the External RC modes, the External Clock modes and the internal oscillator block. The particular mode is defined by the FOSC3:FOSC0 configuration bits. The details of these modes are covered earlier in this chapter.

The secondary oscillators are those external sources not connected to the OSC1 or OSC2 pins. These sources may continue to operate even after the controller is placed in a power managed mode. PIC18F2X1X/4X1X devices offer the Timer1 oscillator as a secondary oscillator which will bring more difficult in the process of Copy Microcontroller PIC18F4515 Code. This oscillator, in all power managed modes, is often the time base for functions such as a real-time clock.

Most often, a 32.768 kHz watch crystal is connected between the RC0/T1OSO/T13CKI and RC1/T1OSI pins. Like the LP mode oscillator circuit, loading capacitors are also connected from each pin to ground. The Timer1 oscillator is discussed in greater detail in Section 11.3 “Timer1 Oscillator”.

In addition to being a primary clock source, the internal oscillator block is available as a power managed mode clock source. The INTRC source is also used as the clock source for several special features, such as the WDT and Fail-Safe Clock Monitor.

The clock sources for the PIC18F2X1X/4X1X devices are shown in Figure 2-8. See Section 22.0 “Special Features of the CPU” for Configuration register details. The OSCCON register (Register 2-2) controls several aspects of the device clock’s operation, both in full power operation and in power managed modes.

The System Clock Select bits, SCS1:SCS0, select the clock source. The available clock sources are the primary clock (defined by the FOSC3:FOSC0 configuration bits), the secondary clock (Timer1 oscillator) and the internal oscillator block. The clock source changes immediately after one or more of the bits is written to, following a brief clock transition interval.

PostHeaderIcon Copy IC PIC12C671 Eeprom: The Part Has Program Memory, Not a Data Array

A request arrives asking for the EEPROM content of a PIC12C671. The device has no EEPROM. It has one array, it is program memory, it is one-time programmable, and it is where every byte of interest on the product lives. Getting to a useful answer means correcting the vocabulary without discarding the request, because what the customer actually needs — the persistent content of the device — is entirely present.

The distinction is not pedantic. EEPROM implies byte granularity, in-circuit rewriting and a separate address space. None of that applies here. Treating the array as if it were EEPROM leads to wrong expectations about how much can be modified, and occasionally to a plan that involves writing to the part when the part cannot be written again at all.

What the device actually is

The 12-bit core family sits at the small end of the mid-1990s Microchip line. Fourteen-bit instruction words, a small register file, a handful of I/O, an analogue-to-digital converter on the variants that carry one, and an eight-pin package.

Attribute This device
Core 12-bit, 14-bit instruction words
Program memory 1K words, one-time programmable
Data EEPROM none
RAM small, volatile, 128 bytes class
Configuration word one word at the top of the map
Package eight pins, shared with the oscillator and programming pins

The absence of a data array is the structural fact that shapes everything else. On later flash parts, parameters live in a separate byte-writable region and the program array can be treated as pure code. Here there is nowhere else for parameters to go, so a product built on this device either keeps its settings in RAM and loses them at power-off, or burns them into the program array as constants.

Where the parameters go when there is nowhere to put them

Three patterns turn up on real products, and the image itself says which one was used.

The first is constants in code. A trim value, a gain, a serial-number range, a timing table — all assembled into the program at build time. The image then contains them as literal operands, and finding them means reading the code, not scanning for a record structure.

The second is a table near the top of the array. Engineers who knew the part would never be rewritten still often reserved a block of words for per-unit data, and programmed the block differently for each unit at the end of the production line. The tell is a run of words whose values differ between two units of the same product while the surrounding code is identical.

The third is an external serial memory on two of the eight pins. On a device this small, that is a common answer to the parameter problem, and it has the pleasant property of being readable without touching the microcontroller at all.

Reading a one-time-programmable array

The array cannot be erased, which changes the risk profile of the job rather than the mechanics of reading it. Nothing in the read path writes, so a read is non-destructive by construction — provided the tool does not perform an erase-then-verify cycle as a matter of habit. Many production programmers do exactly that. On this family it destroys the device and the job at the same time.

The read itself is a linear walk of the address space returning 14-bit words. Two properties of the result need attention.

The first is word width. Fourteen bits do not fit a byte, so any representation in a file has to choose: two bytes per word with the top two bits unused, or a packed form. Mixing the two conventions between two halves of a job produces an image that looks plausible and disassembles to nonsense. The convention has to be fixed before the first byte is written.

The second is the erased state. On a one-time-programmable part the unprogrammed word is all ones, and a partially used array shows a long tail of all-ones words. That tail is information: it locates the end of the code, and its position tells you whether the production line programmed the full array or stopped early.

Why the erase state matters more than it looks

On a flash device the erased pattern is a baseline that can be restored, so a wrong read can be repeated. Here the programmed state is permanent. That makes verification of the read the single most important step, and it has to be done against the device rather than against a second file.

The practical method is a checksum computed by the device itself. The programmer reads the array and computes a checksum over the words; the interface offers the same computation on its side. Agreement between the two does not prove the content is correct, but disagreement proves the read is wrong, and on a part that cannot be re-read after a failure has been diagnosed, catching it at that point is the difference between a finished job and a scrapped unit.

Configuration is one word and it is not optional

The configuration word at the top of the map selects the oscillator mode, the watchdog, the code protection and the reset behaviour of the part. It is programmed along with the code and it is read along with the code, and it must be delivered along with the code.

The reason is that a copy without it is not a copy. Take the oscillator selection: a product designed to run from an external clock source will not start on a device configured for an internal oscillator, and the reverse is also true. The failure presents as a dead board, which sends people looking for a hardware fault that does not exist.

Configuration also carries the protection state. Recording it tells you what the original was set to, which is sometimes the most valuable single fact in the delivery — a device that was locked and a device that was never locked look identical from the outside, and only the configuration word distinguishes them.

Delivering the result

For a device of this size, a complete delivery is short and should stay short.

  • the full program image, start and end addresses stated
  • the configuration word, decoded into named fields
  • any per-unit block identified by address range, with the values listed separately
  • the word-width and file convention used, stated explicitly
  • the identifier or signature bytes, as read

The last item is easy to skip on a part this small and it should not be. It costs one read and it settles the question of which member of the family the image came from, which matters when a customer has several products in the field built on sibling parts.

The wider point

Requests get their vocabulary from the last project the customer worked on. A device described as having an EEPROM may have none, a job described as reading code may really be about a calibration block, and a part described as flash may be one-time programmable. The first ten minutes are better spent establishing which array exists than in starting a read that answers the wrong question.

The same correction shows up on siblings with a data array present, where the split between program and data becomes real — PIC16F88 data recovery covers that case. For a slightly larger part in the same era with a genuine sixteen-byte data array, PIC12CE518 binary recovery shows how small the data side can be while still mattering. And for the smallest flash members of the eight-pin line, where the array can be rewritten but not read under protection, PIC16F506 binary recovery follows the same reasoning to a different conclusion. Where the array is mask-programmed rather than one-time programmable, the constraints change again and no amount of reading recovers the ability to reproduce it.

PostHeaderIcon Copy Microcontroller PIC18F4220 Binary: Three Things Travel, Not One

The word copy hides an assumption. It assumes the device holds one thing, and that taking that one thing away reproduces the device. On an 8-bit part with a single array that assumption is close enough to true. On this member of the PIC18F family it is not, because three separate pieces of non-volatile state decide how the product behaves, and only one of them is the program.

The distinction matters in practice because the failure it produces is quiet. A board loaded with program memory alone will start, run its initialisation, and then do something subtly or grossly wrong — hold the wrong calibration, refuse to communicate on the right address, brown out at the wrong voltage. Nothing in the bench test says the copy was incomplete.

What actually sits in the device

Three regions, three different access rules, three different meanings.

Region Approximate size What it decides Read through the programming interface
Program memory a few thousand instruction words the algorithm yes, until code protection is set
Data EEPROM 256 bytes calibration, counters, identity yes, independent of code protection
Configuration bytes 8 bytes at the top of the config space oscillator mode, watchdog, brown-out, code protection itself yes, with separate protection bits

The third row is the one that surprises people. Configuration bytes are not code and are not covered by the same protection bit. On many parts they remain readable even when the program array has been locked, which makes them the first thing worth reading on a device that refuses everything else.

Program memory is the easy part

Reading the program array is a mechanical operation once the device is unlocked: the interface walks the address space and returns instruction words, and the result is a flat image whose length is fixed by the density of the part. There is no structure to reconstruct, no log to replay, no wear levelling to undo. What comes back is what the linker produced, minus whatever the protection scheme withheld.

Two details are worth checking rather than assuming. The first is the reset and interrupt vectors at the bottom of the array — if they are erased, the image is not a working program regardless of what the rest contains. The second is the tail: unused space in a partially filled array reads as the erased pattern, and a customer comparing two images will see a long run of identical words that means nothing.

Data EEPROM carries the production story

The 256-byte data array is where a product keeps what it learned after the firmware was written. Serial numbers, calibration constants measured on the test fixture, hour counters, user settings, the last known state of a mechanical assembly — all of it lands here, and none of it is in the program image.

This is why a copy that omits it fails in a way that looks like a firmware bug. The replacement controller runs the same instructions on different numbers. On a product where the calibration is a gain and an offset applied to an analogue input, the error is proportional and obvious. On a product where the settings page is a packed bitfield, the error is a device that comes up in the wrong mode and appears to have lost its configuration.

Reading it is a separate operation from reading code, and it is worth doing first on a device whose program array is locked, because data EEPROM protection is a separate bit and is frequently left unset even when code protection is engaged.

Configuration bytes decide whether the copy can run at all

Eight bytes control the physical behaviour of the part before a single instruction executes. The oscillator selection decides what the CPU runs on and whether an external crystal is required. The brown-out threshold decides at what supply voltage the device resets. The watchdog decides whether an unattended product recovers from a hang. The low-voltage programming bit decides whether the programming pin can be used as an input afterwards.

A copy that gets the program and the data right and leaves the configuration at its factory default will, on many boards, fail to start. The most common instance is an oscillator setting: a product designed to run from its internal oscillator is copied onto a part configured for an external crystal input, and the replacement sits there producing nothing.

The configuration space also holds the protection bits themselves. That creates a trap on rework: writing the configuration bytes of a protected original onto a fresh device re-locks the fresh device. The order of operations has to be read and data first, configuration last, and only after the image has been verified.

The identity region is a fourth thing

Above the configuration bytes sits a small read-only area, programmed by the manufacturer and not erasable by the user. It carries a device identifier and a revision code. It cannot be copied and does not need to be, but it does need to be recorded, because it tells you which silicon revision produced the behaviour you are trying to reproduce.

That revision code has real consequences. Errata are tied to it, and a copy made onto a different revision may behave differently in the exact corner the original was designed around. Recording the identifier and the revision alongside the three copied regions is what makes a copy auditable a year later.

What a complete deliverable looks like

A job described as a binary copy should end with four files and one page of notes.

  • the program image, with its start and end address stated
  • the data EEPROM image, as a flat 256-byte block
  • the configuration bytes, decoded into named fields rather than left as hex
  • the identifier and revision code, as read
  • a note stating which regions were read and which were inferred

The note is not paperwork. When a customer later reports that the replacement unit behaves differently, the note is what distinguishes a copy that was always incomplete from a copy that has since been corrupted.

Reading order when time is short

On a device with unknown history, the order that produces the most information per minute is fixed.

  1. Read the identifier and revision. This confirms what the part is and which errata apply.
  2. Read the configuration bytes. This tells you whether the array is locked, and how the part is meant to start.
  3. Read the data EEPROM. It is usually unprotected and it is often the real goal of the job.
  4. Read the program array last, because it is the largest operation and the one most likely to be blocked.

If step four is refused, steps one to three have still produced a usable result for a repair or a re-calibration, and they have told you precisely why step four failed. See PIC18F4220 binary boundaries for what the image looks like when the array does come out, and PIC16F88 data recovery for a smaller device where the same three-region split applies with different proportions.

Where the three-region model breaks

It is worth knowing the exception, because it changes the shape of the job. On some products the data EEPROM is not used at all and the parameters are compiled into the program image as constants. The tell is that the data array reads as a uniform pattern while the product clearly remembers settings across power cycles — which means the store is elsewhere, either in an external serial memory or in a reserved block of the program array.

Conversely, some products keep almost nothing in the program array and treat it purely as an interpreter, with all behaviour driven by the data array. On those, copying the program alone yields a device that runs a generic engine against empty settings.

Deciding which model a product follows takes one observation: read both arrays, then compare each against the erased pattern. Whichever array shows structure is where the product keeps its state. On this device, the answer is usually both — which is exactly why a single-file copy is the wrong shape for the job. For the same reasoning applied to a larger part with more peripherals, the PIC18F14K22 flash readout covers how peripheral configuration migrates into the copy.

PostHeaderIcon Duplicating a PIC16C72: Correcting the Record on What This Part Has

Duplication work starts with knowing exactly what is inside the device, and the PIC16C72 is one of those parts where published summaries routinely disagree with the datasheet. The family tables quote maximums that belong to the largest member; feature lists get copied down the line; peripherals that exist only on the 40-pin parts get attributed to the 28-pin ones. Each of those errors propagates into a rebuild, so it is worth settling the specification first.

The part in context

The PIC16C72 is a 28-pin mid-range 8-bit microcontroller with EPROM program memory, a three-timer set, one CCP module, an SSP serial port, and a 5-channel 8-bit A/D converter.

PropertyPIC16C72Commonly misattributed
Program memory2K × 14 words“up to 8K × 14” (that is the PIC16C77)
Data memory128 bytes“up to 368 bytes” (PIC16C76/77)
I/O pins22—
Timer modulesTimer0, Timer1, Timer2—
CCP modules1—
SerialSSP (SPI / I²C)“+ USART” (PIC16C73A and up)
Parallel slave portNone“8-bit PSP” (PIC16C74A and up)
A/D converter5 channels, 8-bit—
Data EEPROMNone—
Packages28-pin SDIP, SOIC, SSOP—

Two of those corrections are structural rather than cosmetic. The USART and the parallel slave port are 40-pin features; the PIC16C72 has neither. A rebuild plan that budgets for serial firmware will be chasing code that does not exist.

The third correction is the one most often overlooked: there is no data EEPROM on this device. Everything persistent lives in program memory. That is actually good news for duplication, because it means the program array is the complete artifact — there is no second non-volatile region to capture separately, and no risk of a rebuild that restores the code but loses the stored configuration.

Copy MCU PIC16C72 Software
Copy MCU PIC16C72 Software

Memory organisation

Reset is at 0000h, interrupts at 0004h. The 13-bit program counter addresses an 8K × 14 space of which 2K is implemented, so reads above 07FFh wrap around.

Data memory is split into banks of 128 bytes, with Special Function Registers at the low addresses and General Purpose Registers above. High-use SFRs are mirrored between banks to reduce bank switching. On a part with 128 bytes and only one CCP, the firmware is typically a tight polling loop rather than an interrupt-driven design, and the code reads accordingly: few ISRs, heavy use of Timer0 or Timer1 as a time base, tight bit manipulation on PORT registers.

What duplication actually involves

Duplicating a PIC16C72 means producing blank parts that behave like the original. Four things have to travel:

ItemSourceFailure mode if omitted
Program array2K instruction wordsNothing runs
Configuration word2007hWrong oscillator mode; device may not start
ID locations2000h–2003hUsually cosmetic, occasionally checked by firmware
Device marking and package variantPhysical partFit and thermal issues, not functional

The verification step deserves emphasis. A checksum comparison proves the files match; it does not prove the device behaves. Because the C72 has an A/D converter, the honest test is to run both parts on the same board with the same stimulus and compare converter readings and output timing — not just whether the board lights up.

How protection works

The code-protect bit sits in the configuration word at 2007h, inside the same EPROM array as the program. Set, it blocks read-out of program memory over the programming interface, in-circuit serial programming included.

Because configuration and program share one array, the documented path out — erasing, which clears the bit — also erases the program. Windowed parts lose both to ultraviolet light; OTP parts have no erase at all. The approaches that preserve the code therefore work around the check rather than through it: a timed disturbance during the protection evaluation, or physical read of the floating-gate cells after decapsulation.

Neighbouring parts in the same datasheet illustrate how the feature set grows with pin count — PIC16C73A program recovery for the 28-pin part that adds the USART, and PIC16C76 firmware and PIC16C77 code recovery for the larger arrays.

Why this part gets duplicated

The PIC16C72 sits in a sweet spot for sensor and appliance control: 22 I/O, five analog inputs, a serial port, 28 pins, and a price that made it ubiquitous through the late 1990s and 2000s. Products built on it are still in service, and the design houses that wrote the firmware have largely moved on.

When a production line needs spares, the programmed OTP devices in stock are the only copy of the program. That is the honest version of what “copy MCU firmware” means in practice — not acquiring someone else’s design, but keeping a product the requester already owns in production after its documentation has been lost.

Limits worth stating upfront

  • No data EEPROM. Any settings the product persists must be in program memory, so the image is everything — but also, nothing is cached elsewhere.
  • 2K words is small. A rebuild that silently drops the last few words will still pass a casual check.
  • OTP parts are single-shot. There is no erase-and-retry.
  • A/D behaviour is not verified by a checksum. Functional comparison on hardware is the only honest test.

FAQ

Does the PIC16C72 have a USART? No. The USART appears on the PIC16C73A and above. The C72 has an SSP, configurable as 3-wire SPI or 2-wire I²C, but no asynchronous serial port.

Does it have a parallel slave port? No. The PSP is a 40-pin feature, present on the PIC16C74A and PIC16C77.

How much program memory does it have? 2K × 14 words, or 3.5 KB in byte terms. The 8K figure in family tables belongs to the PIC16C77.

Is there data EEPROM for storing calibration? None. The 128 bytes are RAM and are lost at power-down. Persistent constants must be in program memory.

Conclusion

Duplicating a PIC16C72 is straightforward in principle and error-prone in practice, because the part is usually described by its family’s maximums rather than its own specification. Get the feature set right — no USART, no parallel slave port, no data EEPROM, 2K words and 128 bytes — and the rest of the work is the standard sequence: recover the array, carry the configuration word and ID locations, and verify behaviour rather than checksums.

PostHeaderIcon Breaking a PIC16C716 to a Hex File: What That Image Actually Contains

“Heximal” is industry shorthand for the hex image — the file a programmer writes and a reader returns. It is worth being precise about what that file holds, because a PIC image is not a flat dump of bytes. It is a map of 14-bit instruction words, each padded into two bytes, plus configuration and identification data that sits outside the program space entirely. Recovering the wrong shape of file is one of the most common ways for a technically successful read to produce a device that will not run.

The part in context

The PIC16C716 is a mid-range 8-bit part with EPROM program memory, a 13-bit program counter, and an 8-bit A/D converter. It is closely related to the PIC16C712, which differs mainly in program memory size.

Property PIC16C716
Program memory 2K × 14 words EPROM
Address range 0000h–07FFh
Program counter 13-bit (8K × 14 address space)
Data memory 128 bytes
I/O pins 13
A/D converter 4 channels, 8-bit
Package 18-pin PDIP/SOIC, 20-pin SSOP
Program memory type EPROM / OTP

The 13-bit counter can address 8K × 14, but only 2K is implemented. Accessing above 07FFh wraps around — a behaviour that makes a short read look complete.

How the memory is laid out

The device has two separate memory blocks, program and data, each with its own bus, which is what allows an instruction fetch and a data access to proceed concurrently. That Harvard arrangement is the reason a 14-bit instruction word can coexist with 8-bit data without bus contention.

The reset vector sits at 0000h and the interrupt vector at 0004h. Every routine in the firmware is reachable from those two words.

Data memory is divided into banks of 128 bytes (7Fh). The low addresses of each bank are reserved for Special Function Registers; General Purpose Registers, implemented as static RAM, sit above them. High-use SFRs are mirrored across banks so that common operations do not need a bank switch — which is convenient for the original programmer and a nuisance for anyone reading the disassembly, because the same address means different registers depending on the current bank.

Two registers dominate any reading of a recovered image:

  • STATUS holds the ALU result flags, the reset status, and the bank-select bits. It can be the destination of any instruction, but writes to the Z, DC, and C bits are suppressed when it is, and the TO and PD bits are not writable — so an instruction targeting STATUS does not do what its mnemonic implies. Disassemblers that ignore this produce subtly wrong output.
  • PCL and PCLATH split the program counter. PCL is readable and writable; the high bits are not directly accessible and are updated only through PCLATH. Computed jumps therefore appear as a write to PCLATH followed by a write to PCL, and that pattern is the single most reliable signal that a table-driven branch is being used rather than ordinary control flow.

The eight-level hardware stack is not part of either memory space, which means a recovered image contains no stack contents to recover — calls and returns are implicit.

From instruction words to Intel HEX

A PIC image is stored in Intel HEX format, where each line is a record:

“ :LLAAAATT[DD...]CC “

LL is the byte count, AAAA the address, TT the record type, the DD bytes the payload, and CC a checksum formed as the two’s complement of the sum of all preceding bytes. Data records use type 00 and end-of-file is type 01.

The conversion that matters is arithmetic: a 14-bit instruction word occupies two bytes, low byte first, with the two unused high bits zero. So 2K words of program occupies 4,096 bytes in the file, and the file’s address space is byte-oriented while the device’s is word-oriented. Converting between them is mechanical and unforgiving — an off-by-one in the byte order produces an image that reads correctly in a hex editor and executes as garbage.

Three regions sit outside the program array and all three have to be captured:

Region Address Contents
Program 0000h–07FFh 2K instruction words
ID locations 2000h–2003h User identification words
Configuration word 2007h Oscillator mode, watchdog, code protect, and other device options

Why the configuration word decides whether it boots

A recovered program that omits the configuration word is not a recovery. The configuration word selects the oscillator mode, which alone determines whether the device starts at all on the target board; it sets watchdog behaviour; and it carries the code-protect bit. An image with the program intact and the wrong configuration word produces a device that either does not oscillate or resets continuously — behaviour that is easily misread as a failed read rather than a wrong rebuild.

How protection works on this part

The code-protect bit is part of that configuration word at 2007h, and the configuration word lives in the same EPROM array as the program. When the bit is set, the program memory cannot be read out through the programming interface, in-circuit serial programming included.

The consequence is the familiar asymmetry: because configuration and program share one array, clearing the bit through the documented path erases the program. On a windowed part, ultraviolet erase clears both. On an OTP part, there is no erase at all.

Routes beyond the documented one are the same families that apply across this architecture — a timing disturbance during the protection check, or a physical read of the floating-gate cells after decapsulation. Sibling parts show the same structure at different sizes: PIC16C715 firmware for the smaller array, PIC16C717 program recovery for the larger part with a ten-bit converter.

Why this part turns up locked

The PIC16C716 was aimed at designs that needed a small A/D front end and not much else — sensors, panel controls, small appliances. Those products shipped in volume, the design houses that wrote the firmware have often closed, and the OTP parts in the field carry the only copy of the program. Because the part is OTP, there is no benign route to a spare image: no erase, no re-read, no recovery from a programmed device without addressing the protection.

Limits worth stating upfront

  • Two bytes per word. A byte-count check is not a word-count check, and mismatches here are silent.
  • The configuration word is not optional. Omitting it produces a non-booting result that looks like a bad read.
  • Bank state changes meaning. The same SFR address resolves differently depending on STATUS, so a disassembly without bank tracking is unreliable.
  • OTP means one attempt per device. There is no erase to fall back on.

FAQ

What exactly does “heximal” mean? The hex file representing the device image — program words, ID locations, and configuration word — in Intel HEX format.

Why does a 2K-word part produce a 4 KB file? Because each 14-bit word is stored in two bytes. The file is byte-addressed; the device is word-addressed.

Can the image be rebuilt without the configuration word? Not usefully. The oscillator selection alone determines whether the rebuilt device starts, so the configuration word has to come from the original device or be reconstructed deliberately.

Is the eight-level stack recoverable? There is nothing to recover. The stack is hardware, outside both memory spaces, and holds no persistent contents.

Conclusion

Breaking a PIC16C716 to a usable hex file is a question of shape as much as of access: 2K words padded to 4,096 bytes, plus ID locations at 2000h and a configuration word at 2007h that decides whether the result runs. Getting past the code-protect bit is one problem. Producing an image that a blank part will actually boot from is a second, and it is the one that separates a dump from a recovery.

Related reading

PostHeaderIcon Copy CPLD XC2C128_VQ100 Content

The XC2C128_VQ100 is a high-performance PLD widely integrated into modern embedded systems requiring deterministic logic control and flexible configuration. With its non-volatile architecture and efficient power profile, this device is frequently used in telecommunications infrastructure, industrial controllers, automotive electronics, and aerospace subsystems. It manages complex logic operations while securely storing critical firmware, program structures, and configuration data within internal memory. In many deployments, this information is intentionally protected, locked, or encrypted, preventing unauthorized duplication of valuable source code, binary, or heximal files that define the device’s functionality.

Nosso serviço "Cópia de Conteúdo do CPLD XILINX XC2C128_VQ100" foi projetado para atacar, quebrar e decodificar até mesmo as configurações mais seguras e protegidas incorporadas no CPLD XILINX XC2C128_VQ100. Aplicando técnicas avançadas de desencapsulamento juntamente com análises elétricas não invasivas, podemos recuperar o firmware crítico, extrair dados binários e hexadecimais estruturados e reconstruir o código-fonte utilizável a partir do espaço de memória interno. Independentemente de o projeto estar armazenado em flash, EEPROM ou células de configuração proprietárias, nosso processo nos permite invadir com eficácia o chip CPLD XILINX XC2C128_VQ100 criptografado e bloqueado. O arquivo recuperado do CPLD XILINX XC2C128_VQ100 é então processado em um arquivo de programa completo, permitindo que os clientes clonem, dupliquem ou reimplementem o projeto lógico original em novas plataformas de hardware com precisão e consistência.
Nosso serviço “Cópia de Conteúdo do CPLD XILINX XC2C128_VQ100” foi projetado para atacar, quebrar e decodificar até mesmo as configurações mais seguras e protegidas incorporadas no CPLD XILINX XC2C128_VQ100. Aplicando técnicas avançadas de desencapsulamento juntamente com análises elétricas não invasivas, podemos recuperar o firmware crítico, extrair dados binários e hexadecimais estruturados e reconstruir o código-fonte utilizável a partir do espaço de memória interno. Independentemente de o projeto estar armazenado em flash, EEPROM ou células de configuração proprietárias, nosso processo nos permite invadir com eficácia o chip CPLD XILINX XC2C128_VQ100 criptografado e bloqueado. O arquivo recuperado do CPLD XILINX XC2C128_VQ100 é então processado em um arquivo de programa completo, permitindo que os clientes clonem, dupliquem ou reimplementem o projeto lógico original em novas plataformas de hardware com precisão e consistência.

Our “Copy CPLD XC2C128_VQ100 Content” service is engineered to attack, break, and decode even the most secured and protective configurations embedded within the chip. By applying advanced decapsulate techniques alongside non-invasive electrical analysis, we can retrieve critical firmware, extract structured binary and heximal data, and reconstruct usable source code from the internal memory space. Whether the design is stored in flash, EEPROM, or proprietary configuration cells, our process enables us to effectively hack through encrypted and locked barriers. The recovered archive is then processed into a complete program file, allowing clients to clone, duplicate, or redeploy the original logic design across new hardware platforms with precision and consistency.

Copy CPLD XC2C128_VQ100 Content
Copy CPLD XC2C128_VQ100 Content

We can Copy CPLD XC2C128_VQ100 Content, please view below CPLD XC2C128_VQ100 features for your reference:

Features

· Optimized for 1.8V systems

– Industry’s fastest low power CPLD

– Densities from 32 to 512 macrocells

· Industry’s best 0.18 micron CMOS CPLD

– Optimized architecture for effective logic synthesis by Copy CPLD XC2C128_VQ100 Content

– Multi-voltage I/O operation — 1.5V to 3.3V

· Advanced system features

– Fastest in system programming

·  1.8V ISP using IEEE 1532 (JTAG) interface

– On-The-Fly Reconfiguration (OTF)

– IEEE1149.1 JTAG Boundary Scan Test

– Optional Schmitt trigger input (per pin)

– Multiple I/O banks on all devices

– Unsurpassed low power management

– SSTL2_1,SSTL3_1, and HSTL_1 on 128 macrocell and denser devices

– Hot pluggable PLA architecture

– Superior pinout retention

– 100% product term routability across function block Wide package availability including fine pitch:

– Chip Scale Package (CSP) BGA, Fine Line BGA, TQFP, PQFP, VQFP, and QFN packages

– Pb-free available for all packages Design entry/verification using Xilinx and industry standard CAE tools

Free software support for all densities using Xilinx® WebPACK™ tool Industry leading nonvolatile 0.18 micron CMOS

Наша услуга «Копирование содержимого CPLD XILINX XC2C128_VQ100» разработана для атаки, взлома и декодирования даже самых защищенных и безопасных конфигураций, встроенных в CPLD XILINX XC2C128_VQ100. Применяя передовые методы декапсуляции в сочетании с неинвазивным электрическим анализом, мы можем извлечь критически важную прошивку, структурированные двоичные и шестнадцатеричные данные и восстановить пригодный для использования исходный код из внутреннего пространства памяти. Независимо от того, хранится ли проект во флэш-памяти, EEPROM или в проприетарных ячейках конфигурации, наш процесс позволяет нам эффективно взламывать зашифрованный и заблокированный чип CPLD XILINX XC2C128_VQ100. Восстановленный архив CPLD XILINX XC2C128_VQ100 затем обрабатывается в полный программный файл, что позволяет клиентам клонировать, дублировать или повторно развертывать исходный логический проект на новых аппаратных платформах с точностью и согласованностью.
Наша услуга «Копирование содержимого CPLD XILINX XC2C128_VQ100» разработана для атаки, взлома и декодирования даже самых защищенных и безопасных конфигураций, встроенных в CPLD XILINX XC2C128_VQ100. Применяя передовые методы декапсуляции в сочетании с неинвазивным электрическим анализом, мы можем извлечь критически важную прошивку, структурированные двоичные и шестнадцатеричные данные и восстановить пригодный для использования исходный код из внутреннего пространства памяти. Независимо от того, хранится ли проект во флэш-памяти, EEPROM или в проприетарных ячейках конфигурации, наш процесс позволяет нам эффективно взламывать зашифрованный и заблокированный чип CPLD XILINX XC2C128_VQ100. Восстановленный архив CPLD XILINX XC2C128_VQ100 затем обрабатывается в полный программный файл, что позволяет клиентам клонировать, дублировать или повторно развертывать исходный логический проект на новых аппаратных платформах с точностью и согласованностью.

·  DataGATE external signal control

– Flexible clocking modes

·  Optional DualEDGE triggered registers

·  Clock divider (÷ 2,4,6,8,10,12,14,16)

·  CoolCLOCK

– Global signal options with macrocell control

·  Multiple global clocks with phase selection per macrocell

·  Multiple global output enables

·  Global set/reset

– Abundant product term clocks, output enables and set/resets

– Efficient control term clocks, output enables and set/resets for each macrocell and shared across function blocks from Copy CPLD XC2C128_VQ100 Content

– Advanced design security

– Open-drain output option for Wired-OR and LED drive

– Optional bus-hold, 3-state or weak pullup on select I/O pins

– Optional configurable grounds on unused I/Os

– Mixed I/O voltages compatible with 1.5V, 1.8V, process

– Guaranteed 1,000 program/erase cycles

– Guaranteed 20 year data retention

Family Overview

Nasza usługa „Kopiowanie zawartości CPLD XILINX XC2C128_VQ100” została zaprojektowana w celu atakowania, łamania i dekodowania nawet najbardziej zabezpieczonych i ochronnych konfiguracji wbudowanych w układ CPLD XILINX XC2C128_VQ100. Dzięki zastosowaniu zaawansowanych technik dekapsulacji wraz z nieinwazyjną analizą elektryczną, możemy odzyskać krytyczne oprogramowanie układowe, wyodrębnić ustrukturyzowane dane binarne i szesnastkowe oraz zrekonstruować użyteczny kod źródłowy z wewnętrznej pamięci. Niezależnie od tego, czy projekt jest przechowywany w pamięci flash, EEPROM, czy zastrzeżonych komórkach konfiguracyjnych, nasz proces pozwala nam skutecznie włamać się do zaszyfrowanego i zablokowanego układu CPLD XILINX XC2C128_VQ100. Odzyskane archiwum CPLD XILINX XC2C128_VQ100 jest następnie przetwarzane w kompletny plik programu, umożliwiając klientom klonowanie, duplikowanie lub ponowne wdrażanie oryginalnego projektu logicznego na nowych platformach sprzętowych z precyzją i spójnością.
Nasza usługa „Kopiowanie zawartości CPLD XILINX XC2C128_VQ100” została zaprojektowana w celu atakowania, łamania i dekodowania nawet najbardziej zabezpieczonych i ochronnych konfiguracji wbudowanych w układ CPLD XILINX XC2C128_VQ100. Dzięki zastosowaniu zaawansowanych technik dekapsulacji wraz z nieinwazyjną analizą elektryczną, możemy odzyskać krytyczne oprogramowanie układowe, wyodrębnić ustrukturyzowane dane binarne i szesnastkowe oraz zrekonstruować użyteczny kod źródłowy z wewnętrznej pamięci. Niezależnie od tego, czy projekt jest przechowywany w pamięci flash, EEPROM, czy zastrzeżonych komórkach konfiguracyjnych, nasz proces pozwala nam skutecznie włamać się do zaszyfrowanego i zablokowanego układu CPLD XILINX XC2C128_VQ100. Odzyskane archiwum CPLD XILINX XC2C128_VQ100 jest następnie przetwarzane w kompletny plik programu, umożliwiając klientom klonowanie, duplikowanie lub ponowne wdrażanie oryginalnego projektu logicznego na nowych platformach sprzętowych z precyzją i spójnością.

Xilinx CoolRunner™-II CPLDs deliver the high speed and ease of use associated with the XC9500/XL/XV CPLD family with the extremely low power versatility of the XPLA3 family in a single MCU Recovery. This means that the exact same parts can be used for high-speed data communications.

computing systems and leading edge portable products, with the added benefit of In System Programming. Low power consumption and high-speed operation are combined into a single family that is easy to use and cost effective. Clocking techniques and other power saving features extend the users’ power budget. The design features are supported starting with Xilinx ISE® 4.1i WebPACK tool.

From a technical perspective, the methodology combines both physical inspection and algorithmic reconstruction. During the decapsulation stage, the silicon structure is exposed to allow direct interaction with internal nodes, enabling deeper retrieval of embedded data. Parallel to this, logical decode procedures interpret raw binary dumps into structured firmware formats, ensuring that each file within the archive is accurate and functional. This dual approach significantly improves the success rate when dealing with highly protected or encrypted CPLD devices. As a result, clients receive not just raw data, but a refined and usable representation of the original program and source code, ready for analysis, modification, or reproduction.

“CPLD XILINX XC2C128_VQ100 İçeriğini Kopyala” hizmetimiz, CPLD XILINX XC2C128_VQ100 içine yerleştirilmiş en güvenli ve koruyucu yapılandırmaları bile saldırıya uğratmak, kırmak ve kodunu çözmek için tasarlanmıştır. Gelişmiş kapsül açma tekniklerini, invaziv olmayan elektriksel analizle birlikte uygulayarak, kritik bellenimi kurtarabilir, yapılandırılmış ikili ve onaltılık verileri çıkarabilir ve dahili bellek alanından kullanılabilir kaynak kodunu yeniden oluşturabiliriz. Tasarım ister flash bellekte, ister EEPROM'da veya özel yapılandırma hücrelerinde saklansın, işlemimiz şifrelenmiş ve kilitli CPLD XILINX XC2C128_VQ100 çipini etkili bir şekilde hacklememizi sağlar. Kurtarılan CPLD XILINX XC2C128_VQ100 arşivi daha sonra eksiksiz bir program dosyasına işlenir ve müşterilerin orijinal mantık tasarımını yeni donanım platformlarında hassasiyet ve tutarlılıkla klonlamasına, çoğaltmasına veya yeniden dağıtmasına olanak tanır.
“CPLD XILINX XC2C128_VQ100 İçeriğini Kopyala” hizmetimiz, CPLD XILINX XC2C128_VQ100 içine yerleştirilmiş en güvenli ve koruyucu yapılandırmaları bile saldırıya uğratmak, kırmak ve kodunu çözmek için tasarlanmıştır. Gelişmiş kapsül açma tekniklerini, invaziv olmayan elektriksel analizle birlikte uygulayarak, kritik bellenimi kurtarabilir, yapılandırılmış ikili ve onaltılık verileri çıkarabilir ve dahili bellek alanından kullanılabilir kaynak kodunu yeniden oluşturabiliriz. Tasarım ister flash bellekte, ister EEPROM’da veya özel yapılandırma hücrelerinde saklansın, işlemimiz şifrelenmiş ve kilitli CPLD XILINX XC2C128_VQ100 çipini etkili bir şekilde hacklememizi sağlar. Kurtarılan CPLD XILINX XC2C128_VQ100 arşivi daha sonra eksiksiz bir program dosyasına işlenir ve müşterilerin orijinal mantık tasarımını yeni donanım platformlarında hassasiyet ve tutarlılıkla klonlamasına, çoğaltmasına veya yeniden dağıtmasına olanak tanır.

The ability to copy, clone, and restore CPLD content has become essential in industries facing component discontinuation, lack of design documentation, or the need for system replication. By leveraging our expertise to attack, decode, and extract secured memory, customers gain full access to otherwise inaccessible firmware and data assets. This enables efficient maintenance, redesign, and long-term support of critical systems without dependence on original suppliers. Ultimately, our service provides a reliable and technically robust pathway to unlock, understand, and duplicate the functional core of the XC2C128_VQ100, delivering measurable value in both engineering flexibility and operational continuity.

Perkhidmatan "Salin Kandungan CPLD XC2C128_VQ100" kami direka bentuk untuk menyerang, memecahkan dan menyahkod walaupun konfigurasi yang paling selamat dan terlindung yang terbenam dalam CPLD XILINX XC2C128_VQ100. Dengan menggunakan teknik penyahkapsulan lanjutan di samping analisis elektrik bukan invasif, kami boleh mendapatkan semula firmware kritikal, mengekstrak data binari dan heksimal berstruktur dan membina semula kod sumber yang boleh digunakan daripada ruang memori dalaman. Sama ada reka bentuk disimpan dalam flash, EEPROM atau sel konfigurasi proprietari, proses kami membolehkan kami menggodam cip CPLD XILINX XC2C128_VQ100 yang disulitkan dan dikunci dengan berkesan. Arkib CPLD XILINX XC2C128_VQ100 yang dipulihkan kemudiannya diproses menjadi fail program yang lengkap, membolehkan klien mengklon, menduplikasi atau menggunakan semula reka bentuk logik asal merentasi platform perkakasan baharu dengan ketepatan dan konsistensi.
Perkhidmatan “Salin Kandungan CPLD XC2C128_VQ100” kami direka bentuk untuk menyerang, memecahkan dan menyahkod walaupun konfigurasi yang paling selamat dan terlindung yang terbenam dalam CPLD XILINX XC2C128_VQ100. Dengan menggunakan teknik penyahkapsulan lanjutan di samping analisis elektrik bukan invasif, kami boleh mendapatkan semula firmware kritikal, mengekstrak data binari dan heksimal berstruktur dan membina semula kod sumber yang boleh digunakan daripada ruang memori dalaman. Sama ada reka bentuk disimpan dalam flash, EEPROM atau sel konfigurasi proprietari, proses kami membolehkan kami menggodam cip CPLD XILINX XC2C128_VQ100 yang disulitkan dan dikunci dengan berkesan. Arkib CPLD XILINX XC2C128_VQ100 yang dipulihkan kemudiannya diproses menjadi fail program yang lengkap, membolehkan klien mengklon, menduplikasi atau menggunakan semula reka bentuk logik asal merentasi platform perkakasan baharu dengan ketepatan dan konsistensi.

PostHeaderIcon Copy CPLD EPM9320ARC208-10 Binary

High-performance CMOS EEPROM-based programmable logic devices (PLDs) built on third-generation Multiple Array MatriX (MAX®) architecture which is the main reason for requirement on Copy CPLD EPM9320ARC208-10 Binary.

5.0-V in-system programmability (ISP) through built-in IEEE Std.

1149.1 Joint Test Action Group (JTAG) interface

Built-in JTAG boundary-scan test (BST) circuitry compliant with IEEE Std. 1149.1-1990

High-density erasable programmable logic device (EPLD) family ranging from 6,000 to 12,000 usable gates (see Table 1)

10-ns pin-to-pin logic delays with counter frequencies of up to 144 MHz

Fully compliant with the peripheral component interconnect Special Interest Group’s (PCI SIG) PCI Local Bus Specification, Revision 2.2

Dual-output macrocell for independent use of combinatorial and registered logic

FastTrack® Interconnect for fast, predictable interconnect delays

Input/output registers with clear and clock enable on all I/O pins

Programmable output slew-rate control to reduce switching noise

 

MultiVolt™ I/O interface operation, allowing devices to interface with 3.3-V and 5.0-V devices

Configurable expander product-term distribution allowing up to 32 product terms per macrocell

Programmable power-saving mode for more than 50% power reduction in each macrocell

 

Programmable macrocell flipflops with individual clear, preset, clock, and clock enable controls

Programmable security bit for protection of proprietary designs which must be disable when Copy CPLD EPM9320ARC208-10 Binary

Software design support and automatic place-and-route

Altera’s MAX+PLUS® II development system on Windows-based PCs as well as Sun SPARCstation, HP 9000 Series 700/800, and IBM RISC System/6000 workstations

Additional design entry and simulation support provided by EDIF 200 and 300 netlist files, library of parameterized modules (LPM), Verilog HDL, VHDL, and other interfaces to popular EDA tools from manufacturers such as Cadence, Exemplar Logic, Mentor Graphics, OrCAD, Synopsys, Synplicity, and VeriBest

Programming support with Altera’s Master Programming Unit (MPU), BitBlasterTM serial download cable, ByteBlasterTM parallel port download cable, and ByteBlasterMVTM parallel port download cable, as well as programming hardware from third-party manufacturers.

Offered in a variety of package options with 84 to 356 pins.

PostHeaderIcon Copy Chip PIC16F74A Binary: A 14-Bit Word and One Config Word

The PIC16F74A holds 4096 program words and each word is fourteen bits wide. That one sentence explains most of what is strange about copying this family: the array is not byte-addressed, the file that represents it is, and the lock that stops you reading it is a single bit in a register that is itself part of the image.

Copy Chip PIC16F74A Binary

Fourteen bits into eight

Program memory is word-addressed. A call takes one word, a literal load takes one word, and the instruction field is fourteen bits including the opcode. The programmer’s view is different: file formats are byte-oriented, so each word occupies two bytes with the value right-justified and the two high bits zero.

Quantity Value Consequence
Word width 14 bits Two bytes per word in a file
Program words 4096 8 KB of file space
Program counter 12 bits Reaches 0x0000 to 0x0FFF
Configuration word 0x2007 Outside the program range

The last row is where mistakes happen. A twelve-bit program counter cannot reach the configuration word, so the programmer addresses it with a separate command. A read that stops at the end of the program range produces a complete-looking image with the lock state missing.

What code protect does to a read

The protection is a bit in the configuration word. When it is set, reading a program word returns zero instead of the stored value.

The device does not refuse the read and it does not return noise. It returns a legal word, which disassembles as a no-operation, so a dump of a protected part is a listing of NOPs while the file length and checksum arithmetic both look reasonable.

Read result Meaning
Real instructions Protection off, or device unprotected
Zeros across the range Code protect set
Zeros followed by valid code Protection set, partial image
All ones Erased device

The second and fourth rows look similar in a hex viewer and mean opposite things: one is a device with firmware you cannot see, the other a device with no firmware at all.

One bit, one chip erase

Clearing that bit requires an erase, and the erase is chip-wide. There is no per-block unlock, so the request that arrives most often — remove the protection, keep the contents — is impossible at the silicon level rather than at the tooling level.

The arithmetic is therefore short. Either the device is erased and reprogrammed from another source, or the array is read by a route that never consults the protect bit.

What a copy has to carry

A complete image of this family has four parts, and a copy that omits the last two boots on the bench and fails weeks later.

Part Where Survives a naive copy
Program words 0x0000 to 0x0FFF Yes
Configuration word 0x2007 Only if read explicitly
User ID locations 0x2000 to 0x2003 Only if read explicitly
Oscillator calibration Part dependent Some family members only

The configuration word alone decides the oscillator mode, the watchdog, low-voltage programming and the protection. Copy a device with the watchdog enabled into a part whose configuration says otherwise and the second unit resets every few milliseconds — a fault that reads like a firmware bug.

Verifying without a reference device

Three checks settle a copy without a second unit.

The first is the checksum the programmer computes over the program range, compared with the value in the original programming log. The second is a blank check after erase and before programming, which catches the failed erase that would otherwise leave a device carrying code from two different images. The third is a read-back at the configuration address, and it is the only one of the three that catches a copy which got every instruction right and the lock state wrong.

The route when the array is protected

Two routes remain, and both are described elsewhere at the level of principle: the electrical one, where a port or a fault injection makes the device return the array, and the physical one, where the die is opened and imaged.

For this family the electrical route is usually cheaper: the array is small, the read sequence short, and the package easy to work with. The comparison of routes is in crack IC flash, and the port survey that decides whether an electrical route exists at all is in read MCU code.

What we deliver

A heximal file with the configuration word and the user ID locations included, plus the checksum and a note on which of the four parts came from a read and which were inferred.

The note is not a formality. A copy is a claim about a class of devices, and those four parts are exactly where the class and the individual diverge. The general treatment is in copy IC code, and the object-level framing — bits, code, behaviour, unit — is in copy microcontroller.

PostHeaderIcon PIC16C770: What Copying an OTP Part Actually Involves

The PIC16C770 is a 20-pin mid-range part with 2048 × 14 words of program memory, 128 bytes of RAM, 256 bytes of data EEPROM and a 12-bit A/D converter. It is the smaller of the two parts in its family — the PIC16C771 has twice the program memory — and both exist for one reason: a 12-bit converter in a 20-pin package at a time when that combination was unusual.

The C in the part number is what shapes the question. This is an EPROM device, one-time programmable in the plastic package. “Copy” on a Flash part means writing an image back to the same chip. “Copy” here means building a second unit out of blank silicon, which is a different operation with different constraints.

What the PIC16C770 actually contains

Item PIC16C770
Core 14-bit instruction word, 35 instructions
Program memory 2048 × 14-bit EPROM (OTP)
Data RAM 128 bytes
Data EEPROM 256 bytes
I/O pins 16 (PORTA 6, PORTB 8, PORTC 2)
A/D converter 12-bit successive approximation, 5 channels
Comparators 2, with programmable reference
PWM CCP1
Serial SSP (SPI/I²C), USART
Timers Timer0, Timer1 (16-bit), Timer2
Packages 20-pin PDIP, SOIC, SSOP
Programming high voltage on MCLR, OTP

Note the mismatch that defines this family: 128 bytes of RAM and 2048 words of program against 256 bytes of data EEPROM and a 12-bit converter. The ratio is unusual — twice as much non-volatile data storage as volatile scratch — and it tells you where the design expected its state to live. Filter coefficients, offset corrections and calibration points were meant to sit in EEPROM, not in RAM.

Three separate things have to line up

A functional copy requires all of the following, and each one is a separate constraint:

The image. Program memory, the configuration word, the four user ID words and the 256 bytes of data EEPROM. The data array is separately protected by CPD, and on this part it is not optional baggage — it usually holds the calibration the program reads at start-up. An image without it produces a device that runs and measures wrong.

Blank silicon. OTP parts cannot be rewritten. A copy program needs unscheduled blank devices of the same part number, and this is where the practical difficulty concentrates: the PIC16C77X family reached end-of-life long ago, and blank stock exists only as residual inventory. Windowed ceramic parts can be erased and reused, which makes them useful for validation, but they are not a production path.

The same die revision. Silicon revisions of an OTP part are not always interchangeable. Errata change behaviour in corners — a timer flag that latches late, an ADC sequence that needs a settling delay, a serial framing edge — and firmware written against one revision can fail intermittently on another. The device ID and revision are readable, and they should be matched, not assumed.

What the copy does not fix

Two categories of content are outside the image and stay outside it.

Values written at runtime. If the firmware writes to its own data EEPROM — accumulating run hours, storing a learned zero, storing a serial number on first power-up — then the array in the source device holds values produced by operation, not by manufacture. Copying them reproduces one specific unit’s history. Whether that is correct depends on what the field means, and the only way to know is to read the routines that touch EEPROM, not to compare bytes.

Per-unit identity. Some production lines program a unique identifier into the user ID words or into EEPROM at test time, and the firmware compares it against something external. A copy that carries the source unit’s identifier will behave identically to the source unit — including any licensing check that was supposed to distinguish them.

Both of these are visible in the listing. EEADR/EEDATA writes immediately after reset point at initialisation patterns; reads at start-up followed by a comparison point at identity checks.

The configuration word at 2007h

Bit Field Meaning
13:7 — Unimplemented, read as 1
6 CP Program memory protection; 1 = disabled, 0 = enabled
5 CPD Data EEPROM protection; 1 = disabled, 0 = enabled
4 BOREN Brown-out reset; 1 = enabled
3 PWRTEN Power-up timer; 1 = disabled, 0 = enabled
2 WDTEN Watchdog; 1 = enabled
1:0 FOSC1:FOSC0 11 RC, 10 HS, 01 XT, 00 LP

Because the word is EPROM, its state in a source device is a permanent record of how that unit was programmed — there is no interface command that returns a programmed bit to 1. On a plastic part the protection state cannot be changed at all; on a windowed part, ultraviolet erasure clears the whole die, configuration word included, so protection cannot be lifted while preserving the array.

Verification is the part that catches mistakes

A copy that appears to work is not a copy that matches. Three checks, in increasing order of usefulness:

  1. Read back the programmed device and compare against the source image, byte for byte, including the configuration word and the data EEPROM. This catches programming errors and wrong device settings.
  2. Compare the analog path. With a 12-bit converter, feed the same known input to both devices and compare raw counts, not converted values. A one-count difference in the raw result is a calibration difference; a difference of 64 or 4096 indicates an alignment error in how the 12-bit result was assembled.
  3. Exercise the timing-dependent paths. Serial baud rates, PWM periods and watchdog resets all depend on the oscillator field and the external components around the chip. A copy on a board with a different crystal value will pass checks 1 and 2 and fail in the field.

The second check is specific to this part and easy to skip. Twelve bits means the result is split across ADRESH and ADRESL with justification bits deciding the alignment, and a copy that shifts the pair the wrong way produces values that look like sensor readings and are off by a fixed factor.

Related notes

The 4K-word PIC16C771 is the same die with more program memory. The 40-pin PIC16C77 is the larger part with a 10-bit converter, and the Flash-era replacement for this whole family’s role is described under the PIC16F684.

FAQ

Can a PIC16C770 be reprogrammed with a different program? No. It is OTP EPROM in the plastic package. A windowed ceramic part can be UV-erased and reused, but only as a whole die.

What has to be copied besides the program? The configuration word, the four user ID words and the 256 bytes of data EEPROM, which is where the calibration usually sits.

Is the copy limited by blank part availability? Yes. OTP silicon cannot be rewritten, so a copy program depends on blank devices of the same part number and preferably the same revision.

Why compare raw ADC counts instead of converted values? Because the 12-bit result is assembled from two registers, and an alignment error shows up as a fixed factor in raw counts while converted values can still look plausible.

What if the firmware writes to EEPROM at runtime? Then part of the source array is operational history rather than factory data. Copying it reproduces one unit’s state, which may or may not be what the field is meant to hold.

Conclusion

Copying a PIC16C770 is less about reading the code than about everything around it. The image is the easy part; blank silicon of a matching revision, a data array that carries the calibration, a 12-bit result that has to be assembled the same way, and an oscillator field whose frequency lives on the board rather than in the chip. Get any one of those wrong and the copy runs — just not identically.