This micro is very flexible in terms of the clock, as it has the option of using XTAL two external and even alternate the use of these during the program.
also has an internal RC clock 8MHz (FRC), which allows us to work the microcontroller without the need for external Xtal without boarding this oscillator is not as accurate as a Xtal, so what you recommend for applications where timing is not very important. And it has also an internal RC clock slow (LPRC) from 31Khz to save energy.
-containing PLL module to increase the frequency of external Xtal reach 48MHz for the USB module with a 4 MHz Xtal. The PLL is also available for the internal RC clock (FRC), however due to the low precision of this is not recommended for use in USB-related applications.
Pictured above is seen a diagram of the oscillators with potential job options oscillator module.
worth mentioning that the instructions are carried out in 2 machine cycles in the datasheet is symbolized by FCY which is equal to Fosc / 2. So, with a 4MHz clock the PLL is able to lift up to 32MHz , and having regard to the above, the operation speed of the CPU is 16Mhz ie 16MIPS.
The following image shows a more detailed diagram of the PLL using the POSC primary oscillator or FRC.
There are 3 records for the configuration of the oscillator: OSCCON
• • • OSCTUN
CLKDIV
with which you can select the clock as well as frequency division, etc ...
Page 123 datasheet for more information.
Perhaps at first it may be a little confusing if you have never worked with the PLL. If you are familiar with the PIC18F this is even easier than the form of the model. Finally, in our program all comes down to a couple of lines, that once understood the operation, it becomes almost like breathing: P.