General questions about USB (Frequency)

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Kiwi

General questions about USB (Frequency)

Post by Kiwi » Tue Nov 27, 2007 4:09 pm

Hi
I have some general questions about the USB. I saw the example such as easylogger. The questions are
why do you choose the frequency of 16.5M?
How do you calculate this frequency? Is this based on the USB speed of 12Mbps?
If I want to use external crystal, which frequency should I choose?

I tried to make the example of esaylogger. But it does not work well. I want to find the reason, and understand the basic principle.

Kiwi

Post by Kiwi » Tue Nov 27, 2007 4:10 pm

I forgot to say
Thanks in advance for the help!!!
:D :D

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Sat Dec 01, 2007 1:43 pm

A low speed USB device sends with a bit clock of 1.5 MHz. The driver is easier to implement if the CPU clock is a multiple of that.

For crystal based designs, I would recommend 12 MHz as this is the oldest and therefore best tested implementation. But you can also use 15 or 16 MHz crystals, as long as you configure the driver for this frequency.

If you want to use the internal RC oscillator, the driver must also implement a synchronization mechanism (Phase Locked Loop). We have done that for 16.5 MHz only (this is a multiple of 1.5 MHz).

Guest

Post by Guest » Sun Dec 02, 2007 3:54 pm

Thank you for the reply!! :D :D :D

bbb

Post by bbb » Mon Dec 10, 2007 9:39 am

By the way, do you plan to add 18 and 20 MHz routines? (Actually those could be probably made of the 12/15Mhz and 16MHz by adding a couple of nop's, if I am right...?)

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Mon Dec 10, 2007 11:55 am

We may add a 20 MHz module, but I don't see a demand for 18 MHz.

bbb

Post by bbb » Wed Dec 12, 2007 1:03 am

It may be good for overclocking mega8's and similar...

Post Reply