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.
PIC12F629 Compile error
-
simon-sandtcontrols
- Posts: 47
- http://meble-kuchenne.info.pl
- Joined: Sun Mar 21, 2021 3:56 pm
- Has thanked: 5 times
- Been thanked: 7 times
-
chipfryer27
- Valued Contributor
- Posts: 1902
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 415 times
- Been thanked: 639 times
Re: PIC12F629 Compile error
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.
Regards
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.
Regards
-
simon-sandtcontrols
- Posts: 47
- Joined: Sun Mar 21, 2021 3:56 pm
- Has thanked: 5 times
- Been thanked: 7 times
Re: PIC12F629 Compile error
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.
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: 1902
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 415 times
- Been thanked: 639 times
Re: PIC12F629 Compile error
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
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
Thanks, both. It looks like a problem with the chip definition file and we'll get that fixed asap.