Page 1 of 1

18f2685 internal osc with pll

Posted: Sun Jul 01, 2012 10:49 pm
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?

Re: 18f2685 internal osc with pll

Posted: Sun Jul 01, 2012 11:27 pm
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.

Re: 18f2685 internal osc with pll

Posted: Sun Jul 01, 2012 11:39 pm
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

Re: 18f2685 internal osc with pll

Posted: Tue Jul 03, 2012 6:05 pm
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;

Re: 18f2685 internal osc with pll

Posted: Wed Jul 04, 2012 4:07 am
by brandonb
Code: Select all
C code:
osccon = 0x70;/ / 8MHz
or
osccon = 0x60;/ / 4MHz

osctune = 0xC0;
right on, that works perfect