PIC12F629 Compile error

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
simon-sandtcontrols
Posts: 48
http://meble-kuchenne.info.pl
Joined: Sun Mar 21, 2021 3:56 pm
Has thanked: 5 times
Been thanked: 7 times

Flowcode v10 PIC12F629 Compile error

Post by simon-sandtcontrols »

Hi All,

I hope I am right and this is a bug and not something I am doing daft. I can not get a PIC 12F629 to compile. I just wanted a simple oscillator to toggle 2 pins on and off. I have replaced the device with a 12F683 and it worked straight away. I have a draw full of 12F629's so it would be nice to get it to work.

I have attached my code.

The error I get:

32: #pragma config 0x1 = 0x4;
^ (1363) unknown configuration setting/register (0x1 = 0x4;) used
33: #pragma config 0x2 = 0x0;
^ (1363) unknown configuration setting/register (0x2 = 0x0;) used
(908) exit status = 1
(908) exit status = 1

Error returned from [xc8.exe]

I note that when I set it up, the oscillator and watchdog timer selections are prefilled with a number and not a selection. Not sure if this means anything, it just looks to me that the problem might be to do with the configuration registers.

Many Thanks.

Simon.
Attachments
Oscilator.fcfx
(11.06 KiB) Downloaded 5 times

chipfryer27
Valued Contributor
Posts: 1903
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 415 times
Been thanked: 639 times

Re: PIC12F629 Compile error

Post by chipfryer27 »

Hi

First thing I noticed was that you are running on an internal oscillator but forgotten the C-Code block to set. FC has a handy tool to calculate the code for you found under Component Libraries > Runtime > IntOsc Helper.

However this claims that there is no internal oscillator for that chip which appears to contradict the datasheet that states a 4MHz one is available.

Screenshot 2026-02-10 113538.jpg
Screenshot 2026-02-10 113538.jpg (27.81 KiB) Viewed 46 times
Screenshot 2026-02-10 113635.jpg
Screenshot 2026-02-10 113635.jpg (38.65 KiB) Viewed 46 times

Regards

simon-sandtcontrols
Posts: 48
Joined: Sun Mar 21, 2021 3:56 pm
Has thanked: 5 times
Been thanked: 7 times

Re: PIC12F629 Compile error

Post by simon-sandtcontrols »

Hi Chipfryer,

Thanks for taking a look. I Usually use a C code block and set the OSCCON register, but when I went to the data sheet, I couldn't find any reference to a register for the internal clock. I assumed, possibly incorrectly, that it is simply set to 4MHz and is configured by the configuration register where the clock is chosen. Previous experience of missing this off, the PIC still compiles fine, just doesn't necessarily run at the expected speed. I am sure I have used these devices in the past on older versions of Flowcode and they have worked fine on their own internal oscillator.

chipfryer27
Valued Contributor
Posts: 1903
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 415 times
Been thanked: 639 times

Re: PIC12F629 Compile error

Post by chipfryer27 »

Hi

I haven't used any, but thought that a C-block would be necessary to set the configuration. However in my post above it looks like there is some issue with the component configuration. Incidentally I forgot to mention that I too get the same error using v11.

Guess it's one for the team?

Regards

Steve-Matrix
Matrix Staff
Posts: 1744
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 254 times
Been thanked: 409 times

Re: PIC12F629 Compile error

Post by Steve-Matrix »

Thanks, both. It looks like a problem with the chip definition file and we'll get that fixed asap.

simon-sandtcontrols
Posts: 48
Joined: Sun Mar 21, 2021 3:56 pm
Has thanked: 5 times
Been thanked: 7 times

Re: PIC12F629 Compile error

Post by simon-sandtcontrols »

Thanks Steve.

Glad it wasn't me going mad.

BenR
Matrix Staff
Posts: 2122
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 563 times
Been thanked: 749 times

Re: PIC12F629 Compile error

Post by BenR »

Hello,

Hopefully resolved for you now, please go to Help -> Library updates to get the latest chip definition file.

Then reload your project and go back into the build -> project options menu to check the new configuration settings.

chipfryer27
Valued Contributor
Posts: 1903
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 415 times
Been thanked: 639 times

Re: PIC12F629 Compile error

Post by chipfryer27 »

Hi Ben

Compiles to Hex without issue for me.

Regards

Post Reply