jakeselectronics
Member
Hey Everyone
I've used the PIC12F629 before but never really undertood the band gap bits of the config word. But I realise I don't really need to.
629 Configuration Word (from data sheet)JPEG:
Also, from what I understand the Band Gap, along with the OSCCAL are pre set at the factory.
After some hunting around I understand from the [URL='https://ww1.microchip.com/downloads/en/DeviceDoc/41191D.pdf']629 Programming Spec[/url] (found on the 629 page of microchip.com) that the programming device (PICkit2 in my case) should in fact save the Band Gap and the OSCCAL values, and re-write them after the program cycle is complete to ensure they remain unchanged.
The flow chart on page 13 in the spec I've linked above makes it pretty clear.
So the band gap has something to do with the Brown Out reset thresholds or whatever. cool.
Question 1: The 2 Band Gap bits are the 2 Msb's of the config word so does it not matter what you attempt to write to the config word in regards to these 2 bits? Will they be restored to what they were prior to erasing anyway? (If the programmer meets microchips programmers spec). I mean, is it possible to mess the factory set BG bits up, (other than by means of using a programmer that does not save and restore these bits during erasing/programming cycles)
And the OSCCAL is fairly self explanatory; It calibrates the int osc.
But the data sheet and the 629 programming spec I've linked above seem to refer to the OSCCAL as 2 different things.
1: The programming spec refers to is as a RETLW instruction stored in the last address of the program memory at 0x03FF where the 8 Lsb's of the 14 bit word is the factory set osc cal (which I have had a play with and read this location with the 3 629's I own), and,
2: The data sheet has an OSCCAL register located at 90h in bank 1 (where only 6 bits are implemented)
629 OSCCAL Register (from data sheet)JPEG:
So Question 2 is, what is the deal with OSCCAL ?
I understand what it does, but is the OSCCAL at 90h just another means of fine tuning the int osc on top of the already factory set value at 0x03FF? Or are they related?
Jake.
I've used the PIC12F629 before but never really undertood the band gap bits of the config word. But I realise I don't really need to.
629 Configuration Word (from data sheet)JPEG:

Also, from what I understand the Band Gap, along with the OSCCAL are pre set at the factory.
After some hunting around I understand from the [URL='https://ww1.microchip.com/downloads/en/DeviceDoc/41191D.pdf']629 Programming Spec[/url] (found on the 629 page of microchip.com) that the programming device (PICkit2 in my case) should in fact save the Band Gap and the OSCCAL values, and re-write them after the program cycle is complete to ensure they remain unchanged.
The flow chart on page 13 in the spec I've linked above makes it pretty clear.
So the band gap has something to do with the Brown Out reset thresholds or whatever. cool.
Question 1: The 2 Band Gap bits are the 2 Msb's of the config word so does it not matter what you attempt to write to the config word in regards to these 2 bits? Will they be restored to what they were prior to erasing anyway? (If the programmer meets microchips programmers spec). I mean, is it possible to mess the factory set BG bits up, (other than by means of using a programmer that does not save and restore these bits during erasing/programming cycles)
And the OSCCAL is fairly self explanatory; It calibrates the int osc.
But the data sheet and the 629 programming spec I've linked above seem to refer to the OSCCAL as 2 different things.
1: The programming spec refers to is as a RETLW instruction stored in the last address of the program memory at 0x03FF where the 8 Lsb's of the 14 bit word is the factory set osc cal (which I have had a play with and read this location with the 3 629's I own), and,
2: The data sheet has an OSCCAL register located at 90h in bank 1 (where only 6 bits are implemented)
629 OSCCAL Register (from data sheet)JPEG:

So Question 2 is, what is the deal with OSCCAL ?
I understand what it does, but is the OSCCAL at 90h just another means of fine tuning the int osc on top of the already factory set value at 0x03FF? Or are they related?
Jake.