Posts Tagged ‘copy protected chip eeprom’
Copy Protected Chip PIC16C56 Code: Three Different Jobs Hide Behind the Word Copy
The phrase in the request is “copy protected chip”, and it describes the obstacle rather than the objective. Customers who use it want one of three outcomes, and the difference between them is larger than the difference between two unrelated part numbers.
Some want the bytes: an image file, archived, for a failure analysis or a regulatory submission. Some want working units: a programmable replacement built from the image, burned into blank parts, tested and shipped. Some want to own the design: a listing with the tables marked and the timing constants explained, so that a maintenance programme can change a threshold without a reverse engineer in the room.
Only the first is a memory recovery. The other two are projects that begin with one.
The part in numbers
| item | PIC16C56 |
|---|---|
| program memory | 1024 by 12 bits, OTP |
| pages | 2, selected by PA0 in the status register |
| data RAM | 25 bytes |
| I/O | 12 pins, PORTA and PORTB |
| instruction set | 33 instructions, 12-bit core |
| interrupts | none |
| protection | two code-protect fuses |
| clock | fixed by order code, not by a bit |
Twenty-five bytes of RAM is the number that explains most of the code you will read on this device. There is no room for buffers, so everything is done a byte at a time with the working register, and everything that needs more than a few values keeps them in program memory as RETLW tables. On a 16C56, tables are not an optimisation; they are the only storage available beyond the file registers.
Two fuses, four states, one useful pair
Code protection on this class is implemented as two fuses rather than a single bit, which gives four combinations. Two of them are documented and used: both open, meaning unprotected, and both blown, meaning protected. The other two are the halfway states, and they are not a feature — they are evidence of a programming sequence that did not complete.
This matters at triage because a partially protected part returns something that looks like a read: some words come back as data, some as a fixed pattern, and the pattern boundary does not fall on any meaningful address. Tools that report “read OK” on such a unit are reporting that the communication worked, not that the memory was read. The correct conclusion is that the fuse state is ambiguous and that the job is a decapsulation, which is a different line item.
What the protection actually blocks
On an OTP device the fuses do not encrypt anything. They disable the read path. The array is still there, the bits are still the bits that were programmed, and a probe placed on the die reads them without any protocol at all.
Everything that depends on the read command therefore fails, and everything that depends on the die works. That is the entire model of the service, and it is worth stating plainly because customers often expect that a protected part has been “encrypted” and that a key exists. There is no key. There is a physical barrier, and the way past it is physical.
The same model explains why a protected OTP part cannot be unprotected. Blowing a fuse is a one-way act, and no sequence of commands regrows it.
The three jobs, spelled out
| the customer says | the deliverable | what it needs beyond the image |
|---|---|---|
| “I need the code” | image file, byte-accurate, with a stated packing convention | a note on the config word and the clock grade |
| “I need units” | programmed, tested replacements | blank OTP stock, a supported programmer, a functional test |
| “I need to change something” | listing with tables identified, plus an assembler-compatible source | a disassembly pass and a timing review |
The middle row is where projects stall, and the reason is not technical. A 16C56 clone needs blank 16C56 parts. The part is obsolete; the supply is whatever remains in distributor stock and on the brokerage market, and the brokerage market for obsolete OTP parts contains remarked and re-marked devices. A clone programme that begins with a purchase order for five hundred blanks will discover this in month two, not month one.
The third row is where budgets are usually underestimated. Producing a listing is mechanical; producing something a maintenance engineer can change safely requires identifying every delay loop and every timing constant, because on a part with a fixed clock grade the constants are not portable. A clone that runs at the right speed on the original hardware will run at the wrong speed on a variant board, and the source has to say why.
Why 1024 words changes the reading
Two pages, one select bit, and no interrupts. The single entry point at address zero makes the image easy to verify, and the page bit makes it easy to misread: a linear disassembly that does not track PA0 will label cross-page calls at addresses 512 words away from where they point.
The practical habit that avoids most of this is to treat the page bit as part of the address. Annotate every entry point with the page state, and when a call target disagrees with the state, suspect the state rather than the target. On hand-written firmware the bit is usually set immediately before the call and cleared immediately after, which produces a recognisable three-instruction pattern around every cross-page transfer.
Delivering a copy that survives a second look
Three things make the difference between a delivery that is accepted and one that comes back with questions.
State the packing convention in the file, not in the covering note. A 1024-word image is 1536 bytes packed or 2048 bytes unpacked, and a customer who burns the wrong one gets a device that does not start.
Include the configuration word as data. On this family it carries the watchdog enable and the protection fuses, and a clone built without it will be either unprotected by accident or protected from the first power-up and therefore unverifiable.
Include the oscillator grade the image assumes, because it cannot be read from the part. That single line prevents the most common post-delivery failure: a rebuilt unit that boots and then runs a motor at the wrong speed.
For the container conventions in detail, PIC16C57 heximal file extraction handles the packing question. For the same protection model on a part twice this size, PIC16C57C firmware is the nearest relative. And where an identical fuse state has to be distinguished from a damaged die, PIC16C56A heximal file covers the readback signature.
FAQ
Is a protected 16C56 encrypted? No. The read path is disabled, the memory is not transformed. Anyone with access to the die reads the original bits.
Can the part be re-protected after work? A recovered image can be burned into a blank part with the fuses blown, which reproduces the original state. The original device is not restored.
Does the A suffix change the copy? The 16C56A is a faster grade of the same architecture. The image is compatible; the timing constants are not, which is why the grade belongs in the delivery note.
The short version
Protection on this part is a fuse, not a cipher, and “copy” is three jobs wearing one word. Decide which one is wanted before quoting, because the second depends on blank stock that may not exist and the third depends on a disassembly budget that is easy to underestimate. Deliver the image with its packing convention, its configuration word and its clock grade, and the copy can be reproduced by someone who was not in the room.