CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC18F14k22 and fuses

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
spilz



Joined: 30 Jan 2012
Posts: 220

View user's profile Send private message

PIC18F14k22 and fuses
PostPosted: Sat Nov 16, 2024 11:18 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Nov 16, 2024 3:46 pm     Reply with quote

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: 19553

View user's profile Send private message

PostPosted: Sun Nov 17, 2024 2:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 21, 2024 4:29 am     Reply with quote

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: 19553

View user's profile Send private message

PostPosted: Fri Nov 22, 2024 2:16 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Dec 16, 2024 3:37 am     Reply with quote

Thanks for your help, I’m doing some test to find the perfect option
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Dec 16, 2024 6:03 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group