View previous topic :: View next topic |
Author |
Message |
spilz
Joined: 30 Jan 2012 Posts: 220
|
PIC18F14k22 and fuses |
Posted: Sat Nov 16, 2024 11:18 am |
|
|
Hello everyone
I’m working on the PIC18F14K22 and I’m confused about protection fuses.
What I would like :
- Writing the code only once
- disable writing a new bin
- disable reading the bin
- disable reading from outside the EEPROM
- disable fuses clearing
- keep enable reading and writing the EEPROM from the internal software
Any other protection ??
I tried to read datasheet and topics but I was very confused
Can someone help me ?
Thanks in avance |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Sat Nov 16, 2024 3:46 pm |
|
|
re: Any other protection
Not really 'protection' but if you sand off the PIC's model number and date code it'll slow down someone from reading what you have.......1st they have to figure out WHAT the blob of epoxy actually is...
Have to admit I don't use 'code protection'. I remember the very early PICs ( the ones with quartz windows ) you COULD read even if protected. What looked like garbage ,once you did some 'bit manipulations', the real machine code 'magically appeared'.
I assume Microchip has added better security since then.... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Sun Nov 17, 2024 2:37 am |
|
|
You can always reprogram a flash chip.
If a chip is full erased, all the fuses go off, so it can be reprogrammed.
So your very first wish, can't be done. The only way to have a chip that
can be programmed only once, is to have a OTP chip. Current PIC's are
not OTP.
This fuses are individually protected, _except_ for a full erase. The point
is that you do this, and you start with a blank chip. No code, and no fuses.
Such a blank chip can be programmed with new code. The same applies to
your second line. WRTC enables the fuse protection.
The third, is exactly the point of the code protection. On modern chips this
is very good.
It is always possible to read the code, if you spend enough money. The old
standard get around, was to use an electron microscope on the memory.
The internal EEPROM, can be read/written by the internal software even
when protection is enabled. Would be pointless otherwise.
23.3.2 in the data sheet, |
|
|
jaka
Joined: 04 May 2014 Posts: 36 Location: Finland
|
|
Posted: Thu Nov 21, 2024 4:29 am |
|
|
Ttelmah wrote: | The only way to have a chip that can be programmed only once, is to have a OTP chip. Current PIC's are not OTP. |
The relatively new 18F Q24 family has some OTP config bits, including ICSPDIS. If you clear this configuration bit, the whole ICSP interface is permanently disabled. You can't read, write or erase the chip.
I don't know if these OTP bits are really OTP, or just FLASH which is prevented from erasing. So theoretically someone could decap the chip and selectively erase the the config bits with UV. Although they are likely covered by additional metal. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Fri Nov 22, 2024 2:16 am |
|
|
Yes. These have a single word of the config memory, that needs different
commands to access, and contain a number of bits affecting various
features of the programming. I'd guess they are actually flash memory,
but without he charge pump connections for erase. So once set, except
for age degradation after perhaps 20+ years, they are OTP.
Does give effectively OTP behaviour on the flash memory. |
|
|
spilz
Joined: 30 Jan 2012 Posts: 220
|
|
Posted: Mon Dec 16, 2024 3:37 am |
|
|
Thanks for your help, I’m doing some test to find the perfect option |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Mon Dec 16, 2024 6:03 am |
|
|
The one way I know to do all of what's listed in the 1st post , is to have Microchip program the PICs. They probably have OTP versions of your PIC, or one that will work for your application. |
|
|
|