Oscillator configuration PIC16F18313

Moderator: Benj

Post Reply
CSM2711
Posts: 47
Joined: Mon Apr 16, 2018 10:28 am
Location: Germany
Has thanked: 1 time
Been thanked: 9 times
Contact:

Oscillator configuration PIC16F18313

Post by CSM2711 »

Hello,

I want to run my PIC16F18313 at 4 MHZ for this i configure the chip like this:
clock1.JPG
clock1.JPG (30.41 KiB) Viewed 2565 times
clock2.JPG
clock2.JPG (76.02 KiB) Viewed 2565 times
But when I Measure the CLKOUT Pin there is a 8 MHZ sawtooth.

After adding the following code:

Code: Select all

OSCCON1 = 0x03;
Everything is fine. That means I can measure a 1 Mhz square

So now my question, should it work also by configure the chip via Project options ot is this a Bug?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Oscillator configuration PIC16F18313

Post by Benj »

Hello,

The clock speed setting in the project options is used to configure delays and baud rates etc. It must match the clock speed of the hardware but it does not in itself set the hardware clock speed.

The INTOSC helper component can be useful when using the internal oscillator.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Oscillator configuration PIC16F18313

Post by kersing »

Hi Ben,

The 'clock speed' setting just the speed for calculations is a recurring source of confusion, would it be possible to add a remark to the dialog or change the text? There is plenty of screen real estate available in that dialog for more text.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Oscillator configuration PIC16F18313

Post by Benj »

Good suggestion there Jack. We have changed the label text to the following.
Clock Speed (Hz): Defines delay related timings

Post Reply