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

18LF25k22 oscillator too fast

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



Joined: 04 Aug 2006
Posts: 98

View user's profile Send private message

18LF25k22 oscillator too fast
PostPosted: Wed Jan 02, 2013 1:50 am     Reply with quote

Hi

I am using an 18LF25K22 with the fuses

Code:

#use delay(clock=20000000, crystal=20000000)
#fuses NOWDT, WDT128, HSH, NOIESO, BROWNOUT, PUT, NOSTVREN, NODEBUG, NOLVP, NOEBTR, NOCPB, NOEBTRB, NOWRTC, NOWRTB, NOFCMEN, NOPBADEN


and a 20MHz crystal. I set a pin to alternate between high and low every 5000 milliseconds with delay_ms(5000). But on my scope I can clearly see the signal's period is just over 1 second...

VDD is 4.5V.

I'm curious as to why it just won't go at the right speed? Any help appreciated, thanks.
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Wed Jan 02, 2013 2:30 am     Reply with quote

Add NOPLLEN

The default fuse has the PLL enabled, _unless_ you say otherwise. You can always tell by looking at the bit patterns selected at the end of the .LST file, and checking these against the data sheet. It is designed to confuse, since on most chips the default is for the PLL to be 'off'.
Impressive actually that the chip runs at 80MHz.... ;)

Best Wishes
theteaman



Joined: 04 Aug 2006
Posts: 98

View user's profile Send private message

PostPosted: Wed Jan 02, 2013 2:41 am     Reply with quote

You sir, just saved me hours more confusion! Thank you! I never thought that the PLL default could be different for different devices.

Thanks again.
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