Quantcast
Channel: PIC18F4550 - oscillator settings - FlowCode
Viewing all articles
Browse latest Browse all 56

Re: PIC18F4550 - oscillator settings - FlowCode (viki2000)

$
0
0
I try to eliminate all unusable combinations and find a step by step procedure in setting the external oscillator, of course not covering all combinations, because that would be too much.
Looking at the datasheet I see that 20MHz external is the highest HS crystal frequency that I can use. I think at higher frequency for higher precision timing. That’s why I choose 20MHz, even if we speak about principle and in reality I do not need the higher precision. Probably I could live also with 4MHz internal. I just need a criteria to decide and I decided for higher precision, lower tolerance, therefore 20MHz external. That is the primary source oscillator that I want to use.
Therefore the first step is to choose at 4) HS or HS+PLL.
Because you mentioned that USB requires PLL to achieve the frequency and timing and I plan to use it later, then seems a must at 4) HS+PLL
Next step is 1), where seems that I have no other option except "USBDIV=2" = "USB Clock Selection: clc src from 96MHz PLL/2”, because I want USB and there is no crystal with so high frequency to provide the USB requirements higher than 20MHz. If I choose “USBDIV=1" = "USB Clocl Selection: clc src from OSC1/OSC2", then the USB is limited at 20MHz.
Therefore at 1) I must choose "USBDIV=2" = "USB Clock Selection: clc src from 96MHz PLL/2”.
 
Is it not so?
 
Next step is 3) the “96MHz PLL Prescaler” which must be set at “PLLDIV=5” due to 20MHz/5=4MHz Input Only.
Then we arrive to CPU clock, the last part 2), which can be as you mentioned 48MHz, 32MHz, 24MHz or 16MHz – datasheet page 33 top of table.
 
Am I right? If yes, then are not too many options left.
Actually that table shows also when I choose HS for 4), without PLL. Then the CPU is frequency is different, lower. What is then about with USB frequency, clock settings?

Viewing all articles
Browse latest Browse all 56

Trending Articles