So this is probably a dumb question, but is there something more you have to do to use a different clock speed than just redefine the F_CPU and USB_CFG_CLOCK_KHZ values to reflect your new clock speed?
I've been working on a project with a 16mHz external clock chip. I'm trying to make more of them, but all I have is 20mHz clock chips. My code works just fine with the 16mHz chips. However, when I plug in a 20mHz clock, make clean, modify the F_CPU and CLOCK_KHZ values in usb-config.h, and recompile, the device is no longer recognized by Windows. Is there something else I have to change, or should I just order some more 16mHz chips? I'm currently running on an ATMega168 at 5v, with 3.6v zener diodes dropping the USB line voltage.
Thanks,
Alan Chatham
Changing Clock Speeds
-
- Rank 1
- Posts: 28
- Joined: Wed Sep 30, 2009 3:36 am
- Location: Osaka, Japan
- Contact:
Re: Changing Clock Speeds
See datashhet to ATmega168. 20 MHz clock rate may be possible at voltage more than 5 V. Try to use self-power device at ~6 V, try to use other MCU, use stable V-USB lib drivers.
Best regards, Saimon.
Best regards, Saimon.
Re: Changing Clock Speeds
These two defines should be all you need to change. And then you need to do a "make clean" because there are no dependencies on usbconfig.h and Makefile.
AVRs can usually be overclocked quite a bit, so I doubt that it's a hardware problem. I've tested the 20 MHz module myself and it worked for me (still works in one of my projects).
AVRs can usually be overclocked quite a bit, so I doubt that it's a hardware problem. I've tested the 20 MHz module myself and it worked for me (still works in one of my projects).