Hi,
I've never used USB (tried once, couldn't get it to work) but here's my interpretation of the figure in the previous post.
If you connect a 4MHz x-tal to the PIC you need to set the PLL-prescaler (PLLDIV) to divide by 1 (PLLDIV=000) because the 96MHz PLL expects 4MHz input in order to generate 96MHz output - it even says 4MHz input only. Had it been a 8MHz x-tal, you'd set the PLL prescaler to divide by 2 in order to feed 4MHz to the downstream PLL circuitry. Note that you are indeed dividing the input frequency in order to get the needed 4MHz input to the PLL which is THEN multiplying that 4MHz signal in order to get 96MHz.
The 96MHz output signal from the PLL is then divided by 2 to generate 48MHz that can be used for the USB peripheral provided USBDIV=1 and FSEN=1. So far we haven't really touched the CPU clock....
Now you have the option the derive the CPU clock from the 96MHz signal by using the PLL postscaler (ie set your CONFIG to XTPLL mode etc) OR "directly" from your 4MHz oscillator by using the Oscillator postscaler (ie set your CONFIG to XT or HS mode etc).
If you use XT mode you'd set the Oscillator Postscaler to divide by 1 and DEFINE OSC 4 (that's the maximum you can get that way). If you use XTPLL mode you could, for example, set PLL postscaler to divide by 2 and DEFINE OSC 48.
That's how I read the schematic, I'm open for corrections!
/Henrik.




Bookmarks