• AVR Freaks

AnsweredProtection of memory on PIC18F4550

Junior Member
  • Total Posts : 107
  • Reward points : 0
  • Joined: 2012/08/27 05:21:28
  • Location: 0
  • Status: offline
2019/05/24 04:45:21 (permalink)

Protection of memory on PIC18F4550

I am designing a device that uses a PIC18F4550. Among other things, I need to protect a portion of the memory from being erased or rewritten by another unauthorized person, even if it uses any programmer. I need to protect only a few bytes, like a serial number. Is it possible ? If it is not possible, What level of similar protection can I achieve using PIC18F4550?
I know there are other cheap solution ways, like EEPROM chips with pre-programmed Serial Numbers. However, I have some doubts:
From what I understand, they would come from the factory with the serial already programmed, so my application on the PIC should read this external EEPROM chip to get the serial number, correct? would be possible to change these values? Could a person easily read this chip externally, swap this number or even swap the chip by another one?
I've heard about crypto memorys, but I was warned that they are a difficult solution to implement. What's the difficulty of using them?
post edited by danbakana - 2019/05/24 04:55:36
Super Member
  • Total Posts : 1700
  • Reward points : 0
  • Joined: 2014/03/27 07:04:41
  • Location: 0
  • Status: offline
Re: Protection of memory on PIC18F4550 2019/05/24 04:56:28 (permalink) ☼ Best Answerby danbakana 2019/05/24 08:19:41
+2 (2)
Turn code protection on. You won’t be able to protect it from being erased with the programmer, but you will stop anyone being able to read any of the data (code or EEPROM) out of your device with a programmer before they do that.

If they can’t read the device, all they can do is brick it by completely erasing it.
Super Member
  • Total Posts : 287
  • Reward points : 0
  • Joined: 2005/09/07 10:12:10
  • Status: offline
Re: Protection of memory on PIC18F4550 2019/05/24 13:24:04 (permalink)
+1 (1)
Also, Consider a PIC18F45k50 for new designs.  It's a newer, pin compatible and cheaper.
Super Member
  • Total Posts : 1849
  • Reward points : 0
  • Joined: 2003/11/07 12:35:49
  • Status: offline
Re: Protection of memory on PIC18F4550 2019/05/24 23:35:10 (permalink)
+1 (1)
Turning code protection on is not enough. If blocks have R/W access from other blocks then code can be inserted in a different block to read out "code protected" information. With just two devices it is possible to retrieve the entire contents of the PIC18F4550 if block R/W access is not disabled. You must disable table reads and table writes to any block you truly want to protect as well as code protection for that block.
Sadly, this then sort of defeats the idea of having a global bootloader as any bootloader can then only work within its own block if security is to be maintained. 
Jump to:
© 2020 APG vNext Commercial Version 4.5