Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a project for developing a USB keyboard, and I am new to USB protocol and I did initial study regarding basics of data transmissions through USB.

I am now checking for USB supported microcontrollers required for my application and any development kits associated with it.

While checking some, I came through usb keyboard with Teensy which uses a microcontroller AT90USB162-16AU which has a CPU speed of max 16MHz.

But for USB isn't the required clock speed of 48MHz?

What am I missing here?

share|improve this question
Apart from tcrosley's excellent answer, it comes down to not really needing much core speed at all for something as simple as a keyboard. All you need on a controller is the USB interface and enough interfaces to detect the number of keys you have. – Asmyldof Jan 31 at 9:51
up vote 7 down vote accepted

The USB in the AT90USB162-16AU has its own clock circuitry. The 48 MHz USB clock is generated with an on-chip Phase Locked Loop (PLL). The PLL in this case always multiplies its input by 6. Thus the PLL clock register must be programmed by software to generate an 8MHz clock on the PLL input as shown below:

enter image description here

So if an 8 MHz crystal is used, the PLL clock prescaler is set to divide by 1. If a 16 MHz crystal is used, the PLL clock prescaler is set to divide by 2. In either case, the input to the PLL is 8 MHz, and the output is 48 MHz.

One should not use the internal 8 MHz RC clock when doing USB as it will not be accurate enough.

share|improve this answer

USB is an asynchronous protocol. Each node has its own local clock and samples the bus looking for signal transitions. For reliability, the sampling is typically done at 4-5 times the actual bit rate. USB full speed is 12 Mbps, so you need a 48 or 60 MHz high-precision clock for sampling. However, the rest of the system doesn't have to run at that speed. It's possible to have a PLL just for USB that feeds directly into the sampling logic. This allows the CPU and other peripherals to run at a lower or higher frequency.

share|improve this answer

48Mhz isn't needed for USB, V-USB does low speed USB in software using a 12Mhz clock, for a keyboard that's probably sufficient, unless you're a really good typist.

share|improve this answer
OPs MCU has hardware USB support, thus no need for VUSB. – Turbo J Jan 31 at 12:35
just saying 48Mhz is not needed for USB – Jasen Feb 6 at 10:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.