This should be available in Build/Project Options/Configure but is not. It should allow the part to run at 8MHz using the internal oscillator.
So if you're running into this question you need to do the following:
1. Use Build/Project Options/Configure to select one of the INTRC options for the Oscillator
2. Add a simple line of C code to initialize the OSCCON register, setting the IRFC bits for the desired clock frequency, an example below.
/*
set IRFC2:0=7 for 8MHz internal osc
*/
osccon =0x70;
INTOSC option not available for PIC16F818
Moderator: Benj
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: INTOSC option not available for PIC16F818
You are mistaken in your assumption where it should be:
The configuration screen in the project options allows specifying the bits in the CONFIGURATION WORD (register 21-1, page 90 of the data sheet), INTOSC is not available in this register. The OSCCON register, where this mode should be configured, is not part of the configuration settings. Adding C code to set this register is exactly the right solution. So INTOSC is available as intended.
The configuration screen in the project options allows specifying the bits in the CONFIGURATION WORD (register 21-1, page 90 of the data sheet), INTOSC is not available in this register. The OSCCON register, where this mode should be configured, is not part of the configuration settings. Adding C code to set this register is exactly the right solution. So INTOSC is available as intended.
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Posts: 37
- Joined: Sun Mar 30, 2014 9:27 pm
- Has thanked: 10 times
- Been thanked: 10 times
- Contact:
Re: INTOSC option not available for PIC16F818
I understand and appreciate the comments made but... in my opinion Flowcode is not C but more like a nice graphical way to program something. The fact that it allows coding in C or assembly is mostly to say that "here it is a way to get by for when components and macros are not available".
I'm new to FC and therefore not as well versed as you guys but since posting this I did get into browsing and reading more in this forum and found many posts dealing with this particular issue. This only fact shows how often people run into it and makes me think that the Build / Project Options / Configure should be the place to take care of setting the OSCCON or at least link to additional help to make the user immediately aware that it does not. Other software people do this why not FC?
I'm new to FC and therefore not as well versed as you guys but since posting this I did get into browsing and reading more in this forum and found many posts dealing with this particular issue. This only fact shows how often people run into it and makes me think that the Build / Project Options / Configure should be the place to take care of setting the OSCCON or at least link to additional help to make the user immediately aware that it does not. Other software people do this why not FC?