PDA

View Full Version : Can I do like this?



Jumper
- 19th January 2007, 07:16
Hi,

I am starting to use the 18F2550 USB pic but I have read the datasheet several times and still there are question marks.

The plan is to get a low speed USB connection BUT still run the MCU core at 48MHz, it should be possible by using different clock sources for the MCU. This is because I need the MIPS but the computers it should connect to are not the newest ones, they might only have USB 1.0

Since low speed USB always gets the clock from the primary souce I plan to put a 4 MHz crystal with 33 pF caps and that will after all internal PLL's and dividers give a nice clock for the USB. (page 30 in the datacheet)

Then I must run the rest from the secondary source (Timer 1 oscillator). It it so simple that I can put a 48MHz crystal here and after the PIC has started on the primary clock just in my software switch to this source?

What would the best capacitor value be for a 48MHz crystal? Any comments are very welcome since USB is a totally new thing for me and I usually run my PIC from oscillators.

/me

Jumper
- 19th January 2007, 08:18
At best, a PIC can do "Full Speed" USB. Which is compatible with USB 1.1.
So the old laptop should be fine. (said DT in an other post)

So then I am on the track, just fit a 4 MHz oscillator and go for 48 MHz using PLL's.

Thanks!!

/me

vacpress
- 23rd January 2007, 21:52
if i understand you correct, you want to use usb and found that it requires a 48mhz clock... the way to get this from other oscillator settings is to use the PLL configs. I believe the PLL derives a 96mhz clock from your (4..20.. whatever) input... then you devide that by two. this is done with the config flags and one define..

DEFINE OSC 48

Do a search on 'USBDemo' and study that a bit... it taught me quite alot and ive just started with it.

if i am wrong, i hope someone corrects me quickly

hope it helps