Page 1 of 1

PIC18F14K22 Oscillator question

Posted: Mon Oct 08, 2018 8:11 am
by radist73
Hi,
Seems as Oscillator Config in Project Options not works as need.
My pic starts only after adding C code at the begin of chart.

OSCCON=0b01110110;
OSCCON2=0b00000010;
OSCTUNE=0b11000000;

It is starts at 16MHZ.

Now I need to use PLL to starts internal OSC at 64MHZ. I need to add to C code configuration register CONFIG1H=0b01011000
but compiler give error message

LCD_Enc_test.c: main()
4758: CONFIG1H=0b01011000;
^ (192) undefined identifier "CONFIG1H"
(908) exit status = 1
(908) exit status = 1

C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe reported error code 1

Can you advice to run PIC with internal oscillator at 64MHZ?
Thanks!

Re: PIC18F14K22 Oscillator question

Posted: Thu Oct 18, 2018 5:15 pm
by medelec35
radist73 wrote: I need to add to C code configuration register CONFIG1H=0b01011000
but compiler give error message

Error is there because you cant add any CONFIG statments.
You must set the CONFIG within Flowcode configuration settings (Build, Project options) only.

Re: PIC18F14K22 Oscillator question

Posted: Fri Oct 19, 2018 6:42 am
by radist73
Thanks for reply! But could you check, may be component have any problem? Seems as PLL cant start...

Re: PIC18F14K22 Oscillator question

Posted: Fri Oct 19, 2018 7:34 am
by medelec35
If you post your flowchart I can see if I can spot the issue.