V-USB with Arduino Duemilanove 328?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
miketeo
Posts: 3
Joined: Sat May 23, 2009 10:54 am

V-USB with Arduino Duemilanove 328?

Post by miketeo » Sat May 23, 2009 10:55 am

Hi, have anyone gotten V-USB working on an Arduino Duemilanove 328?

I have tried using rancidbacon keyboard demo http://code.rancidbacon.com/ProjectLogArduinoUSB but have gotten the following error on my Linux console.

Code: Select all

May 23 16:34:28 mira kernel: usb 3-2: new low speed USB device using uhci_hcd and address 70
May 23 16:34:29 mira kernel: usb 3-2: device descriptor read/64, error -71
May 23 16:34:29 mira kernel: usb 3-2: device descriptor read/64, error -71
May 23 16:34:29 mira kernel: usb 3-2: new low speed USB device using uhci_hcd and address 71
May 23 16:34:29 mira kernel: usb 3-2: device descriptor read/64, error -71
May 23 16:34:29 mira kernel: usb 3-2: device descriptor read/64, error -71
May 23 16:34:30 mira kernel: usb 3-2: new low speed USB device using uhci_hcd and address 72
May 23 16:34:30 mira kernel: usb 3-2: device not accepting address 72, error -71
May 23 16:34:30 mira kernel: usb 3-2: new low speed USB device using uhci_hcd and address 73
May 23 16:34:30 mira kernel: usb 3-2: device not accepting address 73, error -71
May 23 16:34:30 mira kernel: hub 3-0:1.0: unable to enumerate USB device on port 2


My circuit is the recommended setup with 3.6V zener diodes pair with a 1.5k pull resistor on the D- line.
I have verified the voltage across the D- line to be 3.29V but D+ line shows close to 0V.
Is that the correct observation?

Hope someone can help me with this. Thanks.

Best regards,
Michael

reginr
Posts: 1
Joined: Thu May 28, 2009 9:14 am

Re: V-USB with Arduino Duemilanove 328?

Post by reginr » Thu May 28, 2009 9:28 am

Hi Micheal,
We have the same problem, I am suspecting it is the diode. Did you managed to use the same number (1N5227 3.6V - 0.5 watt) ?

miketeo
Posts: 3
Joined: Sat May 23, 2009 10:54 am

Re: V-USB with Arduino Duemilanove 328?

Post by miketeo » Sat May 30, 2009 5:56 pm

Hi, reginr.
I have gotten my zener diodes from a local hardware store. There weren't any part numbers on the diodes, but they were listed as 3.6V 1/2W.

Michael

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Re: V-USB with Arduino Duemilanove 328?

Post by christian » Fri Jun 05, 2009 5:36 pm

The voltage levels should be OK.

V-USB in conjunction with Arduino's runtime environment can be a bit problematic because Arduino was not made for real-time systems.

The error message you see probably means that USB does not work at all. The first step of initialization, assigning an ID to the device, fails. Have you checked that the clock rate you use for V-USB matches your Arduino's clock rate?

miketeo
Posts: 3
Joined: Sat May 23, 2009 10:54 am

Re: V-USB with Arduino Duemilanove 328?

Post by miketeo » Sat Jun 06, 2009 5:32 am

Hi, Christian.
Yes, I have verified that the clock rate used for V-USB matches the crystal and the bootloader for Arduino at 16.000MHz.

I have ordered some 1N5227A zener diodes from Farnell; will try them out when it arrives next week.

Michael

objective
Posts: 5
Joined: Wed Sep 30, 2009 10:16 pm

Re: V-USB with Arduino Duemilanove 328?

Post by objective » Wed Sep 30, 2009 10:19 pm

Hi Michael,

I, too, have been trying to get the rancidbacon code to work with the 328 but have been unsuccessful. I was able to find a 168 and have it up and running. Hopefully, you've had some success getting the code to run on the 328.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Re: V-USB with Arduino Duemilanove 328?

Post by christian » Wed Sep 30, 2009 10:37 pm

If the problem is only with the 328p, please look at the following thread: viewtopic.php?f=8&t=2663

objective
Posts: 5
Joined: Wed Sep 30, 2009 10:16 pm

Re: V-USB with Arduino Duemilanove 328?

Post by objective » Thu Oct 01, 2009 4:30 am

Thanks for the link, Christian. I'm not sure if the fuses need to be set differently than the 168... I thought that the 328p and the 168 are pretty much the same except for the memory size.

I did try compiling with the same fuses as recommended in the Makefile for the 168 since there was no mention of the 328p.

Also, the two threads are a bit different. This thread, in particular, is more geared towards getting the code to run in the Arduino environment. This is interesting to me as coding in Arduino is easier for me than having to remember all the port pins and such.

Either way, I can't get the avr working with the 328p while it seems to work fine with the 168... I hope the issue is just a matter of setting the right fuses (though I am still not sure how).

Thanks again for your helpfulness!

objective
Posts: 5
Joined: Wed Sep 30, 2009 10:16 pm

Re: V-USB with Arduino Duemilanove 328?

Post by objective » Thu Oct 01, 2009 6:43 pm

I did get the Arduino code running on my 328 :D Just compile it as if you're using the 168 and then burn the hex file normally as for the 328. I did the same thing to get the example HID-mouse code working, too.

Post Reply