Page 1 of 1

PIC10F202 OSCCAL

Posted: Tue Apr 02, 2019 5:37 pm
by Dave Squibb
Hi all,
I need to load OSCCAL with its stored value.

Tried

Code: Select all

asm movwf OSCCAL
in a C Box
And got compiler errors:

31: __config("__PROG_CONFIG", "pic", 0x1, 0x3FEB);
^ (1386) unable to determine the semantics of the configuration setting "OSC" for register "CONFIG" (warning)
PIC10F.c: main()
74: asm movlw osccal
^ (317) "(" expected
^ (318) string expected
^ (194) ")" expected
^ (312) ";" expected
(908) exit status = 1
(908) exit status = 1

Error returned from [xc8.exe]

C:\Program Files (x86)\Flowcode\Common\Compilers\pic\batch\pic_xc8_comp.bat reported error code 1



FINISHED

Any ideas please?
Dave

Re: PIC10F202 OSCCAL

Posted: Wed Apr 03, 2019 9:15 am
by Dave Squibb
OK, This seems to compile:

Code: Select all

#asm
movlw OSCCAL
#endasm
The XC8 compiler manual says "Note that this function is automatically called by the runtime start-up code (unless you
have explicitly disabled this option,( see Section 3.7.1.14 “osccal”) and you do not need
to call it to calibrate the internal oscillator."

Question: Does Flowcode 8 automatically load OSCCAL with the calibration value?

Thanks,
Dave.

Re: PIC10F202 OSCCAL

Posted: Thu Apr 04, 2019 3:39 pm
by Benj
Hi Dave,

We haven't explicitly disabled the osccal functionality so the compiler should be doing its thing for you and loading the calibration value.