PIC10F202 OSCCAL

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times

PIC10F202 OSCCAL

Post 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

Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times

Re: PIC10F202 OSCCAL

Post 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.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC10F202 OSCCAL

Post 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.

Post Reply