Oscillator configuration PIC16F18313

Moderator: Benj

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

Postby CSM2711 » Tue Oct 02, 2018 8:57 am

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 910 times

clock2.JPG
clock2.JPG (76.02 KiB) Viewed 910 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: 14375
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4448 times
Been thanked: 4151 times
Contact:

Re: Oscillator configuration PIC16F18313

Postby Benj » Tue Oct 02, 2018 9:55 am

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: 1873
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 530 times
Been thanked: 1040 times
Contact:

Re: Oscillator configuration PIC16F18313

Postby kersing » Tue Oct 02, 2018 11:10 am

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.
These users thanked the author kersing for the post (total 2):
Benj (Tue Oct 02, 2018 11:41 am) • medelec35 (Tue Oct 02, 2018 12:26 pm)
Rating: 10.53%
 
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

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

Re: Oscillator configuration PIC16F18313

Postby Benj » Tue Oct 02, 2018 11:43 am

Good suggestion there Jack. We have changed the label text to the following.

Clock Speed (Hz): Defines delay related timings
These users thanked the author Benj for the post (total 2):
kersing (Tue Oct 02, 2018 12:17 pm) • medelec35 (Tue Oct 02, 2018 12:26 pm)
Rating: 10.53%