Page 1 of 1

Debugging V-USB

Posted: Mon Oct 22, 2012 2:52 am
by Traumflug
Hello all,

I've put together my own variant of circuitry from the plentitude of samples and try to get it working. Whatever sample firmware I try (e.g. http://www.ruinelli.ch/how-to-use-v-usb-on-an-attiny85 or http://www.recursion.jp/avrcdc/cdc-spi.html), the device fails to be recognized in Ubuntu 64-bit:

Code: Select all

$ demsg
...
[852867.928035] usb 6-2: new low-speed USB device number 53 using uhci_hcd
[852868.048034] usb 6-2: device descriptor read/64, error -71
[852868.272028] usb 6-2: device descriptor read/64, error -71
[852868.488039] usb 6-2: new low-speed USB device number 54 using uhci_hcd
[852868.608032] usb 6-2: device descriptor read/64, error -71
...

Two questions: how can one debug such a combination of hard- and software? Getting a sign of life out of the chip? Of course I triple-checked usbconfig.h and fuses, still no dice. About all posts I could google to similar problems sometimes end up with "now it works", without explanation on how to get there or what had to be changed.

The other question: what is this INT0 interrupt thing mentioned in usbconfig.h's hardware config section? Apparently none of the sample projects takes care of that.

Here's the circuitry I've built, the four lines going to the right make up the SPI interface for the programmer (and shall make a generic SPI interface later). Uploading a firmware works fine.

Image

Thanks,
Markus

Re: Debugging V-USB

Posted: Mon Oct 22, 2012 2:24 pm
by Traumflug
After trying another few sample projects I found one which is extremely similar to mine: http://www.simpleavr.com/avr/vusbtiny . Just PB3 and PB4 pins are swapped, which was easily adjusted in usbconfig.h.

Uploading this chaged things a bit. Now the device is apparently recognized somewhat. Still, the /dev/ACM* device doesn't appear, I get different errors:

Code: Select all

...
[870037.320035] hub 2-0:1.0: connect-debounce failed, port 2 disabled
[870039.256033] hub 2-0:1.0: connect-debounce failed, port 2 disabled
[870041.192040] hub 2-0:1.0: connect-debounce failed, port 2 disabled
...

Repeated every two seconds.

Any ideas on where to look next?

Thanks.

Re: Debugging V-USB

Posted: Mon Oct 22, 2012 4:52 pm
by Traumflug
After soldering the housing of the USB-B header to the board's ground plane I apparently have even more success:

Code: Select all

$ demsg
...
[878547.088035] usb 6-2: new low-speed USB device number 83 using uhci_hcd
$ lsusb
...
Bus 006 Device 083: ID 1781:0c9f Multiple Vendors USBtiny

Looks good, doesn't it?

Some details are still missing, which I expect to fix by reviewing the configuration:

Code: Select all

$lsusb -v
Bus 006 Device 083: ID 1781:0c9f Multiple Vendors USBtiny
Couldn't open device, some information will be missing
...

Thanks for the help, everybody :wink:

Re: Debugging V-USB

Posted: Thu Nov 22, 2012 7:43 pm
by Pit
You should post more information. What are the low level signals?