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.
General questions about USB (Frequency)
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).
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).