Bumped into this hoary old issue again this month!
Edit : App V2.61 + device file V1.62.14 is STILL BROKEN and zeros your band gap bits every time you erase or program a PIC12F629, PIC12F675, PIC16F630 and PIC16F676 without this MANUAL patch! 































The required device file dat edits (above) are *MUCH* easier to do with the
PICkit 2 device file editor - so DONT hack the binary directly!
The attached dat file is based on PK2DeviceFile.dat V1.62.14
(the current version as of Feb 2012) but has duplicate entries PIC12F629_BG, PIC12F675_BG, PIC16F630_BG and PIC16F676_BG all with the BandGapMask zeroed and the high nibble of ConfigMasks[0] set to 3 (inline with the above discussion) to remove special bandgap handling and make them normally editable CONFIG bits. You can only select the edited _BG devices using MANUAL DEVICE SELECT so if you are using autodetect, they are disabled (pure luck the standard device entry is used first - which would be an excellent safety feature if the app wasn't broken

) so you *COULD* simply replace the standard device file with the hacked one.
USE THE ATTACHED FILE STRICTLY AT YOUR OWN RISK!
RECORD ALL OSCCAL and BANDGAP DATA BEFORE EXPERIMENTING!
Here
(lightly edited for the forum) is what I emailed to my contact that was having difficulties with his PIC12F675 chips:
***********************************************************************
It is possible the bandgap bits in the CONFIG word have also been lost -
Symptoms will be a brown-out reset voltage outside the range BVDD Brown-out Detect Voltage 2.025 — 2.175 V (from datasheet table 12.4). Vbod (D005) 2.1V typical
My PICs were out of spec and had lost the bandgap bits, resulting in a BOR threshold of about 1.95V.

Reprogramming the bandgap bits to 1 0 got the BOR threshold back to 2.1V.
To do this, you need a hacked PK2devicefile.dat that lets you read the chip, toggle the formerly hidden bandgap bits in the CONFIG and reprogram.
Test on a variable bench supply, monitoring the LEDs,
with a test program loaded that has BOR enabled and lights the LEDs. The chip should reset (LEDs goes out) as you decrease the supply voltage past 2.1V and re-illuminate when you increase it again, with both transitions being within the BVDD range above.
N.B. the Pickit 2 adjustable Vdd doesn't go low enough - but if you patch in a silicon diode in series with the Vdd pin and use a DMM to monitor the actual voltage you can test the BOR voltage using the PICkit 2 and even reprogram it like this - though you don't want to leave the diode in permanently and PGC, PGD are likely to be slightly too high to be in spec. If not, with the app CLOSED, edit PICkit2.ini and add the line:
SDAT: Y
which makes the app ask you for the dat file at startup and drop the attached file into your PICkit 2 program directory.
If you select it and use manual device select (on the programmer menu), selecting any midrange device ending _BG overrides the standard settings to let you edit the bandgap bits (bits 12 and 13 ) in the CONFIG (click the underlined blue Configuration:)
Caution: You MUST NOT use the hacked <device>_BG device selections for normal programming or you will wipe the bandgap bits.
Edit: See bug above! WRITE DOWN the new value, you WILL need it again
Sequence:
- Select 'Manual Device Select' on the programmer menu and also 'Use VPP First Program Entry' on the tools menu
- Select the device PIC12F675_BG
- Read chip or load a HEX file,
- Edit CONFIG to set bandgap bits
- MAKE SURE THE PICKIT 2 is set for 5V Vdd and [Write] back to the chip and re-test.
- Some trial and error may be required, you only have three combinations to retest as if the original was OK you wouldn't be doing this!
DON'T FORGET to remove the SDAT: Y from PICkit2.ini to restore normal operation once all corrupted devices have been reclaimed.
*********************************************************************************************************
HTH
Ian
post edited by Ian.M - 2012/02/23 16:33:53