---
+ Post New Thread
Results 1 to 11 of 11
  1. #1
    Junior Member level 2
    Points: 1,334, Level: 8
    mago's Avatar
    Join Date
    Jan 2006
    Posts
    23
    Helped
    1 / 1
    Points
    1,334
    Level
    8

    erase code protected pic

    Hi everybody,

    Does anyone know how to chip erase the pic16f628? i have a pic that, acidentally, had its code protection bits activated, and now i want to know if it is lost, or if there is another way to recover it. I do not care about the code that is already burned in it. i know that some pics have this function about erasing all the pic, chip erase, but i am afraid that this model does not have this function.

    Anybody can help?

  2. #2
    Full Member level 3
    Points: 2,903, Level: 12

    Join Date
    Mar 2005
    Location
    Morocco
    Posts
    183
    Helped
    11 / 11
    Points
    2,903
    Level
    12

    pic 16f628a cp

    Hello
    This is is Flash , you can Erase it Normally!

    Regards
    Cortex



    •   Alt10th March 2007, 00:01

      advertising

        
       

  3. #3
    Junior Member level 2
    Points: 1,334, Level: 8
    mago's Avatar
    Join Date
    Jan 2006
    Posts
    23
    Helped
    1 / 1
    Points
    1,334
    Level
    8

    pic 16f876 erase code protection

    but when the code protection bits are enable, you don´t have access to the segment code you have protected, program and/or data code.
    and even trying to reprogram the flash, you cannot rewrite those bits in the configuration word.

    Am i wrong?



    •   Alt11th March 2007, 17:34

      advertising

        
       

  4. #4
    Advanced Member level 5
    Points: 14,575, Level: 29
    blueroomelectronics's Avatar
    Join Date
    Sep 2006
    Location
    Toronto, Canada
    Posts
    1,682
    Helped
    179 / 179
    Points
    14,575
    Level
    29

    code protect pic16f628

    Erasing a code protected PIC will erase everything. Just like a new PIC.



  5. #5
    Junior Member level 2
    Points: 1,334, Level: 8
    mago's Avatar
    Join Date
    Jan 2006
    Posts
    23
    Helped
    1 / 1
    Points
    1,334
    Level
    8

    how to write data in eeprom of pic16f628a

    yes , that is what i want but how can i do that for pic16f628?
    is there any command in the porgram specification for doing this?



    •   Alt11th March 2007, 22:29

      advertising

        
       

  6. #6
    Full Member level 3
    Points: 3,020, Level: 12
    folks's Avatar
    Join Date
    Oct 2006
    Location
    Guadalajara
    Posts
    182
    Helped
    33 / 33
    Points
    3,020
    Level
    12

    pic16f628a erase

    Quote Originally Posted by mago
    yes , that is what i want but how can i do that for pic16f628?
    is there any command in the porgram specification for doing this?
    Mago, this is simple:

    1.- Open you software for pic Program (winpic800, icprog, Mplab etc...)
    2.- Erase the Pic
    3.- Your pic is ready



  7. #7
    Advanced Member level 1
    Points: 5,629, Level: 17

    Join Date
    Aug 2005
    Location
    Macedonia
    Posts
    412
    Helped
    40 / 40
    Points
    5,629
    Level
    17

    pic16f628 code protection

    Hi MAGO,
    this a simple view on ICPROG software, look option erase all,
    regards



  8. #8
    Junior Member level 2
    Points: 1,334, Level: 8
    mago's Avatar
    Join Date
    Jan 2006
    Posts
    23
    Helped
    1 / 1
    Points
    1,334
    Level
    8

    erase code protected pic

    thank you all, but i was wondering if that will work on a pic that had its code protected bits already set.



  9. #9
    Full Member level 3
    Points: 3,020, Level: 12
    folks's Avatar
    Join Date
    Oct 2006
    Location
    Guadalajara
    Posts
    182
    Helped
    33 / 33
    Points
    3,020
    Level
    12

    pic16f628a program

    Quote Originally Posted by mago
    thank you all, but i was wondering if that will work on a pic that had its code protected bits already set.
    Yes your pic have the reason, read this (Microchip Datasheet):

    PAGE 89
    When the device is code-protected, the CPU can
    continue to read and write the data EEPROM memory. A
    device programmer can no longer access this memory.

    PAGE 111
    Only a Bulk Erase function can set the CP
    and CPD bits by turning off the code
    protection. The entire data EEPROM and
    Flash program memory will be erased to
    turn the code protection off.

    So you can write a code to turn off cp and cpd

    Sorry, but is true.


    1 members found this post helpful.

  10. #10
    Junior Member level 2
    Points: 1,334, Level: 8
    mago's Avatar
    Join Date
    Jan 2006
    Posts
    23
    Helped
    1 / 1
    Points
    1,334
    Level
    8

    pic16f628a code protect off

    Thanks my friends, i have finally concluded that when you set a code protection bit, you protect the area of memory (program and/or data, depending wheter you set the appropriate bits in the configuration word), in such a way that, when you try to read the program memory or data memory, you receive 0x0000 or 0x00 respectively. This protect someone else from stealing your code. however, if you run the bulk erase program memory command, you erase both of areas(data and program) and reset the configuration word to 0x3FFF, so that you can program again the pic, but you cannot see the code that was previously burned.

    Someone told me that its possible to "hack" the pic (i think that has something to do with manipulating the power pins), and they can do reverse engineering, disabling those protection bits and then read the code.

    I have found that some models have a special function called chip erase, that do what i mentioned above, and because pic16f628, doesnt had this function i was wondering that this old model would not clear after the protected bits were set. This is what was confusing me. Thanks everybody for the help.



  11. #11
    Newbie level 1
    Points: 825, Level: 6

    Join Date
    Apr 2008
    Posts
    1
    Helped
    0 / 0
    Points
    825
    Level
    6

    pic16f628 erase

    I have the same problem with a PIC16F877A.

    How can I disable code protect?

    I can't download the attached file *.pdf.

    Thank you. :)



+ Post New Thread
Please login