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

Post Reply
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

Post by brandonb »

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

Re: 18f2685 internal osc with pll

Post by kersing »

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

Post by brandonb »

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

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: 18f2685 internal osc with pll

Post by STibor »

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;

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

Post by brandonb »

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

osctune = 0xC0;
right on, that works perfect

Post Reply