PDA

View Full Version : 12C671 & Osccal register - I am confused



Megahertz
- 25th December 2009, 23:19
Merry Christmas to everyone
I am having a small problem which I would like to ask.
I am using 12C671 & my fuse settings are the following ones:


DEFINE NO_CLRWDT
DEFINE OSC 4
@ __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF


I just want to run the PIC at 4MHz. I do not understand how to implement bits of the OSCCAL register. Mainly bits 4 to 7.
I read the PBP manual and it advises to put one of the two defines in the program: Define OSCCAL_1K 1 & Define OSCCAL_2K 1

I am confused as to if I put Define OSCCAL_1K 1 on top of the code, do I need any other supporting statement in the fuse setting section like may be setting bits 4-7 of OSCCAL register? OR Will my PIC will run at 4MHz just by adding this define statement only?
Can someone guide me please?
Thanks

Archangel
- 26th December 2009, 06:03
Check what BRUCE said here, I think it applies to your project.
http://www.picbasic.co.uk/forum/showthread.php?t=1466
http://www.picbasic.co.uk/forum/showthread.php?t=11771
As for OSCCAL, BITs 7:4 adjust how much change and BITs 3:2 Determine which direction. Data Sheet 4.2.2.7 OSCCAL REGISTER
Also Dave comments here:http://www.picbasic.co.uk/forum/showthread.php?t=12265
Get <b>this version</b> of google, you can search <b>just this forum with it, </b>or the whole internet:
http://www.google.com/custom?hl=en&cof=AH%3Aleft%3BS%3Ahttp%3A%2F%2Fwww.picbasic.co.u k%2Fforum%3BL%3Ahttp%3A%2F%2Fwww.crownhill.co.uk%2 Flogo.gif%3BLH%3A37%3BLW%3A174%3B&domains=picbasic.co.uk&q=&btnG=Search&sitesearch=