What oscillator/crystal for USB?

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am just beginning my first USB design. I plan to use an AVR with built in USB like ATmega32U6 but I could maybe also use a software solution like vUSB but it may be too slow, I need to transfer 1 Gbit from a flash memory in a reasonable time. The design do only need to be able to put into a computer for download of the file so endpoint mode should be enough.

But I need to know if I need to use a crystal or if I can use the internal RC oscillator. And what speed must it be. Power consumption at the time it is not connected to the computer is very critical and the RC oscillator have much faster start-up time (it will use 32 kHz crystal and power up once a second) and therefore it may be to prefer if possible. Speed also depend on what is possible for the voltage. 3V is again best for power consumption but maybe I must use higher for clock speed demands of the USB.

Any information about the clock/voltage/USB is
appreciated.

My favorites:
1. My oscilloscope, Yokogawa DLM2024.
2. My soldering iron, Weller WD2M, WMRP+WMRT.
3. JTAGICE3 debugger.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

12MHz crystal usually for USB

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For the AT90USB1287 (and I'm guessing the other USB AVRs) you have to use an external crystal if you want to use the USB peripheral. There is a PLL that lets you use a few different clock speeds. V-USB uses some wizardry to let you use the internal RC clock on some AVRs.

Math is cool.
jevinskie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, and 12 MHz is for sure the slowest clock speed? That will decide the minimum voltage to the AVR and that will have great impact on current consumption during sleep modes.

Do you know anything about the "wizardry" of V-USB? The precision of the RC oscillator will not be better than 1%.

My favorites:
1. My oscilloscope, Yokogawa DLM2024.
2. My soldering iron, Weller WD2M, WMRP+WMRT.
3. JTAGICE3 debugger.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

The precision of the RC oscillator will not be better than 1%.

You need to look at the code but I think I read that they use an initial bit burst on the USB data lines to calibrate OSCCAL - so they're effectively using the PC's USB signals as an accurate timing reference.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

That will decide the minimum voltage to the AVR and that will have great impact on current consumption during sleep modes.

Ummm--expand on that for me. Like 4uA to 8uA for a deep-sleeping AVR?

When you are connected to USB, you have a ready source of power.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can calibrate OSCCAL as exactly as it can be using the external 32 kHz crystal, OSCCAL is only 8 bits so better than that is impossible. I think calibrated precision is 1% but the question is if 1% is good enough for USB?

About current: USB will only be used to read out the memory, most of the time the device will be battery powered and not plugged into the computer.

USB is 5V so I hope that I in some way can switch between low voltage (3 V is best) and 5V. 5 V from battery is not an option as it will mean a lot more circuits to create 5V from the one lithium cell.

If that is possible, but I am forced to use a 12 MHz crystal, 3V is not possible because highest speed at 3 V is only 8 MHz. Some AVRs have software selectable clock source but not this one with the hardware USB. But there is a clock prescaler register so maybe I can switch from 12 MHz to 6 MHz in low voltage mode. But it could be a problem to switch between clock speeds at USB plug in and out so I think safest method would be if it was possible to run from a slower speed than 12 MHz.

My favorites:
1. My oscilloscope, Yokogawa DLM2024.
2. My soldering iron, Weller WD2M, WMRP+WMRT.
3. JTAGICE3 debugger.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have checked the LUFA code now and yes, 8 MHz is possible! That will solve everything.

My favorites:
1. My oscilloscope, Yokogawa DLM2024.
2. My soldering iron, Weller WD2M, WMRP+WMRT.
3. JTAGICE3 debugger.