How to identify the type of a microcontroller

microcontroller

Assuming that we have an application which a lot of devices can connect and interact each other (like Internet of Things). Is there a way to identify the micro-controller that each connecting device contain inside? For example to identify if one device has a PIC or an Atmel or else? If not can at least identify if the micro-controller is 8bit vs 16bit or else?

edit: Can the firmware return the version of a microcontroller?

Best Answer

This answer is written on the basic assumption that the OP is choosing the devices and writing the firmware him/herself. The OP indicates this to be true in the comment discussion below the question.

Yes, you can certainly include functionality that will identify the device in use. Most (if not all) microcontrollers will have read-only memory that contains a device ID and a silicon revision number. The microcontroller will probably have the ability to read its own memory location in firmware so that it can report those values upon request. How you implement that functionality is entirely up to you.

If you're trying to prevent thieves from porting your firmware into other chips, this method will not prove to be very effective. It will be trivial for them to report dummy identification values when requested to make their chip look like another.