How to set and change Configuration Bits programmatically?


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    453


    Did you find this post helpful? Yes | No

    Default Re: How to set and change Configuration Bits programmatically?

    You may not be able to do what you want if any of the code protection bits are set...
    Code:
    Note: Code protection bits may only be written to a ‘0’ from a ‘1’ state. 
    It is not possible to write a ‘1’ to a bit in the ‘0’ state. 
    Code protection bits are only set to ‘1’ by a full Chip Erase or Block Erase function. 
    The full Chip Erase and Block Erase functions can only be initiated via ICSP or an
    external programmer.
    Since you can brick the device if you get the config bits incorrect (ie wrong osc type) I like to have the bootloader just ignore reprogramming the config bytes.

  2. #2
    Join Date
    Aug 2006
    Location
    Italy
    Posts
    72


    Did you find this post helpful? Yes | No

    Default Re: How to set and change Configuration Bits programmatically?

    Quote Originally Posted by tumbleweed View Post
    You may not be able to do what you want if any of the code protection bits are set...
    Code:
    Note: Code protection bits may only be written to a ‘0’ from a ‘1’ state. 
    It is not possible to write a ‘1’ to a bit in the ‘0’ state. 
    Code protection bits are only set to ‘1’ by a full Chip Erase or Block Erase function. 
    The full Chip Erase and Block Erase functions can only be initiated via ICSP or an
    external programmer.
    Since you can brick the device if you get the config bits incorrect (ie wrong osc type) I like to have the bootloader just ignore reprogramming the config bytes.
    Thank you for your answer.
    What you say is True.
    In the current scenario, all the CODE PROTECTION bits are set. I don't want to deal with that.
    What I'm trying to do, is to change the bits WRTC (Configuration Register Write Protection bit) and WRTB (Boot Block Write Protection bit) that are currently set, and I wish to revert to "not protected".

    Do you think it is possible?

    Unfortunately yesterday my old ICD2 decided to not work anymore. So, I've to wait for a new (and expensive ICD3), but it will be here in 5 or 6 days. So I've mandatory to wait for my own tests...

    Regards.

  3. #3
    Join Date
    Aug 2011
    Posts
    453


    Did you find this post helpful? Yes | No

    Default Re: How to set and change Configuration Bits programmatically?

    I'm not sure, but I think it treats all of the CPn, WRTn, and EBTRn as "code protection bits" so if they're set to 0 I don't think you'll be able to change them.

    According to the datasheet the WRTC Configuration protect bit can only be written via ICSP or an external programmer.

Similar Threads

  1. Set configuration bits
    By Petenausen in forum Code Examples
    Replies: 5
    Last Post: - 27th May 2013, 17:04
  2. _config set change for pic12f683
    By nbrucew in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th March 2010, 01:03
  3. configuration bits
    By Izone1173 in forum mel PIC BASIC
    Replies: 2
    Last Post: - 18th June 2009, 04:17
  4. Set Configuration from code?
    By kevj in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 26th September 2008, 04:52
  5. Configuration bits
    By DJEE in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th June 2007, 19:20

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts