PDA

View Full Version : Oscillator Selection



CocaColaKid
- 29th January 2009, 15:57
I'm looking to implement USB programming of one of our products and I am a little confused about which oscillator frequency I need to use. The data sheet says something about 48 MHz is required for full speed USB and only 6 MHz for low speed USB. Is this the same as USB 2.0 and USB 1.1? Can I run a 6 MHz oscillator if I only need to use USB 1.1 speeds?

mister_e
- 29th January 2009, 16:52
I never tried it myself, but have a look to USB.TXT


The USB header files for these PICs are set for a default oscillator of 20MHz.
The other settings for full-speed USB are HSPLL, USB clock is 96MHz PLL / 2
and system clock postscaler is divided by 2. For low-speed USB operation,
the main changes are to set the system clock postscaler to divide by 4 and
change the define for UCFG_VAL in the descriptor file for the project. The
sample project descriptor files show settings of UCFG_VAL for both full-
speed and low-speed. With these settings, for full-speed, the PIC core runs
at 48MHz. For low-speed, the PIC core runs at 24MHz.

You can run @ full speed using a simple 4MHz crystal, look USBDemo.

HTH

CocaColaKid
- 29th January 2009, 19:09
Steve,

Thanks for the quick reply. Just out of curiosity why would someone want to use a 4 MHz oscillator instead of say a 40 or a 20 MHz?

mister_e
- 29th January 2009, 19:15
Those USB PIC have a oscillator block that divide anything (well not on all mode but) down to 4MHz, then the internal PLL rise it up to 96Mhz, then you divide it /2 to have your expected 48MHz processor speed.

So why using 20MHz (or else) instead of 4? I no longer see of any good reason apart if, for some reason, you have a bunch of those already in stock.

CocaColaKid
- 29th January 2009, 19:26
The PIC that was are looking to use is the 18F2550. We don't need a many I/O, just a handful and a USB port. The only reason I could possibly think to use a faster oscillator is for better accuracy. Does it not make sense that to say an oscillator running at 4 MHz +/-50 ppm will be less accurate than one running at 20 MHz +/- 50 ppm due to multiplying less to achieve the same results?

mister_e
- 29th January 2009, 19:38
This is what i thought as well... but it's still divided down to 4MHz at the end... and you still have +/- 50 ppm at the end too.

We already talked about that here a while back

http://www.picbasic.co.uk/forum/showpost.php?p=23775&postcount=11