PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Nov 14, 2005 5:53 pm |
|
|
Quote: |
CP0-CP1-CP2,CP3 bits of PIC18F452 register should be set to all zero to
protect PIC18F452's code from read. But when i do this my PIC dont works |
If you have the CCS compiler, just put PROTECT in the #fuses statement
as shown below. This will set all the CPx bits = 0 and enable code
protection.
Quote: | #include <18F452.h>
#fuses XT,NOWDT,PROTECT,PUT,BROWNOUT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS) |
I suspect that you may not have the CCS compiler, and you may
be setting the CPx bits by other means. You are probably trashing the
config bits in some other config register and this causes your program
to lock-up. |
|