Confused- PIC data protection??

Status
Not open for further replies.

dalmation

Member
Hi-
Just wondering about pic microcontroller data protection..

Programming some PIC16F627 and I have enabled data protect (to protect entire code area).

But I can still read the chip with my programmer?? Why does that happen- am I missing something?

I thought it made the chip unreadable (until erased).

I want to prevent the chip being copied by someone wanting to 'clone' my PCB.

I'm not up to speed with PIC's, but if someone could explain better- that would be great.

-Thanks in advance.

-DAlmation.
 
dalmation said:
Hi-
Programming some PIC16F627 and I have enabled data protect (to protect entire code area).
You are maybe confusing DATA protection with CODE protection. CPD (bit8) in the CONFIGURATION WORD protects the EEprom data area NOT the FLASH program area. The FLASH program area is protected by clearing bits 10-13 in the CONFIGURATION WORD.
 
Have you got code for a 627A but are programming a 627. Microchip changed the config settings between the 2 versions and the code protect bits are different. Your config value should start with a 0 for code protection to be on.

Mike.
 

It does, if you set it correctly - as already suggested, you need to set code protection on, data protection is only for the data EEPROM area.
 
Sorry- I did mean code-protection, not data protection.

I'll recompile the program specifically for 627 (I did compile for 628A, yes).

If I get it to work properly- I shouldnt be able to read it, but I can still erase and start again- is that right?

-Dalmation
 
Yes, you should be able to erase. Does it now read back as all zeroes?

Mike.
 

Yes, with the FLASH/EEPROM chips you can - but don't ever try it on the UV eraseable JW chips!.
 
Nigel Goodwin said:
Yes, with the FLASH/EEPROM chips you can - but don't ever try it on the UV eraseable JW chips!.

Why not, you can still erase and start again with the JW chips or do you know something I don't.

Mike.
 
blueroomelectronics said:
Apparently the protect bits don't erase with UV

Exactly, for security reasons the protection bits can't be UV erased, so if you set them on a JW part (which are VERY expensive) you ruin it.
 
Okay- sorted.

The firmweare was written for the 628 and I was using it on the 627- even with setting the config on the programmer- it wasnt playing ball. I tried again onto a 628 chip and everything went perfect.

Thanks for your help guys.

-Dalmation.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…