How to set the clock for USB apps ?

Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

Post Reply
WalkOver
Posts: 65
Joined: Fri Nov 23, 2007 11:24 pm
Contact:

How to set the clock for USB apps ?

Post by WalkOver »

Hello !

I want to use a 18F2550 to play with the USB component.
First, I just want to send data from my PC to the 18F2550 and read the calculated DATA in return. Is the USB_HID is the best for me ?

Then, If i want to have the smallest PCB, Is-it possible the use only the internal oscillator ? No crystal will be great.
In the Pic configuration, I don't know how to set the first four lines to have 48 Mhz.

Any body can help me ?

Thank you very much and happy new year !!

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: How to set the clock for USB apps ?

Post by Benj »

Hello

The HID component is generally for creating keyboards, mice and other computer peripherals. You would be better off using the slave component if the PC is going to instigate every transaction or using the Serial component if either device can talk at any time.

You will need a crystal for the USB im afraid. It needs the stability of the crystal to stabilise the 96MHz PLL oscillator that drives the USB functionality.

Configuration settings should be as such.
USB Clock Selection - clk src from 96MHz PLL/2
CPU Sys CLK Select - no divide
OSC Select - Match the setting with your oscillator value.
Oscillator - HS: HS+PLL, USB-HS

Hope this helps.
Let me know if you have any problems with these settings.

Post Reply