Wouter wrote: >So your potential customer/data thief can put any program in the ROM he >wants. In that case I don't see how you can prevent that he reads the data >EEPROM, while at the same time your program can read it. The best you might >do is that he can not make sense of what he reads, but that is anoter >matter. I believe there is another option, and this is what I'm working towards. I'm assuming that it is not possible to selectively erase, say, the program memory without also causing the EEPROM contents to revert to 0xFF for every cell. I.e. bulk erase erases both program memory and EEPROM memory. Is my assumption correct? If it is, then if you don't leave any unprogrammed (0x3FFF) cells in program ROM, then it's nearly impossible (I believe) to "put any program in the ROM he wants" without first erasing the device entirely, because to bulk erase program memory you'll end up erasing EEPROM memory, too. You would have to be very lucky to find just the right combination of opcodes in the existing code to allow you to overwrite them (i.e. turn 1's to 0's) to exactly match the EEPROM reading program you want / need. Therefore to try to read the protected EEPROM via a (new) internal program, you must bulk-erase the part, and with that, the EEPROM contents are destroyed. My intention is for the (my) program to refuse to work if it can't find a particular "key" in EEPROM. Therefore protecting the EEPROM is what I need to do. Sound plausible / correct / possible? Regards, -- ______________________________________ Andrew E. Kalman, Ph.D. aek@pumpkininc.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.