Recovering PIC16C74 Code: What the Factory-Programmed Parts Change
A PIC16C74 recovered from a working board is rarely a device that someone programmed on a bench. In volume production these parts arrived from the factory already programmed, with the configuration word already set, and often with a unique serial number burned into a few words of the array. That detail matters because it means the protection state of the device in your hand is not something you got to choose — and because the serial number is itself part of the image you are trying to recover.

The part in context
The PIC16C74 is the 40-pin member of the PIC16C7X family: 4K × 14 words of EPROM program memory, three timers, two CCP modules, both an SSP and a USART, a parallel slave port, and an 8-channel 8-bit A/D converter.
| Property | PIC16C74 |
| Program memory | 4K × 14 words EPROM |
| Data memory | 192 bytes |
| I/O pins | 33 |
| Timer modules | Timer0, Timer1, Timer2 |
| CCP modules | 2 |
| Serial | SSP (SPI / I²C) and USART |
| Parallel slave port | Yes, 8-bit with external RD, WR, CS |
| A/D converter | 8 channels, 8-bit |
| Package | 40-pin PDIP |
| Data EEPROM | None |
Two of those features define what the firmware looks like. The parallel slave port lets the device sit on a bus as a peripheral with external read, write and chip-select control, which means the C74 is often not the master of its own system — it is a co-processor with a protocol to honour. And eight analog channels with 33 I/O means it is frequently the entire controller of a machine: panel, sensors, actuators, and communications all on one die.
What factory programming means
Microchip offered two services that put code into devices before they shipped, and both are relevant to recovery because they change the state of the part you receive.
Quick-Turnaround-Production. All EPROM locations and configuration options are programmed by the factory, and the devices are otherwise identical to ordinary OTP parts. The consequence is that a QTP device arrives with the configuration word already written — including, if the customer asked for it, code protection.
Serialised QTP. A few user-defined locations in each device are programmed with different values: sequential, pseudo-random, or random. Those words function as an entry code, a password, or an identifier.
This produces a genuinely awkward situation in the field. A board carrying a QTP part has a device whose protection state cannot be determined from the outside, was not chosen by anyone currently involved, and whose image contains a serial number that must be preserved for the product to keep working — a serial that also tells you the parts are not interchangeable even when the firmware is identical.
Memory organisation
Reset is at 0000h, interrupts at 0004h. The 13-bit program counter addresses 8K × 14 with 4K implemented, so addresses above 0FFFh wrap around.
Data memory is banked in 128-byte blocks, SFRs at the low addresses with common registers mirrored between banks. With 192 bytes of RAM and no data EEPROM, everything persistent lives in program memory — there is no second non-volatile region to capture, and no stored settings outside the array itself. That simplifies recovery: the program array is the complete artifact.
How protection works
The code-protect bit is in the configuration word at 2007h, in the same EPROM array as the program. Set, it blocks read-out over the programming interface, in-circuit serial programming included. Because the two share an array, the documented route out — erase — destroys the program along with the bit. Windowed CERDIP parts lose both to ultraviolet; OTP parts, which is what most production C74s are, have no erase path.
The approaches that preserve the code are the established ones: a precisely timed disturbance causing the protection check to be mis-evaluated, or physical read of the floating-gate cells after decapsulation. On a 4K-word array the physical route is more work than on a 512-word part, because the array is larger and the imaging job scales with it.
Family members at neighbouring densities behave identically at the protection level — PIC16C74B binary recovery for the later revision, PIC16C73A program recovery for the 28-pin part without the parallel port, and PIC16C77 code recovery for the 8K sibling.
What “recovering the code” has to return
A usable result from a C74 is more than 4,096 instruction words. It includes:
- The program array, 0000h–0FFFh.
- The configuration word at 2007h — oscillator mode above all, since it decides whether the rebuilt device starts at all.
- The ID locations at 2000h–2003h.
- Any serialised words, if the product verifies them. A rebuilt unit with a duplicate serial will fail the product’s own checks even though the firmware is identical.
Point four is the one that surprises people, and it follows directly from serialised factory programming. Copying the code faithfully can produce a device that is rejected by the very firmware it is running.
Why this part gets recovered
The C74 sits at the top of the 40-pin mid-range line, so it appears in machinery where one chip does everything: analytical instruments, industrial controllers, appliance panels, telecom line cards. Those products were built in volume across two decades, and the design files behind them are frequently gone.
The realistic case is continuity: a production line or a repair depot needs units that behave like the originals, and the only surviving record of that behaviour is the programmed part in a working board. That the device was factory-programmed a quarter of a century ago is incidental — it has simply become the archive.
Limits worth stating upfront
- OTP parts are single-attempt. There is no erase to fall back on after an invasive route.
- Serialised words are part of the design. Faithful code with a duplicated serial can still fail product validation.
- 4K words is a real array. Physical read effort scales with area, and this is four times the work of the smaller family members.
- The parallel slave port resists black-box recovery. A bus protocol with external strobes is much harder to characterise by input sweeping than a simple control loop.
FAQ
What is a QTP device? A part programmed by the factory before shipment, with program memory and configuration options already written. It is electrically identical to an ordinary OTP part.
Why does my rebuilt unit fail the product’s own self-test? Most often because the original carried a serialised identifier in a few program words and the rebuild duplicated it — or omitted it entirely.
Can the configuration word be inferred instead of recovered? Sometimes, by matching the board’s oscillator circuit, but it is guesswork. Recovering 2007h with the program is the reliable approach.
Does the C74 have data EEPROM for stored settings? No. All persistent data must live in program memory, which makes the recovered array the complete artifact.
Conclusion
Recovering PIC16C74 code is a 4K-word read with two complications that are easy to overlook: the configuration word at 2007h decides whether the result boots, and the serialised words that factory programming put in the array decide whether the product accepts it. On this part, a byte-perfect image and a working replacement are not the same thing.