abcminiuser / lufa

LUFA - the Lightweight USB Framework for AVRs.
http://www.lufa-lib.org
1.03k stars 321 forks source link

HID examples not working on ATMega8u2 #147

Closed Smashcat closed 5 years ago

Smashcat commented 5 years ago

It seems there is an issue using this device with LUFA - All HID examples fail when compiling with Atmel Studio 7.0. The code compiles fine, but after flashing and resetting the device, Windows reports an error with the device. Flashing the same code onto an ATMega32u4 works fine. Flashing the CDC Serial-USB example works fine on the 8u2. Seems like it's a problem with the HID examples.

Smashcat commented 5 years ago

Please ignore - issue is that examples all have 16mhz clock defined. 8u2 cannot run the USB peripheral at an external clock of this speed - it must be 8mhz. For some reason the USB-Serial example doesn't have this setting, so was working! Maybe one of the conditional blocks in the code could set the F_CPU and F_USB when the target is an 8u2 or 16u2?