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 support@ccsinfo.com

PIC18LF2550 Oscillator configuration

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



Joined: 25 Nov 2005
Posts: 56
Location: Porto - Portugal

View user's profile Send private message Visit poster's website

PIC18LF2550 Oscillator configuration
PostPosted: Tue Sep 01, 2009 6:33 pm     Reply with quote

Hello.
I'm working with PIC18LF2550 and I have some questions that I have difficult to understand.
1-At 5V, Can I use a 16MHZ crystal and put the pic to work at 48MHz or 20MHZ? What instructions must I give?


2-What is the maximum frequency that I can use at 3,3V. Datasheet have figure 28-2 but no formula.

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 01, 2009 6:49 pm     Reply with quote

Quote:
At 5V, Can I use a 16MHZ crystal and put the pic to work at 48MHz

The formula is really very simple. The PLL must have an input frequency
of 4 MHz. So, just use the PLLx fuse to divide your crystal frequency
so that you get 4 MHz. For example, you have a 16 MHz crystal. If you
divide it by 4, then you get the required 4 MHz. So use the PLL4 fuse
to do this. If you have a 20 MHz crystal, then use PLL5. If you have an
8 MHz crystal then use PLL2. It's easy.

Example for running at 48 MHz with a 16 MHz crystal:
Code:

#include <18F4550.h>
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,USBDIV,PLL4,CPUDIV1
#use delay(clock=48000000)

//==========================
void main()
{

while(1)
  {
   output_high(PIN_B0);
   delay_ms(500);
   output_low(PIN_B0);
   delay_ms(500);
  }

}



Quote:
2-What is the maximum frequency that I can use at 3,3V. Datasheet have figure 28-2 but no formula.

It can't run at 48 MHz. Interpolating the diagram, it looks like it will
run at about 18 MHz maximum.
jaime



Joined: 25 Nov 2005
Posts: 56
Location: Porto - Portugal

View user's profile Send private message Visit poster's website

PostPosted: Wed Sep 02, 2009 4:53 am     Reply with quote

Thanks for your help
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