18f2685 internal osc with pll

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

18f2685 internal osc with pll

Postby brandonb » Sun Jul 01, 2012 10:49 pm

im trying the get the 18f2685 set to 4 meg internal with 4x ppl, shooting for 16Mhz internal osc but can seem to get it to work as it default to 4Mhz... i set osctune to 0x40 (01000000) and osccon to 0x6e (01101110), what am i doing wrong and can you please explain it to me?

kersing
Valued Contributor
Valued Contributor
Posts: 1930
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 567 times
Been thanked: 1078 times
Contact:

Re: 18f2685 internal osc with pll

Postby kersing » Sun Jul 01, 2012 11:27 pm

brandonb wrote:im trying the get the 18f2685 set to 4 meg internal with 4x ppl, shooting for 16Mhz internal osc but can seem to get it to work as it default to 4Mhz... i set osctune to 0x40 (01000000) and osccon to 0x6e (01101110), what am i doing wrong and can you please explain it to me?


Have you set the configuration (FOSC3:FOSC0) bits in CONFIG1H correctly? (Open the chip configuration in flowcode, set oscillator to Internal Oscillator Block mode)

Setting osccon to 0x6e means you are trying to write to read-only bits of the register, 0x62 seems more appropriate.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

Re: 18f2685 internal osc with pll

Postby brandonb » Sun Jul 01, 2012 11:39 pm

thanks for checking it out but that didnt work either :?: here is the flowchart so far https://dl.dropbox.com/u/10367218/flow_v4.9.00_osccon.fcf its a bit too large to post

User avatar
STibor
Posts: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: 18f2685 internal osc with pll

Postby STibor » Tue Jul 03, 2012 6:05 pm

Hi!
Flowcode5
Microcontroller: Pic18F2620
internal oscillator8MHz and 4Pll
Beginning of the program:

Code: Select all

 C code:
 osccon = 0x70;/ / 8MHz
or
osccon = 0x60;/ / 4MHz

osctune = 0xC0;
These users thanked the author STibor for the post (total 2):
brandonb (Wed Jul 04, 2012 4:08 am) • medelec35 (Mon Sep 02, 2013 7:37 pm)
Rating: 10%
 

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

Re: 18f2685 internal osc with pll

Postby brandonb » Wed Jul 04, 2012 4:07 am

Code: Select all
C code:
osccon = 0x70;/ / 8MHz
or
osccon = 0x60;/ / 4MHz

osctune = 0xC0;
right on, that works perfect