PIC18F14K22 Oscillator question

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

Moderator: Benj

radist73
Posts: 36
Joined: Mon Dec 22, 2014 10:04 pm
Location: TALLINN
Has thanked: 5 times
Been thanked: 2 times
Contact:

PIC18F14K22 Oscillator question

Postby radist73 » Mon Oct 08, 2018 8:11 am

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!

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8817
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2559 times
Been thanked: 3715 times
Contact:

Re: PIC18F14K22 Oscillator question

Postby medelec35 » Thu Oct 18, 2018 5:15 pm

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

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

radist73
Posts: 36
Joined: Mon Dec 22, 2014 10:04 pm
Location: TALLINN
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: PIC18F14K22 Oscillator question

Postby radist73 » Fri Oct 19, 2018 6:42 am

Thanks for reply! But could you check, may be component have any problem? Seems as PLL cant start...

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8817
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2559 times
Been thanked: 3715 times
Contact:

Re: PIC18F14K22 Oscillator question

Postby medelec35 » Fri Oct 19, 2018 7:34 am

If you post your flowchart I can see if I can spot the issue.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.