PDA

View Full Version : Define osccal_1k 1



grounded
- 6th April 2009, 02:47
most of my programming is done with 12f629/75 , and 16f630/76
I have read that it is a good practices to added this define when using OSC
DEFINE OSCCAL_1K 1
my ? is do I still need to add
DEFINE OSC 4

pic12F629
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF

Define OSCCAL_1K 1
DEFINE OSC 4 'INTERNAL CLOCK SPEED 4MH.
thanks grounded

mister_e
- 6th April 2009, 17:12
DEFINE OSC and OSCCAL_1K are two different animal.

DEFINE OSC just define the OSC speed, while OSCCAL call the factory internal oscillator calibration to tweak the accuracy as much as possible.

Better explanation, and in real English :D
http://www.rentron.com/PIC12C67X.htm

mister_e
- 6th April 2009, 17:13
If you don't use DEFINE OSC 4, the compiler will include it for you in background.

grounded
- 6th April 2009, 20:25
thanks for the link
you second post answered my ?
I had seen code that had it and some that did not and now I know you just don't have to.
thanks