> Another idea is to do a bunch of current measurements at > production, and store them in eeprom. Then if the detected current > at specific stages is in-correct, due to probe load, disconnected > I/O, etc., the unit could become evil and inflict it's wrath! > Craig |You know, thats finally a constructive technique. |I will save your mail under my folder : NiceToRemember Hmm... if the goal is to make it so your code can't just be burned into another PIC, then how about this method [note: be sure to test devices after you do this, including some tests at temperature extremes etc!]: Select certain pins on your design that will be used as inputs only (best if it's an entire I/O port). Then, one at a time, pull each of those pins HARD to 5 volts while grounding everything else (INCLUDING VDD). If past experience is any guide, this will blow out the high side drivers on those pins while leaving everything else intact. Once that has been done, you should be able to program those pins to output high sometimes or always without any effect; if someone puts your code into an 'undamaged' chip, the pins will pull high and the inputs won't be useable. Note that if you use this trick, you shouldn't use read/modify/write operations on that I/O port since they could cause a low input level to get latched. If someone tries to analyze your code, of course, it won't be hard for them to simply remove the stuff that was causing them hardship. Nonetheless the technique might work against some casual adversaries.