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

PIC18F24J10 using PLL - compiler problems

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



Joined: 24 Oct 2006
Posts: 7

View user's profile Send private message

PIC18F24J10 using PLL - compiler problems
PostPosted: Tue Oct 24, 2006 11:12 am     Reply with quote

I have been programming PICs in assembly for about 6 years now, but in the last 4 months have switched over to C using the CCS PCH compiler.
On the project I am presently working on, I decided to go from a 20MHz xtal to a 10MHz xtal and then use the 18F24J10's PLL to run at 40MHz. My code had previously read:
Code:
#use delay(clock=20MHZ)

But to update it to match my new clocking scheme, I changed it to read:
Code:
#use delay(clock=40MHZ, oscillator=10MHZ)

But, now when I try to compile this, I get an error on this line like this:
Quote:
*** Error 99 "C:\..." Line 28(5,94): Option invalid No PLL

What am I missing?
(I have version 4.013 of the PCH compiler)
Greg
drh



Joined: 12 Jul 2004
Posts: 192
Location: Hemet, California USA

View user's profile Send private message

PostPosted: Tue Oct 24, 2006 12:25 pm     Reply with quote

According to the V4 Aug, 2006 manual (page 105), "oscillator=10mhz" is not valid for use in the #use delay() directive.
_________________
David
gbolson



Joined: 24 Oct 2006
Posts: 7

View user's profile Send private message

PostPosted: Tue Oct 24, 2006 1:16 pm     Reply with quote

David,
I did take a look at page 105 - and noticed that it didn't reallly address the use of PLLs generating a higher clock rate than the crystal.
I got the idea for doing it the way I did from the help file - in the Index of the help file, if you pull up "#USE DELAY", in the example area it says...
Quote:
//application is using a 10Mhz oscillator, but using the 4x PLL
//to upscale it to 40Mhz. Compiler will set H4 config bit.
#use delay(clock=40M, oscillator=10M)

If this is wrong (which it would seem it might be from page 105 of the manual), do you know the right way to tell the compiler that the crystal frequency is not equal to the operation frequency?
Greg
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 24, 2006 2:08 pm     Reply with quote

This thread has some tips on how to get the PLL to work with the 18F24J10:
http://www.ccsinfo.com/forum/viewtopic.php?t=27276
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