PIC18F2620 Hex File Read-Out: Why the Chip Is Not Encrypted

A PIC18F2620 that refuses to read is not encrypted. Nothing inside the device scrambles the program — the silicon simply stops answering the programmer once the protection bits are set. That distinction decides what a read-out can recover, how the work is done, and why a hex file with the wrong config words still produces a dead clone.

The PIC18F2620 is a 28-pin enhanced-flash part: 64 KB of program memory, 3,968 bytes of SRAM, 1,024 bytes of data EEPROM, a ten-channel 10-bit ADC and 25 I/O pins, running to 10 MIPS. It sits in the middle of a long-lived family, which is exactly why so many of them are still in the field with no source code behind them.

Where the Program Actually Lives

A PIC18F2620 hex file is not one flat blob. It is an address map, and a usable read-out has to cover all of it.

Region Address range Size
Program flash 0x000000–0x00FFFF 64 KB (32,768 words)
Data EEPROM 0xF00000–0xF003FF 1,024 bytes
Config words 0x300000–0x30000D 14 bytes
Device ID 0x3FFFFE–0x3FFFFF 2 bytes

Engineers usually ask for the flash. The config words are the part that decides whether the copy boots.

The Gate Sits in CONFIG5L

Protection on this device is not a password and not a cipher. CONFIG5L carries four bits, CP0 through CP3, each covering one block of program memory; CONFIG5H adds CPB for the boot block and CPD for the data EEPROM. A separate set, EBTR0–EBTR3 in CONFIG7L, blocks table reads from user code, so firmware cannot copy its own flash out through TBLRD either.

Once those bits are set, the in-circuit serial programming interface still connects, the device ID still reads back correctly, and the hex file still has the right length. It is simply full of a uniform filler word where instructions should be. A naive dump therefore returns 64 KB of plausible-looking nothing — the classic failure that makes people believe the chip is “encrypted”.

This is also why the copy protection scheme matters more than the part number. Two boards with the same PIC18F2620 can behave completely differently depending on which blocks were protected and whether the EEPROM was left open.

How the Gate Is Passed

Because there is no cipher to break, the work is physical before it is electrical. The package is opened and the array is read at the silicon level rather than through the programming interface, using semi-invasive IC extraction where the array is directly accessible, and reading the program memory once it is. The output is then reassembled into a standard Intel HEX file with the config words and EEPROM in their proper regions.

How a Dump Is Proven Complete

A read that “worked” is not the same as a read that is correct. Four checks separate the two:

  • Reset vector. Address 0x0000 must hold a valid GOTO, not filler.
  • Interrupt vectors. The high-priority and low-priority entries at 0x0008 and 0x0018 must point inside the image.
  • Filler scan. Every 64-byte block is scanned for the constant the programmer returns on protected cells; a run of it inside what should be code is a hole, not a subroutine.
  • Independent re-read. A second acquisition from a different access point has to produce the same checksum. One read is a sample; two matching reads are evidence.

Only after that does the file get opened in MPLAB X and checked for region warnings. Chip extraction analysis is where most of the schedule actually goes — the read itself is often the short part.

When the Part Is the Wrong Starting Point

If you only need 32 KB, the PIC18F2610 is the same architecture with half the flash and the same toolchain, and a PIC18F2610 read-out follows an identical process. If the goal is to keep a production line running rather than to recover source, it is worth asking whether a pin-compatible migration is cheaper than a full recovery — the honest answer is sometimes yes.

Send the full part number, the package, and what the board currently does. That is enough to say whether a PIC18F2620 hex file is recoverable here; our services page lists what the deliverable contains.

Service scope and next steps

Before we quote a PIC job we confirm the silicon revision and the protection configuration, because both decide whether the on-chip programming area can be read directly or needs a different approach. The full scope of what we handle, how a project runs from electrical integrity test to delivered file, and the payment terms are described on our service capabilities page.

Ready to extract this PIC firmware?

Send us the part number and a short description of what you need. Free evaluation, fixed quotation, and a reply within one business day.

Request a quotation

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *