read microcontroller program

Thread Starter

mik3

Joined Feb 4, 2008
4,843
hi guys,

If we read the program of a microcontroller it will be in hex. Can we translate it back to C++ or find from it the number of the chip used (if the number has been erased form the package) ?
 

Papabravo

Joined Feb 24, 2006
21,228
A recognizeable translation back to c is highly improbable. All the information about the names of the symbols is lost.

The type of the processor is problematic also because some processors have a large number of nearly identical variants. This is especially true of microcontrollers which have different arrangements of peripherals around a common core. You could probably tell the difference between a PIC and an 8051 but nailing down the particular variant without additional information would be difficult.
 

Thread Starter

mik3

Joined Feb 4, 2008
4,843
Is there any way to identify a microcontroller if its product number is erased from the package by using a programmer?
 

Caveman

Joined Apr 15, 2008
471
If you can program it as a PIC, it is a PIC. If you want to further identify it, you try to write and read memory to determine the amount of memory that actually is written. This should help narrow it down a bit when you consider the package and memory sizes. I'm not sure if a PIC has an identification byte in memory that would make is simpler. That would be easiest.
 

n9352527

Joined Oct 14, 2005
1,198
They are defined in the respective micro's Flash Memory Programming Specification document. For example, the ID bits for 16F88 are 14 bits wide located at address 2006h. The most significant ten bits are the device ID and the rests are revision ID.

00 0111 0110 XXXX
 
Top