|
|
View previous topic :: View next topic |
Author |
Message |
jaime
Joined: 25 Nov 2005 Posts: 56 Location: Porto - Portugal
|
PIC18LF2550 Oscillator configuration |
Posted: Tue Sep 01, 2009 6:33 pm |
|
|
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
|
|
Posted: Tue Sep 01, 2009 6:49 pm |
|
|
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
|
|
Posted: Wed Sep 02, 2009 4:53 am |
|
|
Thanks for your help |
|
|
|
|
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
|