Internal Oscillator error 16f1823 & 16f1829

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

Moderator: Benj

Post Reply
dannyvanneijenhoff
Posts: 65
Joined: Thu Feb 07, 2008 7:59 am
Has thanked: 17 times
Been thanked: 10 times
Contact:

Internal Oscillator error 16f1823 & 16f1829

Post by dannyvanneijenhoff »

Hello

I have an error, or an stupid mistake :?
For now, i am out of options :cry:

It looks like they run at +/- 32khz.
If i only use OutputC5=1 and OutputC5= 0, the output at c5 is for 5V and 0V is 5,6kHz.
-
1 and 0 is 5700hz.png
1 and 0 is 5700hz.png (49.23 KiB) Viewed 8522 times


I have tryed several things:
- Different PIC (16f1823 & 16f1829 ) and other pcb's.
- FC7 in stead of FC8
- Several settings at config bit's
-
config FC8 16f1823.png
config FC8 16f1823.png (209.84 KiB) Viewed 8522 times


Best regards Danny
Attachments
weg test 16f1823.fcfx
(7.56 KiB) Downloaded 108 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Internal Oscillator error 16f1823 & 16f1829

Post by medelec35 »

Hello Danny.
Can you enter 32000000 for the Clock speed in your project options, General options tab.
Also, at the very start of Main, add a code block with

Code: Select all

OSCCON = 0xF0;
Martin

dannyvanneijenhoff
Posts: 65
Joined: Thu Feb 07, 2008 7:59 am
Has thanked: 17 times
Been thanked: 10 times
Contact:

Re: Internal Oscillator error 16f1823 & 16f1829

Post by dannyvanneijenhoff »

:oops:

It works, it looks like i have missed something when using OSCCON = 0x70; and OSCCON = 0xF0;
Frequentie c5 on/of (whitout delay's and anything else) is now 364khz.

Many thanks for the fast respons. :P

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Internal Oscillator error 16f1823 & 16f1829

Post by medelec35 »

Hi Danny.
No, it's not your fault with the OSCCON value.
You can indeed have OSCCON = 0x70;
But if you did, then the PLL Enable within the configuration settings must be set to Yes.
In the case of the 16F1823 there is a textual bug.
Instead of showing PLL Enable, it's showing VCAP P
I have fixed this issue and there will be an update as soon as possible.
Your mistake was to leave the clock speed within project options set at the default speed of 19.6608MHz
Before the update is available, If you want to experiment, you can use OSCCON = 0x70; and change VCAP P from No to Yes, and the internal OSC should run at 32MHz.
The difference between OSCCON = 0x70; and OSCCON = 0xF0;
OSCCON = 0x70; allows the PLL Enable to be disabled, so int OSC will run at 8MHz, or PLL Enabled so int OSC will run at 32MHz
OSCCON = 0xF0; overwrites the PLL Enable, so int OSC will run at 32MHz, whether PLL is enabled or not.
Martin

Post Reply