VUSB working at 8MHz?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
AKSpi
Posts: 2
Joined: Thu Sep 13, 2012 1:39 pm

VUSB working at 8MHz?

Post by AKSpi » Thu Sep 13, 2012 1:43 pm

Does the VUSB code and AVRDoper work at 8MHz source? What code changes do I need to make for that? I am not able to get Atmega8-16PU, I am getting only the -8PU versions of the chip from my country's electronics store.

Thanks!

[moderator team] Deleted your duplicate post [moderator team]

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: VUSB working at 8MHz?

Post by ulao » Thu Sep 13, 2012 2:41 pm

I can not say for sure if 8mhz will work, have to check the docs on that but the setting for speed is in your make file. If you don't have a make file it depends on the IDE you have.

AKSpi
Posts: 2
Joined: Thu Sep 13, 2012 1:39 pm

Re: VUSB working at 8MHz?

Post by AKSpi » Thu Sep 13, 2012 10:34 pm

I tried changing the numbers in the makefile, but I get errors saying accepted values are 12, 16 and 16.5 MHz. Here is the line in usbconfig.h:
#define USB_CFG_CLOCK_KHZ (F_CPU/1000)

I tried changing the divider to 500 to get the numbers right, but USB device is not recognized. I guess I need to change some of the calculations??

Coda
Posts: 18
Joined: Thu Apr 26, 2012 10:56 pm

Re: VUSB working at 8MHz?

Post by Coda » Fri Sep 14, 2012 2:21 pm

I think you will be out of luck there, there are ASM source files that are included into the project depending on the speed that you have defined. If I remember correctly reading that 12Mhz is quite tight to get the timing right. Even if you do manage to get 8mhz working, how many cycles will be free to do what you need? That's the question.
However, there is another possibility. Why not just put a 12mhz resonator/crystal on the 8mhz part anyway, and see if it's ok with the overclock? I can't imagine that the silicon won't handle 12mhz as all parts that are not low power versions (or extremely old versions) can handle 20mhz officially on 5V (and those can be overclocked too).
What country are you in?

Post Reply