morning all
using a 16F18875 an i am not sure how to set the internal oscillator
http://www.microchip.com/wwwproducts/en/pic16f18875
data sheet
http://ww1.microchip.com/downloads/en/D ... 01802D.pdf
i believe i need to use OSCCON1 ? in C code box
looking at section 6.2.2 & 6.3.1 i am not sure of what setting(s) to apply
looking at 20mhz clock speed to start with
Steve
advice on setting internal oscillator
Moderator: Benj
-
- Flowcode v5 User
- Posts: 211
- Joined: Tue Feb 19, 2013 9:51 pm
- Has thanked: 72 times
- Been thanked: 177 times
- Contact:
Re: advice on setting internal oscillator
I don't see an option for 20MHz. How about 16MHz with no PLL or divisions?
Step 1) Select HFINTOSC 32MHz and Ext OSC Off in Project Options/Configure.
Step 2) Change the HFINTOSC from 32MHz to 16MHz by adding this in a C Code box:
One way to check it is to enable Clockout in Configure and multiply your measurement by 4.
I have not tested any of this so, I could be wrong. Also, there seem to be some typo's in the Configure for bits 6-4 of CONFIG1. One selection appears to be missing and others might be in the wrong place. HFINTOSC 32MHz looks to be correct though.
Step 1) Select HFINTOSC 32MHz and Ext OSC Off in Project Options/Configure.
Step 2) Change the HFINTOSC from 32MHz to 16MHz by adding this in a C Code box:
Code: Select all
OSCFRQ=0b00000101;
I have not tested any of this so, I could be wrong. Also, there seem to be some typo's in the Configure for bits 6-4 of CONFIG1. One selection appears to be missing and others might be in the wrong place. HFINTOSC 32MHz looks to be correct though.
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: advice on setting internal oscillator
cheers kenrix2
Think i will try 32mhz
Steve
Think i will try 32mhz
Steve
Success always occurs in private and failure in full view.