PostHeaderIcon Break IC PIC16C771 Firmware: Read Inhibition Is Not Code Protection

Two devices can both be described as “protected”, carry the same part-number prefix, come from the same family, and respond to a read attempt in completely different ways, because the mechanism that stops the read is not the same mechanism in both. On this generation of OTP parts it is read inhibition in the array and its decode logic; on flash parts it is a configuration bit that gates the interface. The distinction is not academic: it decides what a failed read looks like, and therefore what the next step should be.

The PIC16C771 is a twenty-pin part with 4096 by 14 bits of program memory, 256 bytes of RAM, 256 bytes of data EEPROM, a twelve-bit converter with a dozen channels, and two comparators. The twelve-bit converter is why the part exists: very few microcontrollers of its generation offered more than ten bits on chip, and the devices built around it are instruments rather than controllers — scales, pressure transmitters, thermocouple front ends.

The same word, two mechanisms

Aspect flash protection OTP read inhibition
what is set a configuration bit, rewritable a permanent condition in the array or its decode
how it acts gates the programming interface prevents the array from presenting content
reversibility can be cleared on an erased part no clear path
failure signature of a read uniform pattern or bus error patterned or attenuated content
where the work moves sometimes none needed always to the die

The fourth row is the useful one in practice. A flash part that refuses to read usually returns a well-defined refusal: a known pattern, a status flag, an error. An OTP part with read inhibition may return something that looks like content — a stable repeating value, or a set of words that decodes into instructions that do nothing useful. That appearance of content is what makes the diagnosis hard, because it invites analysis rather than suspicion.

Why “protected” reads sometimes look plausible

The inhibition acts on the sense path rather than on the address decode, so the array still sequences through addresses and the interface still returns values. What comes back is not the stored content but a fixed or attenuated response determined by the inhibit circuit.

Two signatures distinguish it. The values are identical across a long run of addresses that should contain varied code, and they are identical across different units of the same design. Real content differs between addresses; inhibited content does not.

The check is cheap: read two addresses a few hundred words apart that both should hold code, and compare. If they match exactly and the match repeats across the array, the array is not being read.

The twelve-bit converter changes what a recovery is worth

On a general-purpose part, a recovered image is worth having because it is the product. Here the image is only half the product: the other half is the calibration that turns a converter count into a physical quantity.

That calibration lives in two places. The data EEPROM holds the unit-specific values written at end of line — offset, gain, sometimes a temperature compensation table. The program holds the design-wide constants: the reference voltage assumption, the linearisation curve, the scaling to engineering units.

A delivery that omits the EEPROM content therefore hands over a program that cannot measure anything correctly, even though it is complete as an instruction listing. On this part, the 256 bytes matter as much as the four thousand words.

What the data EEPROM contains on an instrument

Region Typical content Consequence if lost
first few bytes offset and gain corrections reading drifts by a fixed amount
middle linearisation segments or breakpoints non-linearity returns
later serial number, production date, model code unit cannot be identified
tail usage counters or a checksum self-test fails at start-up

The fourth row explains a specific failure that is often blamed on the recovery: a device restored with a blank EEPROM runs its start-up self-test, compares a checksum over the data area against a stored value, finds a mismatch, and halts or enters a safe mode. The program is correct and the device is behaving exactly as designed.

Protecting one array and not the other

Because the bits are separate, a part can be shipped with the program array inhibited and the data EEPROM open, or the reverse. Both combinations occur in production, and they correspond to different commercial intentions: the first protects the design, the second protects the unit’s calibration.

For a job, the second combination is the awkward one, because the design is available and the calibration is not — and the calibration is what the customer cannot reconstruct without the original instrument’s test fixture.

Delivering firmware rather than a dump

The word “firmware” in the request implies something programmable, not merely readable. Three additions turn an image into firmware.

The configuration word, decoded, so that a blank part can be set up identically. The data EEPROM content, with the unit-specific values identified where their role can be established from the code that reads them. And a note on any region of the program array that could not be read or that reads as blank, because on an OTP device a blank region can mean three different things and the customer needs to know which.

Where the same family’s job classification is the subject, PIC16C770 eeprom reading sets out read, break and rebuild as separate engagements. Where the constants that make the converter meaningful are the focus, PIC16C717 program reads them as a specification. And where a mask-programmed part has no array to inhibit at all, PIC16CR83 heximal explains the different physics.

The short version

Protection is a mechanism, not a property. On this part the mechanism inhibits the sense path, so a blocked read can look like content and must be detected by repetition rather than by error. Then remember that the instrument is the converter plus the calibration, and deliver both arrays.

Comments are closed.