On 20/12/2010 00:12, Olin Lathrop wrote: > 6 - If I remember right, 20MHz crystal doesn't work with USB. Did you re= ad > the datasheet before designing the circuit? I didn't think so. Go read = it. > It does. Internal 96MHz oscillator and PLL locked to the 20MHz. 2.3Oscillator Settings for USB When these devices are used for USB connectivity, they must have either a 6MHz or 48MHz clock for USB operation, depending on whether Low-Speed or Full-Speed mode is being used. This may require some forethought in selecting an oscillator frequency and programming the device. The full range of possible oscillator configurations compatible with USB operation is shown in Table2-3. Table 2.3 OSCILLATOR CONFIGURATION OPTIONS FOR USB OPERATION Possible Crystals for 24MHz CPU (6MHz USB low speed) or 48MHz CPU=20 (48MHz USB high speed) are 4, 8, 12, 16, 20, 24 and 48MHz Consult also FIGURE 2-1:PIC18F2455/2550/4455/4550 CLOCK DIAGRAM (page 26) Crystal is divided by 1, 2, 3, 4, 5, 6, 10 or 12 to get 4MHz 96Mhz osc PLL to the 4MHz For High Speed you divide by 2 for USB clock CPU clock is 96 MHz divide by 2, 3, 4 or 6 -OR- Crystal divided by 1,=20 2 ,3 or 4 For Low speed USB you can use either CPU Primary clock divider (the via=20 96MHz or direct external), but must be 24MHz as it's divided by 4 CPU clock can also be secondary external or Internal Osc (not the 96MHz). It's very flexible --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .