CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Correct setup internal 32Mhz; OSC_32MHZ

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Torello



Joined: 29 Sep 2006
Posts: 120

View user's profile Send private message

Correct setup internal 32Mhz; OSC_32MHZ
PostPosted: Sun Feb 24, 2008 9:13 am     Reply with quote

Hello,

Just to share:

setup_oscillator(OSC_INTRC | OSC_32MHZ);

Will not select the PLL and set the pic into 32Mhz. Why? Because the OSC_INTR sets bit 1 of OSCCON and this selects the internal oscillator block as system clock.

The PLL only works on the internal oscillator block when:
- the primary oscillator is selected as system clock (OSCCON b1/b0=00)
- the fuses are set to INTRC or INTRC_IO
- 4Mhz or 8Mhz is selected from the oscillator block.

Thus correct CCS setup:
- #FUSES INTRC_IO or INTRC (thus making the internal block primary)
- setup_oscillator(OSC_32MHZ);
- setup_oscillator(OSC_32MHZ); -or- setup_oscillator(OSC_8MHZ | OSC_PLL_ON);

Regards,
Edwin
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Feb 24, 2008 3:29 pm     Reply with quote

You need to specify what this information applies to.
Example:

1. The compiler. Presumably PCH or PCD ?
2. The compiler version.
3. The PIC.

Remember, we are not mind-readers.
Guest








PostPosted: Sat Mar 01, 2008 6:33 am     Reply with quote

Sorry forgotten:

Compiler PCHW version 4.068
Pic18 series, tested on Pic18LF4620
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group