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?

  • \$\begingroup\$ 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. \$\endgroup\$ – Asmyldof Jan 31 '16 at 9:51

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.


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.


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.

  • \$\begingroup\$ OPs MCU has hardware USB support, thus no need for VUSB. \$\endgroup\$ – Turbo J Jan 31 '16 at 12:35
  • \$\begingroup\$ just saying 48Mhz is not needed for USB \$\endgroup\$ – Jasen Feb 6 '16 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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